From 8892e8ed8062d73d3e1cbd31fad6e7e731a60bde Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Tue, 24 Nov 2026 21:01:24 +0800 Subject: [PATCH 01/17] fix(cua): polish computer-use UI copy and experimental notice --- apps/web/tests/cua-optin.e2e.ts | 10 +- apps/web/tests/cua-permissions.e2e.ts | 22 +- .../application-approval.expected.md | 2 +- .../cua-permissions/missing.expected.md | 16 +- .../cua-permissions/setup.expected.md | 2 +- .../ui-plugin-manager/src/client/locales.ts | 16 +- packages/experimental/cua/README.i18n.yaml | 8 +- packages/experimental/cua/README.md | 6 +- packages/experimental/cua/README.zh.md | 6 +- .../cua/src/client/PermissionPanel.module.css | 27 +- .../cua/src/client/PermissionPanel.tsx | 27 +- .../experimental/cua/src/client/controller.ts | 15 +- .../experimental/cua/src/client/locales.ts | 343 +++++++++--------- packages/experimental/cua/src/client/mount.ts | 8 +- packages/experimental/cua/src/locales.ts | 16 +- .../cua/src/system-input-locales.ts | 32 +- .../cua/tests/application-access.spec.ts | 8 +- .../cua/tests/controller.client.spec.ts | 37 +- .../cua/tests/mount.client.spec.ts | 24 +- .../cua/tests/panel.client.spec.tsx | 43 +-- 20 files changed, 313 insertions(+), 355 deletions(-) diff --git a/apps/web/tests/cua-optin.e2e.ts b/apps/web/tests/cua-optin.e2e.ts index cfaeff3212..32292093d8 100644 --- a/apps/web/tests/cua-optin.e2e.ts +++ b/apps/web/tests/cua-optin.e2e.ts @@ -112,7 +112,7 @@ it.skipIf(process.platform !== 'darwin').each([ await card.getByRole('status').getByText('正在应用 自动电脑操作 的更改', { exact: true }).waitFor({ state: 'hidden' }) const setup = page.getByRole('dialog', { name: '配置自动电脑操作', exact: true }) await setup.waitFor() - expect(await setup.getByText('“自动电脑操作”插件已开启,但暂时无法检测系统权限。请前往插件详情页查看原因并重试。', { exact: true }).count()).toBe(1) + expect(await setup.getByText('“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', { exact: true }).count()).toBe(1) await compareOrRefreshGolden(fileURLToPath(new URL('./expected/cua-permissions/setup.expected.md', import.meta.url)), await captureStableAria(page, '[role="dialog"]', scaffold.workspaceCwd), webSnapshotMode()) expect(await setup.getByRole('group', { name: '新会话默认模式', exact: true }).count()).toBe(0) @@ -158,7 +158,7 @@ it.skipIf(process.platform !== 'darwin').each([ expect(runtimeFiber() === originalRuntimeFiber).toBe(true) expect(scaffold.ctx.ptcRuntime.programFormat).toBe(script ? 'script' : 'function-body') await setup.waitFor() - expect(await setup.getByText('“自动电脑操作”插件已开启,但暂时无法检测系统权限。请前往插件详情页查看原因并重试。', { exact: true }).count()).toBe(1) + expect(await setup.getByText('“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', { exact: true }).count()).toBe(1) await setup.getByRole('button', { name: '稍后', exact: true }).click() await setup.waitFor({ state: 'hidden' }) const saved = await readFile(settingsPath, 'utf8') @@ -189,7 +189,7 @@ it.skipIf(process.platform !== 'darwin').each([ const detail = plugins.locator('[data-detail-document]') await detail.getByRole('img', { name: '在多窗口桌面中自动操作选定任务看板窗口的示意图' }).waitFor() const guidance = plugins.locator('[data-cua-guidance]') - await guidance.getByText(/请谨慎在生产环境中使用/).waitFor() + await guidance.getByText(/请谨慎在重要或生产环境中使用/).waitFor() expect(await guidance.textContent()).not.toContain('helperPath') expect(await detail.textContent()).not.toContain('PTC') toggle = page.locator('[data-plugin-panel]').getByRole('switch', { name: '启用 自动电脑操作', exact: true }) @@ -232,11 +232,11 @@ it.skipIf(process.platform !== 'darwin').each([ await toggle.click() await toggle.and(page.locator('[aria-checked="true"]')).waitFor({ state: 'visible' }) await setup.waitFor() - expect(await setup.getByText('“自动电脑操作”插件已开启,但暂时无法检测系统权限。请前往插件详情页查看原因并重试。', { exact: true }).count()).toBe(1) + expect(await setup.getByText('“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', { exact: true }).count()).toBe(1) expect(scaffold.ctx.agentPresets.defaultId).toBe(initialDefault) await setup.getByRole('button', { name: '前往设置', exact: true }).click() await setup.waitFor({ state: 'hidden' }) - await page.getByRole('region', { name: '系统权限与设置', exact: true }).getByRole('alert').waitFor() + await page.getByRole('region', { name: '系统权限', exact: true }).getByRole('alert').waitFor() expect(await readFile(settingsPath, 'utf8')).toBe(saved) expect(scaffold.ctx.settings.describe().find(row => row.ns === 'ui-settings')?.value).toMatchObject({ enabled: codingTools }) expect(scaffold.ctx.agentPresets.defaultId).toBe(initialDefault) diff --git a/apps/web/tests/cua-permissions.e2e.ts b/apps/web/tests/cua-permissions.e2e.ts index 21aa20e25c..98de892222 100644 --- a/apps/web/tests/cua-permissions.e2e.ts +++ b/apps/web/tests/cua-permissions.e2e.ts @@ -159,13 +159,13 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr const panel = page.locator('[data-cua-settings]') const accessibility = panel.getByRole('group', { name: 'Accessibility', exact: true }) await accessibility.getByRole('button', { name: 'Request permission', exact: true }).waitFor() - expect(await panel.getByRole('region', { name: 'Authorize computer use', exact: true }).getByRole('group').count()).toBe(2) + expect(await panel.getByRole('region', { name: 'System permissions', exact: true }).getByRole('group').count()).toBe(2) expect(await panel.getByRole('region', { name: 'Manage applications computer use can access', exact: true }).count()).toBe(1) await expect.poll(() => panel.locator('li img').evaluate((image: HTMLImageElement) => image.naturalWidth)).toBe(1) expect(await panel.getByText('/fixture/app', { exact: true }).count()).toBe(0) expect(await accessibility.getByText('DSH Computer Use.app', { exact: true }).count()).toBe(1) - expect(await accessibility.textContent()).toContain('In System Settings, allow') - expect(await accessibility.textContent()).toContain('to read interface controls, click, and type.') + expect(await accessibility.textContent()).toContain('Allow') + expect(await accessibility.textContent()).toContain('to read interface content, click, and type.') expect(await panel.getByRole('group', { name: 'Screen Recording', exact: true }).getByText('DSH Computer Use.app', { exact: true }).count()).toBe(1) await expect.poll(() => accessibility.locator('img').evaluate((image: HTMLImageElement) => image.naturalWidth)).toBe(1) await expect.poll(() => panel.getAttribute('aria-busy')).toBe('false') @@ -334,7 +334,7 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr expect(tripwire.pageErrors).toEqual([]) }) -it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows Windows setup when the helper is missing', async () => { +it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows guidance without manual helper build instructions when the helper is missing', async () => { const root = await mkdtemp(join(tmpdir(), 'dsh-cua-missing-helper-')) const resources: { scaffold?: WebScaffold; browser?: Browser } = {} onTestFinished(async () => { @@ -348,12 +348,6 @@ it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows const scaffold = resources.scaffold = await launchWebScaffold({ profile: { packages: [{ dir: bundle, enabled: true }] }, extraOverlayPath: patch, }) - if (process.platform === 'darwin') { - // The Host inventory reads this Loader flag; only the platform-specific input is substituted on macOS. - const windows = [...scaffold.ctx.loader.entries()].find(entry => entry.options.id === 'cua-windows') - if (!windows) throw new Error('CUA bundle has no Windows provider row') - vi.spyOn(windows, 'disabled', 'get').mockReturnValue(false) - } const browser = resources.browser = await chromium.launch() const page = await newEnglishPage(browser) await page.goto(scaffold.authenticatedUrl) @@ -361,11 +355,13 @@ it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows await page.getByRole('button', { name: 'View Computer use', exact: true }).click() const panel = page.locator('[data-cua-settings]') const guidance = panel.locator('[data-cua-guidance]') - await guidance.getByText(/pnpm run build:native:x64/).waitFor() - await guidance.getByText(/helperPath/).waitFor() + await guidance.getByRole('note').getByText('Experimental feature', { exact: true }).waitFor() + await guidance.getByText(/We recommend using PTC mode/).waitFor() + expect(await guidance.textContent()).not.toContain('pnpm run build:native') + expect(await guidance.textContent()).not.toContain('helperPath') const preview = page.locator('[data-detail-document] img') await preview.evaluate(async (image) => { await (image as HTMLImageElement).decode() }) - const firstSetting = panel.getByRole('heading', { name: 'Authorize computer use', exact: true }) + const firstSetting = panel.getByRole('heading', { name: 'System permissions', exact: true }) const previewBox = await preview.boundingBox(), guidanceBox = await guidance.boundingBox(), settingBox = await firstSetting.boundingBox() expect(previewBox!.y + previewBox!.height).toBeLessThanOrEqual(guidanceBox!.y) expect(guidanceBox!.y + guidanceBox!.height).toBeLessThanOrEqual(settingBox!.y) diff --git a/apps/web/tests/expected/cua-permissions/application-approval.expected.md b/apps/web/tests/expected/cua-permissions/application-approval.expected.md index 6ef8b2863f..86fa3b92e8 100644 --- a/apps/web/tests/expected/cua-permissions/application-approval.expected.md +++ b/apps/web/tests/expected/cua-permissions/application-approval.expected.md @@ -3,7 +3,7 @@ - strong: Fixture - text: Allow agent to control this application via computer use? - button "Risks" - - paragraph: Manage app permissions for all sessions on the plugin page. + - paragraph: Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings. - button "Reject" - button "Allow for this session" - button "Always allow" diff --git a/apps/web/tests/expected/cua-permissions/missing.expected.md b/apps/web/tests/expected/cua-permissions/missing.expected.md index c32a07b2be..b528d1876a 100644 --- a/apps/web/tests/expected/cua-permissions/missing.expected.md +++ b/apps/web/tests/expected/cua-permissions/missing.expected.md @@ -1,15 +1,19 @@ -- region "Authorize computer use": - - paragraph: Computer use is an experimental preview. The agent may click the wrong button or type in the wrong window. Use caution in production environments. We recommend native PTC mode so the agent can operate apps and call other tools in the same program. - - heading "Authorize computer use" [level=3] +- region "System permissions": + - note: + - paragraph: Experimental feature + - paragraph: Computer use is experimental and results are not guaranteed. The agent may click the wrong button or type in the wrong window. Use caution in important or production environments. + - paragraph: We recommend using PTC mode so the agent can operate apps and call other tools in the same program. + - heading "System permissions" [level=3] + - paragraph: "Computer use requires the following system permissions to run:" - group "Accessibility": - strong: Accessibility - - paragraph: In System Settings, allow DSH Computer Use.app to read interface controls, click, and type. + - paragraph: Allow DSH Computer Use.app to read interface content, click, and type. - button "Request permission" - group "Screen Recording": - strong: Screen Recording - - paragraph: In System Settings, allow DSH Computer Use.app to capture application windows. + - paragraph: Allow DSH Computer Use.app to capture the selected application window. - button "Request permission" - - paragraph: Manage Accessibility and Screen Recording permissions in System Settings. + - paragraph: You can change these permissions anytime in System Settings. - region "Manage applications computer use can access": - heading "Manage applications computer use can access" [level=3] - heading "Always-allowed applications" [level=4] diff --git a/apps/web/tests/expected/cua-permissions/setup.expected.md b/apps/web/tests/expected/cua-permissions/setup.expected.md index 1b918bf3f8..81f0f4ad80 100644 --- a/apps/web/tests/expected/cua-permissions/setup.expected.md +++ b/apps/web/tests/expected/cua-permissions/setup.expected.md @@ -1,6 +1,6 @@ - dialog "配置自动电脑操作": - heading "配置自动电脑操作" [level=2] - button "关闭" - - paragraph: “自动电脑操作”插件已开启,但暂时无法检测系统权限。请前往插件详情页查看原因并重试。 + - paragraph: “自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。 - button "稍后" - button "前往设置" diff --git a/packages/client/ui-plugin-manager/src/client/locales.ts b/packages/client/ui-plugin-manager/src/client/locales.ts index 2c5b687c68..2f94190697 100644 --- a/packages/client/ui-plugin-manager/src/client/locales.ts +++ b/packages/client/ui-plugin-manager/src/client/locales.ts @@ -294,7 +294,7 @@ export const zh = { reasonStaleApproval: '待允许的安装脚本列表已变化,请重新安装以刷新', reasonIncompatibleVersion: '{plugin} 与 DSH {runtime} 不兼容(要求 {requirements}),运行它可能导致崩溃或数据丢失。', reasonIncompatibleVersionUnnamed: '这个插件与当前 DSH 版本不兼容,运行它可能导致崩溃或数据丢失。', - reasonUnsupportedPlatform: '此插件不支持运行 DSH 的主机操作系统', + reasonUnsupportedPlatform: '此插件不支持当前操作系统', reasonIncompatibleInstall: '请安装与当前 DSH 兼容的插件版本。', reasonIncompatibleInstalled: '请卸载后重新安装与当前 DSH 兼容的版本。', reasonUnexpectedPackage: '插件来源安装了与所请求不同的包或版本,已撤销这次安装。请向插件发布者或插件索引维护者报告此问题。', @@ -601,7 +601,7 @@ export const en = { reasonStaleApproval: 'The pending script approvals changed; install again to refresh them.', reasonIncompatibleVersion: '{plugin} is incompatible with DSH {runtime} (requires {requirements}); running it may cause crashes or data loss.', reasonIncompatibleVersionUnnamed: 'This plugin is incompatible with the running DSH version; running it may cause crashes or data loss.', - reasonUnsupportedPlatform: 'This plugin does not support the operating system running DSH.', + reasonUnsupportedPlatform: 'This plugin does not support this operating system.', reasonIncompatibleInstall: 'Install a plugin version compatible with this DSH.', reasonIncompatibleInstalled: 'Uninstall it and install a version compatible with this DSH.', reasonUnexpectedPackage: 'The plugin source installed another package or version than requested; the installation was undone. Report it to the plugin\'s publisher or the index maintainer.', @@ -618,7 +618,7 @@ export const en = { /** Japanese copy, checked against the English keys. */ export const ja = { - 'reasonUnsupportedPlatform': 'このプラグインはDSHを実行しているホストOSに対応していません。', + 'reasonUnsupportedPlatform': 'このプラグインは現在の OS に対応していません。', 'panel': 'プラグイン', 'settingsEntry': 'プラグイン管理', 'clientSyncing': 'このページでプラグインを同期中…', @@ -922,7 +922,7 @@ export const ja = { /** Spanish dictionary, checked against the English keys. */ export const es = { - reasonUnsupportedPlatform: 'Este complemento no es compatible con el sistema operativo que ejecuta DSH.', + reasonUnsupportedPlatform: 'Este complemento no es compatible con este sistema operativo.', panel: 'Complementos', settingsEntry: 'Complementos', clientSyncing: 'Sincronizando complementos en esta página…', @@ -1226,7 +1226,7 @@ export const es = { /** French dictionary, checked against the English keys. */ export const fr = { - reasonUnsupportedPlatform: 'Ce plugin ne prend pas en charge le système d’exploitation sur lequel DSH s’exécute.', + reasonUnsupportedPlatform: 'Ce plugin n’est pas compatible avec ce système d’exploitation.', panel: 'Plugins', settingsEntry: 'Plugins', clientSyncing: 'Synchronisation des plugins sur cette page…', @@ -1530,7 +1530,7 @@ export const fr = { /** German dictionary, checked against the English keys. */ export const de = { - reasonUnsupportedPlatform: 'Dieses Plugin unterstützt das Betriebssystem, auf dem DSH läuft, nicht.', + reasonUnsupportedPlatform: 'Dieses Plugin unterstützt dieses Betriebssystem nicht.', panel: 'Plugins', settingsEntry: 'Plugins', clientSyncing: 'Plugins auf dieser Seite werden synchronisiert…', @@ -1834,7 +1834,7 @@ export const de = { /** Russian dictionary, checked against the English keys. */ export const ru = { - reasonUnsupportedPlatform: 'Этот плагин не поддерживает операционную систему, в которой работает DSH.', + reasonUnsupportedPlatform: 'Этот плагин не поддерживает текущую операционную систему.', panel: 'Плагины', settingsEntry: 'Плагины', clientSyncing: 'Синхронизация плагинов на этой странице…', @@ -2138,7 +2138,7 @@ export const ru = { /** Portuguese dictionary, checked against the English keys. */ export const pt = { - reasonUnsupportedPlatform: 'Este plugin não oferece suporte ao sistema operacional em que o DSH está sendo executado.', + reasonUnsupportedPlatform: 'Este plugin não é compatível com este sistema operacional.', panel: 'Plug-ins', settingsEntry: 'Plug-ins', clientSyncing: 'Sincronizando plug-ins nesta página…', diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 7c92b26973..1c075f156a 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,11 +18,11 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: 724e72c7dc35eb49 - zh: aa99fa5d5eb400ba + en: 088dba2f155af4c4 + zh: 0a67d2ede2824a44 /deepseek-ai-dsh-cua/understand-the-implementation: - en: 05dd7d67f596934a - zh: d8ce8406d288f17e + en: b74198b9f3d440c5 + zh: 3a3a7404ec045e9c /deepseek-ai-dsh-cua/further-exploration: en: c174fb5a00ea3681 zh: 039340042676881d diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index 6f3ebcf354..9c8027e549 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -68,9 +68,9 @@ The application approval card includes a **Risks** tag. Hover over it, focus it On the Computer Use detail page, permission cards, component rows, and source facts use l3 borders, with 32px gaps between sections. Application badges retain their l1 borders. -The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **Authorize computer use** groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. +The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **System permissions** introduces the required permissions and groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. -The enabled bundle shows the preview notice above the system permission controls. The Windows page also gives the npm helper build and configuration steps. The macOS page offers Accessibility and Screen Recording controls. +The enabled bundle highlights the experimental notice above the system permission controls and places the PTC recommendation in a separate paragraph. The Windows page shows desktop status and window capture readiness, and the macOS page offers Accessibility and Screen Recording controls. The page refreshes on entry, window focus, and completed actions. Query failures retain the last observation as unknown and offer **Retry**. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. @@ -133,7 +133,7 @@ Check `methods` and `keyboard` in the result of `await cua.getCapabilities()` fo Platform providers import `CuaConfigFields` from `@deepseek-ai/dsh-cua/config` to extend the shared configuration. The root Host entry exports `installCua`, `CuaConfig`, and the Typert-discovered `CuaAccess` service; its `apply()` only marks the optional Client contribution. `/client` loads the permission UI through the existing module loader. Separate Host and Client compiler projects keep React, CSS, and browser registrations out of headless imports. `/api` owns the app/window API and its types; `/bridge`, `/native-client`, and `/protocol` retain runtime and platform consumers. `/types` exports only the named types required by generated Remote declarations. The Client uses package-local types. `/typert` supplies Host reflection and `/remote` supplies generated browser descriptors and codecs; permission authority remains on the Host. -The optional browser contribution mounts the native provider's permission Remote and reuses the Plugins activation and configuration slots. The system permission rows remain visible while unknown fields use placeholders; platform-specific permission guidance remains visible during queries and after grants once the platform has been identified. System checks, application decisions, and application icons fill in as each query completes. Application names and actions do not wait for icons; icon positions retain their space. User actions run in order without waiting for pending observation queries. Disposal waits for both actions and queries to settle before releasing the separately owned Remote mount. Known query errors stay visible while management operations or retries run, with their actions disabled. Query errors stay with the affected section, and activation guidance depends only on system checks. The injection layer observes Plugin Manager operations independently of the page. Bundle and row changes pause permission queries and invalidate in-flight results; settlement refreshes observations even after the page closes. Last known errors remain until a successful read. Disposal discards late results. When no native system observation is available, the controller reads the Host plugin inventory to identify an enabled Windows provider, including one that failed during helper preparation. If both reads fail, the page reports both causes and offers a retry. It projects queries into the page and setup dialog; reconnects refresh it. Page entry, focus and completed actions read the current permission store. Operation notices live in the shell overlay, so closing the page does not remove them. The provider owns permission checks, persisted decisions, and cancellation; the browser owns no authorization state. +The optional browser contribution mounts the native provider's permission Remote and reuses the Plugins activation and configuration slots. The system permission rows remain visible while unknown fields use placeholders; platform-specific permission guidance remains visible during queries and after grants once the platform has been identified. System checks, application decisions, and application icons fill in as each query completes. Application names and actions do not wait for icons; icon positions retain their space. User actions run in order without waiting for pending observation queries. Disposal waits for both actions and queries to settle before releasing the separately owned Remote mount. Known query errors stay visible while management operations or retries run, with their actions disabled. Query errors stay with the affected section, and activation guidance depends only on system checks. The injection layer observes Plugin Manager operations independently of the page. Bundle and row changes pause permission queries and invalidate in-flight results; settlement refreshes observations even after the page closes. Last known errors remain until a successful read. Disposal discards late results. It projects queries into the page and setup dialog; reconnects refresh it. Page entry, focus and completed actions read the current permission store. Operation notices live in the shell overlay, so closing the page does not remove them. The provider owns permission checks, persisted decisions, and cancellation; the browser owns no authorization state. ----- diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 9f460455b9..5e842826a1 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -68,9 +68,9 @@ kind: "package-reference" Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边框,区块间距为 32px。应用名称徽标保留 l1 边框。 -[Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限与设置”把辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 +[Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限”先说明运行所需权限,再将辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 -启用组合包后,系统权限上方显示预览提示。Windows 页面还提供 npm 安装所需的辅助程序构建和配置步骤,macOS 页面提供辅助功能和屏幕录制授权操作。 +启用组合包后,系统权限上方高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。Windows 页面展示桌面状态和窗口截图就绪情况,macOS 页面提供辅助功能和屏幕录制授权操作。 进入页面、返回窗口和操作结束后会刷新状态。查询失败保留上次观测但标为未确认,并提供“重试”。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 @@ -133,7 +133,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 平台提供方从 `@deepseek-ai/dsh-cua/config` 导入 `CuaConfigFields` 来扩展共享配置。根 Host 入口导出 `installCua`、`CuaConfig` 和供 Typert 发现的 `CuaAccess` 服务,`apply()` 只标记可选 Client 贡献。`/client` 通过现有模块加载器加载权限界面。Host 和 Client 使用独立编译项目,headless 导入不会加载 React、CSS 或浏览器注册。`/api` 提供应用、窗口 API 及其类型;`/bridge`、`/native-client` 和 `/protocol` 保留运行时和平台消费者。`/types` 仅导出生成 Remote 声明所需的命名类型,Client 使用包内类型。`/typert` 提供 Host 反射,`/remote` 提供浏览器描述和编解码,权限判断仍由 Host 执行。 -可选浏览器插件挂载原生 provider 的权限 Remote,复用插件页的启用引导和配置插槽。系统权限始终可见,未加载的字段保留占位;平台确认后,查询期间和权限已允许时均保留权限管理说明。系统权限、应用列表和应用图标分别查询,结果返回后各自显示。应用名称和操作按钮不等待图标,图标位置保留空位。用户操作按顺序执行,不等待尚未完成的查询;卸载时等待操作和查询全部结束,再释放独立持有的 Remote 挂载。已知查询错误在管理操作或重试期间保持可见,操作按钮禁用。查询错误只显示在对应部分,启用引导只等待系统权限结果。注入层独立于页面观察插件管理操作。组合包和组件行变更会暂停权限查询,并使进行中的结果失效;操作结束后即使页面已关闭,也会重新查询。已知错误保留至读取成功;卸载后的迟到结果会被丢弃。首次读取系统权限失败时,控制器会查询主机插件清单。已启用的 Windows 提供方即使因准备辅助程序而加载失败,页面仍会显示配置步骤。两项查询都失败时,页面显示两个错误并提供重试。重新连接后会刷新状态。进入页面、窗口聚焦或操作完成后读取当前授权存储。操作提示挂载到 shell overlay,关闭页面后仍可显示。provider 负责权限检查、持久授权和取消;浏览器不保存授权决定。 +可选浏览器插件挂载原生 provider 的权限 Remote,复用插件页的启用引导和配置插槽。系统权限始终可见,未加载的字段保留占位;平台确认后,查询期间和权限已允许时均保留权限管理说明。系统权限、应用列表和应用图标分别查询,结果返回后各自显示。应用名称和操作按钮不等待图标,图标位置保留空位。用户操作按顺序执行,不等待尚未完成的查询;卸载时等待操作和查询全部结束,再释放独立持有的 Remote 挂载。已知查询错误在管理操作或重试期间保持可见,操作按钮禁用。查询错误只显示在对应部分,启用引导只等待系统权限结果。注入层独立于页面观察插件管理操作。组合包和组件行变更会暂停权限查询,并使进行中的结果失效;操作结束后即使页面已关闭,也会重新查询。已知错误保留至读取成功;卸载后的迟到结果会被丢弃。重新连接后会刷新状态。进入页面、窗口聚焦或操作完成后读取当前授权存储。操作提示挂载到 shell overlay,关闭页面后仍可显示。provider 负责权限检查、持久授权和取消;浏览器不保存授权决定。 ----- diff --git a/packages/experimental/cua/src/client/PermissionPanel.module.css b/packages/experimental/cua/src/client/PermissionPanel.module.css index 2752078681..af5b9b79b4 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.module.css +++ b/packages/experimental/cua/src/client/PermissionPanel.module.css @@ -1,6 +1,31 @@ .panels { display: grid; gap: 32px; margin: 0; font-size: 13px; } .panel { display: grid; gap: 12px; min-width: 0; } -.guidance { display: grid; gap: 8px; overflow-wrap: anywhere; } +.guidance { display: grid; gap: 12px; margin-bottom: 12px; overflow-wrap: anywhere; } +.caution { + display: flex; + align-items: flex-start; + gap: 8px; + padding: 12px; + border: 0.5px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary) 40%, transparent); + border-radius: var(--dsw-radius-lg); + background: var(--dsw-alias-state-warn-tertiary); +} +.cautionIcon { + display: inline-flex; + flex: none; + margin-top: 2px; + color: var(--dsw-alias-state-warn-primary); +} +.cautionBody { + display: flex; + flex-direction: column; + gap: 4px; + min-width: 0; +} +.cautionBody .cautionTitle { + color: var(--dsw-alias-label-primary); + font-weight: 500; +} .card { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); } .card > * + * { border-top: 0.5px solid var(--dsw-alias-border-l3); } .panel p { margin: 0; color: var(--dsw-alias-label-secondary); line-height: 1.6; } diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 1c9849be57..7b63d68df8 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -1,6 +1,6 @@ /** Native permission status and revocable application consent on the existing plugin page. */ import { useEffect } from 'react' -import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' +import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, IconWarningOutlineMedium, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' import { assertNever } from '@deepseek-ai/dsh-util-values' import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' @@ -116,7 +116,6 @@ export function PermissionPanel(props: PermissionProps) { const { t, refresh } = props const state = props.useCuaPermissions(value => value) const observed = state.system.value - const windows = observed?.platform === 'windows' || (observed === null && state.windowsProvider.value === true) const apps = state.applications.value const transitioning = state.changing const busy = transitioning || state.system.busy @@ -132,22 +131,20 @@ export function PermissionPanel(props: PermissionProps) { return
-

{t('previewNotice')}

- {windows && <> -

{t('windowsHelperBuild', { - directory: 'packages/experimental/cua-windows', - x64: 'pnpm run build:native:x64', arm64: 'pnpm run build:native:arm64', - })}

-

{t('windowsHelperPath', { - patch: 'cordis.patch.yml', entry: 'cua-windows', config: 'config', path: 'helperPath', exe: 'dsh-cua-windows.exe', - })}

- } +
+ +
+

{t('previewNoticeTitle')}

+

{t('previewNotice')}

+
+
+

{t('ptcRecommendation')}

{t('title')}

+

+ {t(observed?.platform === 'windows' ? 'windowsPermissionsIntro' : 'permissionsIntro')} +

- {observed === null && state.windowsProvider.error !== null &&

- {t('providerLookupFailed', { message: state.windowsProvider.error })} -

} {state.system.error !== null &&
{t('queryFailed', { message: state.system.error })} diff --git a/packages/experimental/cua/src/client/controller.ts b/packages/experimental/cua/src/client/controller.ts index 35ef12ecc3..e1ad4d6bc7 100644 --- a/packages/experimental/cua/src/client/controller.ts +++ b/packages/experimental/cua/src/client/controller.ts @@ -7,7 +7,6 @@ import { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client import type { CuaApplicationId, CuaApplicationState, CuaSystemPermission, CuaSystemPermissionState } from '../access-types.ts' interface PermissionData { - windowsProvider: boolean system: CuaSystemPermissionState applications: CuaApplicationState icons: Record @@ -39,7 +38,6 @@ export interface PermissionFace { export class PermissionController { /** Last observed permissions and the lifetime of the current refresh/action. */ readonly state = createSnapshotStore({ - windowsProvider: { value: null, busy: false, error: null }, system: { value: null, busy: false, error: null }, applications: { value: null, busy: false, error: null }, icons: { value: null, busy: false, error: null }, @@ -53,10 +51,9 @@ export class PermissionController { /** * @param remote Generated CUA Remote namespace; failed results follow the query and action paths. * @param locale Current Client language, read when a permission action starts. - * @param windowsProvider Read the enabled Host provider when native setup fails before reporting its platform. */ constructor(private readonly remote: Context['remote']['cuaAccess'], - private readonly locale: () => string, private readonly windowsProvider: () => Promise>) {} + private readonly locale: () => string) {} /** * Bind the permission projection to its user actions. * @returns Reactive state and controls shared by the page, prompt, and toast host. @@ -86,7 +83,6 @@ export class PermissionController { this.state.update((state) => { state.changing = changing state.busy = true - state.windowsProvider.busy = false for (const key of ['system', 'applications', 'icons'] as const) state[key].busy = true }) if (!changing) this.enqueue() @@ -100,7 +96,6 @@ export class PermissionController { const sequence = ++this.sequence this.state.update((state) => { state.busy = true - state.windowsProvider.busy = false for (const key of ['system', 'applications', 'icons'] as const) state[key].busy = true }) this.tail = this.tail.then(async () => { @@ -119,13 +114,7 @@ export class PermissionController { } const latest = () => current() && this.sequence === sequence const refresh = Promise.all([ - this.read('system', this.remote.systemStatus, latest).then(async () => { - // The Windows helper can be missing before its first permission response. - if (latest() && this.state.getSnapshot().system.value === null) { - this.state.update((state) => { state.windowsProvider.busy = true }) - await this.read('windowsProvider', this.windowsProvider, latest) - } - }), + this.read('system', this.remote.systemStatus, latest), this.read('applications', this.remote.applications, latest), this.read('icons', this.remote.applicationIcons, latest), ]).then(() => { diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index 34d2d1f3df..ff5044b98a 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -2,33 +2,34 @@ export const NS = 'cuaPermissions' /** English permission-page dictionary. */ export const en = { - previewNotice: 'Computer use is an experimental preview. The agent may click the wrong button or type in the wrong window. Use caution in production environments. We recommend native PTC mode so the agent can operate apps and call other tools in the same program.', - windowsHelperBuild: 'If you installed DSH through npm, build the Windows helper from the matching DSH source. In {directory}, run {x64} or {arm64} with the .NET 10 SDK for your architecture.', - providerLookupFailed: 'Could not identify the computer use provider: {message}', - windowsHelperPath: 'In the active profile’s {patch}, find or add the entry with ID {entry}. Set {path} under its {config} to the absolute path of {exe}.', + previewNoticeTitle: 'Experimental feature', + previewNotice: 'Computer use is experimental and results are not guaranteed. The agent may click the wrong button or type in the wrong window. Use caution in important or production environments.', + ptcRecommendation: 'We recommend using PTC mode so the agent can operate apps and call other tools in the same program.', approvalRisks: 'Risks', approvalRiskTitle: 'Computer use risks', approvalRiskNotice: 'The agent can access only apps you approve, and can read and control them in the background.\n\nOnline games, messaging apps, and other apps may restrict automation. Violating their rules could result in your account with that app being suspended or banned.\n\nProceed at your own risk. To stop automated control at any time, press Stop in DeepSeek Harness.', - title: 'Authorize computer use', + title: 'System permissions', + permissionsIntro: 'Computer use requires the following system permissions to run:', + windowsPermissionsIntro: 'Computer use requires the following Windows environment conditions:', applicationsTitle: 'Manage applications computer use can access', - windowsSetupTitle: 'Check Windows desktop access', - windowsSetupBody: 'Unlock the Windows desktop, then check again. DSH asks before accessing each application.', - windowsSessionUnknown: 'No interactive Windows desktop was verified. Run DSH in a signed-in desktop session, then check again.', - windowsCaptureUnavailable: 'This Windows session does not support window capture. Check the Windows version and graphics driver, then check again.', + windowsSetupTitle: 'Check Windows environment', + windowsSetupBody: 'Unlock the Windows desktop and try again. DeepSeek Harness still asks for your approval before accessing each app.', + windowsSessionUnknown: 'Could not detect an available Windows desktop. Run DeepSeek Harness in a signed-in desktop session and try again.', + windowsCaptureUnavailable: 'This Windows environment does not support window capture. Check your Windows version and graphics driver, then try again.', applicationInteraction: 'Application interaction', - windowsInstructions: 'Keep the Windows desktop unlocked. Some input needs the target application in front. Applications running with higher privileges can refuse access.', - windowsDesktop: 'Interactive desktop', windowsDesktopUse: 'An unlocked desktop is required for observation and input.', + windowsInstructions: 'Keep the Windows desktop unlocked while in use. Some actions require bringing the target app to the front; apps running with higher privileges may not be controllable.', + windowsDesktop: 'Desktop status', windowsDesktopUse: 'Keep the desktop unlocked so the agent can view the screen and perform actions.', windowsCapture: 'Window capture', available: 'Available', unavailable: 'Unavailable', locked: 'Locked or disconnected', - elevated: 'The native component is running with administrator privileges.', standardPrivileges: 'The native component is running with standard user privileges.', + elevated: 'Currently running with administrator privileges.', standardPrivileges: 'Currently running with standard user privileges.', setupTitle: 'Set up computer use before use', - setupBody: 'Computer use is enabled. Before using it, grant Accessibility and Screen Recording permissions. Open the plugin details to complete setup.', - setupQueryFailed: 'computer use is enabled, but system permissions could not be checked. Open the plugin details to see the error and retry.', + setupBody: 'Computer use is enabled and requires Accessibility and Screen Recording permissions to run. Open the plugin details to finish setup.', + setupQueryFailed: 'Computer use is enabled, but system permissions could not be checked. Open the plugin details to view the error and try again.', openSetup: 'Open settings', later: 'Later', close: 'Close', accessibility: 'Accessibility', screenRecording: 'Screen Recording', - accessibilityUse: 'Read interface controls, click, and type.', screenRecordingUse: 'Capture the selected application window.', - accessibilityPermission: 'In System Settings, allow {application} to read interface controls, click, and type.', - screenRecordingPermission: 'In System Settings, allow {application} to capture application windows.', - permissionHint: 'Manage Accessibility and Screen Recording permissions in System Settings.', + accessibilityUse: 'Read interface content, click, and type.', screenRecordingUse: 'Capture the selected application window.', + accessibilityPermission: 'Allow {application} to read interface content, click, and type.', + screenRecordingPermission: 'Allow {application} to capture the selected application window.', + permissionHint: 'You can change these permissions anytime in System Settings.', granted: 'Allowed', unknown: 'Unknown', request: 'Request permission', settings: 'Open System Settings', retry: 'Retry', allowedApps: 'Always-allowed applications', blockedApps: 'Applications not allowed', retryApproval: 'Allow asking again', @@ -36,37 +37,39 @@ export const en = { noApps: 'No always-allowed or blocked applications.', revoke: 'Revoke', revoked: 'Application access revoked', requested: 'Follow the guide at the bottom of System Settings', opened: 'System Settings opened', applicationsFailed: 'Could not load application access: {message}', iconsFailed: 'Could not load application icons: {message}', - failed: 'Could not update permissions: {message}', queryFailed: 'Could not check permissions: {message}', + failed: 'Could not update permissions: {message}', queryFailed: 'Could not check system permissions: {message}', } /** Keys shared by all supported locale dictionaries. */ export type CuaPermissionLocaleKey = keyof typeof en /** Chinese permission-page dictionary. */ export const zh: Record = { - previewNotice: '自动电脑操作目前为实验性预览功能。智能体可能点错按钮,或把内容输入错误的窗口,请谨慎在生产环境中使用。推荐使用原生 PTC 模式,让智能体在同一段代码中操作应用并调用其他工具。', - windowsHelperBuild: '通过 npm 安装 DSH 后,请使用对应版本的 DSH 源码构建 Windows 辅助程序。在 {directory} 中使用 .NET 10 SDK,按电脑架构运行 {x64} 或 {arm64}。', - providerLookupFailed: '无法识别自动电脑操作后端:{message}', - windowsHelperPath: '在当前 profile 的 {patch} 中,找到或添加 ID 为 {entry} 的条目,将其 {config} 下的 {path} 设为 {exe} 的绝对路径。', + previewNoticeTitle: '实验性功能提示', + previewNotice: '自动电脑操作仍处于实验阶段,不保证操作结果。智能体可能误点按钮或在错误的窗口中输入内容,请谨慎在重要或生产环境中使用。', + ptcRecommendation: '建议配合 PTC 模式使用,让智能体在同一段代码中完成应用操作并调用其他工具。', approvalRisks: '风险提示', approvalRiskTitle: '自动电脑操作风险提示', approvalRiskNotice: '智能体只能访问你已授权的应用,并可在后台读取应用内容、操作应用。\n\n网络游戏、即时通讯等应用可能对自动化操作有所限制。违反相关规则可能导致你在该应用中的账号被暂停使用或封禁。\n\n请自行承担使用风险。如需停止自动化操作,可随时点击 DeepSeek Harness 中的停止按钮。', - title: '系统权限与设置', applicationsTitle: '管理可访问的应用', setupTitle: '配置自动电脑操作', - setupBody: '“自动电脑操作”插件已开启。使用前需授予辅助功能和屏幕录制权限,请前往插件详情页完成设置。', - setupQueryFailed: '“自动电脑操作”插件已开启,但暂时无法检测系统权限。请前往插件详情页查看原因并重试。', - windowsSetupTitle: '检查 Windows 桌面访问状态', - windowsSetupBody: '请解锁 Windows 桌面,然后重新检测。DSH 会在访问每个应用前询问授权。', - windowsSessionUnknown: '尚未确认可交互的 Windows 桌面。请在已登录的桌面会话中运行 DSH,然后重新检测。', - windowsCaptureUnavailable: '当前 Windows 会话不支持窗口截图。请检查 Windows 版本和显卡驱动,然后重新检测。', + title: '系统权限', + permissionsIntro: '自动电脑操作需要以下两项系统权限才能运行:', + windowsPermissionsIntro: '自动电脑操作需要满足以下 Windows 运行条件:', + applicationsTitle: '管理可访问的应用', setupTitle: '配置自动电脑操作', + setupBody: '“自动电脑操作”已开启,需要授予「辅助功能」和「屏幕录制」权限才能运行。请前往插件详情页完成设置。', + setupQueryFailed: '“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', + windowsSetupTitle: '检查 Windows 运行环境', + windowsSetupBody: '请先解锁 Windows 桌面后重试。访问具体应用前,DeepSeek Harness 仍会逐一请求你的授权。', + windowsSessionUnknown: '无法检测到可用的 Windows 桌面。请在已登录的桌面环境中运行 DeepSeek Harness,然后重试。', + windowsCaptureUnavailable: '当前 Windows 环境不支持窗口截图。请检查系统版本与显卡驱动后重试。', applicationInteraction: '应用交互', - windowsInstructions: '请保持 Windows 桌面解锁。部分输入需要将目标应用切到前台,运行权限更高的应用可能拒绝访问。', - windowsDesktop: '交互桌面', windowsDesktopUse: '观察和输入需要已解锁的桌面。', - windowsCapture: '窗口截图', available: '可用', unavailable: '不可用', locked: '已锁定或断开连接', - elevated: '本机组件正以管理员权限运行。', standardPrivileges: '本机组件正以普通用户权限运行。', + windowsInstructions: '使用时请保持 Windows 桌面处于解锁状态。部分操作需要将目标应用切到前台;以更高权限运行的应用可能无法操作。', + windowsDesktop: '桌面状态', windowsDesktopUse: '桌面保持解锁时,智能体才能查看画面并执行操作。', + windowsCapture: '窗口截图', available: '可用', unavailable: '不可用', locked: '已锁屏或未连接', + elevated: '当前以管理员权限运行。', standardPrivileges: '当前以普通用户权限运行。', openSetup: '前往设置', later: '稍后', close: '关闭', accessibility: '辅助功能', screenRecording: '屏幕录制', - accessibilityUse: '读取界面控件、点击和输入文字', screenRecordingUse: '截取所选应用的窗口', - accessibilityPermission: '在系统设置中允许 {application} 读取界面、点击和输入。', - screenRecordingPermission: '在系统设置中允许 {application} 截取应用窗口。', - permissionHint: '在系统设置中管理辅助功能和屏幕录制权限', + accessibilityUse: '读取界面内容,并执行点击和键盘输入。', screenRecordingUse: '截取所选应用窗口的画面。', + accessibilityPermission: '允许 {application} 读取界面内容,并执行点击和键盘输入。', + screenRecordingPermission: '允许 {application} 截取所选应用窗口的画面。', + permissionHint: '可随时在「系统设置」中修改以上权限。', granted: '已允许', unknown: '未确认', request: '申请权限', settings: '打开系统设置', retry: '重试', allowedApps: '始终允许的应用', blockedApps: '不允许访问的应用', retryApproval: '允许再次询问', @@ -74,45 +77,46 @@ export const zh: Record = { noApps: '暂无始终允许或不允许访问的应用。', revoke: '撤销', revoked: '已撤销应用访问权限', requested: '请按系统设置底部的引导完成授权', opened: '已打开系统设置', applicationsFailed: '无法读取应用授权:{message}', iconsFailed: '无法读取应用图标:{message}', - failed: '无法更新权限:{message}', queryFailed: '无法检测权限:{message}', + failed: '无法更新权限:{message}', queryFailed: '无法检查系统权限:{message}', } /** Japanese copy, checked against the English keys. */ export const ja = { - previewNotice: 'Computer Use は実験的なプレビュー機能です。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。本番環境では慎重に使用してください。ネイティブ PTC モードでは、同じプログラムでアプリの操作と他のツールの呼び出しができるため、このモードを推奨します。', - windowsHelperBuild: 'npm で DSH をインストールした場合は、同じバージョンの DSH のソースから Windows 用ヘルパーをビルドしてください。{directory} で .NET 10 SDK を使い、アーキテクチャに応じて {x64} または {arm64} を実行します。', - providerLookupFailed: 'Computer Use のプロバイダーを特定できませんでした:{message}', - windowsHelperPath: '使用中のプロファイルの {patch} で、ID が {entry} の項目を探すか追加し、その {config} 内の {path} に {exe} の絶対パスを指定してください。', - windowsSetupTitle: 'Windows デスクトップへのアクセスを確認', - windowsSetupBody: 'Windows デスクトップのロックを解除して再確認してください。DSH は各アプリへのアクセス前に確認します。', - windowsSessionUnknown: '操作可能な Windows デスクトップを確認できませんでした。サインイン済みのデスクトップセッションで DSH を実行し、再確認してください。', - windowsCaptureUnavailable: 'この Windows セッションはウィンドウキャプチャに対応していません。Windows のバージョンとグラフィックスドライバーを確認して再試行してください。', + previewNoticeTitle: '実験的機能について', + previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', + ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', + windowsSetupTitle: 'Windows 実行環境を確認', + windowsSetupBody: 'Windows デスクトップのロックを解除して再試行してください。各アプリへアクセスする前には、引き続き DeepSeek Harness が確認します。', + windowsSessionUnknown: '利用可能な Windows デスクトップを検出できませんでした。サインイン済みのデスクトップ環境で DeepSeek Harness を実行して再試行してください。', + windowsCaptureUnavailable: '現在の Windows 環境はウィンドウキャプチャに対応していません。Windows のバージョンとグラフィックスドライバーを確認して再試行してください。', applicationInteraction: 'アプリの操作', - windowsInstructions: 'Windows デスクトップのロックを解除しておいてください。一部の入力では対象アプリを最前面にする必要があります。高い権限で実行中のアプリはアクセスを拒否する場合があります。', - windowsDesktop: '操作可能なデスクトップ', - windowsDesktopUse: '画面の確認と入力にはロック解除済みのデスクトップが必要です。', + windowsInstructions: '使用中は Windows デスクトップのロックを解除しておいてください。一部の操作では対象アプリを最前面に表示する必要があり、より高い権限で実行中のアプリは操作できない場合があります。', + windowsDesktop: 'デスクトップ状態', + windowsDesktopUse: 'エージェントが画面を確認して操作できるよう、デスクトップのロックを解除しておいてください。', windowsCapture: 'ウィンドウキャプチャ', - available: '利用可能', unavailable: '利用不可', locked: 'ロック中または切断済み', - elevated: 'ネイティブコンポーネントは管理者権限で実行中です。', - standardPrivileges: 'ネイティブコンポーネントは標準ユーザー権限で実行中です。', + available: '利用可能', unavailable: '利用不可', locked: 'ロック中または未接続', + elevated: '現在、管理者権限で実行中です。', + standardPrivileges: '現在、標準ユーザー権限で実行中です。', approvalRisks: 'リスク', approvalRiskTitle: 'コンピュータ操作のリスク', approvalRiskNotice: 'エージェントがアクセスできるのは、あなたが許可したアプリだけです。許可したアプリの内容を読み取ったり、バックグラウンドで操作したりできます。\n\nオンラインゲームやメッセージアプリなどでは、自動操作が制限されている場合があります。規約に違反すると、そのアプリのアカウントが一時停止または永久停止になる可能性があります。\n\n自己責任でご利用ください。自動操作は、DeepSeek Harness の停止ボタンでいつでも止められます。', - 'title': 'コンピュータ操作を承認', + 'title': 'システム権限', + 'permissionsIntro': 'Computer Use を実行するには、次の 2 つのシステム権限が必要です。', + 'windowsPermissionsIntro': 'Computer Use を実行するには、次の Windows 環境の条件を満たす必要があります。', 'applicationsTitle': 'Computer Useがアクセスできるアプリを管理', 'setupTitle': '使用前にComputer Useを設定', - 'setupBody': 'Computer Use は有効です。使用前にアクセシビリティと画面収録の権限を許可してください。プラグインの詳細を開いて設定を完了してください。', - 'setupQueryFailed': 'Computer Useは有効ですが、システム権限を確認できませんでした。プラグインの詳細を開いてエラーを確認し、再試行してください。', + 'setupBody': 'Computer Use が有効になりました。実行するには「アクセシビリティ」と「画面収録」の権限が必要です。プラグインの詳細ページで設定を完了してください。', + 'setupQueryFailed': 'Computer Use は有効ですが、システム権限を確認できませんでした。プラグインの詳細ページで内容を確認して再試行してください。', 'openSetup': '設定を開く', 'later': '後で', 'close': '閉じる', 'accessibility': 'アクセシビリティ', 'screenRecording': '画面収録', - 'accessibilityUse': 'インターフェースのコントロールを読み取り、クリックし、入力します。', - 'screenRecordingUse': '選択したアプリケーションのウィンドウをキャプチャします。', - 'accessibilityPermission': 'システム設定で、{application}にインターフェースのコントロールの読み取り、クリック、入力を許可してください。', - 'screenRecordingPermission': 'システム設定で、{application}にアプリケーションウィンドウのキャプチャを許可してください。', - 'permissionHint': 'システム設定でアクセシビリティと画面収録の権限を管理してください。', + 'accessibilityUse': '画面の内容を読み取り、クリックやキーボード入力を行います。', + 'screenRecordingUse': '選択したアプリのウィンドウ画面をキャプチャします。', + 'accessibilityPermission': '{application} に画面内容の読み取り、クリック、キーボード入力を許可します。', + 'screenRecordingPermission': '{application} に選択したアプリウィンドウの画面キャプチャを許可します。', + 'permissionHint': 'これらの権限は「システム設定」からいつでも変更できます。', 'granted': '許可済み', 'unknown': '不明', 'request': '権限をリクエスト', @@ -130,43 +134,44 @@ export const ja = { 'applicationsFailed': 'アプリケーションのアクセスを読み込めませんでした: {message}', 'iconsFailed': 'アプリケーションのアイコンを読み込めませんでした: {message}', 'failed': '権限を更新できませんでした: {message}', - 'queryFailed': '権限を確認できませんでした: {message}', + 'queryFailed': 'システム権限を確認できませんでした:{message}', } satisfies Record /** Spanish dictionary, checked against the English keys. */ export const es = { - previewNotice: 'Computer Use es una función experimental en fase de prueba. El agente puede pulsar el botón equivocado o escribir en otra ventana. Úsala con precaución en entornos de producción. Recomendamos el modo PTC nativo para que el agente pueda controlar aplicaciones y usar otras herramientas en el mismo programa.', - windowsHelperBuild: 'Si instalaste DSH con npm, compila el programa auxiliar de Windows desde las fuentes de la misma versión de DSH. En {directory}, usa el SDK de .NET 10 y ejecuta {x64} o {arm64} según la arquitectura del equipo.', - providerLookupFailed: 'No se pudo identificar el proveedor de Computer Use: {message}', - windowsHelperPath: 'En el archivo {patch} del perfil activo, busca o añade la entrada con el ID {entry}. En su sección {config}, establece {path} en la ruta absoluta de {exe}.', - windowsSetupTitle: 'Comprobar el acceso al escritorio de Windows', - windowsSetupBody: 'Desbloquea el escritorio de Windows y vuelve a comprobarlo. DSH pide permiso antes de acceder a cada aplicación.', - windowsSessionUnknown: 'No se ha verificado un escritorio interactivo de Windows. Ejecuta DSH en una sesión de escritorio iniciada y vuelve a comprobarlo.', - windowsCaptureUnavailable: 'Esta sesión de Windows no admite la captura de ventanas. Comprueba la versión de Windows y el controlador gráfico, y vuelve a intentarlo.', + previewNoticeTitle: 'Función experimental', + previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', + ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', + windowsSetupTitle: 'Comprobar el entorno de Windows', + windowsSetupBody: 'Desbloquea el escritorio de Windows e inténtalo de nuevo. DeepSeek Harness seguirá pidiendo tu autorización antes de acceder a cada aplicación.', + windowsSessionUnknown: 'No se pudo detectar un escritorio de Windows disponible. Ejecuta DeepSeek Harness en una sesión de escritorio iniciada e inténtalo de nuevo.', + windowsCaptureUnavailable: 'Este entorno de Windows no admite la captura de ventanas. Comprueba la versión de Windows y el controlador gráfico, y vuelve a intentarlo.', applicationInteraction: 'Interacción con aplicaciones', - windowsInstructions: 'Mantén desbloqueado el escritorio de Windows. Algunas entradas requieren que la aplicación esté en primer plano. Las aplicaciones con más privilegios pueden denegar el acceso.', - windowsDesktop: 'Escritorio interactivo', - windowsDesktopUse: 'La observación y la entrada requieren un escritorio desbloqueado.', + windowsInstructions: 'Mantén el escritorio de Windows desbloqueado durante el uso. Algunas acciones requieren poner la aplicación en primer plano y es posible que las aplicaciones con mayores privilegios no se puedan controlar.', + windowsDesktop: 'Estado del escritorio', + windowsDesktopUse: 'Mantén el escritorio desbloqueado para que el agente pueda ver la pantalla y realizar acciones.', windowsCapture: 'Captura de ventanas', available: 'Disponible', unavailable: 'No disponible', locked: 'Bloqueado o desconectado', - elevated: 'El componente nativo se ejecuta con privilegios de administrador.', - standardPrivileges: 'El componente nativo se ejecuta con privilegios de usuario estándar.', + elevated: 'Actualmente se ejecuta con privilegios de administrador.', + standardPrivileges: 'Actualmente se ejecuta con privilegios de usuario estándar.', approvalRisks: 'Riesgos', approvalRiskTitle: 'Riesgos del control del equipo', approvalRiskNotice: 'El agente solo puede acceder a las aplicaciones que autorices, y puede leer su contenido y controlarlas en segundo plano.\n\nLos juegos en línea, las aplicaciones de mensajería y otras aplicaciones pueden restringir la automatización. Incumplir sus normas podría provocar la suspensión o el bloqueo permanente de tu cuenta en esa aplicación.\n\nContinúa bajo tu propia responsabilidad. Para detener el control automatizado en cualquier momento, pulsa Detener en DeepSeek Harness.', - title: 'Autorizar el uso de la computadora', + title: 'Permisos del sistema', + permissionsIntro: 'Computer Use necesita los siguientes permisos del sistema para funcionar:', + windowsPermissionsIntro: 'Computer Use requiere las siguientes condiciones del entorno de Windows:', applicationsTitle: 'Administrar aplicaciones a las que puede acceder el uso de la computadora', setupTitle: 'Configurar el uso de la computadora antes de usarla', - setupBody: 'El uso de la computadora está habilitado. Antes de usarlo, otorgue permisos de Accesibilidad y Grabación de pantalla. Abra los detalles del complemento para completar la configuración.', - setupQueryFailed: 'El uso de la computadora está habilitado, pero no se pudieron verificar los permisos del sistema. Abra los detalles del complemento para ver el error y vuelva a intentarlo.', + setupBody: 'Computer Use está activado y necesita permisos de Accesibilidad y Grabación de pantalla para funcionar. Abre los detalles del complemento para completar la configuración.', + setupQueryFailed: 'Computer Use está activado, pero no se pudieron comprobar los permisos del sistema. Abre los detalles del complemento para ver el error e inténtalo de nuevo.', openSetup: 'Abrir configuración', later: 'Más tarde', close: 'Cerrar', accessibility: 'Accesibilidad', screenRecording: 'Grabación de pantalla', - accessibilityUse: 'Lea los controles de la interfaz, haga clic y escriba.', screenRecordingUse: 'Capture la ventana de la aplicación seleccionada.', - accessibilityPermission: 'En Configuración del sistema, permita que {application} lea los controles de la interfaz, haga clic y escriba.', - screenRecordingPermission: 'En Configuración del sistema, permita que {application} capture ventanas de aplicaciones.', - permissionHint: 'Administre los permisos de accesibilidad y grabación de pantalla en Configuración del sistema.', + accessibilityUse: 'Leer el contenido de la interfaz, hacer clic y escribir.', screenRecordingUse: 'Capturar la ventana de la aplicación seleccionada.', + accessibilityPermission: 'Permite que {application} lea el contenido de la interfaz, haga clic y escriba.', + screenRecordingPermission: 'Permite que {application} capture la ventana de la aplicación seleccionada.', + permissionHint: 'Puedes cambiar estos permisos en cualquier momento en Configuración del sistema.', granted: 'Permitido', unknown: 'Desconocido', request: 'Solicitar permiso', settings: 'Abrir configuración del sistema', retry: 'Reintentar', allowedApps: 'Aplicaciones siempre permitidas', blockedApps: 'Aplicaciones no permitidas', retryApproval: 'Permitir preguntar de nuevo', @@ -174,43 +179,44 @@ export const es = { noApps: 'No hay aplicaciones siempre permitidas o bloqueadas.', revoke: 'Revocar', revoked: 'Acceso a la aplicación revocado', requested: 'Siga la guía en la parte inferior de Configuración del sistema', opened: 'Configuración del sistema abierta', applicationsFailed: 'No se pudo cargar el acceso a la aplicación: {message}', iconsFailed: 'No se pudieron cargar los íconos de la aplicación: {message}', - failed: 'No se pudieron actualizar los permisos: {message}', queryFailed: 'No se pudieron verificar los permisos: {message}', + failed: 'No se pudieron actualizar los permisos: {message}', queryFailed: 'No se pudieron comprobar los permisos del sistema: {message}', } satisfies Record /** French dictionary, checked against the English keys. */ export const fr = { - previewNotice: 'Computer Use est proposé en aperçu expérimental. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent en production. Nous recommandons le mode PTC natif pour que l’agent puisse piloter des applications et utiliser d’autres outils dans le même programme.', - windowsHelperBuild: 'Si vous avez installé DSH avec npm, compilez le programme auxiliaire Windows à partir des sources de la même version de DSH. Dans {directory}, utilisez le SDK .NET 10 et exécutez {x64} ou {arm64} selon votre architecture.', - providerLookupFailed: 'Impossible d’identifier le fournisseur de Computer Use : {message}', - windowsHelperPath: 'Dans le fichier {patch} du profil actif, trouvez ou ajoutez l’entrée d’identifiant {entry}. Dans sa section {config}, indiquez le chemin absolu de {exe} dans {path}.', - windowsSetupTitle: 'Vérifier l’accès au bureau Windows', - windowsSetupBody: 'Déverrouillez le bureau Windows, puis vérifiez à nouveau. DSH demande une autorisation avant d’accéder à chaque application.', - windowsSessionUnknown: 'Aucun bureau Windows interactif n’a été vérifié. Exécutez DSH dans une session de bureau ouverte, puis vérifiez à nouveau.', - windowsCaptureUnavailable: 'Cette session Windows ne prend pas en charge la capture de fenêtres. Vérifiez la version de Windows et le pilote graphique, puis réessayez.', + previewNoticeTitle: 'Fonctionnalité expérimentale', + previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', + ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', + windowsSetupTitle: 'Vérifier l’environnement Windows', + windowsSetupBody: 'Déverrouillez le bureau Windows puis réessayez. DeepSeek Harness vous demandera toujours votre autorisation avant d’accéder à chaque application.', + windowsSessionUnknown: 'Impossible de détecter un bureau Windows disponible. Exécutez DeepSeek Harness dans une session de bureau ouverte puis réessayez.', + windowsCaptureUnavailable: 'Cet environnement Windows ne prend pas en charge la capture de fenêtres. Vérifiez la version de Windows et le pilote graphique, puis réessayez.', applicationInteraction: 'Interaction avec les applications', - windowsInstructions: 'Gardez le bureau Windows déverrouillé. Certaines saisies nécessitent que l’application soit au premier plan. Les applications disposant de privilèges supérieurs peuvent refuser l’accès.', - windowsDesktop: 'Bureau interactif', - windowsDesktopUse: 'L’observation et la saisie nécessitent un bureau déverrouillé.', + windowsInstructions: 'Gardez le bureau Windows déverrouillé pendant l’utilisation. Certaines actions nécessitent de placer l’application au premier plan, et les applications exécutées avec des privilèges supérieurs peuvent ne pas être contrôlables.', + windowsDesktop: 'État du bureau', + windowsDesktopUse: 'Gardez le bureau déverrouillé afin que l’agent puisse voir l’écran et effectuer des actions.', windowsCapture: 'Capture de fenêtres', available: 'Disponible', unavailable: 'Indisponible', locked: 'Verrouillé ou déconnecté', - elevated: 'Le composant natif s’exécute avec des privilèges d’administrateur.', - standardPrivileges: 'Le composant natif s’exécute avec des privilèges d’utilisateur standard.', + elevated: 'Fonctionne actuellement avec des privilèges d’administrateur.', + standardPrivileges: 'Fonctionne actuellement avec des privilèges d’utilisateur standard.', approvalRisks: 'Risques', approvalRiskTitle: 'Risques du contrôle de l’ordinateur', approvalRiskNotice: 'L’agent ne peut accéder qu’aux applications que vous autorisez. Il peut en lire le contenu et les contrôler en arrière-plan.\n\nLes jeux en ligne, les messageries et d’autres applications peuvent limiter l’automatisation. Le non-respect de leurs règles pourrait entraîner la suspension ou le bannissement de votre compte dans l’application concernée.\n\nUtilisez cette fonction à vos risques et périls. Vous pouvez interrompre le contrôle automatisé à tout moment en cliquant sur Arrêter dans DeepSeek Harness.', - title: "Autoriser l'utilisation de l'ordinateur", + title: 'Autorisations système', + permissionsIntro: 'Computer Use a besoin des autorisations système suivantes pour fonctionner :', + windowsPermissionsIntro: 'Computer Use nécessite les conditions suivantes dans l’environnement Windows :', applicationsTitle: "Gérer les applications auxquelles l'ordinateur peut accéder", setupTitle: "Configurer l'utilisation de l'ordinateur avant utilisation", - setupBody: "L'utilisation de l'ordinateur est activée. Avant de l'utiliser, accordez les autorisations d'accessibilité et d'enregistrement d'écran. Ouvrez les détails du plugin pour terminer la configuration.", - setupQueryFailed: "L'utilisation de l'ordinateur est activée, mais les autorisations système n'ont pas pu être vérifiées. Ouvrez les détails du plugin pour voir l'erreur et réessayez.", + setupBody: 'Computer Use est activé et nécessite les autorisations Accessibilité et Enregistrement de l’écran pour fonctionner. Ouvrez les détails du plugin pour terminer la configuration.', + setupQueryFailed: 'Computer Use est activé, mais les autorisations système n’ont pas pu être vérifiées. Ouvrez les détails du plugin pour voir l’erreur et réessayer.', openSetup: 'Ouvrir les paramètres', later: 'Plus tard', close: 'Fermer', accessibility: 'Accessibilité', screenRecording: "Enregistrement d'écran", - accessibilityUse: 'Lisez les commandes de l’interface, cliquez et tapez.', screenRecordingUse: "Capturez la fenêtre de l'application sélectionnée.", - accessibilityPermission: "Dans Paramètres système, autorisez {application} à lire les commandes de l'interface, à cliquer et à taper.", - screenRecordingPermission: "Dans Paramètres système, autorisez {application} à capturer les fenêtres d'application.", - permissionHint: 'Gérez les autorisations d’accessibilité et d’enregistrement de l’écran dans les réglages système.', + accessibilityUse: 'Lire le contenu de l’interface, cliquer et saisir au clavier.', screenRecordingUse: 'Capturer la fenêtre de l’application sélectionnée.', + accessibilityPermission: 'Autorisez {application} à lire le contenu de l’interface, cliquer et saisir au clavier.', + screenRecordingPermission: 'Autorisez {application} à capturer la fenêtre de l’application sélectionnée.', + permissionHint: 'Vous pouvez modifier ces autorisations à tout moment dans les Réglages Système.', granted: 'Autorisé', unknown: 'Inconnu', request: "Demander l'autorisation", settings: 'Ouvrir les paramètres système', retry: 'Réessayer', allowedApps: 'Applications toujours autorisées', blockedApps: 'Applications non autorisées', retryApproval: 'Autoriser la demande à nouveau', @@ -218,43 +224,44 @@ export const fr = { noApps: 'Aucune application toujours autorisée ou bloquée.', revoke: 'Révoquer', revoked: "Accès à l'application révoqué", requested: 'Suivez le guide en bas des réglages système.', opened: 'Paramètres système ouverts', applicationsFailed: "Impossible de charger l'accès à l'application : {message}", iconsFailed: "Impossible de charger les icônes d'application : {message}", - failed: 'Impossible de mettre à jour les autorisations : {message}', queryFailed: 'Impossible de vérifier les autorisations : {message}', + failed: 'Impossible de mettre à jour les autorisations : {message}', queryFailed: 'Impossible de vérifier les autorisations système : {message}', } satisfies Record /** German dictionary, checked against the English keys. */ export const de = { - previewNotice: 'Computer Use ist eine experimentelle Vorschau. Der Agent kann auf die falsche Schaltfläche klicken oder Text im falschen Fenster eingeben. Seien Sie in Produktionsumgebungen vorsichtig. Wir empfehlen den nativen PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', - windowsHelperBuild: 'Wenn Sie DSH über npm installiert haben, bauen Sie das Windows-Hilfsprogramm aus dem Quellcode der passenden DSH-Version. Führen Sie in {directory} mit dem .NET 10 SDK je nach Architektur {x64} oder {arm64} aus.', - providerLookupFailed: 'Der Computer-Use-Anbieter konnte nicht ermittelt werden: {message}', - windowsHelperPath: 'Suchen oder erstellen Sie in der Datei {patch} des aktiven Profils den Eintrag mit der ID {entry}. Setzen Sie dort unter {config} den Wert von {path} auf den absoluten Pfad zu {exe}.', - windowsSetupTitle: 'Windows-Desktopzugriff prüfen', - windowsSetupBody: 'Entsperren Sie den Windows-Desktop und prüfen Sie erneut. DSH fragt vor dem Zugriff auf jede Anwendung nach einer Erlaubnis.', - windowsSessionUnknown: 'Es wurde kein interaktiver Windows-Desktop bestätigt. Führen Sie DSH in einer angemeldeten Desktopsitzung aus und prüfen Sie erneut.', - windowsCaptureUnavailable: 'Diese Windows-Sitzung unterstützt keine Fensteraufnahme. Prüfen Sie die Windows-Version und den Grafiktreiber und versuchen Sie es erneut.', + previewNoticeTitle: 'Experimentelle Funktion', + previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', + ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', + windowsSetupTitle: 'Windows-Umgebung prüfen', + windowsSetupBody: 'Entsperren Sie den Windows-Desktop und versuchen Sie es erneut. DeepSeek Harness fragt weiterhin vor dem Zugriff auf jede App nach Ihrer Zustimmung.', + windowsSessionUnknown: 'Es konnte kein verfügbarer Windows-Desktop erkannt werden. Führen Sie DeepSeek Harness in einer angemeldeten Desktopsitzung aus und versuchen Sie es erneut.', + windowsCaptureUnavailable: 'Diese Windows-Umgebung unterstützt keine Fensteraufnahme. Prüfen Sie die Windows-Version und den Grafiktreiber und versuchen Sie es erneut.', applicationInteraction: 'Anwendungsinteraktion', - windowsInstructions: 'Lassen Sie den Windows-Desktop entsperrt. Manche Eingaben erfordern die Zielanwendung im Vordergrund. Anwendungen mit höheren Berechtigungen können den Zugriff verweigern.', - windowsDesktop: 'Interaktiver Desktop', - windowsDesktopUse: 'Für Beobachtung und Eingaben muss der Desktop entsperrt sein.', + windowsInstructions: 'Lassen Sie den Windows-Desktop während der Nutzung entsperrt. Einige Aktionen erfordern die Zielanwendung im Vordergrund; Apps mit höheren Berechtigungen lassen sich möglicherweise nicht steuern.', + windowsDesktop: 'Desktopstatus', + windowsDesktopUse: 'Lassen Sie den Desktop entsperrt, damit der Agent den Bildschirm sehen und Aktionen ausführen kann.', windowsCapture: 'Fensteraufnahme', available: 'Verfügbar', unavailable: 'Nicht verfügbar', locked: 'Gesperrt oder getrennt', - elevated: 'Die native Komponente wird mit Administratorrechten ausgeführt.', - standardPrivileges: 'Die native Komponente wird mit Standardbenutzerrechten ausgeführt.', + elevated: 'Wird derzeit mit Administratorrechten ausgeführt.', + standardPrivileges: 'Wird derzeit mit Standardbenutzerrechten ausgeführt.', approvalRisks: 'Risiken', approvalRiskTitle: 'Risiken der Computersteuerung', approvalRiskNotice: 'Der Agent kann nur auf Apps zugreifen, die Sie freigeben. Er kann deren Inhalte lesen und die Apps im Hintergrund steuern.\n\nOnline-Spiele, Messenger und andere Apps können die Automatisierung einschränken. Bei Verstößen gegen ihre Regeln könnte Ihr Konto bei der jeweiligen App vorübergehend oder dauerhaft gesperrt werden.\n\nDie Nutzung erfolgt auf eigenes Risiko. Über Stopp in DeepSeek Harness können Sie die automatisierte Steuerung jederzeit beenden.', - title: 'Autorisieren Sie die Computernutzung', + title: 'Systemberechtigungen', + permissionsIntro: 'Computer Use benötigt die folgenden Systemberechtigungen:', + windowsPermissionsIntro: 'Computer Use erfordert die folgenden Bedingungen in der Windows-Umgebung:', applicationsTitle: 'Verwalten Sie Anwendungen, auf die der Computer zugreifen kann', setupTitle: 'Richten Sie die Computernutzung vor der Nutzung ein', - setupBody: 'Die Computernutzung ist aktiviert. Erteilen Sie vor der Verwendung die Berechtigungen für Barrierefreiheit und Bildschirmaufzeichnung. Öffnen Sie die Plugin-Details, um die Einrichtung abzuschließen.', - setupQueryFailed: 'Die Computernutzung ist aktiviert, aber die Systemberechtigungen konnten nicht überprüft werden. Öffnen Sie die Plugin-Details, um den Fehler anzuzeigen, und versuchen Sie es erneut.', + setupBody: 'Computer Use ist aktiviert und benötigt die Berechtigungen für Bedienungshilfen und Bildschirmaufnahme. Öffnen Sie die Plugin-Details, um die Einrichtung abzuschließen.', + setupQueryFailed: 'Computer Use ist aktiviert, aber die Systemberechtigungen konnten nicht geprüft werden. Öffnen Sie die Plugin-Details, um den Fehler anzuzeigen und es erneut zu versuchen.', openSetup: 'Einstellungen öffnen', later: 'Später', close: 'Schließen', accessibility: 'Barrierefreiheit', screenRecording: 'Bildschirmaufzeichnung', - accessibilityUse: 'Lesen Sie die Steuerelemente der Benutzeroberfläche, klicken Sie und geben Sie ein.', screenRecordingUse: 'Erfassen Sie das ausgewählte Anwendungsfenster.', - accessibilityPermission: 'Erlauben Sie {application} in den Systemeinstellungen, Schnittstellensteuerelemente zu lesen, zu klicken und zu tippen.', - screenRecordingPermission: 'Erlauben Sie {application} in den Systemeinstellungen, Anwendungsfenster zu erfassen.', - permissionHint: 'Verwalten Sie die Berechtigungen für Bedienungshilfen und Bildschirmaufnahme in den Systemeinstellungen.', + accessibilityUse: 'Oberflächeninhalte lesen, klicken und tippen.', screenRecordingUse: 'Das Fenster der ausgewählten Anwendung aufnehmen.', + accessibilityPermission: 'Erlauben Sie {application}, Oberflächeninhalte zu lesen, zu klicken und zu tippen.', + screenRecordingPermission: 'Erlauben Sie {application}, das Fenster der ausgewählten Anwendung aufzunehmen.', + permissionHint: 'Sie können diese Berechtigungen jederzeit in den Systemeinstellungen ändern.', granted: 'Erlaubt', unknown: 'Unbekannt', request: 'Bitte um Erlaubnis', settings: 'Öffnen Sie die Systemeinstellungen', retry: 'Erneut versuchen', allowedApps: 'Immer zulässige Anwendungen', blockedApps: 'Nicht erlaubte Anwendungen', retryApproval: 'Erlaube noch einmal nachzufragen', @@ -262,43 +269,44 @@ export const de = { noApps: 'Keine immer erlaubten oder blockierten Anwendungen.', revoke: 'Widerrufen', revoked: 'Anwendungszugriff widerrufen', requested: 'Folgen Sie der Anleitung unten in den Systemeinstellungen', opened: 'Systemeinstellungen geöffnet', applicationsFailed: 'Anwendungszugriff konnte nicht geladen werden: {message}', iconsFailed: 'Anwendungssymbole konnten nicht geladen werden: {message}', - failed: 'Berechtigungen konnten nicht aktualisiert werden: {message}', queryFailed: 'Berechtigungen konnten nicht überprüft werden: {message}', + failed: 'Berechtigungen konnten nicht aktualisiert werden: {message}', queryFailed: 'Systemberechtigungen konnten nicht geprüft werden: {message}', } satisfies Record /** Russian dictionary, checked against the English keys. */ export const ru = { - previewNotice: 'Управление компьютером доступно в режиме экспериментального предпросмотра. Агент может нажать не ту кнопку или ввести текст не в то окно. Используйте эту функцию в рабочей среде с осторожностью. Рекомендуем нативный режим PTC: в нём агент может управлять приложениями и вызывать другие инструменты в одной программе.', - windowsHelperBuild: 'Если DSH установлен через npm, соберите вспомогательную программу для Windows из исходного кода той же версии DSH. В каталоге {directory} выполните {x64} или {arm64} с помощью .NET 10 SDK в зависимости от архитектуры компьютера.', - providerLookupFailed: 'Не удалось определить поставщика Computer Use: {message}', - windowsHelperPath: 'В файле {patch} активного профиля найдите или добавьте запись с идентификатором {entry}. В её разделе {config} задайте для {path} абсолютный путь к {exe}.', - windowsSetupTitle: 'Проверить доступ к рабочему столу Windows', - windowsSetupBody: 'Разблокируйте рабочий стол Windows и повторите проверку. DSH запрашивает разрешение перед доступом к каждому приложению.', - windowsSessionUnknown: 'Интерактивный рабочий стол Windows не подтверждён. Запустите DSH в сеансе вошедшего в систему пользователя и повторите проверку.', - windowsCaptureUnavailable: 'Этот сеанс Windows не поддерживает захват окон. Проверьте версию Windows и графический драйвер, затем повторите проверку.', + previewNoticeTitle: 'Экспериментальная функция', + previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', + ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', + windowsSetupTitle: 'Проверить среду Windows', + windowsSetupBody: 'Разблокируйте рабочий стол Windows и повторите попытку. DeepSeek Harness по-прежнему запрашивает ваше разрешение перед доступом к каждому приложению.', + windowsSessionUnknown: 'Не удалось обнаружить доступный рабочий стол Windows. Запустите DeepSeek Harness в активной сессии рабочего стола и повторите попытку.', + windowsCaptureUnavailable: 'Текущая среда Windows не поддерживает захват окон. Проверьте версию Windows и графический драйвер, затем повторите попытку.', applicationInteraction: 'Взаимодействие с приложениями', - windowsInstructions: 'Не блокируйте рабочий стол Windows. Для некоторых действий требуется вывести целевое приложение на передний план. Приложения с повышенными привилегиями могут отказать в доступе.', - windowsDesktop: 'Интерактивный рабочий стол', - windowsDesktopUse: 'Для наблюдения и ввода требуется разблокированный рабочий стол.', + windowsInstructions: 'Во время работы держите рабочий стол Windows разблокированным. Для некоторых действий нужно вывести приложение на передний план; приложения с повышенными привилегиями могут не поддаваться управлению.', + windowsDesktop: 'Состояние рабочего стола', + windowsDesktopUse: 'Держите рабочий стол разблокированным, чтобы агент мог видеть экран и выполнять действия.', windowsCapture: 'Захват окон', available: 'Доступно', unavailable: 'Недоступно', locked: 'Заблокирован или отключён', - elevated: 'Нативный компонент работает с правами администратора.', - standardPrivileges: 'Нативный компонент работает с обычными правами пользователя.', + elevated: 'Сейчас запущено с правами администратора.', + standardPrivileges: 'Сейчас запущено с обычными правами пользователя.', approvalRisks: 'Риски', approvalRiskTitle: 'Риски управления компьютером', approvalRiskNotice: 'Агент получает доступ только к приложениям, которые вы разрешили, и может читать их содержимое и управлять ими в фоновом режиме.\n\nВ онлайн-играх, мессенджерах и других приложениях могут действовать ограничения на автоматизацию. Нарушение их правил может привести к временной или постоянной блокировке вашей учётной записи в соответствующем приложении.\n\nВы пользуетесь этой возможностью на свой страх и риск. Чтобы в любой момент остановить автоматизированное управление, нажмите «Остановить» в DeepSeek Harness.', - title: 'Разрешить использование компьютера', + title: 'Системные разрешения', + permissionsIntro: 'Для работы управления компьютером требуются следующие системные разрешения:', + windowsPermissionsIntro: 'Для работы управления компьютером требуются следующие условия среды Windows:', applicationsTitle: 'Управление приложениями, к которым может иметь доступ компьютер', setupTitle: 'Настройте использование компьютера перед использованием', - setupBody: 'Использование компьютера включено. Перед использованием предоставьте разрешения на универсальный доступ и запись экрана. Откройте сведения о плагине, чтобы завершить настройку.', - setupQueryFailed: 'Использование компьютера разрешено, но системные разрешения проверить не удалось. Откройте сведения о плагине, чтобы увидеть ошибку, и повторите попытку.', + setupBody: 'Управление компьютером включено. Для работы требуются разрешения на универсальный доступ и запись экрана. Откройте сведения о плагине, чтобы завершить настройку.', + setupQueryFailed: 'Управление компьютером включено, но не удалось проверить системные разрешения. Откройте сведения о плагине, чтобы посмотреть ошибку и повторить попытку.', openSetup: 'Открыть настройки', later: 'Позже', close: 'Закрыть', accessibility: 'Доступность', screenRecording: 'Запись экрана', - accessibilityUse: 'Прочтите элементы управления интерфейсом, щелкните и введите текст.', screenRecordingUse: 'Захват выбранного окна приложения.', - accessibilityPermission: 'В настройках системы разрешите {application} читать элементы управления интерфейсом, щелкать и печатать.', - screenRecordingPermission: 'В настройках системы разрешите {application} захватывать окна приложений.', - permissionHint: 'Управляйте разрешениями на универсальный доступ и запись экрана в системных настройках.', + accessibilityUse: 'Читать элементы интерфейса, нажимать и вводить текст.', screenRecordingUse: 'Захватывать окно выбранного приложения.', + accessibilityPermission: 'Разрешите {application} читать элементы интерфейса, нажимать и вводить текст.', + screenRecordingPermission: 'Разрешите {application} захватывать окно выбранного приложения.', + permissionHint: 'Вы можете изменить эти разрешения в любое время в системных настройках.', granted: 'Разрешено', unknown: 'Неизвестно', request: 'Запросить разрешение', settings: 'Открыть настройки системы', retry: 'Повторить', allowedApps: 'Всегда разрешенные приложения', blockedApps: 'Приложения не разрешены', retryApproval: 'Разрешить спросить еще раз', @@ -306,43 +314,44 @@ export const ru = { noApps: 'Никаких всегда разрешенных или заблокированных приложений.', revoke: 'Отозвать', revoked: 'Доступ к приложению отозван', requested: 'Следуйте инструкциям внизу окна «Системные настройки».', opened: 'Системные настройки открыты', applicationsFailed: 'Не удалось загрузить доступ к приложению: {message}.', iconsFailed: 'Не удалось загрузить значки приложений: {message}.', - failed: 'Не удалось обновить разрешения: {message}.', queryFailed: 'Не удалось проверить разрешения: {message}', + failed: 'Не удалось обновить разрешения: {message}.', queryFailed: 'Не удалось проверить системные разрешения: {message}', } satisfies Record /** Portuguese dictionary, checked against the English keys. */ export const pt = { - previewNotice: 'Computer Use é um recurso experimental em prévia. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes de produção. Recomendamos o modo PTC nativo para que o agente possa controlar aplicativos e usar outras ferramentas no mesmo programa.', - windowsHelperBuild: 'Se você instalou o DSH pelo npm, compile o auxiliar do Windows a partir do código-fonte da mesma versão do DSH. Em {directory}, use o SDK do .NET 10 e execute {x64} ou {arm64} conforme a arquitetura do computador.', - providerLookupFailed: 'Não foi possível identificar o provedor do Computer Use: {message}', - windowsHelperPath: 'No arquivo {patch} do perfil ativo, localize ou adicione a entrada com o ID {entry}. Em {config}, defina {path} como o caminho absoluto de {exe}.', - windowsSetupTitle: 'Verificar acesso à área de trabalho do Windows', - windowsSetupBody: 'Desbloqueie a área de trabalho do Windows e verifique novamente. O DSH pede permissão antes de acessar cada aplicativo.', - windowsSessionUnknown: 'Nenhuma área de trabalho interativa do Windows foi confirmada. Execute o DSH em uma sessão com login e verifique novamente.', - windowsCaptureUnavailable: 'Esta sessão do Windows não oferece suporte à captura de janelas. Verifique a versão do Windows e o driver gráfico e tente novamente.', + previewNoticeTitle: 'Recurso experimental', + previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', + ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', + windowsSetupTitle: 'Verificar ambiente Windows', + windowsSetupBody: 'Desbloqueie a área de trabalho do Windows e tente novamente. O DeepSeek Harness continuará pedindo sua autorização antes de acessar cada aplicativo.', + windowsSessionUnknown: 'Não foi possível detectar uma área de trabalho do Windows disponível. Execute o DeepSeek Harness em uma sessão de área de trabalho conectada e tente novamente.', + windowsCaptureUnavailable: 'Este ambiente Windows não oferece suporte à captura de janelas. Verifique a versão do Windows e o driver gráfico e tente novamente.', applicationInteraction: 'Interação com aplicativos', - windowsInstructions: 'Mantenha a área de trabalho do Windows desbloqueada. Algumas entradas exigem que o aplicativo de destino esteja em primeiro plano. Aplicativos com privilégios mais altos podem recusar o acesso.', - windowsDesktop: 'Área de trabalho interativa', - windowsDesktopUse: 'A observação e a entrada exigem uma área de trabalho desbloqueada.', + windowsInstructions: 'Mantenha a área de trabalho do Windows desbloqueada durante o uso. Algumas ações exigem colocar o aplicativo em primeiro plano, e aplicativos com privilégios mais altos podem não ser controláveis.', + windowsDesktop: 'Status da área de trabalho', + windowsDesktopUse: 'Mantenha a área de trabalho desbloqueada para que o agente possa ver a tela e executar ações.', windowsCapture: 'Captura de janelas', available: 'Disponível', unavailable: 'Indisponível', locked: 'Bloqueada ou desconectada', - elevated: 'O componente nativo está sendo executado com privilégios de administrador.', - standardPrivileges: 'O componente nativo está sendo executado com privilégios de usuário padrão.', + elevated: 'Atualmente em execução com privilégios de administrador.', + standardPrivileges: 'Atualmente em execução com privilégios de usuário padrão.', approvalRisks: 'Riscos', approvalRiskTitle: 'Riscos do controle do computador', approvalRiskNotice: 'O agente só pode acessar os aplicativos que você autorizar e pode ler seu conteúdo e controlá-los em segundo plano.\n\nJogos on-line, aplicativos de mensagens e outros aplicativos podem restringir a automação. Violar essas regras pode levar à suspensão ou ao banimento da sua conta no aplicativo em questão.\n\nUse por sua conta e risco. Para interromper o controle automatizado a qualquer momento, clique em Parar no DeepSeek Harness.', - title: 'Autorizar o uso do computador', + title: 'Permissões do sistema', + permissionsIntro: 'O Computer Use precisa das seguintes permissões do sistema para funcionar:', + windowsPermissionsIntro: 'O Computer Use requer as seguintes condições do ambiente Windows:', applicationsTitle: 'Gerenciar aplicativos que o computador pode acessar', setupTitle: 'Configure o uso do computador antes de usar', - setupBody: 'O uso do computador está ativado. Antes de usá-lo, conceda permissões de Acessibilidade e Gravação de tela. Abra os detalhes do plugin para concluir a configuração.', - setupQueryFailed: 'O uso do computador está ativado, mas não foi possível verificar as permissões do sistema. Abra os detalhes do plugin para ver o erro e tente novamente.', + setupBody: 'O Computer Use está ativado e precisa das permissões de Acessibilidade e Gravação de tela para funcionar. Abra os detalhes do plugin para concluir a configuração.', + setupQueryFailed: 'O Computer Use está ativado, mas não foi possível verificar as permissões do sistema. Abra os detalhes do plugin para ver o erro e tentar novamente.', openSetup: 'Abrir configurações', later: 'Mais tarde', close: 'Fechar', accessibility: 'Acessibilidade', screenRecording: 'Gravação de tela', - accessibilityUse: 'Leia os controles da interface, clique e digite.', screenRecordingUse: 'Capture a janela do aplicativo selecionado.', - accessibilityPermission: 'Nas configurações do sistema, permita que {application} leia os controles da interface, clique e digite.', - screenRecordingPermission: 'Nas configurações do sistema, permita que {application} capture janelas de aplicativos.', - permissionHint: 'Gerencie as permissões de acessibilidade e gravação de tela nas Configurações do sistema.', + accessibilityUse: 'Ler o conteúdo da interface, clicar e digitar.', screenRecordingUse: 'Capturar a janela do aplicativo selecionado.', + accessibilityPermission: 'Permita que {application} leia o conteúdo da interface, clique e digite.', + screenRecordingPermission: 'Permita que {application} capture a janela do aplicativo selecionado.', + permissionHint: 'Você pode alterar essas permissões a qualquer momento nas Configurações do sistema.', granted: 'Permitido', unknown: 'Desconhecido', request: 'Solicitar permissão', settings: 'Abra as configurações do sistema', retry: 'Tentar novamente', allowedApps: 'Aplicativos sempre permitidos', blockedApps: 'Aplicativos não permitidos', retryApproval: 'Permitir perguntar novamente', @@ -350,5 +359,5 @@ export const pt = { noApps: 'Nenhum aplicativo sempre permitido ou bloqueado.', revoke: 'Revogar', revoked: 'Acesso ao aplicativo revogado', requested: 'Siga o guia na parte inferior das Configurações do sistema', opened: 'Configurações do sistema abertas', applicationsFailed: 'Não foi possível carregar o acesso ao aplicativo: {message}', iconsFailed: 'Não foi possível carregar os ícones do aplicativo: {message}', - failed: 'Não foi possível atualizar as permissões: {message}', queryFailed: 'Não foi possível verificar as permissões: {message}', + failed: 'Não foi possível atualizar as permissões: {message}', queryFailed: 'Não foi possível verificar as permissões do sistema: {message}', } satisfies Record diff --git a/packages/experimental/cua/src/client/mount.ts b/packages/experimental/cua/src/client/mount.ts index cf86dc9f02..85a70d99ce 100644 --- a/packages/experimental/cua/src/client/mount.ts +++ b/packages/experimental/cua/src/client/mount.ts @@ -31,13 +31,9 @@ export const inject = ['remote', 'slots', 'locale'] */ export async function mountCuaPermissions(ctx: Context, contribution: TypertRemoteContribution): Promise<() => Promise> { const transport = ctx.plugin(async (owner) => { await owner.remote.$mount(contribution) }) - const ui = ctx.inject(['remote.cuaAccess', 'remote.pluginInventory', 'slots', 'locale'], (ctx) => { + const ui = ctx.inject(['remote.cuaAccess', 'slots', 'locale'], (ctx) => { ctx.effect(() => ctx.locale.register(NS, { en, zh, ja, es, fr, de, ru, pt })) - const controller = new PermissionController(ctx.remote.cuaAccess, () => ctx.locale.getSnapshot().active, async () => { - const result = await ctx.remote.pluginInventory.list() - if (!result.ok) return result - return { ok: true, value: result.value.entries.some(entry => entry.enabled && entry.moduleName === '@deepseek-ai/dsh-cua-windows') } - }) + const controller = new PermissionController(ctx.remote.cuaAccess, () => ctx.locale.getSnapshot().active) const face = controller.face() ctx.slots.inject('conversation.composer', () => ctx.slots.register({ name: 'conversation.composer', priority: -1, locale: NS, diff --git a/packages/experimental/cua/src/locales.ts b/packages/experimental/cua/src/locales.ts index 319f5fa9c4..c2ff235dfd 100644 --- a/packages/experimental/cua/src/locales.ts +++ b/packages/experimental/cua/src/locales.ts @@ -3,56 +3,56 @@ /** English application-access messages. */ export const en = { question: 'Allow agent to control this application via computer use?', - detail: 'Manage app permissions for all sessions on the plugin page.', + detail: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', approve: 'Allow for this session', } /** Chinese application-access messages. */ export const zh = { question: '允许智能体自动操作此应用吗?', - detail: '在插件页面管理所有会话的应用权限。', + detail: '允许后,智能体将能够查看并操作此应用。你可随时在插件设置中管理应用权限。', approve: '本会话允许', } satisfies Record /** Japanese application-access messages. */ export const ja = { question: 'エージェントが Computer Use でこのアプリを操作することを許可しますか?', - detail: 'プラグインページで、すべてのセッションのアプリ権限を管理できます。', + detail: '許可すると、エージェントはこのアプリの内容を確認して操作できます。アプリの権限はプラグイン設定からいつでも管理できます。', approve: 'このセッションで許可', } satisfies Record /** Spanish dictionary, checked against the English keys. */ export const es = { question: '¿Permitir que el agente controle esta aplicación mediante Computer Use?', - detail: 'Gestiona los permisos de las aplicaciones para todas las sesiones en la página del plugin.', + detail: 'Si lo permites, el agente podrá ver y controlar esta aplicación. Puedes gestionar los permisos de las aplicaciones en cualquier momento en la configuración del complemento.', approve: 'Permitir durante esta sesión', } satisfies Record /** French dictionary, checked against the English keys. */ export const fr = { question: 'Autoriser l’agent à contrôler cette application via Computer Use ?', - detail: 'Gérez les autorisations des applications pour toutes les sessions sur la page du plugin.', + detail: 'Une fois autorisé, l’agent peut consulter et utiliser cette application. Vous pouvez gérer les autorisations des applications à tout moment dans les paramètres du plugin.', approve: 'Autoriser pour cette session', } satisfies Record /** German dictionary, checked against the English keys. */ export const de = { question: 'Darf der Agent diese Anwendung über Computer Use steuern?', - detail: 'Verwalten Sie App-Berechtigungen für alle Sitzungen auf der Plugin-Seite.', + detail: 'Nach der Freigabe kann der Agent diese App einsehen und bedienen. Sie können App-Berechtigungen jederzeit in den Plugin-Einstellungen verwalten.', approve: 'Für diese Sitzung zulassen', } satisfies Record /** Russian dictionary, checked against the English keys. */ export const ru = { question: 'Разрешить агенту управлять этим приложением через Computer Use?', - detail: 'Управляйте разрешениями приложений для всех сеансов на странице плагина.', + detail: 'После разрешения агент сможет просматривать это приложение и управлять им. Управлять разрешениями приложений можно в любое время в настройках плагина.', approve: 'Разрешить для этого сеанса', } satisfies Record /** Portuguese dictionary, checked against the English keys. */ export const pt = { question: 'Permitir que o agente controle este aplicativo via Computer Use?', - detail: 'Gerencie as permissões dos aplicativos para todas as sessões na página do plugin.', + detail: 'Depois de permitido, o agente poderá visualizar e operar este aplicativo. Você pode gerenciar as permissões de aplicativos a qualquer momento nas configurações do plugin.', approve: 'Permitir nesta sessão', } satisfies Record diff --git a/packages/experimental/cua/src/system-input-locales.ts b/packages/experimental/cua/src/system-input-locales.ts index 574decc4d5..46b9ec3076 100644 --- a/packages/experimental/cua/src/system-input-locales.ts +++ b/packages/experimental/cua/src/system-input-locales.ts @@ -1,23 +1,23 @@ /** Scope and interruption shown before the user grants system input. */ export const systemInputControlPrompt = { question: { - en: 'Allow the agent to control your keyboard and mouse?', - zh: '允许智能体控制你的键盘和鼠标吗?', - ja: 'エージェントにキーボードとマウスの操作を許可しますか?', - es: '¿Permitir que el agente controle tu teclado y ratón?', - fr: 'Autoriser l’agent à contrôler votre clavier et votre souris ?', - de: 'Darf der Agent Ihre Tastatur und Maus steuern?', - ru: 'Разрешить агенту управлять клавиатурой и мышью?', - pt: 'Permitir que o agente controle seu teclado e mouse?', + en: 'Allow the agent to directly control your keyboard and mouse?', + zh: '允许智能体直接控制你的键盘和鼠标吗?', + ja: 'エージェントにキーボードとマウスの直接操作を許可しますか?', + es: '¿Permitir que el agente controle directamente tu teclado y ratón?', + fr: 'Autoriser l’agent à contrôler directement votre clavier et votre souris ?', + de: 'Darf der Agent Ihre Tastatur und Maus direkt steuern?', + ru: 'Разрешить агенту напрямую управлять вашей клавиатурой и мышью?', + pt: 'Permitir que o agente controle diretamente seu teclado e mouse?', }, detail: { - en: 'The agent can send system keystrokes, move your pointer, and hold or release keys and mouse buttons. This can interrupt your input. Your choice lasts until you close this session or restart DSH.', - zh: '智能体可以发送系统键盘输入、移动指针,以及按住或松开键盘键和鼠标按钮,可能打断你的操作。此选择在关闭会话或重启 DSH 前有效。', - ja: 'エージェントはシステムへのキー入力、ポインタ移動、キーやマウスボタンの押下と解放を行えます。操作が中断される場合があります。この選択はセッションを閉じるか DSH を再起動するまで有効です。', - es: 'El agente puede enviar pulsaciones al sistema, mover el puntero y mantener pulsadas o soltar teclas y botones del ratón. Esto puede interrumpir tu interacción. Tu elección se mantiene hasta cerrar la sesión o reiniciar DSH.', - fr: 'L’agent peut envoyer des frappes au système, déplacer le pointeur et maintenir ou relâcher les touches et boutons. Cela peut interrompre vos actions. Votre choix reste valable jusqu’à la fermeture de la session ou au redémarrage de DSH.', - de: 'Der Agent kann Systemtastatureingaben senden, den Zeiger bewegen sowie Tasten und Maustasten gedrückt halten oder loslassen. Dies kann Ihre Eingabe unterbrechen. Ihre Entscheidung gilt bis zum Schließen der Sitzung oder Neustart von DSH.', - ru: 'Агент может отправлять системные нажатия клавиш, перемещать указатель, удерживать и отпускать клавиши и кнопки мыши. Это может прервать ваши действия. Выбор сохраняется до закрытия сеанса или перезапуска DSH.', - pt: 'O agente pode enviar teclas ao sistema, mover o ponteiro e manter teclas e botões pressionados ou soltá-los. Isso pode interromper sua interação. Sua escolha vale até encerrar a sessão ou reiniciar o DSH.', + en: 'Once allowed, the agent can send keystrokes and move or click the mouse, which may interrupt what you are doing. This permission applies only to this session and expires when you close the session or restart DeepSeek Harness.', + zh: '允许后,智能体可直接输入按键、移动和点击鼠标,可能会打断你当前的操作。授权仅在当前会话内有效,关闭会话或重启 DeepSeek Harness 后自动失效。', + ja: '許可すると、エージェントがキー入力やマウスの移動・クリックを直接行えるようになり、作業が中断される場合があります。この許可は現在のセッション中のみ有効で、セッションを閉じるか DeepSeek Harness を再起動すると自動的に失効します。', + es: 'Si lo permites, el agente podrá pulsar teclas y mover o hacer clic con el ratón, lo que puede interrumpir tu actividad actual. Este permiso solo es válido en esta sesión y caduca al cerrarla o reiniciar DeepSeek Harness.', + fr: 'Une fois autorisé, l’agent peut saisir des touches, déplacer la souris et cliquer, ce qui peut interrompre votre activité en cours. Cette autorisation ne s’applique qu’à cette session et expire lorsque vous la fermez ou redémarrez DeepSeek Harness.', + de: 'Nach der Freigabe kann der Agent Tasten drücken sowie die Maus bewegen und klicken, was Ihre laufende Arbeit unterbrechen kann. Diese Erlaubnis gilt nur für diese Sitzung und endet beim Schließen der Sitzung oder Neustart von DeepSeek Harness.', + ru: 'После разрешения агент сможет нажимать клавиши, перемещать курсор и кликать мышью, что может прервать ваши текущие действия. Разрешение действует только в этом сеансе и сбрасывается при его закрытии или перезапуске DeepSeek Harness.', + pt: 'Depois de permitido, o agente poderá digitar teclas e mover ou clicar com o mouse, o que pode interromper o que você está fazendo. Esta permissão vale apenas para esta sessão e expira ao encerrá-la ou reiniciar o DeepSeek Harness.', }, } diff --git a/packages/experimental/cua/tests/application-access.spec.ts b/packages/experimental/cua/tests/application-access.spec.ts index 9a58ff9911..2c2218764a 100644 --- a/packages/experimental/cua/tests/application-access.spec.ts +++ b/packages/experimental/cua/tests/application-access.spec.ts @@ -236,15 +236,15 @@ it.each([ expect(question).toMatchObject({ id: 'cua-app-access', question: 'Allow computer use to launch if needed, read, capture, and control Test application?', - detail: 'Manage app permissions for all sessions on the plugin page.', + detail: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', intent: { kind: 'approval', approve: 'Allow for this session', reject: 'Deny', subject: { name: 'Test application' }, display: { question: { en: 'Allow agent to control this application via computer use?', zh: '允许智能体自动操作此应用吗?', ja: 'エージェントが Computer Use でこのアプリを操作することを許可しますか?' }, - detail: { en: 'Manage app permissions for all sessions on the plugin page.', - zh: '在插件页面管理所有会话的应用权限。', - ja: 'プラグインページで、すべてのセッションのアプリ権限を管理できます。' }, + detail: { en: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', + zh: '允许后,智能体将能够查看并操作此应用。你可随时在插件设置中管理应用权限。', + ja: '許可すると、エージェントはこのアプリの内容を確認して操作できます。アプリの権限はプラグイン設定からいつでも管理できます。' }, approve: { en: 'Allow for this session', zh: '本会话允许', ja: 'このセッションで許可', es: 'Permitir durante esta sesión', fr: 'Autoriser pour cette session', de: 'Für diese Sitzung zulassen', ru: 'Разрешить для этого сеанса', pt: 'Permitir nesta sessão' }, diff --git a/packages/experimental/cua/tests/controller.client.spec.ts b/packages/experimental/cua/tests/controller.client.spec.ts index 55a81ca0f6..098bd237cb 100644 --- a/packages/experimental/cua/tests/controller.client.spec.ts +++ b/packages/experimental/cua/tests/controller.client.spec.ts @@ -24,44 +24,11 @@ function fixture() { enablePersistentPtc: vi.fn(async () => ({ ok: true, value: undefined })), } let locale = 'zh' - const windowsProvider = vi.fn(async () => ({ ok: true as const, value: true })) - const controller = new PermissionController(actions, () => locale, windowsProvider) + const controller = new PermissionController(actions, () => locale) onTestFinished(() => controller.dispose()) - return { actions, controller, windowsProvider, face: controller.face(), setLocale: (value: string) => { locale = value } } + return { actions, controller, face: controller.face(), setLocale: (value: string) => { locale = value } } } -it('identifies the enabled provider if the native helper cannot report its platform', async () => { - const f = fixture() - const statuses: boolean[] = [] - onTestFinished(f.controller.state.subscribe(() => { statuses.push(f.controller.state.getSnapshot().windowsProvider.busy) })) - f.actions.systemStatus.mockRejectedValueOnce(new Error('helper missing')) - f.face.refresh() - await vi.waitFor(() => { expect(f.controller.state.getSnapshot().windowsProvider.value).toBe(true) }) - expect(f.controller.state.getSnapshot().system.error).toBe('helper missing') - f.face.refresh() - await vi.waitFor(() => { expect(f.controller.state.getSnapshot().system.value).toEqual(value) }) - expect(f.windowsProvider).toHaveBeenCalledOnce() - expect(statuses).toContain(true) - expect(statuses.at(-1)).toBe(false) -}) - -it('clears a superseded inventory read when native permissions become available', async () => { - const f = fixture() - const inventory = Promise.withResolvers<{ ok: true; value: boolean }>() - onTestFinished(() => { inventory.resolve({ ok: true, value: true }) }) - f.windowsProvider.mockImplementationOnce(() => inventory.promise) - f.actions.systemStatus.mockRejectedValueOnce(new Error('helper missing')) - f.face.refresh() - await vi.waitFor(() => { expect(f.controller.state.getSnapshot().windowsProvider.busy).toBe(true) }) - f.controller.setChanging(true) - expect(f.controller.state.getSnapshot().windowsProvider.busy).toBe(false) - f.controller.setChanging(false) - await vi.waitFor(() => { expect(f.controller.state.getSnapshot().system.value).toEqual(value) }) - inventory.resolve({ ok: true, value: true }) - await setImmediate() - expect(f.controller.state.getSnapshot().windowsProvider).toEqual({ value: null, busy: false, error: null }) -}) - it('refreshes after a request and then waits for an explicit refresh', async () => { vi.useFakeTimers() const f = fixture() diff --git a/packages/experimental/cua/tests/mount.client.spec.ts b/packages/experimental/cua/tests/mount.client.spec.ts index 29e7a77cf2..f350250e3b 100644 --- a/packages/experimental/cua/tests/mount.client.spec.ts +++ b/packages/experimental/cua/tests/mount.client.spec.ts @@ -2,8 +2,6 @@ import assert from 'node:assert/strict' import { setImmediate } from 'node:timers/promises' import { Context, Service } from '@deepseek-ai/cordis' -import { brandString } from '@deepseek-ai/dsh-brand' -import type { PluginEntryId } from '@deepseek-ai/dsh-api-remotes/client' import { LocaleRuntime } from '@deepseek-ai/dsh-client-locale/client' import { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client' import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' @@ -37,8 +35,6 @@ async function fixture(fail = false) { } } new Remote() - const list = vi.fn() - await ctx.plugin((scope) => { scope.provide('remote.pluginInventory', { list }) }) const changes = createSnapshotStore(false) ctx.provide('pluginChanges', { bundle: (name) => { expect(name).toBe('@deepseek-ai/dsh-cua-bundle') @@ -63,29 +59,11 @@ async function fixture(fail = false) { 'conversation.composer': { kind: 'chain', scope: 'session' }, } } as never, () => null) if (fail) vi.spyOn(ctx.slots, 'inject').mockImplementationOnce(() => { throw new Error('slot unavailable') }) - return { ctx, changes, unmount, status, systemStatus, applicationIcons, list, + return { ctx, changes, unmount, status, systemStatus, applicationIcons, requestPermission, openSettings, revoke, retryApproval, } } -it('reads the Windows provider from the Host inventory when the helper cannot report permissions', async () => { - const f = await fixture() - try { - f.systemStatus.mockRejectedValue(new Error('helper missing')) - const failed = { ok: false, error: new RemoteError('gateway/internal', 'inventory unavailable', {}) } as const - f.list.mockResolvedValueOnce(failed).mockResolvedValue({ ok: true, value: { entries: [ - { moduleName: '@deepseek-ai/dsh-cua-windows', enabled: true, fiberPhase: 'failed', entryId: brandString('cua-windows') }, - ] } }) - await f.ctx.plugin({ inject: [...inject], apply: ctx => mountCuaPermissions(ctx, contribution) }) - const actions = f.ctx.slots.entries('plugins.bundle.config')[0]!.inject!() - actionsOf(actions) - actions.refresh() - await vi.waitFor(() => { expect(actions.hooks.cuaPermissions.getSnapshot().windowsProvider.error).toBe('inventory unavailable') }) - actions.refresh() - await vi.waitFor(() => { expect(actions.hooks.cuaPermissions.getSnapshot().windowsProvider.value).toBe(true) }) - } finally { await f.ctx.fiber.dispose() } -}) - it('withdraws the permission Remote and all controls with the optional plugin', async () => { const f = await fixture() try { diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index 1046d3c82c..d5de516fcd 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -22,7 +22,6 @@ function observe(value: CuaApplicationState & { system: CuaSystemPermissionState function fixture() { const state = createSnapshotStore({ - windowsProvider: { value: null, busy: false, error: null }, system: { value: null, busy: true, error: null }, applications: { value: null, busy: true, error: null }, icons: { value: null, busy: true, error: null }, busy: true, changing: false, toast: null, }) @@ -88,12 +87,14 @@ it.each([en, zh])('waits for platform identification before offering system perm const f = fixture() render() expect(screen.queryByRole('group', { name: dictionary.accessibility })).toBeNull() + expect(screen.getByText(dictionary.permissionsIntro).getAttribute('aria-hidden')).toBe('true') expect(screen.getByText(dictionary.permissionHint).getAttribute('aria-hidden')).toBe('true') f.publish({ system: { ...f.state.getSnapshot().system, busy: false, error: 'connection lost' }, busy: false }) expect(screen.getAllByText(dictionary.unknown)).toHaveLength(2) expect(screen.queryByText(dictionary.granted)).toBeNull() expect(screen.queryByRole('button', { name: dictionary.request })).toBeNull() expect(screen.queryByRole('button', { name: dictionary.unknown })).toBeNull() + expect(screen.getByText(dictionary.permissionsIntro).getAttribute('aria-hidden')).toBe('true') expect(screen.getByText(dictionary.permissionHint).getAttribute('aria-hidden')).toBe('true') f.publish({ ...observe({ ...value, system: { ...value.system, accessibility: true, screenRecording: false } }) }) fireEvent.click(screen.getByRole('button', { name: dictionary.request })) @@ -106,7 +107,7 @@ it('offers setup after inspection, permits dismissal, and dismisses once both pr expect(screen.queryByRole('dialog')).toBeNull() f.publish({ ...observe(value) }) const dialog = screen.getByRole('dialog', { name: en.setupTitle }) - expect(within(dialog).getByText('Computer use is enabled. Before using it, grant Accessibility and Screen Recording permissions. Open the plugin details to complete setup.')).toBeTruthy() + expect(within(dialog).getByText(en.setupBody)).toBeTruthy() fireEvent.click(within(dialog).getByRole('button', { name: en.openSetup })) expect(onOpenDetails).toHaveBeenCalledOnce() fireEvent.click(within(dialog).getByRole('button', { name: en.later })) @@ -213,6 +214,7 @@ it.each([en, zh])('shows system permissions with the target application beside e const recording = within(requirements).getByRole('group', { name: dictionary.screenRecording }) expect(within(recording).getByText(application.name)).toBeTruthy() expect(recording.textContent).toContain(dictionary.screenRecordingPermission.replace('{application}', application.name)) + expect(within(requirements).getByText(dictionary.permissionsIntro)).toBeTruthy() expect(within(requirements).getByText(dictionary.permissionHint)).toBeTruthy() f.publish({ system: { ...f.state.getSnapshot().system, error: 'offline' } }) expect(screen.queryByText(application.name)).toBeNull() @@ -385,27 +387,18 @@ it('retains a known query failure throughout management and refresh', () => { expect(f.state.getSnapshot().changing).toBe(true) }) -it('shows Windows setup above the controls even when the helper is missing', () => { +it.each([en, zh])('highlights the experimental notice and keeps the PTC recommendation separate', (dictionary) => { const f = fixture() - f.publish({ system: { value: null, error: 'helper missing', busy: false }, windowsProvider: { value: true, error: null, busy: false } }) - render() - const instructions = screen.getByText(/pnpm run build:native:x64/) - const firstSetting = screen.getByRole('heading', { name: en.title }) - expect(instructions.compareDocumentPosition(firstSetting) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() - expect(screen.getByText(/helperPath/)).toBeTruthy() - expect(screen.queryByRole('button', { name: en.request })).toBeNull() -}) - -it('keeps the provider lookup diagnostic beside the native error until the platform is known', () => { - const f = fixture() - f.publish({ system: { value: null, error: 'helper missing', busy: false }, windowsProvider: { value: null, error: 'offline', busy: false } }) - render() - const diagnostic = en.providerLookupFailed.replace('{message}', 'offline') - expect(screen.getByText(diagnostic)).toBeTruthy() - fireEvent.click(screen.getByRole('button', { name: en.retry })) - expect(f.props.refresh).toHaveBeenCalledTimes(2) - f.publish({ system: { value: value.system, error: null, busy: false } }) - expect(screen.queryByText(diagnostic)).toBeNull() + f.publish({ ...observe(value) }) + render() + const note = screen.getByRole('note') + expect(within(note).getByText(dictionary.previewNoticeTitle)).toBeTruthy() + expect(within(note).getByText(dictionary.previewNotice)).toBeTruthy() + expect(within(note).queryByText(dictionary.ptcRecommendation)).toBeNull() + const ptc = screen.getByText(dictionary.ptcRecommendation) + const heading = screen.getByRole('heading', { name: dictionary.title }) + expect(note.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(ptc.compareDocumentPosition(heading) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() }) it.each([true, false, null] as const)('shows Windows desktop access for lock state %s without macOS permission actions', (sessionLocked) => { @@ -413,8 +406,12 @@ it.each([true, false, null] as const)('shows Windows desktop access for lock sta f.publish({ ...observe(value), system: { value: { platform: 'windows', sessionLocked, captureAvailable: true, elevated: false, helper: { path: 'C:\\helper.exe' } }, error: null, busy: false } }) render() + expect(screen.getByText(en.previewNoticeTitle)).toBeTruthy() expect(screen.getByText(en.previewNotice)).toBeTruthy() - expect(screen.getByText(/helperPath/)).toBeTruthy() + expect(screen.getByText(en.ptcRecommendation)).toBeTruthy() + expect(screen.getByText(en.windowsPermissionsIntro)).toBeTruthy() + expect(screen.queryByText(/helperPath/)).toBeNull() + expect(screen.queryByText(/pnpm run build:native/)).toBeNull() const desktop = screen.getByRole('group', { name: en.windowsDesktop }) const capture = screen.getByRole('group', { name: en.windowsCapture }) expect(within(desktop).getByText(sessionLocked === null ? en.unknown : sessionLocked ? en.locked : en.available)).toBeTruthy() From 7127aebd5d98ec19dadf103c47adf6869c93cfd0 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 12:17:19 +0800 Subject: [PATCH 02/17] fix(cua): refine notice styling, permission errors, and supported platform copy --- .../cua-permissions/missing.expected.md | 1 - packages/boot/app-boot/src/bundle-platform.ts | 6 + .../app-boot/tests/bundle-platform.spec.ts | 5 + packages/boot/plugin-manager/src/index.ts | 2 +- packages/boot/plugin-manager/src/types.ts | 2 + .../src/client/PluginManagerPage.tsx | 7 +- .../ui-plugin-manager/src/client/locales.ts | 48 ++++++++ .../src/client/manager-store.ts | 12 +- .../src/client/presentation.ts | 24 ++++ .../tests/components.client.spec.tsx | 10 +- .../tests/manager-store.client.spec.ts | 16 ++- packages/experimental/cua/README.i18n.yaml | 4 +- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- .../cua/src/application-access.ts | 12 +- .../cua/src/client/PermissionPanel.module.css | 23 +++- .../cua/src/client/PermissionPanel.tsx | 26 ++-- .../experimental/cua/src/client/locales.ts | 112 +++++++++--------- packages/experimental/cua/src/locales.ts | 16 +++ .../cua/tests/application-access.spec.ts | 14 ++- .../cua/tests/panel.client.spec.tsx | 16 +-- .../cordis-host-runner/src/api-catalog.ts | 2 +- 22 files changed, 262 insertions(+), 100 deletions(-) diff --git a/apps/web/tests/expected/cua-permissions/missing.expected.md b/apps/web/tests/expected/cua-permissions/missing.expected.md index b528d1876a..835fdc977b 100644 --- a/apps/web/tests/expected/cua-permissions/missing.expected.md +++ b/apps/web/tests/expected/cua-permissions/missing.expected.md @@ -13,7 +13,6 @@ - strong: Screen Recording - paragraph: Allow DSH Computer Use.app to capture the selected application window. - button "Request permission" - - paragraph: You can change these permissions anytime in System Settings. - region "Manage applications computer use can access": - heading "Manage applications computer use can access" [level=3] - heading "Always-allowed applications" [level=4] diff --git a/packages/boot/app-boot/src/bundle-platform.ts b/packages/boot/app-boot/src/bundle-platform.ts index 216b1db29e..de56867bf9 100644 --- a/packages/boot/app-boot/src/bundle-platform.ts +++ b/packages/boot/app-boot/src/bundle-platform.ts @@ -7,6 +7,10 @@ const NODE_PLATFORMS: readonly string[] = Object.freeze([ /** A valid bundle declaration excludes the operating system running DSH. */ export class UnsupportedBundlePlatformError extends Error { + /** Node platform names or `wsl` supported by the bundle. */ + readonly platforms: readonly string[] + /** Operating system of the DSH Host. */ + readonly platform: string /** * @param platforms Node platform names or `wsl` supported by the bundle. * @param platform Operating system of the DSH Host. @@ -14,6 +18,8 @@ export class UnsupportedBundlePlatformError extends Error { constructor(platforms: readonly string[], platform: string) { super(`Bundle supports Host platforms ${platforms.join(', ')}; the DSH Host is running ${platform}`) this.name = 'UnsupportedBundlePlatformError' + this.platforms = [...platforms] + this.platform = platform } } diff --git a/packages/boot/app-boot/tests/bundle-platform.spec.ts b/packages/boot/app-boot/tests/bundle-platform.spec.ts index 92455ac4ff..87b84ddee7 100644 --- a/packages/boot/app-boot/tests/bundle-platform.spec.ts +++ b/packages/boot/app-boot/tests/bundle-platform.spec.ts @@ -21,6 +21,11 @@ it.each(['darwin', 'win32', 'linux'])('allows undeclared platforms and an explic it.each(['win32', 'linux'])('rejects macOS-only bundles on %s Hosts', (platform) => { expect(() => { assertBundlePlatform(['darwin'], platform) }).toThrow(UnsupportedBundlePlatformError) expect(() => { assertBundlePlatform(['darwin'], platform) }).toThrow(`the DSH Host is running ${platform}`) + try { assertBundlePlatform(['darwin', 'wsl'], platform) } catch (error) { + expect(error).toBeInstanceOf(UnsupportedBundlePlatformError) + expect((error as UnsupportedBundlePlatformError).platforms).toEqual(['darwin', 'wsl']) + expect((error as UnsupportedBundlePlatformError).platform).toBe(platform) + } }) it.each([null, true, 'darwin', [], [1], [''], ['Darwin'], [' darwin'], ['macos'], ['darwin', 'linxu'], ['darwin', false]].map(platforms => ({ platforms })))('rejects malformed platform metadata $platforms', ({ platforms }) => { diff --git a/packages/boot/plugin-manager/src/index.ts b/packages/boot/plugin-manager/src/index.ts index 062817e703..c5f7d1319a 100644 --- a/packages/boot/plugin-manager/src/index.ts +++ b/packages/boot/plugin-manager/src/index.ts @@ -111,7 +111,7 @@ function messageOf(error: unknown): string { return error instanceof Error ? err /** An expected refusal keeps its code; anything else becomes an operation error carrying its exact diagnostic. */ function managementError(error: unknown): ManagementError { - if (error instanceof UnsupportedBundlePlatformError) return { code: 'unsupported-platform' } + if (error instanceof UnsupportedBundlePlatformError) return { code: 'unsupported-platform', platforms: [...error.platforms] } if (!(error instanceof ManagementFailure)) return { code: 'operation-error', diagnostic: messageOf(error) } return { code: error.code, ...error.incompatible === undefined ? {} : { incompatible: error.incompatible } } } diff --git a/packages/boot/plugin-manager/src/types.ts b/packages/boot/plugin-manager/src/types.ts index e5ebd996c1..83348ef274 100644 --- a/packages/boot/plugin-manager/src/types.ts +++ b/packages/boot/plugin-manager/src/types.ts @@ -40,6 +40,8 @@ export interface ManagementError { diagnostic?: string /** Present with `incompatible-version`: the packages the running DSH version rejects. */ incompatible?: IncompatiblePlugin[] + /** Present with `unsupported-platform`: the Host platforms the bundle supports. */ + platforms?: string[] } /** diff --git a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx index 81b2fa015e..723f21c3aa 100644 --- a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx +++ b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx @@ -1008,7 +1008,12 @@ function failureText(failure: InstallState['failure'], t: Translate, install?: P return t('installFailureNetworkAll', { registries: registryList(asked, t, install?.registries?.resolved ?? null) }) } if (failure.kind !== undefined) return t(FAILURE_KIND_KEYS[failure.kind]) - if (failure.code !== undefined) return managementText({ code: failure.code, diagnostic: failure.reason }, t) + if (failure.code !== undefined) { + return managementText({ + code: failure.code, diagnostic: failure.reason, + ...failure.platforms === undefined ? {} : { platforms: failure.platforms }, + }, t) + } if (failure.reason !== '') return failure.reason // An enabled install that failed applying the bundle names that step, never the install command it already finished. return failure.stage === 'enable' && failure.enabled === true ? t('installFailedEnabling') : t('installFailureGeneric') diff --git a/packages/client/ui-plugin-manager/src/client/locales.ts b/packages/client/ui-plugin-manager/src/client/locales.ts index 2f94190697..0f77548982 100644 --- a/packages/client/ui-plugin-manager/src/client/locales.ts +++ b/packages/client/ui-plugin-manager/src/client/locales.ts @@ -295,6 +295,12 @@ export const zh = { reasonIncompatibleVersion: '{plugin} 与 DSH {runtime} 不兼容(要求 {requirements}),运行它可能导致崩溃或数据丢失。', reasonIncompatibleVersionUnnamed: '这个插件与当前 DSH 版本不兼容,运行它可能导致崩溃或数据丢失。', reasonUnsupportedPlatform: '此插件不支持当前操作系统', + reasonUnsupportedPlatformList: '此插件仅支持 {platforms}', + platformListLastSeparator: ' 和 ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', reasonIncompatibleInstall: '请安装与当前 DSH 兼容的插件版本。', reasonIncompatibleInstalled: '请卸载后重新安装与当前 DSH 兼容的版本。', reasonUnexpectedPackage: '插件来源安装了与所请求不同的包或版本,已撤销这次安装。请向插件发布者或插件索引维护者报告此问题。', @@ -602,6 +608,12 @@ export const en = { reasonIncompatibleVersion: '{plugin} is incompatible with DSH {runtime} (requires {requirements}); running it may cause crashes or data loss.', reasonIncompatibleVersionUnnamed: 'This plugin is incompatible with the running DSH version; running it may cause crashes or data loss.', reasonUnsupportedPlatform: 'This plugin does not support this operating system.', + reasonUnsupportedPlatformList: 'This plugin only supports {platforms}.', + platformListLastSeparator: ' and ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', reasonIncompatibleInstall: 'Install a plugin version compatible with this DSH.', reasonIncompatibleInstalled: 'Uninstall it and install a version compatible with this DSH.', reasonUnexpectedPackage: 'The plugin source installed another package or version than requested; the installation was undone. Report it to the plugin\'s publisher or the index maintainer.', @@ -619,6 +631,12 @@ export const en = { /** Japanese copy, checked against the English keys. */ export const ja = { 'reasonUnsupportedPlatform': 'このプラグインは現在の OS に対応していません。', + 'reasonUnsupportedPlatformList': 'このプラグインは {platforms} にのみ対応しています。', + 'platformListLastSeparator': ' と ', + 'platformDarwin': 'macOS', + 'platformWin32': 'Windows', + 'platformLinux': 'Linux', + 'platformWsl': 'WSL', 'panel': 'プラグイン', 'settingsEntry': 'プラグイン管理', 'clientSyncing': 'このページでプラグインを同期中…', @@ -923,6 +941,12 @@ export const ja = { /** Spanish dictionary, checked against the English keys. */ export const es = { reasonUnsupportedPlatform: 'Este complemento no es compatible con este sistema operativo.', + reasonUnsupportedPlatformList: 'Este complemento solo es compatible con {platforms}.', + platformListLastSeparator: ' y ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', panel: 'Complementos', settingsEntry: 'Complementos', clientSyncing: 'Sincronizando complementos en esta página…', @@ -1227,6 +1251,12 @@ export const es = { /** French dictionary, checked against the English keys. */ export const fr = { reasonUnsupportedPlatform: 'Ce plugin n’est pas compatible avec ce système d’exploitation.', + reasonUnsupportedPlatformList: 'Ce plugin est uniquement compatible avec {platforms}.', + platformListLastSeparator: ' et ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', panel: 'Plugins', settingsEntry: 'Plugins', clientSyncing: 'Synchronisation des plugins sur cette page…', @@ -1531,6 +1561,12 @@ export const fr = { /** German dictionary, checked against the English keys. */ export const de = { reasonUnsupportedPlatform: 'Dieses Plugin unterstützt dieses Betriebssystem nicht.', + reasonUnsupportedPlatformList: 'Dieses Plugin unterstützt nur {platforms}.', + platformListLastSeparator: ' und ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', panel: 'Plugins', settingsEntry: 'Plugins', clientSyncing: 'Plugins auf dieser Seite werden synchronisiert…', @@ -1835,6 +1871,12 @@ export const de = { /** Russian dictionary, checked against the English keys. */ export const ru = { reasonUnsupportedPlatform: 'Этот плагин не поддерживает текущую операционную систему.', + reasonUnsupportedPlatformList: 'Этот плагин поддерживает только {platforms}.', + platformListLastSeparator: ' и ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', panel: 'Плагины', settingsEntry: 'Плагины', clientSyncing: 'Синхронизация плагинов на этой странице…', @@ -2139,6 +2181,12 @@ export const ru = { /** Portuguese dictionary, checked against the English keys. */ export const pt = { reasonUnsupportedPlatform: 'Este plugin não é compatível com este sistema operacional.', + reasonUnsupportedPlatformList: 'Este plugin é compatível apenas com {platforms}.', + platformListLastSeparator: ' e ', + platformDarwin: 'macOS', + platformWin32: 'Windows', + platformLinux: 'Linux', + platformWsl: 'WSL', panel: 'Plug-ins', settingsEntry: 'Plug-ins', clientSyncing: 'Sincronizando plug-ins nesta página…', diff --git a/packages/client/ui-plugin-manager/src/client/manager-store.ts b/packages/client/ui-plugin-manager/src/client/manager-store.ts index e1840548a7..7e2dfb56f3 100644 --- a/packages/client/ui-plugin-manager/src/client/manager-store.ts +++ b/packages/client/ui-plugin-manager/src/client/manager-store.ts @@ -76,6 +76,8 @@ export type ManagerNotice = readonly reason: string /** The packages an `incompatible-version` refusal names. */ readonly incompatible?: readonly IncompatiblePlugin[] + /** The supported Host platforms an `unsupported-platform` refusal names. */ + readonly platforms?: readonly string[] readonly packageName?: string readonly seq: number } @@ -279,6 +281,8 @@ export interface InstallState { readonly code?: ManagementError['code'] /** The packages an `incompatible-version` refusal names. */ readonly incompatible?: readonly IncompatiblePlugin[] + /** The supported Host platforms an `unsupported-platform` refusal names. */ + readonly platforms?: readonly string[] readonly kind?: PluginInstallFailureKind /** The step the failed change reached; `enable` means the installation finished and applying the bundle failed. */ readonly stage?: ChangeResult['stage'] @@ -543,6 +547,7 @@ type Answer = class RemoteAnswerError extends Error { constructor( readonly reason: string, readonly code?: ManagementError['code'], readonly incompatible?: readonly IncompatiblePlugin[], + readonly platforms?: readonly string[], ) { super(reason) this.name = 'RemoteAnswerError' @@ -558,6 +563,7 @@ function failureOf( reason: error?.diagnostic ?? '', ...error === undefined ? {} : { code: error.code }, ...error?.incompatible === undefined ? {} : { incompatible: error.incompatible }, + ...error?.platforms === undefined ? {} : { platforms: error.platforms }, ...kind === undefined ? {} : { kind }, stage, ...enabled === undefined ? {} : { enabled }, @@ -570,9 +576,11 @@ function failureOf( function failedNotice(error: unknown, subject: { action: FailedAction; packageName?: string }, seq: number): ManagerNotice { const code = error instanceof RemoteAnswerError ? error.code : undefined const incompatible = error instanceof RemoteAnswerError ? error.incompatible : undefined + const platforms = error instanceof RemoteAnswerError ? error.platforms : undefined return { kind: 'failed', reason: reasonOf(error), ...code === undefined ? {} : { code }, - ...incompatible === undefined ? {} : { incompatible }, ...subject, seq, + ...incompatible === undefined ? {} : { incompatible }, + ...platforms === undefined ? {} : { platforms }, ...subject, seq, } } @@ -1593,7 +1601,7 @@ export class PluginManagerController { const result = answer.value switch (result.application) { case 'failed': - throw new RemoteAnswerError(result.error?.diagnostic ?? '', result.error?.code, result.error?.incompatible) + throw new RemoteAnswerError(result.error?.diagnostic ?? '', result.error?.code, result.error?.incompatible, result.error?.platforms) case 'cancelled': this.patch({ notice: { kind: 'cancelled', seq: ++this.noticeSeq } }) return diff --git a/packages/client/ui-plugin-manager/src/client/presentation.ts b/packages/client/ui-plugin-manager/src/client/presentation.ts index 8709103837..93a2dde059 100644 --- a/packages/client/ui-plugin-manager/src/client/presentation.ts +++ b/packages/client/ui-plugin-manager/src/client/presentation.ts @@ -46,6 +46,22 @@ function registryHost(registry: string): string { } /** The sentence each of the Host's refusal codes reads as. */ +const PLATFORM_KEYS = new Map([ + ['darwin', 'platformDarwin'], + ['win32', 'platformWin32'], + ['linux', 'platformLinux'], + ['wsl', 'platformWsl'], +]) + +function platformList(platforms: readonly string[], t: Translate): string { + const labels = platforms.map((name) => { + const key = PLATFORM_KEYS.get(name) + return key === undefined ? name : t(key) + }) + if (labels.length === 1) return labels.join('') + return `${labels.slice(0, -1).join(t('registryListSeparator'))}${t('platformListLastSeparator')}${labels.at(-1)}` +} + const CODE_KEYS = { 'management-required': 'reasonManagementRequired', 'unaddressable': 'reasonUnaddressable', @@ -84,6 +100,7 @@ export function managementText(error: { readonly code: ManagementError['code'] readonly diagnostic?: string readonly incompatible?: readonly IncompatiblePlugin[] + readonly platforms?: readonly string[] /** Set when the refused package is being installed rather than already installed; selects the incompatibility remedy. */ readonly installing?: true }, t: Translate): string { @@ -97,6 +114,12 @@ export function managementText(error: { })) return [...sentences, t(error.installing ? 'reasonIncompatibleInstall' : 'reasonIncompatibleInstalled')].join(t('sentenceSeparator')) } + if (error.code === 'unsupported-platform') { + const platforms = error.platforms ?? [] + return platforms.length === 0 + ? t('reasonUnsupportedPlatform') + : t('reasonUnsupportedPlatformList', { platforms: platformList(platforms, t) }) + } if (error.code !== 'operation-error') return t(CODE_KEYS[error.code]) return error.diagnostic === undefined || error.diagnostic === '' ? t('reasonOperationError') : error.diagnostic } @@ -182,6 +205,7 @@ export function noticeText(notice: ManagerNotice, t: Translate): string { case 'failed': { const reason = notice.code === undefined ? notice.reason : managementText({ code: notice.code, diagnostic: notice.reason, ...notice.incompatible === undefined ? {} : { incompatible: notice.incompatible }, + ...notice.platforms === undefined ? {} : { platforms: notice.platforms }, }, t) return t(FAILED_KEYS[notice.action], { reason: reason === '' ? t('reasonOperationError') : reason }) } diff --git a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx index 427103c8f8..cda830bd43 100644 --- a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx +++ b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx @@ -1819,8 +1819,16 @@ describe('PluginManagerPage', () => { set({ packages: [pkg({ enabled: false, error: { code: 'unsupported-platform' } })] }) expect(screen.getByText(en.reasonUnsupportedPlatform)).toBeTruthy() expect(screen.getByRole('switch', { name: en.enableToggle.replace('{name}', 'dsh-better-sidebar') })).toHaveProperty('disabled', true) - set({ packages: [pkg({ enabled: true, error: { code: 'unsupported-platform' } })] }) + set({ packages: [pkg({ enabled: true, error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] } })] }) + expect(screen.getByText('This plugin only supports macOS and Windows.')).toBeTruthy() expect(screen.getByRole('switch', { name: en.enableToggle.replace('{name}', 'dsh-better-sidebar') })).toHaveProperty('disabled', false) + set({ packages: [pkg({ enabled: false, error: { code: 'unsupported-platform', platforms: ['freebsd'] } })] }) + expect(screen.getByText('This plugin only supports freebsd.')).toBeTruthy() + set({ notice: { kind: 'failed', action: 'enable', code: 'unsupported-platform', platforms: ['darwin', 'win32'], reason: '', packageName: 'dsh-better-sidebar', seq: 1 } }) + expect(screen.getByRole('alert').textContent).toContain('This plugin only supports macOS and Windows.') + set({ notice: null, install: { ...IDLE_INSTALL, open: true, spec: 'dsh-cua', phase: 'failed', failure: { code: 'unsupported-platform', platforms: ['darwin', 'win32'], reason: '' } } }) + expect(screen.getByText('This plugin only supports macOS and Windows.')).toBeTruthy() + set({ install: IDLE_INSTALL }) // A bundle that leaves the list drops back to the cards. const { version: _version, ...unversioned } = pkg() set({ packages: [unversioned] }) diff --git a/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts b/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts index 35b6cf5a78..db260c4551 100644 --- a/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts +++ b/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts @@ -536,7 +536,8 @@ describe('PluginManagerController', () => { .mockResolvedValueOnce(ok(failed({ code: 'bundle-in-use' }))) .mockResolvedValueOnce(ok(failed())) .mockResolvedValueOnce(ok({ ...failed(), application: 'cancelled' })) - .mockResolvedValueOnce(ok(failed({ code: 'incompatible-version', incompatible: [INCOMPATIBLE] }))), + .mockResolvedValueOnce(ok(failed({ code: 'incompatible-version', incompatible: [INCOMPATIBLE] }))) + .mockResolvedValueOnce(ok(failed({ code: 'unsupported-platform', platforms: ['darwin', 'win32'] }))), }) await controller.load() face.setEnabled(BUNDLE.name, true) @@ -562,6 +563,12 @@ describe('PluginManagerController', () => { kind: 'failed', action: 'enable', code: 'incompatible-version', incompatible: [INCOMPATIBLE], reason: '', packageName: BUNDLE.name, seq: 8, }) }) + face.setEnabled(BUNDLE.name, true) + await vi.waitFor(() => { + expect(state().notice).toEqual({ + kind: 'failed', action: 'enable', code: 'unsupported-platform', platforms: ['darwin', 'win32'], reason: '', packageName: BUNDLE.name, seq: 9, + }) + }) face.dismissNotice() expect(state().notice).toBeNull() }) @@ -1351,12 +1358,17 @@ describe('PluginManagerController', () => { answer(ok(failed({ code: 'incompatible-version', incompatible: [INCOMPATIBLE] }))) await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) expect(state().install.failure).toEqual({ reason: '', code: 'incompatible-version', incompatible: [INCOMPATIBLE], stage: 'install' }) + // A platform refusal keeps the supported Host platforms it names. + await installing() + answer(ok(failed({ code: 'unsupported-platform', platforms: ['darwin', 'win32'] }))) + await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) + expect(state().install.failure).toEqual({ reason: '', code: 'unsupported-platform', platforms: ['darwin', 'win32'], stage: 'install' }) // A failure the Host does not explain has neither code nor words. await installing() answer(ok(failed())) await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) expect(state().install.failure).toEqual({ reason: '', stage: 'install' }) - expect(plugins.installBundle).toHaveBeenCalledTimes(6) + expect(plugins.installBundle).toHaveBeenCalledTimes(7) // Editing the spec after a failure starts over too. face.editInstallSpec('y') expect(state().install).toMatchObject({ phase: 'idle', spec: 'y', runs: [], failure: null }) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 1c075f156a..508c5d77fc 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: 088dba2f155af4c4 - zh: 0a67d2ede2824a44 + en: e8771da8434eb30d + zh: fe7fbd310b172ede /deepseek-ai-dsh-cua/understand-the-implementation: en: b74198b9f3d440c5 zh: 3a3a7404ec045e9c diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index 9c8027e549..de6945c149 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -72,7 +72,7 @@ The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its nat The enabled bundle highlights the experimental notice above the system permission controls and places the PTC recommendation in a separate paragraph. The Windows page shows desktop status and window capture readiness, and the macOS page offers Accessibility and Screen Recording controls. -The page refreshes on entry, window focus, and completed actions. Query failures retain the last observation as unknown and offer **Retry**. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. +The page refreshes on entry, window focus, and completed actions. System-permission query failures appear directly beneath the section heading with recovery guidance and **Retry**, while retaining the last observation as unknown. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. System-permission operations affect the computer running DSH. When accessing DSH remotely, complete authorization on that computer. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 5e842826a1..9364cec040 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -72,7 +72,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 启用组合包后,系统权限上方高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。Windows 页面展示桌面状态和窗口截图就绪情况,macOS 页面提供辅助功能和屏幕录制授权操作。 -进入页面、返回窗口和操作结束后会刷新状态。查询失败保留上次观测但标为未确认,并提供“重试”。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 +进入页面、返回窗口和操作结束后会刷新状态。系统权限检查失败直接显示在分组标题下方,附带排查建议与“重试”,同时将上次观测标为未确认。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 系统权限操作作用于运行 DSH 的电脑。远程访问时,请在该电脑上完成授权。 diff --git a/packages/experimental/cua/src/application-access.ts b/packages/experimental/cua/src/application-access.ts index 6edef95a18..0060a2fe27 100644 --- a/packages/experimental/cua/src/application-access.ts +++ b/packages/experimental/cua/src/application-access.ts @@ -4,7 +4,7 @@ import type { Agent } from '@deepseek-ai/dsh-agent' import { isDeepStrictEqual } from 'node:util' import { UserQuestionError, type AskUserQuestionAnswer } from '@deepseek-ai/dsh-user-questions' import { z } from 'zod' -import { applicationAccessDisplay } from './locales.ts' +import { applicationAccessDisplay, sessionApplicationAccessDisplay } from './locales.ts' import { NativeError, type NativeClient } from './native-client.ts' import type { CuaAppHandle } from './types.ts' import type { CuaApplicationGrant, CuaApplicationId } from './application-types.ts' @@ -203,17 +203,19 @@ export class ApplicationAccess { const questions = this.ctx.get('userQuestions') if (!questions) throw new NativeError('APP_APPROVAL_UNAVAILABLE', 'No human answerer is available for application access') const options = [{ label: 'Allow for this session' }, { label: 'Deny' }] - if (identity.persistable && this.options.store.persistent) options.push({ label: 'Always allow' }) + const persistable = identity.persistable && this.options.store.persistent + if (persistable) options.push({ label: 'Always allow' }) + const display = persistable ? applicationAccessDisplay : sessionApplicationAccessDisplay let result: AskUserQuestionAnswer try { result = await questions.ask({ agent, signal, questions: [{ id: 'cua-app-access', question: `Allow computer use to launch if needed, read, capture, and control ${identity.name}?`, - detail: applicationAccessDisplay.detail.en, + detail: display.detail.en, options, intent: { kind: 'approval', approve: 'Allow for this session', reject: 'Deny', - ...(identity.persistable && this.options.store.persistent ? { always: 'Always allow' } : {}), + ...(persistable ? { always: 'Always allow' } : {}), subject: { name: identity.name, ...(icon === undefined ? {} : { icon }) }, - display: applicationAccessDisplay, + display, } }] }) } catch (error) { if (error instanceof UserQuestionError && error.code === 'ASK_CANCELLED') { diff --git a/packages/experimental/cua/src/client/PermissionPanel.module.css b/packages/experimental/cua/src/client/PermissionPanel.module.css index af5b9b79b4..deb02a1084 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.module.css +++ b/packages/experimental/cua/src/client/PermissionPanel.module.css @@ -5,15 +5,14 @@ display: flex; align-items: flex-start; gap: 8px; - padding: 12px; - border: 0.5px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary) 40%, transparent); - border-radius: var(--dsw-radius-lg); + padding: 10px 12px; + border-radius: var(--dsw-radius-md); background: var(--dsw-alias-state-warn-tertiary); } .cautionIcon { display: inline-flex; flex: none; - margin-top: 2px; + margin-top: 3px; color: var(--dsw-alias-state-warn-primary); } .cautionBody { @@ -26,6 +25,22 @@ color: var(--dsw-alias-label-primary); font-weight: 500; } +.systemError { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + padding: 10px 12px; + border-radius: var(--dsw-radius-md); + background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); +} +.systemErrorBody { + display: grid; + gap: 4px; + flex: 1; + min-width: 180px; +} .card { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); } .card > * + * { border-top: 0.5px solid var(--dsw-alias-border-l3); } .panel p { margin: 0; color: var(--dsw-alias-label-secondary); line-height: 1.6; } diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 7b63d68df8..df8c566bd8 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -1,6 +1,6 @@ /** Native permission status and revocable application consent on the existing plugin page. */ import { useEffect } from 'react' -import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, IconWarningOutlineMedium, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' +import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, IconWarningOutlineRegular, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' import { assertNever } from '@deepseek-ai/dsh-util-values' import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' @@ -132,7 +132,7 @@ export function PermissionPanel(props: PermissionProps) {
- +

{t('previewNoticeTitle')}

{t('previewNotice')}

@@ -141,14 +141,20 @@ export function PermissionPanel(props: PermissionProps) {

{t('ptcRecommendation')}

{t('title')}

-

+ {state.system.error !== null &&

+
+

{t('queryFailed', { message: state.system.error })}

+

{t('queryFailedHint')}

+
+ +
} + {(observed !== null || state.system.error === null) &&

{t(observed?.platform === 'windows' ? 'windowsPermissionsIntro' : 'permissionsIntro')} -

+

}
- {state.system.error !== null &&
- {t('queryFailed', { message: state.system.error })} - -
} {observed === null ? : observed.platform === 'windows' ? : (['accessibility', 'screenRecording'] as const).map(permission =>
)}
-

{observed?.platform === 'windows' - ? <>{t('windowsInstructions')} {t(observed.elevated ? 'elevated' : 'standardPrivileges')} - : t('permissionHint')}

+ {observed?.platform === 'windows' &&

{t('windowsInstructions')} {t(observed.elevated ? 'elevated' : 'standardPrivileges')}

}

{t('applicationsTitle')}

diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index ff5044b98a..e5db0afe5e 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -10,14 +10,14 @@ export const en = { approvalRiskNotice: 'The agent can access only apps you approve, and can read and control them in the background.\n\nOnline games, messaging apps, and other apps may restrict automation. Violating their rules could result in your account with that app being suspended or banned.\n\nProceed at your own risk. To stop automated control at any time, press Stop in DeepSeek Harness.', title: 'System permissions', permissionsIntro: 'Computer use requires the following system permissions to run:', - windowsPermissionsIntro: 'Computer use requires the following Windows environment conditions:', + windowsPermissionsIntro: 'Computer use requires the following environment conditions:', applicationsTitle: 'Manage applications computer use can access', - windowsSetupTitle: 'Check Windows environment', - windowsSetupBody: 'Unlock the Windows desktop and try again. DeepSeek Harness still asks for your approval before accessing each app.', - windowsSessionUnknown: 'Could not detect an available Windows desktop. Run DeepSeek Harness in a signed-in desktop session and try again.', - windowsCaptureUnavailable: 'This Windows environment does not support window capture. Check your Windows version and graphics driver, then try again.', + windowsSetupTitle: 'Check desktop environment', + windowsSetupBody: 'Unlock the desktop and try again. DeepSeek Harness still asks for your approval before accessing each app.', + windowsSessionUnknown: 'Could not detect an available desktop. Run DeepSeek Harness in a signed-in desktop session and try again.', + windowsCaptureUnavailable: 'This desktop environment does not support window capture. Check your OS version and graphics driver, then try again.', applicationInteraction: 'Application interaction', - windowsInstructions: 'Keep the Windows desktop unlocked while in use. Some actions require bringing the target app to the front; apps running with higher privileges may not be controllable.', + windowsInstructions: 'Keep the desktop unlocked while in use. Some actions require bringing the target app to the front; apps running with higher privileges may not be controllable.', windowsDesktop: 'Desktop status', windowsDesktopUse: 'Keep the desktop unlocked so the agent can view the screen and perform actions.', windowsCapture: 'Window capture', available: 'Available', unavailable: 'Unavailable', locked: 'Locked or disconnected', elevated: 'Currently running with administrator privileges.', standardPrivileges: 'Currently running with standard user privileges.', @@ -29,7 +29,6 @@ export const en = { accessibilityUse: 'Read interface content, click, and type.', screenRecordingUse: 'Capture the selected application window.', accessibilityPermission: 'Allow {application} to read interface content, click, and type.', screenRecordingPermission: 'Allow {application} to capture the selected application window.', - permissionHint: 'You can change these permissions anytime in System Settings.', granted: 'Allowed', unknown: 'Unknown', request: 'Request permission', settings: 'Open System Settings', retry: 'Retry', allowedApps: 'Always-allowed applications', blockedApps: 'Applications not allowed', retryApproval: 'Allow asking again', @@ -38,6 +37,7 @@ export const en = { revoke: 'Revoke', revoked: 'Application access revoked', requested: 'Follow the guide at the bottom of System Settings', opened: 'System Settings opened', applicationsFailed: 'Could not load application access: {message}', iconsFailed: 'Could not load application icons: {message}', failed: 'Could not update permissions: {message}', queryFailed: 'Could not check system permissions: {message}', + queryFailedHint: 'Try disabling and re-enabling this plugin, or restarting DeepSeek Harness. If the issue persists, check whether security software blocked the helper or reinstall DeepSeek Harness.', } /** Keys shared by all supported locale dictionaries. */ export type CuaPermissionLocaleKey = keyof typeof en @@ -51,16 +51,16 @@ export const zh: Record = { approvalRiskNotice: '智能体只能访问你已授权的应用,并可在后台读取应用内容、操作应用。\n\n网络游戏、即时通讯等应用可能对自动化操作有所限制。违反相关规则可能导致你在该应用中的账号被暂停使用或封禁。\n\n请自行承担使用风险。如需停止自动化操作,可随时点击 DeepSeek Harness 中的停止按钮。', title: '系统权限', permissionsIntro: '自动电脑操作需要以下两项系统权限才能运行:', - windowsPermissionsIntro: '自动电脑操作需要满足以下 Windows 运行条件:', + windowsPermissionsIntro: '自动电脑操作需要满足以下运行条件:', applicationsTitle: '管理可访问的应用', setupTitle: '配置自动电脑操作', setupBody: '“自动电脑操作”已开启,需要授予「辅助功能」和「屏幕录制」权限才能运行。请前往插件详情页完成设置。', setupQueryFailed: '“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', - windowsSetupTitle: '检查 Windows 运行环境', - windowsSetupBody: '请先解锁 Windows 桌面后重试。访问具体应用前,DeepSeek Harness 仍会逐一请求你的授权。', - windowsSessionUnknown: '无法检测到可用的 Windows 桌面。请在已登录的桌面环境中运行 DeepSeek Harness,然后重试。', - windowsCaptureUnavailable: '当前 Windows 环境不支持窗口截图。请检查系统版本与显卡驱动后重试。', + windowsSetupTitle: '检查桌面运行环境', + windowsSetupBody: '请先解锁桌面后重试。访问具体应用前,DeepSeek Harness 仍会逐一请求你的授权。', + windowsSessionUnknown: '无法检测到可用的桌面。请在已登录的桌面环境中运行 DeepSeek Harness,然后重试。', + windowsCaptureUnavailable: '当前桌面环境不支持窗口截图。请检查系统版本与显卡驱动后重试。', applicationInteraction: '应用交互', - windowsInstructions: '使用时请保持 Windows 桌面处于解锁状态。部分操作需要将目标应用切到前台;以更高权限运行的应用可能无法操作。', + windowsInstructions: '使用时请保持桌面处于解锁状态。部分操作需要将目标应用切到前台;以更高权限运行的应用可能无法操作。', windowsDesktop: '桌面状态', windowsDesktopUse: '桌面保持解锁时,智能体才能查看画面并执行操作。', windowsCapture: '窗口截图', available: '可用', unavailable: '不可用', locked: '已锁屏或未连接', elevated: '当前以管理员权限运行。', standardPrivileges: '当前以普通用户权限运行。', @@ -69,7 +69,6 @@ export const zh: Record = { accessibilityUse: '读取界面内容,并执行点击和键盘输入。', screenRecordingUse: '截取所选应用窗口的画面。', accessibilityPermission: '允许 {application} 读取界面内容,并执行点击和键盘输入。', screenRecordingPermission: '允许 {application} 截取所选应用窗口的画面。', - permissionHint: '可随时在「系统设置」中修改以上权限。', granted: '已允许', unknown: '未确认', request: '申请权限', settings: '打开系统设置', retry: '重试', allowedApps: '始终允许的应用', blockedApps: '不允许访问的应用', retryApproval: '允许再次询问', @@ -78,6 +77,7 @@ export const zh: Record = { revoke: '撤销', revoked: '已撤销应用访问权限', requested: '请按系统设置底部的引导完成授权', opened: '已打开系统设置', applicationsFailed: '无法读取应用授权:{message}', iconsFailed: '无法读取应用图标:{message}', failed: '无法更新权限:{message}', queryFailed: '无法检查系统权限:{message}', + queryFailedHint: '请尝试关闭并重新启用此插件,或重启 DeepSeek Harness。如仍未解决,请检查安全软件是否拦截了辅助程序,或重新安装。', } /** Japanese copy, checked against the English keys. */ @@ -85,12 +85,12 @@ export const ja = { previewNoticeTitle: '実験的機能について', previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', - windowsSetupTitle: 'Windows 実行環境を確認', - windowsSetupBody: 'Windows デスクトップのロックを解除して再試行してください。各アプリへアクセスする前には、引き続き DeepSeek Harness が確認します。', - windowsSessionUnknown: '利用可能な Windows デスクトップを検出できませんでした。サインイン済みのデスクトップ環境で DeepSeek Harness を実行して再試行してください。', - windowsCaptureUnavailable: '現在の Windows 環境はウィンドウキャプチャに対応していません。Windows のバージョンとグラフィックスドライバーを確認して再試行してください。', + windowsSetupTitle: 'デスクトップ実行環境を確認', + windowsSetupBody: 'デスクトップのロックを解除して再試行してください。各アプリへアクセスする前には、引き続き DeepSeek Harness が確認します。', + windowsSessionUnknown: '利用可能なデスクトップを検出できませんでした。サインイン済みのデスクトップ環境で DeepSeek Harness を実行して再試行してください。', + windowsCaptureUnavailable: '現在のデスクトップ環境はウィンドウキャプチャに対応していません。OS のバージョンとグラフィックスドライバーを確認して再試行してください。', applicationInteraction: 'アプリの操作', - windowsInstructions: '使用中は Windows デスクトップのロックを解除しておいてください。一部の操作では対象アプリを最前面に表示する必要があり、より高い権限で実行中のアプリは操作できない場合があります。', + windowsInstructions: '使用中はデスクトップのロックを解除しておいてください。一部の操作では対象アプリを最前面に表示する必要があり、より高い権限で実行中のアプリは操作できない場合があります。', windowsDesktop: 'デスクトップ状態', windowsDesktopUse: 'エージェントが画面を確認して操作できるよう、デスクトップのロックを解除しておいてください。', windowsCapture: 'ウィンドウキャプチャ', @@ -102,7 +102,7 @@ export const ja = { approvalRiskNotice: 'エージェントがアクセスできるのは、あなたが許可したアプリだけです。許可したアプリの内容を読み取ったり、バックグラウンドで操作したりできます。\n\nオンラインゲームやメッセージアプリなどでは、自動操作が制限されている場合があります。規約に違反すると、そのアプリのアカウントが一時停止または永久停止になる可能性があります。\n\n自己責任でご利用ください。自動操作は、DeepSeek Harness の停止ボタンでいつでも止められます。', 'title': 'システム権限', 'permissionsIntro': 'Computer Use を実行するには、次の 2 つのシステム権限が必要です。', - 'windowsPermissionsIntro': 'Computer Use を実行するには、次の Windows 環境の条件を満たす必要があります。', + 'windowsPermissionsIntro': 'Computer Use を実行するには、次の環境条件を満たす必要があります。', 'applicationsTitle': 'Computer Useがアクセスできるアプリを管理', 'setupTitle': '使用前にComputer Useを設定', 'setupBody': 'Computer Use が有効になりました。実行するには「アクセシビリティ」と「画面収録」の権限が必要です。プラグインの詳細ページで設定を完了してください。', @@ -116,7 +116,6 @@ export const ja = { 'screenRecordingUse': '選択したアプリのウィンドウ画面をキャプチャします。', 'accessibilityPermission': '{application} に画面内容の読み取り、クリック、キーボード入力を許可します。', 'screenRecordingPermission': '{application} に選択したアプリウィンドウの画面キャプチャを許可します。', - 'permissionHint': 'これらの権限は「システム設定」からいつでも変更できます。', 'granted': '許可済み', 'unknown': '不明', 'request': '権限をリクエスト', @@ -135,6 +134,7 @@ export const ja = { 'iconsFailed': 'アプリケーションのアイコンを読み込めませんでした: {message}', 'failed': '権限を更新できませんでした: {message}', 'queryFailed': 'システム権限を確認できませんでした:{message}', + 'queryFailedHint': 'プラグインを一度オフにして再度有効にするか、DeepSeek Harness を再起動してください。解決しない場合は、セキュリティソフトが補助プログラムをブロックしていないか確認するか、再インストールしてください。', } satisfies Record /** Spanish dictionary, checked against the English keys. */ @@ -142,12 +142,12 @@ export const es = { previewNoticeTitle: 'Función experimental', previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', - windowsSetupTitle: 'Comprobar el entorno de Windows', - windowsSetupBody: 'Desbloquea el escritorio de Windows e inténtalo de nuevo. DeepSeek Harness seguirá pidiendo tu autorización antes de acceder a cada aplicación.', - windowsSessionUnknown: 'No se pudo detectar un escritorio de Windows disponible. Ejecuta DeepSeek Harness en una sesión de escritorio iniciada e inténtalo de nuevo.', - windowsCaptureUnavailable: 'Este entorno de Windows no admite la captura de ventanas. Comprueba la versión de Windows y el controlador gráfico, y vuelve a intentarlo.', + windowsSetupTitle: 'Comprobar el entorno del escritorio', + windowsSetupBody: 'Desbloquea el escritorio e inténtalo de nuevo. DeepSeek Harness seguirá pidiendo tu autorización antes de acceder a cada aplicación.', + windowsSessionUnknown: 'No se pudo detectar un escritorio disponible. Ejecuta DeepSeek Harness en una sesión de escritorio iniciada e inténtalo de nuevo.', + windowsCaptureUnavailable: 'Este entorno de escritorio no admite la captura de ventanas. Comprueba la versión del sistema operativo y el controlador gráfico, y vuelve a intentarlo.', applicationInteraction: 'Interacción con aplicaciones', - windowsInstructions: 'Mantén el escritorio de Windows desbloqueado durante el uso. Algunas acciones requieren poner la aplicación en primer plano y es posible que las aplicaciones con mayores privilegios no se puedan controlar.', + windowsInstructions: 'Mantén el escritorio desbloqueado durante el uso. Algunas acciones requieren poner la aplicación en primer plano y es posible que las aplicaciones con mayores privilegios no se puedan controlar.', windowsDesktop: 'Estado del escritorio', windowsDesktopUse: 'Mantén el escritorio desbloqueado para que el agente pueda ver la pantalla y realizar acciones.', windowsCapture: 'Captura de ventanas', @@ -161,7 +161,7 @@ export const es = { approvalRiskNotice: 'El agente solo puede acceder a las aplicaciones que autorices, y puede leer su contenido y controlarlas en segundo plano.\n\nLos juegos en línea, las aplicaciones de mensajería y otras aplicaciones pueden restringir la automatización. Incumplir sus normas podría provocar la suspensión o el bloqueo permanente de tu cuenta en esa aplicación.\n\nContinúa bajo tu propia responsabilidad. Para detener el control automatizado en cualquier momento, pulsa Detener en DeepSeek Harness.', title: 'Permisos del sistema', permissionsIntro: 'Computer Use necesita los siguientes permisos del sistema para funcionar:', - windowsPermissionsIntro: 'Computer Use requiere las siguientes condiciones del entorno de Windows:', + windowsPermissionsIntro: 'Computer Use requiere las siguientes condiciones del entorno:', applicationsTitle: 'Administrar aplicaciones a las que puede acceder el uso de la computadora', setupTitle: 'Configurar el uso de la computadora antes de usarla', setupBody: 'Computer Use está activado y necesita permisos de Accesibilidad y Grabación de pantalla para funcionar. Abre los detalles del complemento para completar la configuración.', @@ -171,7 +171,6 @@ export const es = { accessibilityUse: 'Leer el contenido de la interfaz, hacer clic y escribir.', screenRecordingUse: 'Capturar la ventana de la aplicación seleccionada.', accessibilityPermission: 'Permite que {application} lea el contenido de la interfaz, haga clic y escriba.', screenRecordingPermission: 'Permite que {application} capture la ventana de la aplicación seleccionada.', - permissionHint: 'Puedes cambiar estos permisos en cualquier momento en Configuración del sistema.', granted: 'Permitido', unknown: 'Desconocido', request: 'Solicitar permiso', settings: 'Abrir configuración del sistema', retry: 'Reintentar', allowedApps: 'Aplicaciones siempre permitidas', blockedApps: 'Aplicaciones no permitidas', retryApproval: 'Permitir preguntar de nuevo', @@ -180,6 +179,7 @@ export const es = { revoke: 'Revocar', revoked: 'Acceso a la aplicación revocado', requested: 'Siga la guía en la parte inferior de Configuración del sistema', opened: 'Configuración del sistema abierta', applicationsFailed: 'No se pudo cargar el acceso a la aplicación: {message}', iconsFailed: 'No se pudieron cargar los íconos de la aplicación: {message}', failed: 'No se pudieron actualizar los permisos: {message}', queryFailed: 'No se pudieron comprobar los permisos del sistema: {message}', + queryFailedHint: 'Intenta desactivar y volver a activar este complemento o reiniciar DeepSeek Harness. Si el problema persiste, comprueba si el software de seguridad bloqueó el programa auxiliar o vuelve a instalar DeepSeek Harness.', } satisfies Record /** French dictionary, checked against the English keys. */ @@ -187,12 +187,12 @@ export const fr = { previewNoticeTitle: 'Fonctionnalité expérimentale', previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', - windowsSetupTitle: 'Vérifier l’environnement Windows', - windowsSetupBody: 'Déverrouillez le bureau Windows puis réessayez. DeepSeek Harness vous demandera toujours votre autorisation avant d’accéder à chaque application.', - windowsSessionUnknown: 'Impossible de détecter un bureau Windows disponible. Exécutez DeepSeek Harness dans une session de bureau ouverte puis réessayez.', - windowsCaptureUnavailable: 'Cet environnement Windows ne prend pas en charge la capture de fenêtres. Vérifiez la version de Windows et le pilote graphique, puis réessayez.', + windowsSetupTitle: 'Vérifier l’environnement de bureau', + windowsSetupBody: 'Déverrouillez le bureau puis réessayez. DeepSeek Harness vous demandera toujours votre autorisation avant d’accéder à chaque application.', + windowsSessionUnknown: 'Impossible de détecter un bureau disponible. Exécutez DeepSeek Harness dans une session de bureau ouverte puis réessayez.', + windowsCaptureUnavailable: 'Cet environnement de bureau ne prend pas en charge la capture de fenêtres. Vérifiez la version du système et le pilote graphique, puis réessayez.', applicationInteraction: 'Interaction avec les applications', - windowsInstructions: 'Gardez le bureau Windows déverrouillé pendant l’utilisation. Certaines actions nécessitent de placer l’application au premier plan, et les applications exécutées avec des privilèges supérieurs peuvent ne pas être contrôlables.', + windowsInstructions: 'Gardez le bureau déverrouillé pendant l’utilisation. Certaines actions nécessitent de placer l’application au premier plan, et les applications exécutées avec des privilèges supérieurs peuvent ne pas être contrôlables.', windowsDesktop: 'État du bureau', windowsDesktopUse: 'Gardez le bureau déverrouillé afin que l’agent puisse voir l’écran et effectuer des actions.', windowsCapture: 'Capture de fenêtres', @@ -206,7 +206,7 @@ export const fr = { approvalRiskNotice: 'L’agent ne peut accéder qu’aux applications que vous autorisez. Il peut en lire le contenu et les contrôler en arrière-plan.\n\nLes jeux en ligne, les messageries et d’autres applications peuvent limiter l’automatisation. Le non-respect de leurs règles pourrait entraîner la suspension ou le bannissement de votre compte dans l’application concernée.\n\nUtilisez cette fonction à vos risques et périls. Vous pouvez interrompre le contrôle automatisé à tout moment en cliquant sur Arrêter dans DeepSeek Harness.', title: 'Autorisations système', permissionsIntro: 'Computer Use a besoin des autorisations système suivantes pour fonctionner :', - windowsPermissionsIntro: 'Computer Use nécessite les conditions suivantes dans l’environnement Windows :', + windowsPermissionsIntro: 'Computer Use nécessite les conditions suivantes :', applicationsTitle: "Gérer les applications auxquelles l'ordinateur peut accéder", setupTitle: "Configurer l'utilisation de l'ordinateur avant utilisation", setupBody: 'Computer Use est activé et nécessite les autorisations Accessibilité et Enregistrement de l’écran pour fonctionner. Ouvrez les détails du plugin pour terminer la configuration.', @@ -216,7 +216,6 @@ export const fr = { accessibilityUse: 'Lire le contenu de l’interface, cliquer et saisir au clavier.', screenRecordingUse: 'Capturer la fenêtre de l’application sélectionnée.', accessibilityPermission: 'Autorisez {application} à lire le contenu de l’interface, cliquer et saisir au clavier.', screenRecordingPermission: 'Autorisez {application} à capturer la fenêtre de l’application sélectionnée.', - permissionHint: 'Vous pouvez modifier ces autorisations à tout moment dans les Réglages Système.', granted: 'Autorisé', unknown: 'Inconnu', request: "Demander l'autorisation", settings: 'Ouvrir les paramètres système', retry: 'Réessayer', allowedApps: 'Applications toujours autorisées', blockedApps: 'Applications non autorisées', retryApproval: 'Autoriser la demande à nouveau', @@ -225,6 +224,7 @@ export const fr = { revoke: 'Révoquer', revoked: "Accès à l'application révoqué", requested: 'Suivez le guide en bas des réglages système.', opened: 'Paramètres système ouverts', applicationsFailed: "Impossible de charger l'accès à l'application : {message}", iconsFailed: "Impossible de charger les icônes d'application : {message}", failed: 'Impossible de mettre à jour les autorisations : {message}', queryFailed: 'Impossible de vérifier les autorisations système : {message}', + queryFailedHint: 'Essayez de désactiver puis de réactiver ce plugin, ou de redémarrer DeepSeek Harness. Si le problème persiste, vérifiez si un logiciel de sécurité bloque le programme auxiliaire ou réinstallez DeepSeek Harness.', } satisfies Record /** German dictionary, checked against the English keys. */ @@ -232,12 +232,12 @@ export const de = { previewNoticeTitle: 'Experimentelle Funktion', previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', - windowsSetupTitle: 'Windows-Umgebung prüfen', - windowsSetupBody: 'Entsperren Sie den Windows-Desktop und versuchen Sie es erneut. DeepSeek Harness fragt weiterhin vor dem Zugriff auf jede App nach Ihrer Zustimmung.', - windowsSessionUnknown: 'Es konnte kein verfügbarer Windows-Desktop erkannt werden. Führen Sie DeepSeek Harness in einer angemeldeten Desktopsitzung aus und versuchen Sie es erneut.', - windowsCaptureUnavailable: 'Diese Windows-Umgebung unterstützt keine Fensteraufnahme. Prüfen Sie die Windows-Version und den Grafiktreiber und versuchen Sie es erneut.', + windowsSetupTitle: 'Desktopumgebung prüfen', + windowsSetupBody: 'Entsperren Sie den Desktop und versuchen Sie es erneut. DeepSeek Harness fragt weiterhin vor dem Zugriff auf jede App nach Ihrer Zustimmung.', + windowsSessionUnknown: 'Es konnte kein verfügbarer Desktop erkannt werden. Führen Sie DeepSeek Harness in einer angemeldeten Desktopsitzung aus und versuchen Sie es erneut.', + windowsCaptureUnavailable: 'Diese Desktopumgebung unterstützt keine Fensteraufnahme. Prüfen Sie die Betriebssystemversion und den Grafiktreiber und versuchen Sie es erneut.', applicationInteraction: 'Anwendungsinteraktion', - windowsInstructions: 'Lassen Sie den Windows-Desktop während der Nutzung entsperrt. Einige Aktionen erfordern die Zielanwendung im Vordergrund; Apps mit höheren Berechtigungen lassen sich möglicherweise nicht steuern.', + windowsInstructions: 'Lassen Sie den Desktop während der Nutzung entsperrt. Einige Aktionen erfordern die Zielanwendung im Vordergrund; Apps mit höheren Berechtigungen lassen sich möglicherweise nicht steuern.', windowsDesktop: 'Desktopstatus', windowsDesktopUse: 'Lassen Sie den Desktop entsperrt, damit der Agent den Bildschirm sehen und Aktionen ausführen kann.', windowsCapture: 'Fensteraufnahme', @@ -251,7 +251,7 @@ export const de = { approvalRiskNotice: 'Der Agent kann nur auf Apps zugreifen, die Sie freigeben. Er kann deren Inhalte lesen und die Apps im Hintergrund steuern.\n\nOnline-Spiele, Messenger und andere Apps können die Automatisierung einschränken. Bei Verstößen gegen ihre Regeln könnte Ihr Konto bei der jeweiligen App vorübergehend oder dauerhaft gesperrt werden.\n\nDie Nutzung erfolgt auf eigenes Risiko. Über Stopp in DeepSeek Harness können Sie die automatisierte Steuerung jederzeit beenden.', title: 'Systemberechtigungen', permissionsIntro: 'Computer Use benötigt die folgenden Systemberechtigungen:', - windowsPermissionsIntro: 'Computer Use erfordert die folgenden Bedingungen in der Windows-Umgebung:', + windowsPermissionsIntro: 'Computer Use erfordert die folgenden Umgebungsbedingungen:', applicationsTitle: 'Verwalten Sie Anwendungen, auf die der Computer zugreifen kann', setupTitle: 'Richten Sie die Computernutzung vor der Nutzung ein', setupBody: 'Computer Use ist aktiviert und benötigt die Berechtigungen für Bedienungshilfen und Bildschirmaufnahme. Öffnen Sie die Plugin-Details, um die Einrichtung abzuschließen.', @@ -261,7 +261,6 @@ export const de = { accessibilityUse: 'Oberflächeninhalte lesen, klicken und tippen.', screenRecordingUse: 'Das Fenster der ausgewählten Anwendung aufnehmen.', accessibilityPermission: 'Erlauben Sie {application}, Oberflächeninhalte zu lesen, zu klicken und zu tippen.', screenRecordingPermission: 'Erlauben Sie {application}, das Fenster der ausgewählten Anwendung aufzunehmen.', - permissionHint: 'Sie können diese Berechtigungen jederzeit in den Systemeinstellungen ändern.', granted: 'Erlaubt', unknown: 'Unbekannt', request: 'Bitte um Erlaubnis', settings: 'Öffnen Sie die Systemeinstellungen', retry: 'Erneut versuchen', allowedApps: 'Immer zulässige Anwendungen', blockedApps: 'Nicht erlaubte Anwendungen', retryApproval: 'Erlaube noch einmal nachzufragen', @@ -270,6 +269,7 @@ export const de = { revoke: 'Widerrufen', revoked: 'Anwendungszugriff widerrufen', requested: 'Folgen Sie der Anleitung unten in den Systemeinstellungen', opened: 'Systemeinstellungen geöffnet', applicationsFailed: 'Anwendungszugriff konnte nicht geladen werden: {message}', iconsFailed: 'Anwendungssymbole konnten nicht geladen werden: {message}', failed: 'Berechtigungen konnten nicht aktualisiert werden: {message}', queryFailed: 'Systemberechtigungen konnten nicht geprüft werden: {message}', + queryFailedHint: 'Deaktivieren und aktivieren Sie dieses Plugin erneut oder starten Sie DeepSeek Harness neu. Besteht das Problem weiterhin, prüfen Sie, ob Sicherheitssoftware das Hilfsprogramm blockiert, oder installieren Sie DeepSeek Harness neu.', } satisfies Record /** Russian dictionary, checked against the English keys. */ @@ -277,12 +277,12 @@ export const ru = { previewNoticeTitle: 'Экспериментальная функция', previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', - windowsSetupTitle: 'Проверить среду Windows', - windowsSetupBody: 'Разблокируйте рабочий стол Windows и повторите попытку. DeepSeek Harness по-прежнему запрашивает ваше разрешение перед доступом к каждому приложению.', - windowsSessionUnknown: 'Не удалось обнаружить доступный рабочий стол Windows. Запустите DeepSeek Harness в активной сессии рабочего стола и повторите попытку.', - windowsCaptureUnavailable: 'Текущая среда Windows не поддерживает захват окон. Проверьте версию Windows и графический драйвер, затем повторите попытку.', + windowsSetupTitle: 'Проверить среду рабочего стола', + windowsSetupBody: 'Разблокируйте рабочий стол и повторите попытку. DeepSeek Harness по-прежнему запрашивает ваше разрешение перед доступом к каждому приложению.', + windowsSessionUnknown: 'Не удалось обнаружить доступный рабочий стол. Запустите DeepSeek Harness в активной сессии рабочего стола и повторите попытку.', + windowsCaptureUnavailable: 'Текущая среда рабочего стола не поддерживает захват окон. Проверьте версию ОС и графический драйвер, затем повторите попытку.', applicationInteraction: 'Взаимодействие с приложениями', - windowsInstructions: 'Во время работы держите рабочий стол Windows разблокированным. Для некоторых действий нужно вывести приложение на передний план; приложения с повышенными привилегиями могут не поддаваться управлению.', + windowsInstructions: 'Во время работы держите рабочий стол разблокированным. Для некоторых действий нужно вывести приложение на передний план; приложения с повышенными привилегиями могут не поддаваться управлению.', windowsDesktop: 'Состояние рабочего стола', windowsDesktopUse: 'Держите рабочий стол разблокированным, чтобы агент мог видеть экран и выполнять действия.', windowsCapture: 'Захват окон', @@ -296,7 +296,7 @@ export const ru = { approvalRiskNotice: 'Агент получает доступ только к приложениям, которые вы разрешили, и может читать их содержимое и управлять ими в фоновом режиме.\n\nВ онлайн-играх, мессенджерах и других приложениях могут действовать ограничения на автоматизацию. Нарушение их правил может привести к временной или постоянной блокировке вашей учётной записи в соответствующем приложении.\n\nВы пользуетесь этой возможностью на свой страх и риск. Чтобы в любой момент остановить автоматизированное управление, нажмите «Остановить» в DeepSeek Harness.', title: 'Системные разрешения', permissionsIntro: 'Для работы управления компьютером требуются следующие системные разрешения:', - windowsPermissionsIntro: 'Для работы управления компьютером требуются следующие условия среды Windows:', + windowsPermissionsIntro: 'Для работы управления компьютером требуются следующие условия среды:', applicationsTitle: 'Управление приложениями, к которым может иметь доступ компьютер', setupTitle: 'Настройте использование компьютера перед использованием', setupBody: 'Управление компьютером включено. Для работы требуются разрешения на универсальный доступ и запись экрана. Откройте сведения о плагине, чтобы завершить настройку.', @@ -306,7 +306,6 @@ export const ru = { accessibilityUse: 'Читать элементы интерфейса, нажимать и вводить текст.', screenRecordingUse: 'Захватывать окно выбранного приложения.', accessibilityPermission: 'Разрешите {application} читать элементы интерфейса, нажимать и вводить текст.', screenRecordingPermission: 'Разрешите {application} захватывать окно выбранного приложения.', - permissionHint: 'Вы можете изменить эти разрешения в любое время в системных настройках.', granted: 'Разрешено', unknown: 'Неизвестно', request: 'Запросить разрешение', settings: 'Открыть настройки системы', retry: 'Повторить', allowedApps: 'Всегда разрешенные приложения', blockedApps: 'Приложения не разрешены', retryApproval: 'Разрешить спросить еще раз', @@ -315,6 +314,7 @@ export const ru = { revoke: 'Отозвать', revoked: 'Доступ к приложению отозван', requested: 'Следуйте инструкциям внизу окна «Системные настройки».', opened: 'Системные настройки открыты', applicationsFailed: 'Не удалось загрузить доступ к приложению: {message}.', iconsFailed: 'Не удалось загрузить значки приложений: {message}.', failed: 'Не удалось обновить разрешения: {message}.', queryFailed: 'Не удалось проверить системные разрешения: {message}', + queryFailedHint: 'Попробуйте отключить и снова включить этот плагин или перезапустить DeepSeek Harness. Если проблема сохраняется, проверьте, не блокирует ли вспомогательный компонент защитное ПО, или переустановите DeepSeek Harness.', } satisfies Record /** Portuguese dictionary, checked against the English keys. */ @@ -322,12 +322,12 @@ export const pt = { previewNoticeTitle: 'Recurso experimental', previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', - windowsSetupTitle: 'Verificar ambiente Windows', - windowsSetupBody: 'Desbloqueie a área de trabalho do Windows e tente novamente. O DeepSeek Harness continuará pedindo sua autorização antes de acessar cada aplicativo.', - windowsSessionUnknown: 'Não foi possível detectar uma área de trabalho do Windows disponível. Execute o DeepSeek Harness em uma sessão de área de trabalho conectada e tente novamente.', - windowsCaptureUnavailable: 'Este ambiente Windows não oferece suporte à captura de janelas. Verifique a versão do Windows e o driver gráfico e tente novamente.', + windowsSetupTitle: 'Verificar ambiente da área de trabalho', + windowsSetupBody: 'Desbloqueie a área de trabalho e tente novamente. O DeepSeek Harness continuará pedindo sua autorização antes de acessar cada aplicativo.', + windowsSessionUnknown: 'Não foi possível detectar uma área de trabalho disponível. Execute o DeepSeek Harness em uma sessão de área de trabalho conectada e tente novamente.', + windowsCaptureUnavailable: 'Este ambiente de área de trabalho não oferece suporte à captura de janelas. Verifique a versão do sistema operacional e o driver gráfico e tente novamente.', applicationInteraction: 'Interação com aplicativos', - windowsInstructions: 'Mantenha a área de trabalho do Windows desbloqueada durante o uso. Algumas ações exigem colocar o aplicativo em primeiro plano, e aplicativos com privilégios mais altos podem não ser controláveis.', + windowsInstructions: 'Mantenha a área de trabalho desbloqueada durante o uso. Algumas ações exigem colocar o aplicativo em primeiro plano, e aplicativos com privilégios mais altos podem não ser controláveis.', windowsDesktop: 'Status da área de trabalho', windowsDesktopUse: 'Mantenha a área de trabalho desbloqueada para que o agente possa ver a tela e executar ações.', windowsCapture: 'Captura de janelas', @@ -341,7 +341,7 @@ export const pt = { approvalRiskNotice: 'O agente só pode acessar os aplicativos que você autorizar e pode ler seu conteúdo e controlá-los em segundo plano.\n\nJogos on-line, aplicativos de mensagens e outros aplicativos podem restringir a automação. Violar essas regras pode levar à suspensão ou ao banimento da sua conta no aplicativo em questão.\n\nUse por sua conta e risco. Para interromper o controle automatizado a qualquer momento, clique em Parar no DeepSeek Harness.', title: 'Permissões do sistema', permissionsIntro: 'O Computer Use precisa das seguintes permissões do sistema para funcionar:', - windowsPermissionsIntro: 'O Computer Use requer as seguintes condições do ambiente Windows:', + windowsPermissionsIntro: 'O Computer Use requer as seguintes condições do ambiente:', applicationsTitle: 'Gerenciar aplicativos que o computador pode acessar', setupTitle: 'Configure o uso do computador antes de usar', setupBody: 'O Computer Use está ativado e precisa das permissões de Acessibilidade e Gravação de tela para funcionar. Abra os detalhes do plugin para concluir a configuração.', @@ -351,7 +351,6 @@ export const pt = { accessibilityUse: 'Ler o conteúdo da interface, clicar e digitar.', screenRecordingUse: 'Capturar a janela do aplicativo selecionado.', accessibilityPermission: 'Permita que {application} leia o conteúdo da interface, clique e digite.', screenRecordingPermission: 'Permita que {application} capture a janela do aplicativo selecionado.', - permissionHint: 'Você pode alterar essas permissões a qualquer momento nas Configurações do sistema.', granted: 'Permitido', unknown: 'Desconhecido', request: 'Solicitar permissão', settings: 'Abra as configurações do sistema', retry: 'Tentar novamente', allowedApps: 'Aplicativos sempre permitidos', blockedApps: 'Aplicativos não permitidos', retryApproval: 'Permitir perguntar novamente', @@ -360,4 +359,5 @@ export const pt = { revoke: 'Revogar', revoked: 'Acesso ao aplicativo revogado', requested: 'Siga o guia na parte inferior das Configurações do sistema', opened: 'Configurações do sistema abertas', applicationsFailed: 'Não foi possível carregar o acesso ao aplicativo: {message}', iconsFailed: 'Não foi possível carregar os ícones do aplicativo: {message}', failed: 'Não foi possível atualizar as permissões: {message}', queryFailed: 'Não foi possível verificar as permissões do sistema: {message}', + queryFailedHint: 'Tente desativar e reativar este plugin ou reiniciar o DeepSeek Harness. Se o problema persistir, verifique se algum software de segurança bloqueou o auxiliar ou reinstale o DeepSeek Harness.', } satisfies Record diff --git a/packages/experimental/cua/src/locales.ts b/packages/experimental/cua/src/locales.ts index c2ff235dfd..7caf7fd256 100644 --- a/packages/experimental/cua/src/locales.ts +++ b/packages/experimental/cua/src/locales.ts @@ -4,6 +4,7 @@ export const en = { question: 'Allow agent to control this application via computer use?', detail: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', + sessionDetail: 'Once allowed, the agent can view and operate this app for this session.', approve: 'Allow for this session', } @@ -11,6 +12,7 @@ export const en = { export const zh = { question: '允许智能体自动操作此应用吗?', detail: '允许后,智能体将能够查看并操作此应用。你可随时在插件设置中管理应用权限。', + sessionDetail: '允许后,智能体将能在本会话内查看并操作此应用。', approve: '本会话允许', } satisfies Record @@ -18,6 +20,7 @@ export const zh = { export const ja = { question: 'エージェントが Computer Use でこのアプリを操作することを許可しますか?', detail: '許可すると、エージェントはこのアプリの内容を確認して操作できます。アプリの権限はプラグイン設定からいつでも管理できます。', + sessionDetail: '許可すると、エージェントはこのセッション中にこのアプリの内容を確認して操作できます。', approve: 'このセッションで許可', } satisfies Record @@ -25,6 +28,7 @@ export const ja = { export const es = { question: '¿Permitir que el agente controle esta aplicación mediante Computer Use?', detail: 'Si lo permites, el agente podrá ver y controlar esta aplicación. Puedes gestionar los permisos de las aplicaciones en cualquier momento en la configuración del complemento.', + sessionDetail: 'Si lo permites, el agente podrá ver y controlar esta aplicación durante esta sesión.', approve: 'Permitir durante esta sesión', } satisfies Record @@ -32,6 +36,7 @@ export const es = { export const fr = { question: 'Autoriser l’agent à contrôler cette application via Computer Use ?', detail: 'Une fois autorisé, l’agent peut consulter et utiliser cette application. Vous pouvez gérer les autorisations des applications à tout moment dans les paramètres du plugin.', + sessionDetail: 'Une fois autorisé, l’agent peut consulter et utiliser cette application pendant cette session.', approve: 'Autoriser pour cette session', } satisfies Record @@ -39,6 +44,7 @@ export const fr = { export const de = { question: 'Darf der Agent diese Anwendung über Computer Use steuern?', detail: 'Nach der Freigabe kann der Agent diese App einsehen und bedienen. Sie können App-Berechtigungen jederzeit in den Plugin-Einstellungen verwalten.', + sessionDetail: 'Nach der Freigabe kann der Agent diese App für diese Sitzung einsehen und bedienen.', approve: 'Für diese Sitzung zulassen', } satisfies Record @@ -46,6 +52,7 @@ export const de = { export const ru = { question: 'Разрешить агенту управлять этим приложением через Computer Use?', detail: 'После разрешения агент сможет просматривать это приложение и управлять им. Управлять разрешениями приложений можно в любое время в настройках плагина.', + sessionDetail: 'После разрешения агент сможет просматривать это приложение и управлять им в этом сеансе.', approve: 'Разрешить для этого сеанса', } satisfies Record @@ -53,6 +60,7 @@ export const ru = { export const pt = { question: 'Permitir que o agente controle este aplicativo via Computer Use?', detail: 'Depois de permitido, o agente poderá visualizar e operar este aplicativo. Você pode gerenciar as permissões de aplicativos a qualquer momento nas configurações do plugin.', + sessionDetail: 'Depois de permitido, o agente poderá visualizar e operar este aplicativo nesta sessão.', approve: 'Permitir nesta sessão', } satisfies Record @@ -80,6 +88,14 @@ export const applicationAccessDisplay = { pt: pt.approve, }, } +/** Session-only application-access display translations when persistent grants are unavailable. */ +export const sessionApplicationAccessDisplay = { + ...applicationAccessDisplay, + detail: { + en: en.sessionDetail, zh: zh.sessionDetail, ja: ja.sessionDetail, es: es.sessionDetail, + fr: fr.sessionDetail, de: de.sessionDetail, ru: ru.sessionDetail, pt: pt.sessionDetail, + }, +} /** Window consent never grants access to sibling windows or application launch. */ export const windowAccessQuestion = { diff --git a/packages/experimental/cua/tests/application-access.spec.ts b/packages/experimental/cua/tests/application-access.spec.ts index 2c2218764a..dcdacb49ab 100644 --- a/packages/experimental/cua/tests/application-access.spec.ts +++ b/packages/experimental/cua/tests/application-access.spec.ts @@ -236,15 +236,21 @@ it.each([ expect(question).toMatchObject({ id: 'cua-app-access', question: 'Allow computer use to launch if needed, read, capture, and control Test application?', - detail: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', + detail: offeredAlways + ? 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.' + : 'Once allowed, the agent can view and operate this app for this session.', intent: { kind: 'approval', approve: 'Allow for this session', reject: 'Deny', subject: { name: 'Test application' }, display: { question: { en: 'Allow agent to control this application via computer use?', zh: '允许智能体自动操作此应用吗?', ja: 'エージェントが Computer Use でこのアプリを操作することを許可しますか?' }, - detail: { en: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', - zh: '允许后,智能体将能够查看并操作此应用。你可随时在插件设置中管理应用权限。', - ja: '許可すると、エージェントはこのアプリの内容を確認して操作できます。アプリの権限はプラグイン設定からいつでも管理できます。' }, + detail: offeredAlways + ? { en: 'Once allowed, the agent can view and operate this app. You can manage app permissions anytime in plugin settings.', + zh: '允许后,智能体将能够查看并操作此应用。你可随时在插件设置中管理应用权限。', + ja: '許可すると、エージェントはこのアプリの内容を確認して操作できます。アプリの権限はプラグイン設定からいつでも管理できます。' } + : { en: 'Once allowed, the agent can view and operate this app for this session.', + zh: '允许后,智能体将能在本会话内查看并操作此应用。', + ja: '許可すると、エージェントはこのセッション中にこのアプリの内容を確認して操作できます。' }, approve: { en: 'Allow for this session', zh: '本会话允许', ja: 'このセッションで許可', es: 'Permitir durante esta sesión', fr: 'Autoriser pour cette session', de: 'Für diese Sitzung zulassen', ru: 'Разрешить для этого сеанса', pt: 'Permitir nesta sessão' }, diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index d5de516fcd..fb1bb5a48b 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -88,14 +88,17 @@ it.each([en, zh])('waits for platform identification before offering system perm render() expect(screen.queryByRole('group', { name: dictionary.accessibility })).toBeNull() expect(screen.getByText(dictionary.permissionsIntro).getAttribute('aria-hidden')).toBe('true') - expect(screen.getByText(dictionary.permissionHint).getAttribute('aria-hidden')).toBe('true') f.publish({ system: { ...f.state.getSnapshot().system, busy: false, error: 'connection lost' }, busy: false }) expect(screen.getAllByText(dictionary.unknown)).toHaveLength(2) expect(screen.queryByText(dictionary.granted)).toBeNull() expect(screen.queryByRole('button', { name: dictionary.request })).toBeNull() expect(screen.queryByRole('button', { name: dictionary.unknown })).toBeNull() - expect(screen.getByText(dictionary.permissionsIntro).getAttribute('aria-hidden')).toBe('true') - expect(screen.getByText(dictionary.permissionHint).getAttribute('aria-hidden')).toBe('true') + expect(screen.queryByText(dictionary.permissionsIntro)).toBeNull() + const alert = screen.getByRole('alert') + expect(within(alert).getByText(dictionary.queryFailedHint)).toBeTruthy() + const heading = screen.getByRole('heading', { name: dictionary.title }) + expect(heading.compareDocumentPosition(alert) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(alert.compareDocumentPosition(screen.getByRole('group', { name: dictionary.accessibilityUse })) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() f.publish({ ...observe({ ...value, system: { ...value.system, accessibility: true, screenRecording: false } }) }) fireEvent.click(screen.getByRole('button', { name: dictionary.request })) expect(f.props.request).toHaveBeenCalledWith('screenRecording') @@ -215,10 +218,9 @@ it.each([en, zh])('shows system permissions with the target application beside e expect(within(recording).getByText(application.name)).toBeTruthy() expect(recording.textContent).toContain(dictionary.screenRecordingPermission.replace('{application}', application.name)) expect(within(requirements).getByText(dictionary.permissionsIntro)).toBeTruthy() - expect(within(requirements).getByText(dictionary.permissionHint)).toBeTruthy() f.publish({ system: { ...f.state.getSnapshot().system, error: 'offline' } }) expect(screen.queryByText(application.name)).toBeNull() - expect(within(requirements).getByText(dictionary.permissionHint)).toBeTruthy() + expect(within(requirements).getByText(dictionary.permissionsIntro)).toBeTruthy() }) it('names the authorization target even when its icon is unavailable', () => { @@ -242,12 +244,12 @@ it('waits for the first current observation instead of opening setup with a stal }) -it('keeps permission management guidance after both permissions are granted', () => { +it('shows both permissions as allowed without a redundant macOS footer', () => { const f = fixture() render() f.publish({ ...observe({ ...value, system: { ...value.system, accessibility: true, screenRecording: true } }) }) expect(screen.getAllByText(en.granted)).toHaveLength(2) - expect(screen.getByText(en.permissionHint)).toBeTruthy() + expect(screen.getByText(en.permissionsIntro)).toBeTruthy() }) diff --git a/packages/extensions/cordis-host-runner/src/api-catalog.ts b/packages/extensions/cordis-host-runner/src/api-catalog.ts index bc60aba24f..7573b413f8 100644 --- a/packages/extensions/cordis-host-runner/src/api-catalog.ts +++ b/packages/extensions/cordis-host-runner/src/api-catalog.ts @@ -9286,7 +9286,7 @@ export const TYPE_API: readonly TypeApiEntry[] = [ }, { name: 'ManagementError', - declaration: 'export interface ManagementError {\n code: ReadOnlyReason | \'unknown-plugin\' | \'invalid-spec\' | \'already-installed\' | \'ambiguous-install\' | \'not-bundle\' | \'not-removable\' | \'stop-profile\' | \'bundle-in-use\' | \'stale-approval\' | \'incompatible-version\' | \'unsupported-platform\' | \'unexpected-package\' | \'operation-error\';\n diagnostic?: string;\n incompatible?: IncompatiblePlugin[];\n}', + declaration: 'export interface ManagementError {\n code: ReadOnlyReason | \'unknown-plugin\' | \'invalid-spec\' | \'already-installed\' | \'ambiguous-install\' | \'not-bundle\' | \'not-removable\' | \'stop-profile\' | \'bundle-in-use\' | \'stale-approval\' | \'incompatible-version\' | \'unsupported-platform\' | \'unexpected-package\' | \'operation-error\';\n diagnostic?: string;\n incompatible?: IncompatiblePlugin[];\n platforms?: string[];\n}', }, { name: 'ManualCompactAgentContext', From 093abb685c09928696175a1f46d56a88a347cffc Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 14:01:48 +0800 Subject: [PATCH 03/17] fix(cua): simplify locked desktop setup message --- packages/experimental/cua/src/client/locales.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index e5db0afe5e..f9ebb9cc91 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -13,7 +13,7 @@ export const en = { windowsPermissionsIntro: 'Computer use requires the following environment conditions:', applicationsTitle: 'Manage applications computer use can access', windowsSetupTitle: 'Check desktop environment', - windowsSetupBody: 'Unlock the desktop and try again. DeepSeek Harness still asks for your approval before accessing each app.', + windowsSetupBody: 'The desktop is locked. Unlock it and try again.', windowsSessionUnknown: 'Could not detect an available desktop. Run DeepSeek Harness in a signed-in desktop session and try again.', windowsCaptureUnavailable: 'This desktop environment does not support window capture. Check your OS version and graphics driver, then try again.', applicationInteraction: 'Application interaction', @@ -56,7 +56,7 @@ export const zh: Record = { setupBody: '“自动电脑操作”已开启,需要授予「辅助功能」和「屏幕录制」权限才能运行。请前往插件详情页完成设置。', setupQueryFailed: '“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', windowsSetupTitle: '检查桌面运行环境', - windowsSetupBody: '请先解锁桌面后重试。访问具体应用前,DeepSeek Harness 仍会逐一请求你的授权。', + windowsSetupBody: '桌面已锁定,请解锁后重试。', windowsSessionUnknown: '无法检测到可用的桌面。请在已登录的桌面环境中运行 DeepSeek Harness,然后重试。', windowsCaptureUnavailable: '当前桌面环境不支持窗口截图。请检查系统版本与显卡驱动后重试。', applicationInteraction: '应用交互', @@ -86,7 +86,7 @@ export const ja = { previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', windowsSetupTitle: 'デスクトップ実行環境を確認', - windowsSetupBody: 'デスクトップのロックを解除して再試行してください。各アプリへアクセスする前には、引き続き DeepSeek Harness が確認します。', + windowsSetupBody: 'デスクトップがロックされています。ロックを解除して再試行してください。', windowsSessionUnknown: '利用可能なデスクトップを検出できませんでした。サインイン済みのデスクトップ環境で DeepSeek Harness を実行して再試行してください。', windowsCaptureUnavailable: '現在のデスクトップ環境はウィンドウキャプチャに対応していません。OS のバージョンとグラフィックスドライバーを確認して再試行してください。', applicationInteraction: 'アプリの操作', @@ -143,7 +143,7 @@ export const es = { previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', windowsSetupTitle: 'Comprobar el entorno del escritorio', - windowsSetupBody: 'Desbloquea el escritorio e inténtalo de nuevo. DeepSeek Harness seguirá pidiendo tu autorización antes de acceder a cada aplicación.', + windowsSetupBody: 'El escritorio está bloqueado. Desbloquéalo e inténtalo de nuevo.', windowsSessionUnknown: 'No se pudo detectar un escritorio disponible. Ejecuta DeepSeek Harness en una sesión de escritorio iniciada e inténtalo de nuevo.', windowsCaptureUnavailable: 'Este entorno de escritorio no admite la captura de ventanas. Comprueba la versión del sistema operativo y el controlador gráfico, y vuelve a intentarlo.', applicationInteraction: 'Interacción con aplicaciones', @@ -188,7 +188,7 @@ export const fr = { previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', windowsSetupTitle: 'Vérifier l’environnement de bureau', - windowsSetupBody: 'Déverrouillez le bureau puis réessayez. DeepSeek Harness vous demandera toujours votre autorisation avant d’accéder à chaque application.', + windowsSetupBody: 'Le bureau est verrouillé. Déverrouillez-le puis réessayez.', windowsSessionUnknown: 'Impossible de détecter un bureau disponible. Exécutez DeepSeek Harness dans une session de bureau ouverte puis réessayez.', windowsCaptureUnavailable: 'Cet environnement de bureau ne prend pas en charge la capture de fenêtres. Vérifiez la version du système et le pilote graphique, puis réessayez.', applicationInteraction: 'Interaction avec les applications', @@ -233,7 +233,7 @@ export const de = { previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', windowsSetupTitle: 'Desktopumgebung prüfen', - windowsSetupBody: 'Entsperren Sie den Desktop und versuchen Sie es erneut. DeepSeek Harness fragt weiterhin vor dem Zugriff auf jede App nach Ihrer Zustimmung.', + windowsSetupBody: 'Der Desktop ist gesperrt. Entsperren Sie ihn und versuchen Sie es erneut.', windowsSessionUnknown: 'Es konnte kein verfügbarer Desktop erkannt werden. Führen Sie DeepSeek Harness in einer angemeldeten Desktopsitzung aus und versuchen Sie es erneut.', windowsCaptureUnavailable: 'Diese Desktopumgebung unterstützt keine Fensteraufnahme. Prüfen Sie die Betriebssystemversion und den Grafiktreiber und versuchen Sie es erneut.', applicationInteraction: 'Anwendungsinteraktion', @@ -278,7 +278,7 @@ export const ru = { previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', windowsSetupTitle: 'Проверить среду рабочего стола', - windowsSetupBody: 'Разблокируйте рабочий стол и повторите попытку. DeepSeek Harness по-прежнему запрашивает ваше разрешение перед доступом к каждому приложению.', + windowsSetupBody: 'Рабочий стол заблокирован. Разблокируйте его и повторите попытку.', windowsSessionUnknown: 'Не удалось обнаружить доступный рабочий стол. Запустите DeepSeek Harness в активной сессии рабочего стола и повторите попытку.', windowsCaptureUnavailable: 'Текущая среда рабочего стола не поддерживает захват окон. Проверьте версию ОС и графический драйвер, затем повторите попытку.', applicationInteraction: 'Взаимодействие с приложениями', @@ -323,7 +323,7 @@ export const pt = { previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', windowsSetupTitle: 'Verificar ambiente da área de trabalho', - windowsSetupBody: 'Desbloqueie a área de trabalho e tente novamente. O DeepSeek Harness continuará pedindo sua autorização antes de acessar cada aplicativo.', + windowsSetupBody: 'A área de trabalho está bloqueada. Desbloqueie-a e tente novamente.', windowsSessionUnknown: 'Não foi possível detectar uma área de trabalho disponível. Execute o DeepSeek Harness em uma sessão de área de trabalho conectada e tente novamente.', windowsCaptureUnavailable: 'Este ambiente de área de trabalho não oferece suporte à captura de janelas. Verifique a versão do sistema operacional e o driver gráfico e tente novamente.', applicationInteraction: 'Interação com aplicativos', From 49b2d29be5b8e144411d8548af8e7a3ad5dfd822 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 14:36:34 +0800 Subject: [PATCH 04/17] feat(cua): overhaul Windows permission panel warnings and guidance --- apps/web/tests/cua-permissions.e2e.ts | 2 +- packages/experimental/cua/README.i18n.yaml | 8 +- packages/experimental/cua/README.md | 4 +- packages/experimental/cua/README.zh.md | 4 +- .../cua/src/client/PermissionPanel.module.css | 25 ++- .../cua/src/client/PermissionPanel.tsx | 112 ++++++++----- .../experimental/cua/src/client/controller.ts | 15 +- .../experimental/cua/src/client/locales.ts | 156 +++++++++--------- packages/experimental/cua/src/client/mount.ts | 8 +- .../cua/tests/controller.client.spec.ts | 37 ++++- .../cua/tests/mount.client.spec.ts | 24 ++- .../cua/tests/panel.client.spec.tsx | 73 ++++++-- 12 files changed, 313 insertions(+), 155 deletions(-) diff --git a/apps/web/tests/cua-permissions.e2e.ts b/apps/web/tests/cua-permissions.e2e.ts index 98de892222..825012939f 100644 --- a/apps/web/tests/cua-permissions.e2e.ts +++ b/apps/web/tests/cua-permissions.e2e.ts @@ -361,7 +361,7 @@ it.skipIf(process.platform !== 'darwin' && process.platform !== 'win32')('shows expect(await guidance.textContent()).not.toContain('helperPath') const preview = page.locator('[data-detail-document] img') await preview.evaluate(async (image) => { await (image as HTMLImageElement).decode() }) - const firstSetting = panel.getByRole('heading', { name: 'System permissions', exact: true }) + const firstSetting = panel.getByRole('heading', { name: process.platform === 'win32' ? 'Manage applications computer use can access' : 'System permissions', exact: true }) const previewBox = await preview.boundingBox(), guidanceBox = await guidance.boundingBox(), settingBox = await firstSetting.boundingBox() expect(previewBox!.y + previewBox!.height).toBeLessThanOrEqual(guidanceBox!.y) expect(guidanceBox!.y + guidanceBox!.height).toBeLessThanOrEqual(settingBox!.y) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 508c5d77fc..720b943538 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,11 +18,11 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: e8771da8434eb30d - zh: fe7fbd310b172ede + en: 01518dfb2e7a622d + zh: 53ea58cfa19bbd1b /deepseek-ai-dsh-cua/understand-the-implementation: - en: b74198b9f3d440c5 - zh: 3a3a7404ec045e9c + en: 0bb61400e72a836a + zh: b60cb64e5ce36394 /deepseek-ai-dsh-cua/further-exploration: en: c174fb5a00ea3681 zh: 039340042676881d diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index de6945c149..b556c2ef86 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -70,7 +70,7 @@ On the Computer Use detail page, permission cards, component rows, and source fa The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **System permissions** introduces the required permissions and groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. -The enabled bundle highlights the experimental notice above the system permission controls and places the PTC recommendation in a separate paragraph. The Windows page shows desktop status and window capture readiness, and the macOS page offers Accessibility and Screen Recording controls. +The enabled bundle highlights the experimental notice and places the PTC recommendation in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. The page refreshes on entry, window focus, and completed actions. System-permission query failures appear directly beneath the section heading with recovery guidance and **Retry**, while retaining the last observation as unknown. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. @@ -133,7 +133,7 @@ Check `methods` and `keyboard` in the result of `await cua.getCapabilities()` fo Platform providers import `CuaConfigFields` from `@deepseek-ai/dsh-cua/config` to extend the shared configuration. The root Host entry exports `installCua`, `CuaConfig`, and the Typert-discovered `CuaAccess` service; its `apply()` only marks the optional Client contribution. `/client` loads the permission UI through the existing module loader. Separate Host and Client compiler projects keep React, CSS, and browser registrations out of headless imports. `/api` owns the app/window API and its types; `/bridge`, `/native-client`, and `/protocol` retain runtime and platform consumers. `/types` exports only the named types required by generated Remote declarations. The Client uses package-local types. `/typert` supplies Host reflection and `/remote` supplies generated browser descriptors and codecs; permission authority remains on the Host. -The optional browser contribution mounts the native provider's permission Remote and reuses the Plugins activation and configuration slots. The system permission rows remain visible while unknown fields use placeholders; platform-specific permission guidance remains visible during queries and after grants once the platform has been identified. System checks, application decisions, and application icons fill in as each query completes. Application names and actions do not wait for icons; icon positions retain their space. User actions run in order without waiting for pending observation queries. Disposal waits for both actions and queries to settle before releasing the separately owned Remote mount. Known query errors stay visible while management operations or retries run, with their actions disabled. Query errors stay with the affected section, and activation guidance depends only on system checks. The injection layer observes Plugin Manager operations independently of the page. Bundle and row changes pause permission queries and invalidate in-flight results; settlement refreshes observations even after the page closes. Last known errors remain until a successful read. Disposal discards late results. It projects queries into the page and setup dialog; reconnects refresh it. Page entry, focus and completed actions read the current permission store. Operation notices live in the shell overlay, so closing the page does not remove them. The provider owns permission checks, persisted decisions, and cancellation; the browser owns no authorization state. +The optional browser contribution mounts the native provider's permission Remote and reuses the Plugins activation and configuration slots. The system permission rows remain visible while unknown fields use placeholders; platform-specific guidance updates once the platform is identified. System checks, application decisions, and application icons fill in as each query completes. Application names and actions do not wait for icons; icon positions retain their space. User actions run in order without waiting for pending observation queries. Disposal waits for both actions and queries to settle before releasing the separately owned Remote mount. Known query errors stay visible while management operations or retries run, with their actions disabled. Query errors stay with the affected section, and activation guidance depends only on system checks. The injection layer observes Plugin Manager operations independently of the page. Bundle and row changes pause permission queries and invalidate in-flight results; settlement refreshes observations even after the page closes. Last known errors remain until a successful read. Disposal discards late results. When no native system observation is available, the controller reads the Host plugin inventory to identify an enabled Windows provider so startup helper failures still render the Windows warning layout. It projects queries into the page and setup dialog; reconnects refresh it. Page entry, focus and completed actions read the current permission store. Operation notices live in the shell overlay, so closing the page does not remove them. The provider owns permission checks, persisted decisions, and cancellation; the browser owns no authorization state. ----- diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 9364cec040..d8bf648afc 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -70,7 +70,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 [Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限”先说明运行所需权限,再将辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 -启用组合包后,系统权限上方高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。Windows 页面展示桌面状态和窗口截图就绪情况,macOS 页面提供辅助功能和屏幕录制授权操作。 +启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 进入页面、返回窗口和操作结束后会刷新状态。系统权限检查失败直接显示在分组标题下方,附带排查建议与“重试”,同时将上次观测标为未确认。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 @@ -133,7 +133,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 平台提供方从 `@deepseek-ai/dsh-cua/config` 导入 `CuaConfigFields` 来扩展共享配置。根 Host 入口导出 `installCua`、`CuaConfig` 和供 Typert 发现的 `CuaAccess` 服务,`apply()` 只标记可选 Client 贡献。`/client` 通过现有模块加载器加载权限界面。Host 和 Client 使用独立编译项目,headless 导入不会加载 React、CSS 或浏览器注册。`/api` 提供应用、窗口 API 及其类型;`/bridge`、`/native-client` 和 `/protocol` 保留运行时和平台消费者。`/types` 仅导出生成 Remote 声明所需的命名类型,Client 使用包内类型。`/typert` 提供 Host 反射,`/remote` 提供浏览器描述和编解码,权限判断仍由 Host 执行。 -可选浏览器插件挂载原生 provider 的权限 Remote,复用插件页的启用引导和配置插槽。系统权限始终可见,未加载的字段保留占位;平台确认后,查询期间和权限已允许时均保留权限管理说明。系统权限、应用列表和应用图标分别查询,结果返回后各自显示。应用名称和操作按钮不等待图标,图标位置保留空位。用户操作按顺序执行,不等待尚未完成的查询;卸载时等待操作和查询全部结束,再释放独立持有的 Remote 挂载。已知查询错误在管理操作或重试期间保持可见,操作按钮禁用。查询错误只显示在对应部分,启用引导只等待系统权限结果。注入层独立于页面观察插件管理操作。组合包和组件行变更会暂停权限查询,并使进行中的结果失效;操作结束后即使页面已关闭,也会重新查询。已知错误保留至读取成功;卸载后的迟到结果会被丢弃。重新连接后会刷新状态。进入页面、窗口聚焦或操作完成后读取当前授权存储。操作提示挂载到 shell overlay,关闭页面后仍可显示。provider 负责权限检查、持久授权和取消;浏览器不保存授权决定。 +可选浏览器插件挂载原生 provider 的权限 Remote,复用插件页的启用引导和配置插槽。系统权限始终可见,未加载的字段保留占位;平台确认后按平台展示对应说明。系统权限、应用列表和应用图标分别查询,结果返回后各自显示。应用名称和操作按钮不等待图标,图标位置保留空位。用户操作按顺序执行,不等待尚未完成的查询;卸载时等待操作和查询全部结束,再释放独立持有的 Remote 挂载。已知查询错误在管理操作或重试期间保持可见,操作按钮禁用。查询错误只显示在对应部分,启用引导只等待系统权限结果。注入层独立于页面观察插件管理操作。组合包和组件行变更会暂停权限查询,并使进行中的结果失效;操作结束后即使页面已关闭,也会重新查询。已知错误保留至读取成功;卸载后的迟到结果会被丢弃。首次读取系统权限失败时,控制器会查询主机插件清单以识别已启用的 Windows 提供方,使启动失败仍按 Windows 警告布局展示。重新连接后会刷新状态。进入页面、窗口聚焦或操作完成后读取当前授权存储。操作提示挂载到 shell overlay,关闭页面后仍可显示。provider 负责权限检查、持久授权和取消;浏览器不保存授权决定。 ----- diff --git a/packages/experimental/cua/src/client/PermissionPanel.module.css b/packages/experimental/cua/src/client/PermissionPanel.module.css index deb02a1084..2b2b1c9cb6 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.module.css +++ b/packages/experimental/cua/src/client/PermissionPanel.module.css @@ -1,6 +1,8 @@ .panels { display: grid; gap: 32px; margin: 0; font-size: 13px; } .panel { display: grid; gap: 12px; min-width: 0; } -.guidance { display: grid; gap: 12px; margin-bottom: 12px; overflow-wrap: anywhere; } +.guidance { display: grid; gap: 12px; overflow-wrap: anywhere; } +.panelGuidance { margin-bottom: 12px; } +.guidance p, .panel p { margin: 0; color: var(--dsw-alias-label-secondary); line-height: 1.6; } .caution { display: flex; align-items: flex-start; @@ -9,12 +11,26 @@ border-radius: var(--dsw-radius-md); background: var(--dsw-alias-state-warn-tertiary); } +.dangerNotice { + display: flex; + align-items: flex-start; + gap: 8px; + padding: 10px 12px; + border-radius: var(--dsw-radius-md); + background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); +} .cautionIcon { display: inline-flex; flex: none; margin-top: 3px; color: var(--dsw-alias-state-warn-primary); } +.dangerIcon { + display: inline-flex; + flex: none; + margin-top: 3px; + color: var(--dsw-alias-state-error-primary); +} .cautionBody { display: flex; flex-direction: column; @@ -25,6 +41,10 @@ color: var(--dsw-alias-label-primary); font-weight: 500; } +.cautionBody .dangerTitle { + color: var(--dsw-alias-state-error-primary); + font-weight: 500; +} .systemError { display: flex; flex-wrap: wrap; @@ -43,7 +63,6 @@ } .card { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); } .card > * + * { border-top: 0.5px solid var(--dsw-alias-border-l3); } -.panel p { margin: 0; color: var(--dsw-alias-label-secondary); line-height: 1.6; } .panel h3 { margin: 0; font-size: 14px; font-weight: 500; } .panel h4 { margin: 0; font-size: 13px; font-weight: 500; color: var(--dsw-alias-label-secondary); } .permission, .apps li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; } @@ -56,7 +75,7 @@ .apps li { padding: 12px 0; } .apps li:last-child { padding-bottom: 0; } .panel strong { font-weight: 500; } -.panel .error { color: var(--dsw-alias-state-error-primary); overflow-wrap: anywhere; } +.panels .error { color: var(--dsw-alias-state-error-primary); overflow-wrap: anywhere; } .application { display: flex; align-items: center; gap: 10px; } .application strong { min-width: 0; overflow-wrap: anywhere; } .application img { flex-shrink: 0; object-fit: contain; } diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index df8c566bd8..933d219af7 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -85,21 +85,50 @@ function UnknownStatus({ loading, t }: Pick & { loading: b }) } -function WindowsStatus({ system, uncertain, t }: Pick & { - system: Extract - uncertain: boolean +function NoticeBox({ tone, role, title, body }: { + tone: 'warn' | 'danger' + role: 'note' | 'alert' + title: string + body: string }) { - const unlocked = system.sessionLocked === false - return <> -
-
{t('windowsDesktop')}

{t('windowsDesktopUse')}

- {uncertain || system.sessionLocked === null ? t('unknown') : t(unlocked ? 'available' : 'locked')} + const danger = tone === 'danger' + return
+ +
+

{title}

+

{body}

-
-
{t('windowsCapture')}

{t('screenRecordingUse')}

- {uncertain || system.sessionLocked === null ? t('unknown') : t(unlocked && system.captureAvailable ? 'available' : 'unavailable')} -
- +
+} + +function WindowsGuidance({ system, error, busy, refresh, t }: Pick & { + system: Extract | null + error: string | null + busy: boolean +}) { + return
+ {error !== null &&
+
+

{t('windowsHelperFailed', { message: error })}

+

{t('queryFailedHint')}

+
+ +
} + {error === null && system !== null && <> + {system.sessionLocked === true && } + {system.sessionLocked === null && } + {system.elevated && } + {system.sessionLocked === false && !system.captureAvailable && } + } + +

{t('windowsInstructions')}

+ {error === null && system !== null && !system.elevated &&

{t('standardPrivileges')}

} +

{t('ptcRecommendation')}

+
} function systemReady(system: CuaSystemPermissionState): boolean { @@ -116,12 +145,14 @@ export function PermissionPanel(props: PermissionProps) { const { t, refresh } = props const state = props.useCuaPermissions(value => value) const observed = state.system.value + const windows = observed?.platform === 'windows' || (observed === null && state.windowsProvider.value === true) const apps = state.applications.value const transitioning = state.changing const busy = transitioning || state.system.busy const appsBusy = transitioning || state.applications.busy const loading = observed === null && state.system.error === null const mac = observed?.platform === 'darwin' ? observed : null + const win = observed?.platform === 'windows' ? observed : null const application = state.system.error !== null ? undefined : mac?.launchApplication useEffect(() => { refresh() @@ -129,34 +160,28 @@ export function PermissionPanel(props: PermissionProps) { return () => { window.removeEventListener('focus', refresh) } }, [refresh]) return
-
-
-
- -
-

{t('previewNoticeTitle')}

-

{t('previewNotice')}

+ {windows ? + :
+
+ +

{t('ptcRecommendation')}

+
+

{t('title')}

+ {state.system.error !== null &&
+
+

{t('queryFailed', { message: state.system.error })}

+

{t('queryFailedHint')}

-
-

{t('ptcRecommendation')}

-
-

{t('title')}

- {state.system.error !== null &&
-
-

{t('queryFailed', { message: state.system.error })}

-

{t('queryFailedHint')}

-
- -
} - {(observed !== null || state.system.error === null) &&

- {t(observed?.platform === 'windows' ? 'windowsPermissionsIntro' : 'permissionsIntro')} -

} -
- {observed === null ? - : observed.platform === 'windows' ? + +
} + {(observed !== null || state.system.error === null) &&

+ {t('permissionsIntro')} +

} +
+ {mac === null ? : (['accessibility', 'screenRecording'] as const).map(permission =>
@@ -164,12 +189,11 @@ export function PermissionPanel(props: PermissionProps) {
)} -
- {observed?.platform === 'windows' &&

{t('windowsInstructions')} {t(observed.elevated ? 'elevated' : 'standardPrivileges')}

} -
+
+
}

{t('applicationsTitle')}

diff --git a/packages/experimental/cua/src/client/controller.ts b/packages/experimental/cua/src/client/controller.ts index e1ad4d6bc7..13ceb2fdec 100644 --- a/packages/experimental/cua/src/client/controller.ts +++ b/packages/experimental/cua/src/client/controller.ts @@ -7,6 +7,7 @@ import { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client import type { CuaApplicationId, CuaApplicationState, CuaSystemPermission, CuaSystemPermissionState } from '../access-types.ts' interface PermissionData { + windowsProvider: boolean system: CuaSystemPermissionState applications: CuaApplicationState icons: Record @@ -38,6 +39,7 @@ export interface PermissionFace { export class PermissionController { /** Last observed permissions and the lifetime of the current refresh/action. */ readonly state = createSnapshotStore({ + windowsProvider: { value: null, busy: false, error: null }, system: { value: null, busy: false, error: null }, applications: { value: null, busy: false, error: null }, icons: { value: null, busy: false, error: null }, @@ -51,9 +53,10 @@ export class PermissionController { /** * @param remote Generated CUA Remote namespace; failed results follow the query and action paths. * @param locale Current Client language, read when a permission action starts. + * @param windowsProvider Read the enabled Host provider when native setup fails before reporting its platform. */ constructor(private readonly remote: Context['remote']['cuaAccess'], - private readonly locale: () => string) {} + private readonly locale: () => string, private readonly windowsProvider: () => Promise>) {} /** * Bind the permission projection to its user actions. * @returns Reactive state and controls shared by the page, prompt, and toast host. @@ -83,6 +86,7 @@ export class PermissionController { this.state.update((state) => { state.changing = changing state.busy = true + state.windowsProvider.busy = false for (const key of ['system', 'applications', 'icons'] as const) state[key].busy = true }) if (!changing) this.enqueue() @@ -96,6 +100,7 @@ export class PermissionController { const sequence = ++this.sequence this.state.update((state) => { state.busy = true + state.windowsProvider.busy = false for (const key of ['system', 'applications', 'icons'] as const) state[key].busy = true }) this.tail = this.tail.then(async () => { @@ -114,7 +119,13 @@ export class PermissionController { } const latest = () => current() && this.sequence === sequence const refresh = Promise.all([ - this.read('system', this.remote.systemStatus, latest), + this.read('system', this.remote.systemStatus, latest).then(async () => { + // Identify an enabled Windows provider when native setup fails before reporting its platform. + if (latest() && this.state.getSnapshot().system.value === null) { + this.state.update((state) => { state.windowsProvider.busy = true }) + await this.read('windowsProvider', this.windowsProvider, latest) + } + }), this.read('applications', this.remote.applications, latest), this.read('icons', this.remote.applicationIcons, latest), ]).then(() => { diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index f9ebb9cc91..93439d22e1 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -10,17 +10,21 @@ export const en = { approvalRiskNotice: 'The agent can access only apps you approve, and can read and control them in the background.\n\nOnline games, messaging apps, and other apps may restrict automation. Violating their rules could result in your account with that app being suspended or banned.\n\nProceed at your own risk. To stop automated control at any time, press Stop in DeepSeek Harness.', title: 'System permissions', permissionsIntro: 'Computer use requires the following system permissions to run:', - windowsPermissionsIntro: 'Computer use requires the following environment conditions:', applicationsTitle: 'Manage applications computer use can access', windowsSetupTitle: 'Check desktop environment', windowsSetupBody: 'The desktop is locked. Unlock it and try again.', + windowsSessionUnknownTitle: 'Desktop session unavailable', windowsSessionUnknown: 'Could not detect an available desktop. Run DeepSeek Harness in a signed-in desktop session and try again.', + windowsLockedTitle: 'Desktop is locked', + windowsLockedBody: 'Unlock the desktop so the agent can view and operate apps.', + windowsCaptureUnavailableTitle: 'Window screenshots unavailable', windowsCaptureUnavailable: 'This desktop environment does not support window capture. Check your OS version and graphics driver, then try again.', - applicationInteraction: 'Application interaction', - windowsInstructions: 'Keep the desktop unlocked while in use. Some actions require bringing the target app to the front; apps running with higher privileges may not be controllable.', - windowsDesktop: 'Desktop status', windowsDesktopUse: 'Keep the desktop unlocked so the agent can view the screen and perform actions.', - windowsCapture: 'Window capture', available: 'Available', unavailable: 'Unavailable', locked: 'Locked or disconnected', - elevated: 'Currently running with administrator privileges.', standardPrivileges: 'Currently running with standard user privileges.', + windowsCaptureUnavailableNotice: 'Window capture is unavailable in this environment. Check or update your OS version and graphics driver, then try again. DeepSeek Harness can still operate apps through accessibility, with reduced capability.', + windowsElevatedTitle: 'Running with administrator privileges', + windowsElevatedWarning: 'DeepSeek Harness is running as an administrator and can access almost everything on this computer. Proceed only if you are fully aware of the risks.', + windowsHelperFailed: 'Could not connect to the computer use helper: {message}', + windowsInstructions: 'Keep the desktop unlocked while in use. Some actions require bringing the target app to the front.', + standardPrivileges: 'Currently running with standard user privileges. Apps running with higher privileges (such as as administrator) may not be controllable.', setupTitle: 'Set up computer use before use', setupBody: 'Computer use is enabled and requires Accessibility and Screen Recording permissions to run. Open the plugin details to finish setup.', setupQueryFailed: 'Computer use is enabled, but system permissions could not be checked. Open the plugin details to view the error and try again.', @@ -51,19 +55,23 @@ export const zh: Record = { approvalRiskNotice: '智能体只能访问你已授权的应用,并可在后台读取应用内容、操作应用。\n\n网络游戏、即时通讯等应用可能对自动化操作有所限制。违反相关规则可能导致你在该应用中的账号被暂停使用或封禁。\n\n请自行承担使用风险。如需停止自动化操作,可随时点击 DeepSeek Harness 中的停止按钮。', title: '系统权限', permissionsIntro: '自动电脑操作需要以下两项系统权限才能运行:', - windowsPermissionsIntro: '自动电脑操作需要满足以下运行条件:', applicationsTitle: '管理可访问的应用', setupTitle: '配置自动电脑操作', setupBody: '“自动电脑操作”已开启,需要授予「辅助功能」和「屏幕录制」权限才能运行。请前往插件详情页完成设置。', setupQueryFailed: '“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', windowsSetupTitle: '检查桌面运行环境', windowsSetupBody: '桌面已锁定,请解锁后重试。', + windowsSessionUnknownTitle: '无法检测到可用桌面', windowsSessionUnknown: '无法检测到可用的桌面。请在已登录的桌面环境中运行 DeepSeek Harness,然后重试。', + windowsLockedTitle: '桌面已锁定', + windowsLockedBody: '请解锁桌面,以便智能体查看并操作应用。', + windowsCaptureUnavailableTitle: '窗口截图不可用', windowsCaptureUnavailable: '当前桌面环境不支持窗口截图。请检查系统版本与显卡驱动后重试。', - applicationInteraction: '应用交互', - windowsInstructions: '使用时请保持桌面处于解锁状态。部分操作需要将目标应用切到前台;以更高权限运行的应用可能无法操作。', - windowsDesktop: '桌面状态', windowsDesktopUse: '桌面保持解锁时,智能体才能查看画面并执行操作。', - windowsCapture: '窗口截图', available: '可用', unavailable: '不可用', locked: '已锁屏或未连接', - elevated: '当前以管理员权限运行。', standardPrivileges: '当前以普通用户权限运行。', + windowsCaptureUnavailableNotice: '当前环境不支持窗口截图。请检查或更新系统版本与显卡驱动后重试。DeepSeek Harness 仍可通过辅助功能操作应用,但识别与操作能力会受限。', + windowsElevatedTitle: '当前以管理员权限运行', + windowsElevatedWarning: 'DeepSeek Harness 正以管理员权限运行,可以访问这台电脑上的几乎所有内容。请仅在充分了解风险的情况下继续使用。', + windowsHelperFailed: '无法连接自动电脑操作辅助程序:{message}', + windowsInstructions: '使用时请保持桌面处于解锁状态。部分操作需要将目标应用切到前台。', + standardPrivileges: '当前以普通用户权限运行,以管理员等更高权限运行的应用可能无法操作。', openSetup: '前往设置', later: '稍后', close: '关闭', accessibility: '辅助功能', screenRecording: '屏幕录制', accessibilityUse: '读取界面内容,并执行点击和键盘输入。', screenRecordingUse: '截取所选应用窗口的画面。', @@ -87,22 +95,23 @@ export const ja = { ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', windowsSetupTitle: 'デスクトップ実行環境を確認', windowsSetupBody: 'デスクトップがロックされています。ロックを解除して再試行してください。', + windowsSessionUnknownTitle: 'デスクトップセッションを利用できません', windowsSessionUnknown: '利用可能なデスクトップを検出できませんでした。サインイン済みのデスクトップ環境で DeepSeek Harness を実行して再試行してください。', + windowsLockedTitle: 'デスクトップがロックされています', + windowsLockedBody: 'エージェントがアプリを確認・操作できるよう、デスクトップのロックを解除してください。', + windowsCaptureUnavailableTitle: 'ウィンドウのスクリーンショットを利用できません', windowsCaptureUnavailable: '現在のデスクトップ環境はウィンドウキャプチャに対応していません。OS のバージョンとグラフィックスドライバーを確認して再試行してください。', - applicationInteraction: 'アプリの操作', - windowsInstructions: '使用中はデスクトップのロックを解除しておいてください。一部の操作では対象アプリを最前面に表示する必要があり、より高い権限で実行中のアプリは操作できない場合があります。', - windowsDesktop: 'デスクトップ状態', - windowsDesktopUse: 'エージェントが画面を確認して操作できるよう、デスクトップのロックを解除しておいてください。', - windowsCapture: 'ウィンドウキャプチャ', - available: '利用可能', unavailable: '利用不可', locked: 'ロック中または未接続', - elevated: '現在、管理者権限で実行中です。', - standardPrivileges: '現在、標準ユーザー権限で実行中です。', + windowsCaptureUnavailableNotice: 'この環境ではウィンドウキャプチャを利用できません。OS のバージョンやグラフィックスドライバーを確認・更新して再試行してください。アクセシビリティ機能による操作は引き続き可能ですが、性能や対応範囲が制限されます。', + windowsElevatedTitle: '管理者権限で実行中です', + windowsElevatedWarning: 'DeepSeek Harness は管理者権限で実行されており、このコンピューター上のほぼすべての内容にアクセスできます。リスクを十分理解したうえでのみ続行してください。', + windowsHelperFailed: 'Computer Use 補助プログラムに接続できませんでした:{message}', + windowsInstructions: '使用中はデスクトップのロックを解除しておいてください。一部の操作では対象アプリを最前面に表示する必要があります。', + standardPrivileges: '現在、標準ユーザー権限で実行中です。管理者などより高い権限で実行中のアプリは操作できない場合があります。', approvalRisks: 'リスク', approvalRiskTitle: 'コンピュータ操作のリスク', approvalRiskNotice: 'エージェントがアクセスできるのは、あなたが許可したアプリだけです。許可したアプリの内容を読み取ったり、バックグラウンドで操作したりできます。\n\nオンラインゲームやメッセージアプリなどでは、自動操作が制限されている場合があります。規約に違反すると、そのアプリのアカウントが一時停止または永久停止になる可能性があります。\n\n自己責任でご利用ください。自動操作は、DeepSeek Harness の停止ボタンでいつでも止められます。', 'title': 'システム権限', 'permissionsIntro': 'Computer Use を実行するには、次の 2 つのシステム権限が必要です。', - 'windowsPermissionsIntro': 'Computer Use を実行するには、次の環境条件を満たす必要があります。', 'applicationsTitle': 'Computer Useがアクセスできるアプリを管理', 'setupTitle': '使用前にComputer Useを設定', 'setupBody': 'Computer Use が有効になりました。実行するには「アクセシビリティ」と「画面収録」の権限が必要です。プラグインの詳細ページで設定を完了してください。', @@ -144,24 +153,23 @@ export const es = { ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', windowsSetupTitle: 'Comprobar el entorno del escritorio', windowsSetupBody: 'El escritorio está bloqueado. Desbloquéalo e inténtalo de nuevo.', + windowsSessionUnknownTitle: 'Sesión de escritorio no disponible', windowsSessionUnknown: 'No se pudo detectar un escritorio disponible. Ejecuta DeepSeek Harness en una sesión de escritorio iniciada e inténtalo de nuevo.', + windowsLockedTitle: 'El escritorio está bloqueado', + windowsLockedBody: 'Desbloquea el escritorio para que el agente pueda ver y operar aplicaciones.', + windowsCaptureUnavailableTitle: 'Capturas de ventana no disponibles', windowsCaptureUnavailable: 'Este entorno de escritorio no admite la captura de ventanas. Comprueba la versión del sistema operativo y el controlador gráfico, y vuelve a intentarlo.', - applicationInteraction: 'Interacción con aplicaciones', - windowsInstructions: 'Mantén el escritorio desbloqueado durante el uso. Algunas acciones requieren poner la aplicación en primer plano y es posible que las aplicaciones con mayores privilegios no se puedan controlar.', - windowsDesktop: 'Estado del escritorio', - windowsDesktopUse: 'Mantén el escritorio desbloqueado para que el agente pueda ver la pantalla y realizar acciones.', - windowsCapture: 'Captura de ventanas', - available: 'Disponible', - unavailable: 'No disponible', - locked: 'Bloqueado o desconectado', - elevated: 'Actualmente se ejecuta con privilegios de administrador.', - standardPrivileges: 'Actualmente se ejecuta con privilegios de usuario estándar.', + windowsCaptureUnavailableNotice: 'La captura de ventanas no está disponible en este entorno. Comprueba o actualiza la versión del sistema operativo y el controlador gráfico, y vuelve a intentarlo. DeepSeek Harness puede seguir operando aplicaciones mediante accesibilidad, pero con capacidad reducida.', + windowsElevatedTitle: 'Ejecutándose con privilegios de administrador', + windowsElevatedWarning: 'DeepSeek Harness se ejecuta como administrador y puede acceder a casi todo en este equipo. Continúa solo si eres plenamente consciente de los riesgos.', + windowsHelperFailed: 'No se pudo conectar con el programa auxiliar de Computer Use: {message}', + windowsInstructions: 'Mantén el escritorio desbloqueado durante el uso. Algunas acciones requieren poner la aplicación en primer plano.', + standardPrivileges: 'Actualmente se ejecuta con privilegios de usuario estándar. Es posible que no se puedan controlar aplicaciones con mayores privilegios (como las ejecutadas como administrador).', approvalRisks: 'Riesgos', approvalRiskTitle: 'Riesgos del control del equipo', approvalRiskNotice: 'El agente solo puede acceder a las aplicaciones que autorices, y puede leer su contenido y controlarlas en segundo plano.\n\nLos juegos en línea, las aplicaciones de mensajería y otras aplicaciones pueden restringir la automatización. Incumplir sus normas podría provocar la suspensión o el bloqueo permanente de tu cuenta en esa aplicación.\n\nContinúa bajo tu propia responsabilidad. Para detener el control automatizado en cualquier momento, pulsa Detener en DeepSeek Harness.', title: 'Permisos del sistema', permissionsIntro: 'Computer Use necesita los siguientes permisos del sistema para funcionar:', - windowsPermissionsIntro: 'Computer Use requiere las siguientes condiciones del entorno:', applicationsTitle: 'Administrar aplicaciones a las que puede acceder el uso de la computadora', setupTitle: 'Configurar el uso de la computadora antes de usarla', setupBody: 'Computer Use está activado y necesita permisos de Accesibilidad y Grabación de pantalla para funcionar. Abre los detalles del complemento para completar la configuración.', @@ -189,24 +197,23 @@ export const fr = { ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', windowsSetupTitle: 'Vérifier l’environnement de bureau', windowsSetupBody: 'Le bureau est verrouillé. Déverrouillez-le puis réessayez.', + windowsSessionUnknownTitle: 'Session de bureau indisponible', windowsSessionUnknown: 'Impossible de détecter un bureau disponible. Exécutez DeepSeek Harness dans une session de bureau ouverte puis réessayez.', + windowsLockedTitle: 'Le bureau est verrouillé', + windowsLockedBody: 'Déverrouillez le bureau pour permettre à l’agent de consulter et d’utiliser les applications.', + windowsCaptureUnavailableTitle: 'Captures de fenêtre indisponibles', windowsCaptureUnavailable: 'Cet environnement de bureau ne prend pas en charge la capture de fenêtres. Vérifiez la version du système et le pilote graphique, puis réessayez.', - applicationInteraction: 'Interaction avec les applications', - windowsInstructions: 'Gardez le bureau déverrouillé pendant l’utilisation. Certaines actions nécessitent de placer l’application au premier plan, et les applications exécutées avec des privilèges supérieurs peuvent ne pas être contrôlables.', - windowsDesktop: 'État du bureau', - windowsDesktopUse: 'Gardez le bureau déverrouillé afin que l’agent puisse voir l’écran et effectuer des actions.', - windowsCapture: 'Capture de fenêtres', - available: 'Disponible', - unavailable: 'Indisponible', - locked: 'Verrouillé ou déconnecté', - elevated: 'Fonctionne actuellement avec des privilèges d’administrateur.', - standardPrivileges: 'Fonctionne actuellement avec des privilèges d’utilisateur standard.', + windowsCaptureUnavailableNotice: 'La capture de fenêtres n’est pas disponible dans cet environnement. Vérifiez ou mettez à jour la version du système et le pilote graphique, puis réessayez. DeepSeek Harness peut toujours contrôler les applications via l’accessibilité, avec des capacités réduites.', + windowsElevatedTitle: 'Exécution avec des privilèges d’administrateur', + windowsElevatedWarning: 'DeepSeek Harness s’exécute en tant qu’administrateur et peut accéder à presque tout sur cet ordinateur. Ne continuez que si vous avez pleinement conscience des risques.', + windowsHelperFailed: 'Impossible de se connecter au programme auxiliaire Computer Use : {message}', + windowsInstructions: 'Gardez le bureau déverrouillé pendant l’utilisation. Certaines actions nécessitent de placer l’application au premier plan.', + standardPrivileges: 'Fonctionne actuellement avec des privilèges d’utilisateur standard. Les applications exécutées avec des privilèges supérieurs (comme en tant qu’administrateur) peuvent ne pas être contrôlables.', approvalRisks: 'Risques', approvalRiskTitle: 'Risques du contrôle de l’ordinateur', approvalRiskNotice: 'L’agent ne peut accéder qu’aux applications que vous autorisez. Il peut en lire le contenu et les contrôler en arrière-plan.\n\nLes jeux en ligne, les messageries et d’autres applications peuvent limiter l’automatisation. Le non-respect de leurs règles pourrait entraîner la suspension ou le bannissement de votre compte dans l’application concernée.\n\nUtilisez cette fonction à vos risques et périls. Vous pouvez interrompre le contrôle automatisé à tout moment en cliquant sur Arrêter dans DeepSeek Harness.', title: 'Autorisations système', permissionsIntro: 'Computer Use a besoin des autorisations système suivantes pour fonctionner :', - windowsPermissionsIntro: 'Computer Use nécessite les conditions suivantes :', applicationsTitle: "Gérer les applications auxquelles l'ordinateur peut accéder", setupTitle: "Configurer l'utilisation de l'ordinateur avant utilisation", setupBody: 'Computer Use est activé et nécessite les autorisations Accessibilité et Enregistrement de l’écran pour fonctionner. Ouvrez les détails du plugin pour terminer la configuration.', @@ -234,24 +241,23 @@ export const de = { ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', windowsSetupTitle: 'Desktopumgebung prüfen', windowsSetupBody: 'Der Desktop ist gesperrt. Entsperren Sie ihn und versuchen Sie es erneut.', + windowsSessionUnknownTitle: 'Desktopsitzung nicht verfügbar', windowsSessionUnknown: 'Es konnte kein verfügbarer Desktop erkannt werden. Führen Sie DeepSeek Harness in einer angemeldeten Desktopsitzung aus und versuchen Sie es erneut.', + windowsLockedTitle: 'Desktop ist gesperrt', + windowsLockedBody: 'Entsperren Sie den Desktop, damit der Agent Apps ansehen und bedienen kann.', + windowsCaptureUnavailableTitle: 'Fenster-Screenshots nicht verfügbar', windowsCaptureUnavailable: 'Diese Desktopumgebung unterstützt keine Fensteraufnahme. Prüfen Sie die Betriebssystemversion und den Grafiktreiber und versuchen Sie es erneut.', - applicationInteraction: 'Anwendungsinteraktion', - windowsInstructions: 'Lassen Sie den Desktop während der Nutzung entsperrt. Einige Aktionen erfordern die Zielanwendung im Vordergrund; Apps mit höheren Berechtigungen lassen sich möglicherweise nicht steuern.', - windowsDesktop: 'Desktopstatus', - windowsDesktopUse: 'Lassen Sie den Desktop entsperrt, damit der Agent den Bildschirm sehen und Aktionen ausführen kann.', - windowsCapture: 'Fensteraufnahme', - available: 'Verfügbar', - unavailable: 'Nicht verfügbar', - locked: 'Gesperrt oder getrennt', - elevated: 'Wird derzeit mit Administratorrechten ausgeführt.', - standardPrivileges: 'Wird derzeit mit Standardbenutzerrechten ausgeführt.', + windowsCaptureUnavailableNotice: 'Die Fensteraufnahme ist in dieser Umgebung nicht verfügbar. Prüfen oder aktualisieren Sie Betriebssystemversion und Grafiktreiber und versuchen Sie es erneut. DeepSeek Harness kann Apps weiterhin über Bedienungshilfen steuern, jedoch mit eingeschränkter Leistungsfähigkeit.', + windowsElevatedTitle: 'Ausführung mit Administratorrechten', + windowsElevatedWarning: 'DeepSeek Harness wird als Administrator ausgeführt und hat Zugriff auf nahezu alles auf diesem Computer. Fahren Sie nur fort, wenn Sie sich der Risiken voll bewusst sind.', + windowsHelperFailed: 'Verbindung zum Computer-Use-Hilfsprogramm fehlgeschlagen: {message}', + windowsInstructions: 'Lassen Sie den Desktop während der Nutzung entsperrt. Einige Aktionen erfordern die Zielanwendung im Vordergrund.', + standardPrivileges: 'Wird derzeit mit Standardbenutzerrechten ausgeführt. Apps mit höheren Berechtigungen (z. B. als Administrator) lassen sich möglicherweise nicht steuern.', approvalRisks: 'Risiken', approvalRiskTitle: 'Risiken der Computersteuerung', approvalRiskNotice: 'Der Agent kann nur auf Apps zugreifen, die Sie freigeben. Er kann deren Inhalte lesen und die Apps im Hintergrund steuern.\n\nOnline-Spiele, Messenger und andere Apps können die Automatisierung einschränken. Bei Verstößen gegen ihre Regeln könnte Ihr Konto bei der jeweiligen App vorübergehend oder dauerhaft gesperrt werden.\n\nDie Nutzung erfolgt auf eigenes Risiko. Über Stopp in DeepSeek Harness können Sie die automatisierte Steuerung jederzeit beenden.', title: 'Systemberechtigungen', permissionsIntro: 'Computer Use benötigt die folgenden Systemberechtigungen:', - windowsPermissionsIntro: 'Computer Use erfordert die folgenden Umgebungsbedingungen:', applicationsTitle: 'Verwalten Sie Anwendungen, auf die der Computer zugreifen kann', setupTitle: 'Richten Sie die Computernutzung vor der Nutzung ein', setupBody: 'Computer Use ist aktiviert und benötigt die Berechtigungen für Bedienungshilfen und Bildschirmaufnahme. Öffnen Sie die Plugin-Details, um die Einrichtung abzuschließen.', @@ -279,24 +285,23 @@ export const ru = { ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', windowsSetupTitle: 'Проверить среду рабочего стола', windowsSetupBody: 'Рабочий стол заблокирован. Разблокируйте его и повторите попытку.', + windowsSessionUnknownTitle: 'Сеанс рабочего стола недоступен', windowsSessionUnknown: 'Не удалось обнаружить доступный рабочий стол. Запустите DeepSeek Harness в активной сессии рабочего стола и повторите попытку.', + windowsLockedTitle: 'Рабочий стол заблокирован', + windowsLockedBody: 'Разблокируйте рабочий стол, чтобы агент мог видеть приложения и управлять ими.', + windowsCaptureUnavailableTitle: 'Снимки окон недоступны', windowsCaptureUnavailable: 'Текущая среда рабочего стола не поддерживает захват окон. Проверьте версию ОС и графический драйвер, затем повторите попытку.', - applicationInteraction: 'Взаимодействие с приложениями', - windowsInstructions: 'Во время работы держите рабочий стол разблокированным. Для некоторых действий нужно вывести приложение на передний план; приложения с повышенными привилегиями могут не поддаваться управлению.', - windowsDesktop: 'Состояние рабочего стола', - windowsDesktopUse: 'Держите рабочий стол разблокированным, чтобы агент мог видеть экран и выполнять действия.', - windowsCapture: 'Захват окон', - available: 'Доступно', - unavailable: 'Недоступно', - locked: 'Заблокирован или отключён', - elevated: 'Сейчас запущено с правами администратора.', - standardPrivileges: 'Сейчас запущено с обычными правами пользователя.', + windowsCaptureUnavailableNotice: 'Захват окон недоступен в этой среде. Проверьте или обновите версию ОС и графический драйвер, затем повторите попытку. DeepSeek Harness по-прежнему может управлять приложениями через средства доступности, но с ограниченными возможностями.', + windowsElevatedTitle: 'Запуск с правами администратора', + windowsElevatedWarning: 'DeepSeek Harness запущен от имени администратора и имеет доступ почти ко всему на этом компьютере. Продолжайте только если полностью осознаёте риски.', + windowsHelperFailed: 'Не удалось подключиться к вспомогательному компоненту управления компьютером: {message}', + windowsInstructions: 'Во время работы держите рабочий стол разблокированным. Для некоторых действий нужно вывести приложение на передний план.', + standardPrivileges: 'Сейчас запущено с обычными правами пользователя. Приложения с повышенными привилегиями (например, от имени администратора) могут не поддаваться управлению.', approvalRisks: 'Риски', approvalRiskTitle: 'Риски управления компьютером', approvalRiskNotice: 'Агент получает доступ только к приложениям, которые вы разрешили, и может читать их содержимое и управлять ими в фоновом режиме.\n\nВ онлайн-играх, мессенджерах и других приложениях могут действовать ограничения на автоматизацию. Нарушение их правил может привести к временной или постоянной блокировке вашей учётной записи в соответствующем приложении.\n\nВы пользуетесь этой возможностью на свой страх и риск. Чтобы в любой момент остановить автоматизированное управление, нажмите «Остановить» в DeepSeek Harness.', title: 'Системные разрешения', permissionsIntro: 'Для работы управления компьютером требуются следующие системные разрешения:', - windowsPermissionsIntro: 'Для работы управления компьютером требуются следующие условия среды:', applicationsTitle: 'Управление приложениями, к которым может иметь доступ компьютер', setupTitle: 'Настройте использование компьютера перед использованием', setupBody: 'Управление компьютером включено. Для работы требуются разрешения на универсальный доступ и запись экрана. Откройте сведения о плагине, чтобы завершить настройку.', @@ -324,24 +329,23 @@ export const pt = { ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', windowsSetupTitle: 'Verificar ambiente da área de trabalho', windowsSetupBody: 'A área de trabalho está bloqueada. Desbloqueie-a e tente novamente.', + windowsSessionUnknownTitle: 'Sessão de área de trabalho indisponível', windowsSessionUnknown: 'Não foi possível detectar uma área de trabalho disponível. Execute o DeepSeek Harness em uma sessão de área de trabalho conectada e tente novamente.', + windowsLockedTitle: 'A área de trabalho está bloqueada', + windowsLockedBody: 'Desbloqueie a área de trabalho para que o agente possa ver e operar aplicativos.', + windowsCaptureUnavailableTitle: 'Capturas de janela indisponíveis', windowsCaptureUnavailable: 'Este ambiente de área de trabalho não oferece suporte à captura de janelas. Verifique a versão do sistema operacional e o driver gráfico e tente novamente.', - applicationInteraction: 'Interação com aplicativos', - windowsInstructions: 'Mantenha a área de trabalho desbloqueada durante o uso. Algumas ações exigem colocar o aplicativo em primeiro plano, e aplicativos com privilégios mais altos podem não ser controláveis.', - windowsDesktop: 'Status da área de trabalho', - windowsDesktopUse: 'Mantenha a área de trabalho desbloqueada para que o agente possa ver a tela e executar ações.', - windowsCapture: 'Captura de janelas', - available: 'Disponível', - unavailable: 'Indisponível', - locked: 'Bloqueada ou desconectada', - elevated: 'Atualmente em execução com privilégios de administrador.', - standardPrivileges: 'Atualmente em execução com privilégios de usuário padrão.', + windowsCaptureUnavailableNotice: 'A captura de janelas não está disponível neste ambiente. Verifique ou atualize a versão do sistema operacional e o driver gráfico e tente novamente. O DeepSeek Harness ainda pode operar aplicativos por acessibilidade, com capacidade reduzida.', + windowsElevatedTitle: 'Executando com privilégios de administrador', + windowsElevatedWarning: 'O DeepSeek Harness está sendo executado como administrador e pode acessar quase tudo neste computador. Prossiga apenas se estiver plenamente ciente dos riscos.', + windowsHelperFailed: 'Não foi possível conectar ao auxiliar do Computer Use: {message}', + windowsInstructions: 'Mantenha a área de trabalho desbloqueada durante o uso. Algumas ações exigem colocar o aplicativo em primeiro plano.', + standardPrivileges: 'Atualmente em execução com privilégios de usuário padrão. Aplicativos executados com privilégios mais altos (como administrador) podem não ser controláveis.', approvalRisks: 'Riscos', approvalRiskTitle: 'Riscos do controle do computador', approvalRiskNotice: 'O agente só pode acessar os aplicativos que você autorizar e pode ler seu conteúdo e controlá-los em segundo plano.\n\nJogos on-line, aplicativos de mensagens e outros aplicativos podem restringir a automação. Violar essas regras pode levar à suspensão ou ao banimento da sua conta no aplicativo em questão.\n\nUse por sua conta e risco. Para interromper o controle automatizado a qualquer momento, clique em Parar no DeepSeek Harness.', title: 'Permissões do sistema', permissionsIntro: 'O Computer Use precisa das seguintes permissões do sistema para funcionar:', - windowsPermissionsIntro: 'O Computer Use requer as seguintes condições do ambiente:', applicationsTitle: 'Gerenciar aplicativos que o computador pode acessar', setupTitle: 'Configure o uso do computador antes de usar', setupBody: 'O Computer Use está ativado e precisa das permissões de Acessibilidade e Gravação de tela para funcionar. Abra os detalhes do plugin para concluir a configuração.', diff --git a/packages/experimental/cua/src/client/mount.ts b/packages/experimental/cua/src/client/mount.ts index 85a70d99ce..cf86dc9f02 100644 --- a/packages/experimental/cua/src/client/mount.ts +++ b/packages/experimental/cua/src/client/mount.ts @@ -31,9 +31,13 @@ export const inject = ['remote', 'slots', 'locale'] */ export async function mountCuaPermissions(ctx: Context, contribution: TypertRemoteContribution): Promise<() => Promise> { const transport = ctx.plugin(async (owner) => { await owner.remote.$mount(contribution) }) - const ui = ctx.inject(['remote.cuaAccess', 'slots', 'locale'], (ctx) => { + const ui = ctx.inject(['remote.cuaAccess', 'remote.pluginInventory', 'slots', 'locale'], (ctx) => { ctx.effect(() => ctx.locale.register(NS, { en, zh, ja, es, fr, de, ru, pt })) - const controller = new PermissionController(ctx.remote.cuaAccess, () => ctx.locale.getSnapshot().active) + const controller = new PermissionController(ctx.remote.cuaAccess, () => ctx.locale.getSnapshot().active, async () => { + const result = await ctx.remote.pluginInventory.list() + if (!result.ok) return result + return { ok: true, value: result.value.entries.some(entry => entry.enabled && entry.moduleName === '@deepseek-ai/dsh-cua-windows') } + }) const face = controller.face() ctx.slots.inject('conversation.composer', () => ctx.slots.register({ name: 'conversation.composer', priority: -1, locale: NS, diff --git a/packages/experimental/cua/tests/controller.client.spec.ts b/packages/experimental/cua/tests/controller.client.spec.ts index 098bd237cb..55a81ca0f6 100644 --- a/packages/experimental/cua/tests/controller.client.spec.ts +++ b/packages/experimental/cua/tests/controller.client.spec.ts @@ -24,11 +24,44 @@ function fixture() { enablePersistentPtc: vi.fn(async () => ({ ok: true, value: undefined })), } let locale = 'zh' - const controller = new PermissionController(actions, () => locale) + const windowsProvider = vi.fn(async () => ({ ok: true as const, value: true })) + const controller = new PermissionController(actions, () => locale, windowsProvider) onTestFinished(() => controller.dispose()) - return { actions, controller, face: controller.face(), setLocale: (value: string) => { locale = value } } + return { actions, controller, windowsProvider, face: controller.face(), setLocale: (value: string) => { locale = value } } } +it('identifies the enabled provider if the native helper cannot report its platform', async () => { + const f = fixture() + const statuses: boolean[] = [] + onTestFinished(f.controller.state.subscribe(() => { statuses.push(f.controller.state.getSnapshot().windowsProvider.busy) })) + f.actions.systemStatus.mockRejectedValueOnce(new Error('helper missing')) + f.face.refresh() + await vi.waitFor(() => { expect(f.controller.state.getSnapshot().windowsProvider.value).toBe(true) }) + expect(f.controller.state.getSnapshot().system.error).toBe('helper missing') + f.face.refresh() + await vi.waitFor(() => { expect(f.controller.state.getSnapshot().system.value).toEqual(value) }) + expect(f.windowsProvider).toHaveBeenCalledOnce() + expect(statuses).toContain(true) + expect(statuses.at(-1)).toBe(false) +}) + +it('clears a superseded inventory read when native permissions become available', async () => { + const f = fixture() + const inventory = Promise.withResolvers<{ ok: true; value: boolean }>() + onTestFinished(() => { inventory.resolve({ ok: true, value: true }) }) + f.windowsProvider.mockImplementationOnce(() => inventory.promise) + f.actions.systemStatus.mockRejectedValueOnce(new Error('helper missing')) + f.face.refresh() + await vi.waitFor(() => { expect(f.controller.state.getSnapshot().windowsProvider.busy).toBe(true) }) + f.controller.setChanging(true) + expect(f.controller.state.getSnapshot().windowsProvider.busy).toBe(false) + f.controller.setChanging(false) + await vi.waitFor(() => { expect(f.controller.state.getSnapshot().system.value).toEqual(value) }) + inventory.resolve({ ok: true, value: true }) + await setImmediate() + expect(f.controller.state.getSnapshot().windowsProvider).toEqual({ value: null, busy: false, error: null }) +}) + it('refreshes after a request and then waits for an explicit refresh', async () => { vi.useFakeTimers() const f = fixture() diff --git a/packages/experimental/cua/tests/mount.client.spec.ts b/packages/experimental/cua/tests/mount.client.spec.ts index f350250e3b..29e7a77cf2 100644 --- a/packages/experimental/cua/tests/mount.client.spec.ts +++ b/packages/experimental/cua/tests/mount.client.spec.ts @@ -2,6 +2,8 @@ import assert from 'node:assert/strict' import { setImmediate } from 'node:timers/promises' import { Context, Service } from '@deepseek-ai/cordis' +import { brandString } from '@deepseek-ai/dsh-brand' +import type { PluginEntryId } from '@deepseek-ai/dsh-api-remotes/client' import { LocaleRuntime } from '@deepseek-ai/dsh-client-locale/client' import { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client' import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' @@ -35,6 +37,8 @@ async function fixture(fail = false) { } } new Remote() + const list = vi.fn() + await ctx.plugin((scope) => { scope.provide('remote.pluginInventory', { list }) }) const changes = createSnapshotStore(false) ctx.provide('pluginChanges', { bundle: (name) => { expect(name).toBe('@deepseek-ai/dsh-cua-bundle') @@ -59,11 +63,29 @@ async function fixture(fail = false) { 'conversation.composer': { kind: 'chain', scope: 'session' }, } } as never, () => null) if (fail) vi.spyOn(ctx.slots, 'inject').mockImplementationOnce(() => { throw new Error('slot unavailable') }) - return { ctx, changes, unmount, status, systemStatus, applicationIcons, + return { ctx, changes, unmount, status, systemStatus, applicationIcons, list, requestPermission, openSettings, revoke, retryApproval, } } +it('reads the Windows provider from the Host inventory when the helper cannot report permissions', async () => { + const f = await fixture() + try { + f.systemStatus.mockRejectedValue(new Error('helper missing')) + const failed = { ok: false, error: new RemoteError('gateway/internal', 'inventory unavailable', {}) } as const + f.list.mockResolvedValueOnce(failed).mockResolvedValue({ ok: true, value: { entries: [ + { moduleName: '@deepseek-ai/dsh-cua-windows', enabled: true, fiberPhase: 'failed', entryId: brandString('cua-windows') }, + ] } }) + await f.ctx.plugin({ inject: [...inject], apply: ctx => mountCuaPermissions(ctx, contribution) }) + const actions = f.ctx.slots.entries('plugins.bundle.config')[0]!.inject!() + actionsOf(actions) + actions.refresh() + await vi.waitFor(() => { expect(actions.hooks.cuaPermissions.getSnapshot().windowsProvider.error).toBe('inventory unavailable') }) + actions.refresh() + await vi.waitFor(() => { expect(actions.hooks.cuaPermissions.getSnapshot().windowsProvider.value).toBe(true) }) + } finally { await f.ctx.fiber.dispose() } +}) + it('withdraws the permission Remote and all controls with the optional plugin', async () => { const f = await fixture() try { diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index fb1bb5a48b..06adc38a76 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -22,6 +22,7 @@ function observe(value: CuaApplicationState & { system: CuaSystemPermissionState function fixture() { const state = createSnapshotStore({ + windowsProvider: { value: null, busy: false, error: null }, system: { value: null, busy: true, error: null }, applications: { value: null, busy: true, error: null }, icons: { value: null, busy: true, error: null }, busy: true, changing: false, toast: null, }) @@ -403,32 +404,72 @@ it.each([en, zh])('highlights the experimental notice and keeps the PTC recommen expect(ptc.compareDocumentPosition(heading) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() }) -it.each([true, false, null] as const)('shows Windows desktop access for lock state %s without macOS permission actions', (sessionLocked) => { +it.each([true, false, null] as const)('omits system permissions on Windows and places warnings above the experimental notice for lock=%s', (sessionLocked) => { const f = fixture() f.publish({ ...observe(value), system: { value: { platform: 'windows', sessionLocked, captureAvailable: true, elevated: false, helper: { path: 'C:\\helper.exe' } }, error: null, busy: false } }) render() - expect(screen.getByText(en.previewNoticeTitle)).toBeTruthy() - expect(screen.getByText(en.previewNotice)).toBeTruthy() - expect(screen.getByText(en.ptcRecommendation)).toBeTruthy() - expect(screen.getByText(en.windowsPermissionsIntro)).toBeTruthy() - expect(screen.queryByText(/helperPath/)).toBeNull() - expect(screen.queryByText(/pnpm run build:native/)).toBeNull() - const desktop = screen.getByRole('group', { name: en.windowsDesktop }) - const capture = screen.getByRole('group', { name: en.windowsCapture }) - expect(within(desktop).getByText(sessionLocked === null ? en.unknown : sessionLocked ? en.locked : en.available)).toBeTruthy() - expect(within(capture).getByText(sessionLocked === null ? en.unknown : sessionLocked ? en.unavailable : en.available)).toBeTruthy() - expect(screen.getByText(en.standardPrivileges, { exact: false })).toBeTruthy() - expect(screen.queryByRole('group', { name: en.accessibility })).toBeNull() + expect(screen.queryByRole('heading', { name: en.title })).toBeNull() + expect(screen.queryByRole('region', { name: en.title })).toBeNull() + expect(screen.queryByRole('group')).toBeNull() expect(screen.queryByRole('button', { name: en.request })).toBeNull() expect(screen.queryByRole('button', { name: en.granted })).toBeNull() expect(screen.queryByText('C:\\helper.exe')).toBeNull() + expect(screen.queryByText(/helperPath/)).toBeNull() + expect(screen.queryByText(/pnpm run build:native/)).toBeNull() + const experimental = screen.getByText(en.previewNoticeTitle) + const instructions = screen.getByText(en.windowsInstructions) + const privileges = screen.getByText(en.standardPrivileges) + const ptc = screen.getByText(en.ptcRecommendation) + expect(experimental.compareDocumentPosition(instructions) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(instructions.compareDocumentPosition(privileges) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(privileges.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + if (sessionLocked === true) { + const alert = screen.getByRole('alert') + expect(within(alert).getByText(en.windowsLockedTitle)).toBeTruthy() + expect(within(alert).getByText(en.windowsLockedBody)).toBeTruthy() + expect(alert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + } else if (sessionLocked === null) { + const alert = screen.getByRole('alert') + expect(within(alert).getByText(en.windowsSessionUnknownTitle)).toBeTruthy() + expect(within(alert).getByText(en.windowsSessionUnknown)).toBeTruthy() + expect(alert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + } else { + expect(screen.queryByRole('alert')).toBeNull() + } f.publish({ system: { value: { platform: 'windows', sessionLocked: false, captureAvailable: false, elevated: true, helper: {} }, error: null, busy: false } }) - expect(within(capture).getByText(en.unavailable)).toBeTruthy() - expect(screen.getByText(en.elevated, { exact: false })).toBeTruthy() + const adminAlert = screen.getByRole('alert') + expect(within(adminAlert).getByText(en.windowsElevatedTitle)).toBeTruthy() + expect(within(adminAlert).getByText(en.windowsElevatedWarning)).toBeTruthy() + expect(adminAlert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + const captureNotice = screen.getByText(en.windowsCaptureUnavailableTitle) + expect(screen.getByText(en.windowsCaptureUnavailableNotice)).toBeTruthy() + expect(captureNotice.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(screen.queryByText(en.standardPrivileges)).toBeNull() f.publish({ system: { ...f.state.getSnapshot().system, error: 'offline' } }) - expect(screen.getAllByText(en.unknown)).toHaveLength(2) + const helperAlert = screen.getByRole('alert') + expect(within(helperAlert).getByText(en.windowsHelperFailed.replace('{message}', 'offline'))).toBeTruthy() + expect(within(helperAlert).getByText(en.queryFailedHint)).toBeTruthy() + expect(helperAlert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(screen.queryByText(en.windowsElevatedTitle)).toBeNull() + expect(screen.queryByText(en.windowsCaptureUnavailableTitle)).toBeNull() + fireEvent.click(within(helperAlert).getByRole('button', { name: en.retry })) + expect(f.props.refresh).toHaveBeenCalledTimes(2) +}) + +it('shows the Windows helper warning above the experimental notice when startup fails before reporting platform', () => { + const f = fixture() + f.publish({ system: { value: null, error: 'Native helper not found', busy: false }, + windowsProvider: { value: true, error: null, busy: false } }) + render() + expect(screen.queryByRole('heading', { name: en.title })).toBeNull() + expect(screen.queryByRole('group')).toBeNull() + const alert = screen.getByRole('alert') + expect(within(alert).getByText(en.windowsHelperFailed.replace('{message}', 'Native helper not found'))).toBeTruthy() + expect(within(alert).getByText(en.queryFailedHint)).toBeTruthy() + const experimental = screen.getByText(en.previewNoticeTitle) + expect(alert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() }) it.each([[true, true], [false, true], [false, false], [null, true]] as const)('offers Windows setup for lock=%s and capture=%s', (sessionLocked, captureAvailable) => { From 72257d2bb2e321e32efb2c325e90dd68d7ccf679 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 14:49:24 +0800 Subject: [PATCH 05/17] fix(cua): unify helper-unavailable notice box and primary-ink warning titles --- .../cua/src/client/PermissionPanel.module.css | 37 +++++-------------- .../cua/src/client/PermissionPanel.tsx | 36 ++++++++---------- 2 files changed, 26 insertions(+), 47 deletions(-) diff --git a/packages/experimental/cua/src/client/PermissionPanel.module.css b/packages/experimental/cua/src/client/PermissionPanel.module.css index 2b2b1c9cb6..21d9e81507 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.module.css +++ b/packages/experimental/cua/src/client/PermissionPanel.module.css @@ -3,21 +3,23 @@ .guidance { display: grid; gap: 12px; overflow-wrap: anywhere; } .panelGuidance { margin-bottom: 12px; } .guidance p, .panel p { margin: 0; color: var(--dsw-alias-label-secondary); line-height: 1.6; } -.caution { +.caution, .dangerNotice { display: flex; + flex-wrap: wrap; align-items: flex-start; - gap: 8px; + justify-content: space-between; + gap: 12px; padding: 10px 12px; border-radius: var(--dsw-radius-md); - background: var(--dsw-alias-state-warn-tertiary); } -.dangerNotice { +.caution { background: var(--dsw-alias-state-warn-tertiary); } +.dangerNotice { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); } +.noticeMain { display: flex; align-items: flex-start; gap: 8px; - padding: 10px 12px; - border-radius: var(--dsw-radius-md); - background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); + flex: 1; + min-width: 180px; } .cautionIcon { display: inline-flex; @@ -36,31 +38,12 @@ flex-direction: column; gap: 4px; min-width: 0; + overflow-wrap: anywhere; } .cautionBody .cautionTitle { color: var(--dsw-alias-label-primary); font-weight: 500; } -.cautionBody .dangerTitle { - color: var(--dsw-alias-state-error-primary); - font-weight: 500; -} -.systemError { - display: flex; - flex-wrap: wrap; - align-items: flex-start; - justify-content: space-between; - gap: 12px; - padding: 10px 12px; - border-radius: var(--dsw-radius-md); - background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 8%, transparent); -} -.systemErrorBody { - display: grid; - gap: 4px; - flex: 1; - min-width: 180px; -} .card { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); } .card > * + * { border-top: 0.5px solid var(--dsw-alias-border-l3); } .panel h3 { margin: 0; font-size: 14px; font-weight: 500; } diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 933d219af7..45ad74d3a2 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -1,5 +1,5 @@ /** Native permission status and revocable application consent on the existing plugin page. */ -import { useEffect } from 'react' +import { useEffect, type ReactNode } from 'react' import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, IconWarningOutlineRegular, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' import { assertNever } from '@deepseek-ai/dsh-util-values' import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' @@ -85,19 +85,23 @@ function UnknownStatus({ loading, t }: Pick & { loading: b }) } -function NoticeBox({ tone, role, title, body }: { +function NoticeBox({ tone, role, title, body, action }: { tone: 'warn' | 'danger' role: 'note' | 'alert' title: string body: string + action?: ReactNode }) { const danger = tone === 'danger' return
- -
-

{title}

-

{body}

+
+ +
+

{title}

+

{body}

+
+ {action}
} @@ -107,13 +111,9 @@ function WindowsGuidance({ system, error, busy, refresh, t }: Pick - {error !== null &&
-
-

{t('windowsHelperFailed', { message: error })}

-

{t('queryFailedHint')}

-
- -
} + {error !== null && {t('retry')}} />} {error === null && system !== null && <> {system.sessionLocked === true && } @@ -167,13 +167,9 @@ export function PermissionPanel(props: PermissionProps) {

{t('ptcRecommendation')}

{t('title')}

- {state.system.error !== null &&
-
-

{t('queryFailed', { message: state.system.error })}

-

{t('queryFailedHint')}

-
- -
} + {state.system.error !== null && {t('retry')}} />} {(observed !== null || state.system.error === null) &&

Date: Wed, 25 Nov 2026 15:23:54 +0800 Subject: [PATCH 06/17] feat(cua): link PTC mode recommendation to Settings Agent presets --- apps/web/tests/cua-permissions.e2e.ts | 6 ++++ .../cua-permissions/missing.expected.md | 5 ++- .../ui-settings-general/README.i18n.yaml | 4 +-- packages/client/ui-settings-general/README.md | 2 +- .../client/ui-settings-general/README.zh.md | 2 +- .../ui-settings-general/src/client/index.ts | 21 +++++++++++- .../tests/apply.client.spec.ts | 15 +++++++++ packages/experimental/cua/README.i18n.yaml | 4 +-- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- packages/experimental/cua/package.json | 3 +- .../cua/src/client/PermissionPanel.module.css | 16 ++++++++++ .../cua/src/client/PermissionPanel.tsx | 32 ++++++++++++++++--- .../experimental/cua/src/client/locales.ts | 24 +++++++++----- packages/experimental/cua/src/client/mount.ts | 20 +++++++++++- .../cua/tests/mount.client.spec.ts | 29 +++++++++++++++++ .../cua/tests/panel.client.spec.tsx | 24 +++++++++----- .../experimental/cua/tsconfig.client.json | 3 ++ pnpm-lock.yaml | 3 ++ scripts/gen-cordis-catalog.ts | 1 + 20 files changed, 185 insertions(+), 33 deletions(-) diff --git a/apps/web/tests/cua-permissions.e2e.ts b/apps/web/tests/cua-permissions.e2e.ts index 825012939f..5c7fa5aa9c 100644 --- a/apps/web/tests/cua-permissions.e2e.ts +++ b/apps/web/tests/cua-permissions.e2e.ts @@ -170,6 +170,12 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr await expect.poll(() => accessibility.locator('img').evaluate((image: HTMLImageElement) => image.naturalWidth)).toBe(1) await expect.poll(() => panel.getAttribute('aria-busy')).toBe('false') await compareOrRefreshGolden(expected, await captureStableAria(page, '[data-cua-settings]', scaffold.workspaceCwd), webSnapshotMode()) + await panel.getByRole('button', { name: 'PTC mode', exact: true }).click() + const settingsDialog = page.getByRole('dialog', { name: 'Settings', exact: true }) + await settingsDialog.waitFor() + expect(await settingsDialog.getByRole('button', { name: 'Agent presets', exact: true }).getAttribute('aria-current')).toBe('true') + await page.keyboard.press('Escape') + await settingsDialog.waitFor({ state: 'hidden' }) try { for (const width of [1680, 390]) { await page.setViewportSize({ width, height: 1000 }) diff --git a/apps/web/tests/expected/cua-permissions/missing.expected.md b/apps/web/tests/expected/cua-permissions/missing.expected.md index 835fdc977b..b3ea362800 100644 --- a/apps/web/tests/expected/cua-permissions/missing.expected.md +++ b/apps/web/tests/expected/cua-permissions/missing.expected.md @@ -2,7 +2,10 @@ - note: - paragraph: Experimental feature - paragraph: Computer use is experimental and results are not guaranteed. The agent may click the wrong button or type in the wrong window. Use caution in important or production environments. - - paragraph: We recommend using PTC mode so the agent can operate apps and call other tools in the same program. + - paragraph: + - text: We recommend using + - button "PTC mode" + - text: so the agent can operate apps and call other tools in the same program. - heading "System permissions" [level=3] - paragraph: "Computer use requires the following system permissions to run:" - group "Accessibility": diff --git a/packages/client/ui-settings-general/README.i18n.yaml b/packages/client/ui-settings-general/README.i18n.yaml index a2a637d92f..06198397bf 100644 --- a/packages/client/ui-settings-general/README.i18n.yaml +++ b/packages/client/ui-settings-general/README.i18n.yaml @@ -15,8 +15,8 @@ en: c70d04baca0434f1 zh: e0361f83e76dd846 /deepseek-ai-dsh-client-ui-settings-general/use-this-package: - en: 2b3320655142ffdf - zh: 20dde077885f62aa + en: 07ace7bbc5588e78 + zh: 5fe17edbe0d05b19 /deepseek-ai-dsh-client-ui-settings-general/use-this-package/the-general-section: en: 3cc285b666850b78 zh: 3604a582f112d61e diff --git a/packages/client/ui-settings-general/README.md b/packages/client/ui-settings-general/README.md index 292b912d39..46f108e0ae 100644 --- a/packages/client/ui-settings-general/README.md +++ b/packages/client/ui-settings-general/README.md @@ -41,7 +41,7 @@ When the section navigation exceeds the panel's available height, the list scrol In Desktop, the account-row update control shows availability, progress, verification, readiness, and persistent retry feedback. It shares the connection indicator’s 28px height, 8px corners, 14px icon slot, 4px icon gap, and 12px medium text with an 18px line height; update-state border, fill, and text colors remain independently defined. Retry text and its dot use the same brand blue as other update labels; numeric download progress has no ellipsis and uses tabular digits with space for three digits and the percent sign to keep its width stable. The preload carries semantic phase, version, progress, and classified failures; the component resolves every visible and accessible string from the active `settings` locale, including after an in-application language change. Selecting the download percentage opens the shell’s download-status dialog; closing it leaves the download running. Selecting an available update starts downloading; installation requires a separate shell-owned confirmation. A collapsed sidebar shows the same status as a brand-blue dot on its top expand button, including failures. Connection feedback takes priority except during shell-reported installation, when the expected backend disconnect must not hide update status. Failure restores connection feedback. Both controls share one carrier subscription; browser code cannot choose packages or authorize installation. [Desktop updates](../../../apps/desktop/README.md) owns the release workflow. Checking, verifying, and preparing-to-restart tooltips show only the supplied version; without a version, they retain the state label. Desktop update tooltips preserve the complete version and prerelease suffix without adding v or V; their error summaries match the shell update dialogs, including guidance to exit fullscreen and retry after a fullscreen-transition timeout. -Settings visibility and section selection live in the shell owner store. The shell supplies the effective Settings binding to the contributed launcher for menu keycaps and `aria-keyshortcuts`; the fallback button uses the same binding for hover and keyboard-focus hints and `aria-keyshortcuts`. The Settings command (Desktop: `Mod+,`; Windows/macOS Web: `Mod+Alt+,`) toggles the dialog when Settings is in front or no modal is open; the sidebar control opens the same dialog. The command cannot open or close Settings while the shortcut reference or another modal is in front. Held-key repeats do nothing. The account menu opens General settings; closing the dialog clears the section selection. Onboarding can open a specified section. Initial focus lands on the selected section in the navigation, or on the title when no sections are available, without drawing a focus outline. The section buttons precede header actions and Close in the Tab order. Tab and directional navigation retain their visible focus indicators. `Mod+/` can open the shortcut reference above Settings; `Escape` closes the top dialog and restores focus to its invoking control. Return focus omits outlines after shortcut, Escape, or pointer dismissal. +Settings visibility and section selection live in the shell owner store. While the Settings shell has access to `settings/describe`, it provides the optional `settingsNavigation` service so other Client plugins can open Settings or jump directly to a contributed `settings.section` id via `open(sectionId?)`. The shell supplies the effective Settings binding to the contributed launcher for menu keycaps and `aria-keyshortcuts`; the fallback button uses the same binding for hover and keyboard-focus hints and `aria-keyshortcuts`. The Settings command (Desktop: `Mod+,`; Windows/macOS Web: `Mod+Alt+,`) toggles the dialog when Settings is in front or no modal is open; the sidebar control opens the same dialog. The command cannot open or close Settings while the shortcut reference or another modal is in front. Held-key repeats do nothing. The account menu opens General settings; closing the dialog clears the section selection. Onboarding can open a specified section. Initial focus lands on the selected section in the navigation, or on the title when no sections are available, without drawing a focus outline. The section buttons precede header actions and Close in the Tab order. Tab and directional navigation retain their visible focus indicators. `Mod+/` can open the shortcut reference above Settings; `Escape` closes the top dialog and restores focus to its invoking control. Return focus omits outlines after shortcut, Escape, or pointer dismissal. ### The General section diff --git a/packages/client/ui-settings-general/README.zh.md b/packages/client/ui-settings-general/README.zh.md index 77f4e4cc4f..bc36a4b842 100644 --- a/packages/client/ui-settings-general/README.zh.md +++ b/packages/client/ui-settings-general/README.zh.md @@ -41,7 +41,7 @@ kind: "package-reference" 在 Desktop 中,账户行更新控件显示可用版本、进度、验证、就绪和持久重试反馈。它与连接指示器共用 28px 高度、8px 圆角、14px 图标占位、4px 图文间距,以及 12px 中等字重文字和 18px 行高;更新状态的边框、填充和文字颜色独立定义。重试文字及其圆点与其他更新文案使用相同的品牌蓝色;数字下载进度不带省略号,采用等宽数字并预留三位数字及百分号的空间,使宽度保持稳定。预加载仅传递语义化阶段、版本、进度和失败类别;组件从当前 `settings` locale 解析全部可见与无障碍文案,并在应用内语言变化后同步更新。选择下载百分比会打开壳的下载状态提示,关闭提示不影响下载。选择可用更新即开始下载;安装需要独立的壳拥有的确认。侧栏收起时,其顶部展开按钮以品牌蓝色圆点显示相同状态,包括失败状态。连接反馈通常优先展示,但壳报告正在安装时,预期的后端断开不能遮盖更新状态;失败后恢复连接反馈。两个控件共用一次载体订阅;浏览器代码不能选择安装包或授权安装。[Desktop 更新](../../../apps/desktop/README.zh.md)负责发布流程。检查中、校验中和准备重启状态的悬浮提示只显示已提供的版本号;没有版本号时保留状态文案。桌面更新提示完整保留版本号及预发布后缀,不额外添加 v 或 V;错误提示与桌面升级弹窗保持一致,包括全屏切换超时后退出全屏并重试的指引。 -设置的可见状态和分区选择由 shell owner store 保存。外壳将设置命令的有效绑定传给入口贡献,用于菜单键帽和 `aria-keyshortcuts`;回退按钮使用相同绑定提供悬停、键盘聚焦提示和 `aria-keyshortcuts`。设置位于最前方或没有模态弹窗时,设置命令(Desktop 为 `Mod+,`,Windows/macOS Web 为 `Mod+Alt+,`)切换设置弹窗的开关;侧栏控件打开同一弹窗。快捷键速查或其他模态弹窗位于前方时,该命令不能打开或关闭设置。长按产生的重复按键不执行操作。账号菜单打开通用设置;关闭弹窗会清空分区选择。引导流程可以打开指定分区。初始焦点落在导航中选中的分区;没有可用分区时落在标题上,均不绘制焦点外轮廓线。Tab 顺序中,分区按钮先于头部操作和关闭按钮。Tab 和方向键导航保留可见焦点提示。`Mod+/` 可在设置上方打开快捷键速查;`Escape` 关闭最上层弹窗,焦点返回触发该弹窗的控件。通过快捷键、Esc 或鼠标关闭后的回焦均不绘制外轮廓线。 +设置的可见状态和分区选择由 shell owner store 保存。当设置外壳具备 `settings/describe` 权限时,它提供可选的 `settingsNavigation` 服务,供其他 Client 插件通过 `open(sectionId?)` 打开设置或直接跳转到指定的 `settings.section` 分区。外壳将设置命令的有效绑定传给入口贡献,用于菜单键帽和 `aria-keyshortcuts`;回退按钮使用相同绑定提供悬停、键盘聚焦提示和 `aria-keyshortcuts`。设置位于最前方或没有模态弹窗时,设置命令(Desktop 为 `Mod+,`,Windows/macOS Web 为 `Mod+Alt+,`)切换设置弹窗的开关;侧栏控件打开同一弹窗。快捷键速查或其他模态弹窗位于前方时,该命令不能打开或关闭设置。长按产生的重复按键不执行操作。账号菜单打开通用设置;关闭弹窗会清空分区选择。引导流程可以打开指定分区。初始焦点落在导航中选中的分区;没有可用分区时落在标题上,均不绘制焦点外轮廓线。Tab 顺序中,分区按钮先于头部操作和关闭按钮。Tab 和方向键导航保留可见焦点提示。`Mod+/` 可在设置上方打开快捷键速查;`Escape` 关闭最上层弹窗,焦点返回触发该弹窗的控件。通过快捷键、Esc 或鼠标关闭后的回焦均不绘制外轮廓线。 ### 「通用」分区 diff --git a/packages/client/ui-settings-general/src/client/index.ts b/packages/client/ui-settings-general/src/client/index.ts index 21710ffe46..ab516cbcaf 100644 --- a/packages/client/ui-settings-general/src/client/index.ts +++ b/packages/client/ui-settings-general/src/client/index.ts @@ -70,6 +70,19 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { } } +declare module '@deepseek-ai/cordis' { + interface Context { + /** Cross-plugin navigation to the Settings modal. */ + settingsNavigation: { + /** + * Open Settings, optionally selecting a contributed section by id. + * @param sectionId - optional `settings.section` registration id. + */ + open(sectionId?: string): void + } + } +} + /** Dictionary namespace owned by this plugin (shell chrome + General copy). */ const NS = 'settings' @@ -292,7 +305,13 @@ export function apply(ctx: ClientContext): void { }, inject: shellInjected, }, SettingsRoot) - return () => { disposeCommand(); disposeSlot() } + const disposeNavigation = ctx.reflect.provide('settingsNavigation', { + open: (sectionId?: string) => { + if (sectionId === undefined) shellInstance.actions.open() + else shellInstance.actions.openSection(sectionId) + }, + }) + return () => { void disposeNavigation(); disposeCommand(); disposeSlot() } })) ctx.slots.inject('settings.trigger', () => diff --git a/packages/client/ui-settings-general/tests/apply.client.spec.ts b/packages/client/ui-settings-general/tests/apply.client.spec.ts index cadf647d8e..2c06f322f1 100644 --- a/packages/client/ui-settings-general/tests/apply.client.spec.ts +++ b/packages/client/ui-settings-general/tests/apply.client.spec.ts @@ -430,4 +430,19 @@ describe('ui-settings-general apply', () => { await c.flush() expect(overlay()).toBeUndefined() }) + + it('exposes settingsNavigation for cross-plugin section jumps and removes it on unload', async ({ mock, start }) => { + const { c } = await client(mock, start) + const store = c.ctx.slots.entries('sidebar.settings')[0]!.store + if (store === undefined || !('create' in store)) throw new Error('expected root store handle') + const shell = store.create() + expect(shell.getSnapshot()).toEqual({ open: false, activeId: undefined }) + c.ctx.settingsNavigation.open() + expect(shell.getSnapshot()).toEqual({ open: true, activeId: undefined }) + c.ctx.settingsNavigation.open('agent-presets') + expect(shell.getSnapshot()).toEqual({ open: true, activeId: 'agent-presets' }) + await c.unload(SELF) + await c.flush() + expect(c.ctx.get('settingsNavigation')).toBeUndefined() + }) }) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 720b943538..8e64e3a68e 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: 01518dfb2e7a622d - zh: 53ea58cfa19bbd1b + en: abb42615f37267fa + zh: 6a3fc3da94464d83 /deepseek-ai-dsh-cua/understand-the-implementation: en: 0bb61400e72a836a zh: b60cb64e5ce36394 diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index b556c2ef86..e534a7198f 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -70,7 +70,7 @@ On the Computer Use detail page, permission cards, component rows, and source fa The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **System permissions** introduces the required permissions and groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. -The enabled bundle highlights the experimental notice and places the PTC recommendation in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. +The enabled bundle highlights the experimental notice and places the PTC recommendation in a separate paragraph; when Settings and Agent presets are available, **PTC mode** acts as an inline link that opens **Settings → Agent presets**. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. The page refreshes on entry, window focus, and completed actions. System-permission query failures appear directly beneath the section heading with recovery guidance and **Retry**, while retaining the last observation as unknown. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index d8bf648afc..a6e7580b0b 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -70,7 +70,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 [Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限”先说明运行所需权限,再将辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 -启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 +启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议;设置与 Agent 预设可用时,其中的“PTC 模式”为行内链接,点击直接打开**设置 → Agent 预设**。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 进入页面、返回窗口和操作结束后会刷新状态。系统权限检查失败直接显示在分组标题下方,附带排查建议与“重试”,同时将上次观测标为未确认。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 diff --git a/packages/experimental/cua/package.json b/packages/experimental/cua/package.json index e85a2f43af..63a3ff2940 100644 --- a/packages/experimental/cua/package.json +++ b/packages/experimental/cua/package.json @@ -167,7 +167,8 @@ "@deepseek-ai/dsh-storage-json": "workspace:*", "@deepseek-ai/dsh-client-ui-user-questions": "workspace:*", "@deepseek-ai/dsh-client-ui-approval": "workspace:*", - "@deepseek-ai/dsh-client-ui-conversation": "workspace:*" + "@deepseek-ai/dsh-client-ui-conversation": "workspace:*", + "@deepseek-ai/dsh-client-ui-settings-general": "workspace:*" }, "dsh": { "client": { diff --git a/packages/experimental/cua/src/client/PermissionPanel.module.css b/packages/experimental/cua/src/client/PermissionPanel.module.css index 21d9e81507..8524255c0f 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.module.css +++ b/packages/experimental/cua/src/client/PermissionPanel.module.css @@ -44,6 +44,22 @@ color: var(--dsw-alias-label-primary); font-weight: 500; } +.inlineLink { + display: inline; + padding: 0; + border: 0; + background: transparent; + color: var(--dsw-alias-link); + font: inherit; + text-decoration: underline; + text-underline-offset: 2px; + cursor: pointer; +} +.inlineLink:focus-visible { + outline: 2px solid var(--dsw-alias-link); + outline-offset: 2px; + border-radius: var(--dsw-radius-xs); +} .card { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); } .card > * + * { border-top: 0.5px solid var(--dsw-alias-border-l3); } .panel h3 { margin: 0; font-size: 14px; font-weight: 500; } diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 45ad74d3a2..99af359d2f 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -2,6 +2,7 @@ import { useEffect, type ReactNode } from 'react' import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, IconWarningOutlineRegular, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' import { assertNever } from '@deepseek-ai/dsh-util-values' +import type { SnapshotStore } from '@deepseek-ai/dsh-client-store' import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' import type { CuaApplicationGrant, CuaSystemPermissionState } from '../access-types.ts' @@ -12,6 +13,12 @@ import css from './PermissionPanel.module.css' /** Renderer-bound permission observation and localized controls. */ export type PermissionProps = InjectFace & PropsLocale +/** Permission page controls plus optional Settings navigation to Agent presets. */ +export type PermissionPanelProps = PermissionProps & InjectFace<{ + hooks: { canOpenPresets: SnapshotStore } + openPresets: () => void +}> + /** Permission guidance only navigates to the existing bundle details. */ export type PermissionSetupProps = PermissionProps & Pick, 'onDismiss' | 'onOpenDetails'> @@ -105,10 +112,23 @@ function NoticeBox({ tone, role, title, body, action }: {

} -function WindowsGuidance({ system, error, busy, refresh, t }: Pick & { +function PtcRecommendation({ canOpenPresets, openPresets, t }: Pick & { + canOpenPresets: boolean +}) { + const [before, after] = t('ptcRecommendation').split('{ptcMode}') + const label = t('ptcModeLink') + return

+ {before} + {canOpenPresets ? : label} + {after} +

+} + +function WindowsGuidance({ system, error, busy, refresh, canOpenPresets, openPresets, t }: Pick & { system: Extract | null error: string | null busy: boolean + canOpenPresets: boolean }) { return
{error !== null &&

{t('windowsInstructions')}

{error === null && system !== null && !system.elevated &&

{t('standardPrivileges')}

} -

{t('ptcRecommendation')}

+
} @@ -141,9 +161,10 @@ function systemReady(system: CuaSystemPermissionState): boolean { } /** @param props Host observation and explicit user actions. @returns Permission controls without automatic system prompts. */ -export function PermissionPanel(props: PermissionProps) { +export function PermissionPanel(props: PermissionPanelProps) { const { t, refresh } = props const state = props.useCuaPermissions(value => value) + const canOpenPresets = props.useCanOpenPresets(value => value) const observed = state.system.value const windows = observed?.platform === 'windows' || (observed === null && state.windowsProvider.value === true) const apps = state.applications.value @@ -160,11 +181,12 @@ export function PermissionPanel(props: PermissionProps) { return () => { window.removeEventListener('focus', refresh) } }, [refresh]) return
- {windows ? + {windows ? :
-

{t('ptcRecommendation')}

+

{t('title')}

{state.system.error !== null && = { previewNoticeTitle: '实验性功能提示', previewNotice: '自动电脑操作仍处于实验阶段,不保证操作结果。智能体可能误点按钮或在错误的窗口中输入内容,请谨慎在重要或生产环境中使用。', - ptcRecommendation: '建议配合 PTC 模式使用,让智能体在同一段代码中完成应用操作并调用其他工具。', + ptcModeLink: 'PTC 模式', + ptcRecommendation: '建议配合 {ptcMode} 使用,让智能体在同一段代码中完成应用操作并调用其他工具。', approvalRisks: '风险提示', approvalRiskTitle: '自动电脑操作风险提示', approvalRiskNotice: '智能体只能访问你已授权的应用,并可在后台读取应用内容、操作应用。\n\n网络游戏、即时通讯等应用可能对自动化操作有所限制。违反相关规则可能导致你在该应用中的账号被暂停使用或封禁。\n\n请自行承担使用风险。如需停止自动化操作,可随时点击 DeepSeek Harness 中的停止按钮。', @@ -92,7 +94,8 @@ export const zh: Record = { export const ja = { previewNoticeTitle: '実験的機能について', previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', - ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', + ptcModeLink: 'PTC モード', + ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、{ptcMode} の使用をおすすめします。', windowsSetupTitle: 'デスクトップ実行環境を確認', windowsSetupBody: 'デスクトップがロックされています。ロックを解除して再試行してください。', windowsSessionUnknownTitle: 'デスクトップセッションを利用できません', @@ -150,7 +153,8 @@ export const ja = { export const es = { previewNoticeTitle: 'Función experimental', previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', - ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', + ptcModeLink: 'modo PTC', + ptcRecommendation: 'Recomendamos usar el {ptcMode} para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', windowsSetupTitle: 'Comprobar el entorno del escritorio', windowsSetupBody: 'El escritorio está bloqueado. Desbloquéalo e inténtalo de nuevo.', windowsSessionUnknownTitle: 'Sesión de escritorio no disponible', @@ -194,7 +198,8 @@ export const es = { export const fr = { previewNoticeTitle: 'Fonctionnalité expérimentale', previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', - ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', + ptcModeLink: 'mode PTC', + ptcRecommendation: 'Nous recommandons d’utiliser le {ptcMode} afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', windowsSetupTitle: 'Vérifier l’environnement de bureau', windowsSetupBody: 'Le bureau est verrouillé. Déverrouillez-le puis réessayez.', windowsSessionUnknownTitle: 'Session de bureau indisponible', @@ -238,7 +243,8 @@ export const fr = { export const de = { previewNoticeTitle: 'Experimentelle Funktion', previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', - ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', + ptcModeLink: 'PTC-Modus', + ptcRecommendation: 'Wir empfehlen den {ptcMode}, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', windowsSetupTitle: 'Desktopumgebung prüfen', windowsSetupBody: 'Der Desktop ist gesperrt. Entsperren Sie ihn und versuchen Sie es erneut.', windowsSessionUnknownTitle: 'Desktopsitzung nicht verfügbar', @@ -282,7 +288,8 @@ export const de = { export const ru = { previewNoticeTitle: 'Экспериментальная функция', previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', - ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', + ptcModeLink: 'режим PTC', + ptcRecommendation: 'Рекомендуем использовать {ptcMode}, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', windowsSetupTitle: 'Проверить среду рабочего стола', windowsSetupBody: 'Рабочий стол заблокирован. Разблокируйте его и повторите попытку.', windowsSessionUnknownTitle: 'Сеанс рабочего стола недоступен', @@ -326,7 +333,8 @@ export const ru = { export const pt = { previewNoticeTitle: 'Recurso experimental', previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', - ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', + ptcModeLink: 'modo PTC', + ptcRecommendation: 'Recomendamos usar o {ptcMode} para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', windowsSetupTitle: 'Verificar ambiente da área de trabalho', windowsSetupBody: 'A área de trabalho está bloqueada. Desbloqueie-a e tente novamente.', windowsSessionUnknownTitle: 'Sessão de área de trabalho indisponível', diff --git a/packages/experimental/cua/src/client/mount.ts b/packages/experimental/cua/src/client/mount.ts index cf86dc9f02..331104abda 100644 --- a/packages/experimental/cua/src/client/mount.ts +++ b/packages/experimental/cua/src/client/mount.ts @@ -7,6 +7,8 @@ import type {} from '@deepseek-ai/dsh-client-locale/client' import type {} from '@deepseek-ai/dsh-client-ui-renderer/client' import type {} from '@deepseek-ai/dsh-client-ui-layout/client' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' +import type {} from '@deepseek-ai/dsh-client-ui-settings-general/client' +import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' import type { ComposerChainProps } from '@deepseek-ai/dsh-client-ui-conversation/client' import { ApplicationApproval, selectApplicationApproval } from './ApplicationApproval.tsx' import { PermissionController } from './controller.ts' @@ -55,8 +57,24 @@ export async function mountCuaPermissions(ctx: Context, contribution: TypertRemo }) ctx.effect(() => () => controller.dispose()) ctx.on('connection/reset', face.refresh) + const canOpenPresets = createSnapshotStore(false) + ctx.inject(['settingsNavigation'], (scope) => { + const sync = () => { + canOpenPresets.set(ctx.slots.entries('settings.section').some(entry => entry.options.id === 'agent-presets')) + } + sync() + scope.effect(() => { + const off = ctx.slots.subscribe('settings.section', sync) + return () => { off(); canOpenPresets.set(false) } + }) + }) ctx.slots.inject('plugins.bundle.config', () => ctx.slots.register({ - name: 'plugins.bundle.config', key: '@deepseek-ai/dsh-cua-bundle', locale: NS, inject: () => face, + name: 'plugins.bundle.config', key: '@deepseek-ai/dsh-cua-bundle', locale: NS, + inject: () => ({ + ...face, + hooks: { ...face.hooks, canOpenPresets }, + openPresets: () => { ctx.get('settingsNavigation')?.open('agent-presets') }, + }), }, PermissionPanel)) ctx.slots.inject('plugins.bundle.activation', () => ctx.slots.register({ name: 'plugins.bundle.activation', key: '@deepseek-ai/dsh-cua-bundle', locale: NS, inject: () => face, diff --git a/packages/experimental/cua/tests/mount.client.spec.ts b/packages/experimental/cua/tests/mount.client.spec.ts index 29e7a77cf2..66421c7f21 100644 --- a/packages/experimental/cua/tests/mount.client.spec.ts +++ b/packages/experimental/cua/tests/mount.client.spec.ts @@ -61,6 +61,7 @@ async function fixture(fail = false) { 'plugins.bundle.activation': { kind: 'keyed', scope: 'root' }, 'plugins.bundle.config': { kind: 'keyed', scope: 'root' }, 'shell.overlay': { kind: 'list', scope: 'root' }, 'conversation.composer': { kind: 'chain', scope: 'session' }, + 'settings.section': { kind: 'list', scope: 'root' }, } } as never, () => null) if (fail) vi.spyOn(ctx.slots, 'inject').mockImplementationOnce(() => { throw new Error('slot unavailable') }) return { ctx, changes, unmount, status, systemStatus, applicationIcons, list, @@ -68,6 +69,34 @@ async function fixture(fail = false) { } } +it('enables the PTC mode link only while settings navigation and the Agent presets section are mounted', async () => { + const f = await fixture() + try { + await f.ctx.plugin({ inject: [...inject], apply: ctx => mountCuaPermissions(ctx, contribution) }) + const injected = f.ctx.slots.entries('plugins.bundle.config')[0]!.inject!() as { + hooks: { canOpenPresets: { getSnapshot(): boolean } } + openPresets(): void + } + expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) + injected.openPresets() + const open = vi.fn() + const navFiber = f.ctx.plugin((scope) => { scope.provide('settingsNavigation', { open }) }) + await navFiber + expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) + const disposeSection = f.ctx.slots.register({ name: 'settings.section', id: 'agent-presets' } as never, () => null) + await vi.waitFor(() => { expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(true) }) + injected.openPresets() + expect(open).toHaveBeenCalledExactlyOnceWith('agent-presets') + disposeSection() + await vi.waitFor(() => { expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) }) + const disposeAgain = f.ctx.slots.register({ name: 'settings.section', id: 'agent-presets' } as never, () => null) + await vi.waitFor(() => { expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(true) }) + await navFiber.dispose() + expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) + disposeAgain() + } finally { await f.ctx.fiber.dispose() } +}) + it('reads the Windows provider from the Host inventory when the helper cannot report permissions', async () => { const f = await fixture() try { diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index 06adc38a76..4112e66f99 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -5,7 +5,7 @@ import { bindSnapshotSelector, makeTranslate } from '@deepseek-ai/dsh-client-tes import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' import type { CuaApplicationId, CuaApplicationState, CuaSystemPermissionState } from '../src/access-types.ts' import { afterEach, expect, it, vi } from 'vitest' -import { PermissionPanel, PermissionSetup, PermissionToast, type PermissionProps } from '../src/client/PermissionPanel.tsx' +import { PermissionPanel, PermissionSetup, PermissionToast, type PermissionPanelProps } from '../src/client/PermissionPanel.tsx' import type { PermissionView } from '../src/client/controller.ts' import { en, zh } from '../src/client/locales.ts' @@ -26,13 +26,15 @@ function fixture() { system: { value: null, busy: true, error: null }, applications: { value: null, busy: true, error: null }, icons: { value: null, busy: true, error: null }, busy: true, changing: false, toast: null, }) + const canOpenPresets = createSnapshotStore(false) const refresh = vi.fn() - const props = { useCuaPermissions: bindSnapshotSelector(state), t: makeTranslate(en), - refresh, request: vi.fn(), openSettings: vi.fn(), revoke: vi.fn(), + const props = { useCuaPermissions: bindSnapshotSelector(state), useCanOpenPresets: bindSnapshotSelector(canOpenPresets), + t: makeTranslate(en), refresh, request: vi.fn(), openSettings: vi.fn(), openPresets: vi.fn(), revoke: vi.fn(), retryApproval: vi.fn(), dismissToast: vi.fn(), - } satisfies PermissionProps - return { state, props, + } satisfies PermissionPanelProps + return { state, canOpenPresets, props, publish(patch: Partial) { act(() => { state.set({ ...state.getSnapshot(), ...patch }) }) }, + setPresetsAvailable(available: boolean) { act(() => { canOpenPresets.set(available) }) }, } } @@ -397,11 +399,17 @@ it.each([en, zh])('highlights the experimental notice and keeps the PTC recommen const note = screen.getByRole('note') expect(within(note).getByText(dictionary.previewNoticeTitle)).toBeTruthy() expect(within(note).getByText(dictionary.previewNotice)).toBeTruthy() - expect(within(note).queryByText(dictionary.ptcRecommendation)).toBeNull() - const ptc = screen.getByText(dictionary.ptcRecommendation) + const fullPtc = dictionary.ptcRecommendation.replace('{ptcMode}', dictionary.ptcModeLink) + expect(within(note).queryByText(fullPtc)).toBeNull() + const ptc = screen.getByText(fullPtc) const heading = screen.getByRole('heading', { name: dictionary.title }) expect(note.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(ptc.compareDocumentPosition(heading) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(screen.queryByRole('button', { name: dictionary.ptcModeLink })).toBeNull() + f.setPresetsAvailable(true) + const link = screen.getByRole('button', { name: dictionary.ptcModeLink }) + fireEvent.click(link) + expect(f.props.openPresets).toHaveBeenCalledOnce() }) it.each([true, false, null] as const)('omits system permissions on Windows and places warnings above the experimental notice for lock=%s', (sessionLocked) => { @@ -420,7 +428,7 @@ it.each([true, false, null] as const)('omits system permissions on Windows and p const experimental = screen.getByText(en.previewNoticeTitle) const instructions = screen.getByText(en.windowsInstructions) const privileges = screen.getByText(en.standardPrivileges) - const ptc = screen.getByText(en.ptcRecommendation) + const ptc = screen.getByText(en.ptcRecommendation.replace('{ptcMode}', en.ptcModeLink)) expect(experimental.compareDocumentPosition(instructions) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(instructions.compareDocumentPosition(privileges) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(privileges.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() diff --git a/packages/experimental/cua/tsconfig.client.json b/packages/experimental/cua/tsconfig.client.json index 18ecf577b6..e1c704ea1a 100644 --- a/packages/experimental/cua/tsconfig.client.json +++ b/packages/experimental/cua/tsconfig.client.json @@ -57,6 +57,9 @@ }, { "path": "../../client/ui-conversation/tsconfig.client.json" + }, + { + "path": "../../client/ui-settings-general/tsconfig.client.json" } ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bfc297f736..e88683a6cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11203,6 +11203,9 @@ importers: '@deepseek-ai/dsh-client-ui-renderer': specifier: workspace:* version: link:../../client/ui-renderer + '@deepseek-ai/dsh-client-ui-settings-general': + specifier: workspace:* + version: link:../../client/ui-settings-general '@deepseek-ai/dsh-client-ui-slots': specifier: workspace:* version: link:../../client/ui-slots diff --git a/scripts/gen-cordis-catalog.ts b/scripts/gen-cordis-catalog.ts index b47c105403..0f826ffb2f 100644 --- a/scripts/gen-cordis-catalog.ts +++ b/scripts/gen-cordis-catalog.ts @@ -230,6 +230,7 @@ export const SERVICE_WALK_EXEMPTIONS: Record = { conversation: 'client-side interface-typed browser service — packages/client/ui-conversation/README.md owns the API', layout: 'client-side interface-typed browser service — packages/client/ui-layout/README.md owns the API', pluginNavigation: 'client-side bundle navigation — packages/client/ui-plugin-manager/README.md owns the API', + settingsNavigation: 'client-side settings modal navigation — packages/client/ui-settings-general/README.md owns the API', pluginChanges: 'client-side read-only management activity — packages/client/ui-plugin-manager/README.md owns the API', accountSignIn: 'client-side account sign-in entry — packages/client/ui-settings-account/README.md owns the API', locale: 'client-side interface-typed browser service — packages/client/locale/README.md owns the API', From 29cc55c76f56ce8f07eac962897b2cd46d1fcf28 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 16:21:22 +0800 Subject: [PATCH 07/17] fix(ui-plugin-manager): skip activation popup when enabling from bundle detail page --- apps/web/tests/cua-optin.e2e.ts | 5 +---- apps/web/tests/cua-permissions.e2e.ts | 3 +-- packages/client/ui-plugin-manager/README.i18n.yaml | 4 ++-- packages/client/ui-plugin-manager/README.md | 2 +- packages/client/ui-plugin-manager/README.zh.md | 2 +- .../ui-plugin-manager/src/client/PluginManagerPage.tsx | 2 +- .../ui-plugin-manager/tests/components.client.spec.tsx | 3 +-- packages/experimental/cua/README.i18n.yaml | 4 ++-- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- 10 files changed, 12 insertions(+), 17 deletions(-) diff --git a/apps/web/tests/cua-optin.e2e.ts b/apps/web/tests/cua-optin.e2e.ts index 32292093d8..5908a57353 100644 --- a/apps/web/tests/cua-optin.e2e.ts +++ b/apps/web/tests/cua-optin.e2e.ts @@ -231,12 +231,9 @@ it.skipIf(process.platform !== 'darwin').each([ expect(await readFile(settingsPath, 'utf8')).toBe(saved) await toggle.click() await toggle.and(page.locator('[aria-checked="true"]')).waitFor({ state: 'visible' }) - await setup.waitFor() - expect(await setup.getByText('“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', { exact: true }).count()).toBe(1) expect(scaffold.ctx.agentPresets.defaultId).toBe(initialDefault) - await setup.getByRole('button', { name: '前往设置', exact: true }).click() - await setup.waitFor({ state: 'hidden' }) await page.getByRole('region', { name: '系统权限', exact: true }).getByRole('alert').waitFor() + expect(await setup.count()).toBe(0) expect(await readFile(settingsPath, 'utf8')).toBe(saved) expect(scaffold.ctx.settings.describe().find(row => row.ns === 'ui-settings')?.value).toMatchObject({ enabled: codingTools }) expect(scaffold.ctx.agentPresets.defaultId).toBe(initialDefault) diff --git a/apps/web/tests/cua-permissions.e2e.ts b/apps/web/tests/cua-permissions.e2e.ts index 5c7fa5aa9c..2f273efd18 100644 --- a/apps/web/tests/cua-permissions.e2e.ts +++ b/apps/web/tests/cua-permissions.e2e.ts @@ -286,10 +286,9 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr await expect.poll(() => toggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('false') await expect.poll(() => toggle.isEnabled(), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe(true) await toggle.click() - const setup = page.getByRole('dialog', { name: 'Set up computer use before use', exact: true }) - await setup.getByRole('button', { name: 'Later', exact: true }).click() await expect.poll(() => toggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('true') await expect.poll(() => panel.getAttribute('aria-busy'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('false') + expect(await page.getByRole('dialog', { name: 'Set up computer use before use', exact: true }).count()).toBe(0) expect(await trace.evaluate(value => value.errors)).toEqual([]) } const layouts = await trace.evaluate(value => value.layouts) diff --git a/packages/client/ui-plugin-manager/README.i18n.yaml b/packages/client/ui-plugin-manager/README.i18n.yaml index 04ace33070..dabbed97a4 100644 --- a/packages/client/ui-plugin-manager/README.i18n.yaml +++ b/packages/client/ui-plugin-manager/README.i18n.yaml @@ -48,8 +48,8 @@ en: ef7ab41b4119c7b9 zh: 3166661bf84415e5 /deepseek-ai-dsh-client-ui-plugin-manager/understand-the-implementation/configuration-slots: - en: a8efaca9e2f9616b - zh: cb42a9279f723bc2 + en: e05fbc7760b74d5d + zh: 066e06ea31cf2b0c /deepseek-ai-dsh-client-ui-plugin-manager/further-exploration: en: f9a42dfed0360d6a zh: 455a70bcb6c69624 diff --git a/packages/client/ui-plugin-manager/README.md b/packages/client/ui-plugin-manager/README.md index 347c3880ea..9ed0242860 100644 --- a/packages/client/ui-plugin-manager/README.md +++ b/packages/client/ui-plugin-manager/README.md @@ -157,7 +157,7 @@ Custom item pages use the Host entry id as their registration id; row pages use The page's `main` registration declares `plugins.item`, `plugins.bundle.config`, and `plugins.row.config` as its children, so the slots exist while the page does and a registrant's `ctx.slots.inject` waits for them. `configLedgerSource` projects the four ledgers into one observable — the official items and the `settings.section` entries in ledger order with their labels resolved in the active locale, each section with its registering module when known, and the bundle and row keys — cached until a ledger or the locale moves; the page binds it as `useConfigLedger` beside the store and never names a configurable plugin itself. The registration-owned navigation store selects the main list, the full experimental plugin list, a bundle, an official plugin, or a bundle row; switching away from the Plugins panel resets it to the list, while React remounts preserve the selected target. A fresh registration starts on the main list. Installation highlighting scrolls to a card only when it is on the current page; it does not change the selected page. Other Client plugins read `pluginNavigation` optionally, through `ctx.get` or `ctx.inject`, and call its `openBundle(packageName)` to open bundle details without changing the current Session; listing it in a plugin's `inject` keeps that plugin pending on a page without access. The target survives the initial inventory load; an absent bundle displays the list. A registration lives with the browser half that made it. `dsh-client-modules` attaches a package's browser half to the Loader row whose specifier is the bare package name, so every page a bundle registers, for itself or for any of its rows, goes away when that row is switched off; a sub-plugin whose page must outlive the other rows ships as its own package. Cards and detail pages show the Experimental marker only for packages in `EXPERIMENTAL_BUNDLES` in [`dsh-official-bundles`](../../util/official-bundles/README.md#plugin-manager-lists); package-name prefixes do not select the marker. -`plugins.bundle.config` supplies bundle detail configuration, keyed by npm package name. Client plugins can subscribe to the read-only `ctx.pluginChanges.bundle(packageName)` source to pause their queries while a bundle or one of its rows is being changed. Notifications precede the management request and continue when the page closes; subscribers release their observation on disposal. `plugins.bundle.activation` offers bundle-owned guidance after explicit enablement from either the list or detail page, with callbacks to dismiss it or open the bundle details. It does not appear merely because an enabled bundle was listed. +`plugins.bundle.config` supplies bundle detail configuration, keyed by npm package name. Client plugins can subscribe to the read-only `ctx.pluginChanges.bundle(packageName)` source to pause their queries while a bundle or one of its rows is being changed. Notifications precede the management request and continue when the page closes; subscribers release their observation on disposal. `plugins.bundle.activation` offers bundle-owned guidance after explicit enablement outside the bundle's own detail page, with callbacks to dismiss it or open the bundle details. It does not appear when enabling from the bundle's own detail switch or merely because an enabled bundle was listed. diff --git a/packages/client/ui-plugin-manager/README.zh.md b/packages/client/ui-plugin-manager/README.zh.md index 8b0acb0e3d..11974255d0 100644 --- a/packages/client/ui-plugin-manager/README.zh.md +++ b/packages/client/ui-plugin-manager/README.zh.md @@ -157,7 +157,7 @@ Host 入口通过生成的 Remote 接口暴露 `pluginRegistryProbe.fastest()` 页面的 `main` 注册把 `plugins.item`、`plugins.bundle.config` 与 `plugins.row.config` 声明为子 slot,因此它们与页面同生,注册方的 `ctx.slots.inject` 会等到它们出现。`configLedgerSource` 把四份账本投影成一个可观察对象——按账本顺序排列、标签按当前语言解析的官方条目与 `settings.section` 条目(每个条目在已知时带注册它的模块),以及组合包与行的键——在账本或语言变化前保持缓存;页面把它作为 `useConfigLedger` 绑在 store 旁边,自身从不点名任何可配置插件。注册拥有的导航 store 选择主列表、完整的实验性插件列表、某个组合包、某个官方插件或组合包的某一行;切换离开插件面板时重置为列表,React 重新挂载则保留所选目标。新的注册从主列表开始。安装后的高亮仅在当前页面有对应卡片时滚动定位,不改变所选页面。其他 Client 插件经 `ctx.get` 或 `ctx.inject` 以可选方式读取 `pluginNavigation`,调用其 `openBundle(packageName)` 即可打开组合包详情,不改变当前 Session;把它写进插件的 `inject` 会让该插件在无权限的页面上一直等待。首次读取清单期间保留导航目标;组合包不存在时显示列表。注册与做出它的浏览器半侧同生共死。`dsh-client-modules` 只把一个包的浏览器半侧挂在说明符恰为包名的那一行 Loader 行上,所以组合包为自己或任一行注册的页面,都会在那一行被关闭时一起消失;需要在其他行关闭时仍保留页面的子插件,应作为独立的包发布。 卡片和详情页仅为 [`dsh-official-bundles`](../../util/official-bundles/README.zh.md#plugin-manager-lists) 中 `EXPERIMENTAL_BUNDLES` 名单内的包显示实验性标签,包名前缀不决定标签。 -`plugins.bundle.config` 以 npm 包名为 key,提供 Bundle 详情配置。Client 插件可订阅只读的 `ctx.pluginChanges.bundle(packageName)`,在组合包或其组件行变更期间暂停查询。通知先于管理请求发出,页面关闭后仍会更新;订阅方在卸载时释放观察。`plugins.bundle.activation` 在用户从列表或详情页显式启用后提供 Bundle 自有引导,并传入关闭引导和打开详情的回调。仅列出已启用的 Bundle 不会触发引导。 +`plugins.bundle.config` 以 npm 包名为 key,提供 Bundle 详情配置。Client 插件可订阅只读的 `ctx.pluginChanges.bundle(packageName)`,在组合包或其组件行变更期间暂停查询。通知先于管理请求发出,页面关闭后仍会更新;订阅方在卸载时释放观察。`plugins.bundle.activation` 在用户从非该 Bundle 详情页的位置显式启用后提供 Bundle 自有引导,并传入关闭引导和打开详情的回调。在 Bundle 详情页内直接开启开关,或仅列出已启用的 Bundle,均不会触发引导。 diff --git a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx index 723f21c3aa..604bff4db5 100644 --- a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx +++ b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx @@ -1665,7 +1665,7 @@ export function PluginManagerPage(props: PluginManagerPageProps): ReactNode { : { role: 'tabpanel', id: `${tabsId}-${INSTALLED_TAB}-panel`, 'aria-labelledby': `${tabsId}-${INSTALLED_TAB}` } const activated = listed.find(pkg => pkg.name === activation && pkg.enabled && !state.busy.includes(pkg.name)) const setBundleEnabled = (name: string, enabled: boolean): void => { - setActivation(enabled ? name : null) + setActivation(enabled && openPkg?.name !== name ? name : null) props.setEnabled(name, enabled) } const setRowEnabled = (row: PackageRow, enabled: boolean): void => { diff --git a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx index cda830bd43..9fda6e168d 100644 --- a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx +++ b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx @@ -2988,7 +2988,7 @@ describe('on-demand Official bundles', () => { }) }) -it('uses the same activation guidance from a package detail switch', () => { +it('skips activation guidance when enabling from the bundle detail switch', () => { const name = 'dsh-better-sidebar' const { set, actions } = renderTab({ packages: [pkg({ enabled: false })] }, { bundles: new Set([name]) }, { [`plugins.bundle.activation:${name}`]: (_view, owner) => , @@ -3001,7 +3001,6 @@ it('uses the same activation guidance from a package detail switch', () => { set({ packages: [pkg()], busy: [name] }) expect(screen.queryByText('Finish setup')).toBeNull() set({ busy: [] }) - fireEvent.click(screen.getByText('Finish setup')) expect(screen.queryByText('Finish setup')).toBeNull() expect(screen.getByText('Bundle setup')).toBeTruthy() fireEvent.click(screen.getByRole('switch')) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 8e64e3a68e..0e75e92b7d 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: abb42615f37267fa - zh: 6a3fc3da94464d83 + en: 2bbb3928379273b8 + zh: ac28451f9e96ff77 /deepseek-ai-dsh-cua/understand-the-implementation: en: 0bb61400e72a836a zh: b60cb64e5ce36394 diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index e534a7198f..f60087c5e4 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -76,7 +76,7 @@ The page refreshes on entry, window focus, and completed actions. System-permiss System-permission operations affect the computer running DSH. When accessing DSH remotely, complete authorization on that computer. -Enabling from the plugin list or detail page shows setup guidance when system permissions need attention, with **Later** and **Open settings** actions. Choose the default for new sessions in **Settings → Agent presets**. +Enabling from the plugin list shows setup guidance when system permissions need attention, with **Later** and **Open settings** actions; enabling from the bundle's own detail page stays on the page without opening the dialog. Choose the default for new sessions in **Settings → Agent presets**. The page lists always-allowed applications and refusals from any session. A refusal in one session does not cancel another session’s grant or prevent a new session from asking. Session-only grants remain effective within their sessions and are omitted from this page. **Revoke** removes the selected application's access and cancels affected work. Input already delivered to an application cannot be undone; observe the application before any further action. **Allow asking again** clears that application’s refusal records across all sessions; the next application selection still requires a new decision. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index a6e7580b0b..4a7ede8025 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -76,7 +76,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 系统权限操作作用于运行 DSH 的电脑。远程访问时,请在该电脑上完成授权。 -从插件列表或详情页启用后,系统权限尚未就绪时会显示设置引导,提供“稍后”和“前往设置”。新会话的默认模式可在全局设置的“Agent 预设”页面选择。 +从插件列表启用后,系统权限尚未就绪时会显示设置引导,提供“稍后”和“前往设置”;在插件详情页内启用时停留在当前页,不弹出引导弹窗。新会话的默认模式可在全局设置的“Agent 预设”页面选择。 页面展示“始终允许的应用”和“不允许访问的应用”。后者汇总任一会话的拒绝记录,不取消其他会话已有的授权,也不阻止新会话询问授权。会话授权仍在对应会话中生效,详情页不展示这类应用。“撤销”会移除对应应用的访问许可并取消相关操作。已发送到应用的输入无法撤回,继续操作前需重新观察应用。“允许再次询问”清除该应用在所有会话中的拒绝记录;下次选择应用时仍需用户重新决定。 From b938f4fb4e356b6fc5278cbdb93f5e78e22782e2 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 16:51:29 +0800 Subject: [PATCH 08/17] revert: keep activation guidance when enabling from the bundle detail page Detail-page suppression changed guidance for every bundle (voice input, connector accounts); it will be revisited as a Plugin Manager-wide decision. --- apps/web/tests/cua-optin.e2e.ts | 5 ++++- apps/web/tests/cua-permissions.e2e.ts | 3 ++- packages/client/ui-plugin-manager/README.i18n.yaml | 4 ++-- packages/client/ui-plugin-manager/README.md | 2 +- packages/client/ui-plugin-manager/README.zh.md | 2 +- .../ui-plugin-manager/src/client/PluginManagerPage.tsx | 2 +- .../ui-plugin-manager/tests/components.client.spec.tsx | 3 ++- packages/experimental/cua/README.i18n.yaml | 4 ++-- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/apps/web/tests/cua-optin.e2e.ts b/apps/web/tests/cua-optin.e2e.ts index 5908a57353..32292093d8 100644 --- a/apps/web/tests/cua-optin.e2e.ts +++ b/apps/web/tests/cua-optin.e2e.ts @@ -231,9 +231,12 @@ it.skipIf(process.platform !== 'darwin').each([ expect(await readFile(settingsPath, 'utf8')).toBe(saved) await toggle.click() await toggle.and(page.locator('[aria-checked="true"]')).waitFor({ state: 'visible' }) + await setup.waitFor() + expect(await setup.getByText('“自动电脑操作”已开启,但暂时无法检查系统权限。请前往插件详情页查看详情并重试。', { exact: true }).count()).toBe(1) expect(scaffold.ctx.agentPresets.defaultId).toBe(initialDefault) + await setup.getByRole('button', { name: '前往设置', exact: true }).click() + await setup.waitFor({ state: 'hidden' }) await page.getByRole('region', { name: '系统权限', exact: true }).getByRole('alert').waitFor() - expect(await setup.count()).toBe(0) expect(await readFile(settingsPath, 'utf8')).toBe(saved) expect(scaffold.ctx.settings.describe().find(row => row.ns === 'ui-settings')?.value).toMatchObject({ enabled: codingTools }) expect(scaffold.ctx.agentPresets.defaultId).toBe(initialDefault) diff --git a/apps/web/tests/cua-permissions.e2e.ts b/apps/web/tests/cua-permissions.e2e.ts index 2f273efd18..5c7fa5aa9c 100644 --- a/apps/web/tests/cua-permissions.e2e.ts +++ b/apps/web/tests/cua-permissions.e2e.ts @@ -286,9 +286,10 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr await expect.poll(() => toggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('false') await expect.poll(() => toggle.isEnabled(), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe(true) await toggle.click() + const setup = page.getByRole('dialog', { name: 'Set up computer use before use', exact: true }) + await setup.getByRole('button', { name: 'Later', exact: true }).click() await expect.poll(() => toggle.getAttribute('aria-checked'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('true') await expect.poll(() => panel.getAttribute('aria-busy'), { timeout: PLUGIN_TOGGLE_SETTLE_MS }).toBe('false') - expect(await page.getByRole('dialog', { name: 'Set up computer use before use', exact: true }).count()).toBe(0) expect(await trace.evaluate(value => value.errors)).toEqual([]) } const layouts = await trace.evaluate(value => value.layouts) diff --git a/packages/client/ui-plugin-manager/README.i18n.yaml b/packages/client/ui-plugin-manager/README.i18n.yaml index dabbed97a4..04ace33070 100644 --- a/packages/client/ui-plugin-manager/README.i18n.yaml +++ b/packages/client/ui-plugin-manager/README.i18n.yaml @@ -48,8 +48,8 @@ en: ef7ab41b4119c7b9 zh: 3166661bf84415e5 /deepseek-ai-dsh-client-ui-plugin-manager/understand-the-implementation/configuration-slots: - en: e05fbc7760b74d5d - zh: 066e06ea31cf2b0c + en: a8efaca9e2f9616b + zh: cb42a9279f723bc2 /deepseek-ai-dsh-client-ui-plugin-manager/further-exploration: en: f9a42dfed0360d6a zh: 455a70bcb6c69624 diff --git a/packages/client/ui-plugin-manager/README.md b/packages/client/ui-plugin-manager/README.md index 9ed0242860..347c3880ea 100644 --- a/packages/client/ui-plugin-manager/README.md +++ b/packages/client/ui-plugin-manager/README.md @@ -157,7 +157,7 @@ Custom item pages use the Host entry id as their registration id; row pages use The page's `main` registration declares `plugins.item`, `plugins.bundle.config`, and `plugins.row.config` as its children, so the slots exist while the page does and a registrant's `ctx.slots.inject` waits for them. `configLedgerSource` projects the four ledgers into one observable — the official items and the `settings.section` entries in ledger order with their labels resolved in the active locale, each section with its registering module when known, and the bundle and row keys — cached until a ledger or the locale moves; the page binds it as `useConfigLedger` beside the store and never names a configurable plugin itself. The registration-owned navigation store selects the main list, the full experimental plugin list, a bundle, an official plugin, or a bundle row; switching away from the Plugins panel resets it to the list, while React remounts preserve the selected target. A fresh registration starts on the main list. Installation highlighting scrolls to a card only when it is on the current page; it does not change the selected page. Other Client plugins read `pluginNavigation` optionally, through `ctx.get` or `ctx.inject`, and call its `openBundle(packageName)` to open bundle details without changing the current Session; listing it in a plugin's `inject` keeps that plugin pending on a page without access. The target survives the initial inventory load; an absent bundle displays the list. A registration lives with the browser half that made it. `dsh-client-modules` attaches a package's browser half to the Loader row whose specifier is the bare package name, so every page a bundle registers, for itself or for any of its rows, goes away when that row is switched off; a sub-plugin whose page must outlive the other rows ships as its own package. Cards and detail pages show the Experimental marker only for packages in `EXPERIMENTAL_BUNDLES` in [`dsh-official-bundles`](../../util/official-bundles/README.md#plugin-manager-lists); package-name prefixes do not select the marker. -`plugins.bundle.config` supplies bundle detail configuration, keyed by npm package name. Client plugins can subscribe to the read-only `ctx.pluginChanges.bundle(packageName)` source to pause their queries while a bundle or one of its rows is being changed. Notifications precede the management request and continue when the page closes; subscribers release their observation on disposal. `plugins.bundle.activation` offers bundle-owned guidance after explicit enablement outside the bundle's own detail page, with callbacks to dismiss it or open the bundle details. It does not appear when enabling from the bundle's own detail switch or merely because an enabled bundle was listed. +`plugins.bundle.config` supplies bundle detail configuration, keyed by npm package name. Client plugins can subscribe to the read-only `ctx.pluginChanges.bundle(packageName)` source to pause their queries while a bundle or one of its rows is being changed. Notifications precede the management request and continue when the page closes; subscribers release their observation on disposal. `plugins.bundle.activation` offers bundle-owned guidance after explicit enablement from either the list or detail page, with callbacks to dismiss it or open the bundle details. It does not appear merely because an enabled bundle was listed. diff --git a/packages/client/ui-plugin-manager/README.zh.md b/packages/client/ui-plugin-manager/README.zh.md index 11974255d0..8b0acb0e3d 100644 --- a/packages/client/ui-plugin-manager/README.zh.md +++ b/packages/client/ui-plugin-manager/README.zh.md @@ -157,7 +157,7 @@ Host 入口通过生成的 Remote 接口暴露 `pluginRegistryProbe.fastest()` 页面的 `main` 注册把 `plugins.item`、`plugins.bundle.config` 与 `plugins.row.config` 声明为子 slot,因此它们与页面同生,注册方的 `ctx.slots.inject` 会等到它们出现。`configLedgerSource` 把四份账本投影成一个可观察对象——按账本顺序排列、标签按当前语言解析的官方条目与 `settings.section` 条目(每个条目在已知时带注册它的模块),以及组合包与行的键——在账本或语言变化前保持缓存;页面把它作为 `useConfigLedger` 绑在 store 旁边,自身从不点名任何可配置插件。注册拥有的导航 store 选择主列表、完整的实验性插件列表、某个组合包、某个官方插件或组合包的某一行;切换离开插件面板时重置为列表,React 重新挂载则保留所选目标。新的注册从主列表开始。安装后的高亮仅在当前页面有对应卡片时滚动定位,不改变所选页面。其他 Client 插件经 `ctx.get` 或 `ctx.inject` 以可选方式读取 `pluginNavigation`,调用其 `openBundle(packageName)` 即可打开组合包详情,不改变当前 Session;把它写进插件的 `inject` 会让该插件在无权限的页面上一直等待。首次读取清单期间保留导航目标;组合包不存在时显示列表。注册与做出它的浏览器半侧同生共死。`dsh-client-modules` 只把一个包的浏览器半侧挂在说明符恰为包名的那一行 Loader 行上,所以组合包为自己或任一行注册的页面,都会在那一行被关闭时一起消失;需要在其他行关闭时仍保留页面的子插件,应作为独立的包发布。 卡片和详情页仅为 [`dsh-official-bundles`](../../util/official-bundles/README.zh.md#plugin-manager-lists) 中 `EXPERIMENTAL_BUNDLES` 名单内的包显示实验性标签,包名前缀不决定标签。 -`plugins.bundle.config` 以 npm 包名为 key,提供 Bundle 详情配置。Client 插件可订阅只读的 `ctx.pluginChanges.bundle(packageName)`,在组合包或其组件行变更期间暂停查询。通知先于管理请求发出,页面关闭后仍会更新;订阅方在卸载时释放观察。`plugins.bundle.activation` 在用户从非该 Bundle 详情页的位置显式启用后提供 Bundle 自有引导,并传入关闭引导和打开详情的回调。在 Bundle 详情页内直接开启开关,或仅列出已启用的 Bundle,均不会触发引导。 +`plugins.bundle.config` 以 npm 包名为 key,提供 Bundle 详情配置。Client 插件可订阅只读的 `ctx.pluginChanges.bundle(packageName)`,在组合包或其组件行变更期间暂停查询。通知先于管理请求发出,页面关闭后仍会更新;订阅方在卸载时释放观察。`plugins.bundle.activation` 在用户从列表或详情页显式启用后提供 Bundle 自有引导,并传入关闭引导和打开详情的回调。仅列出已启用的 Bundle 不会触发引导。 diff --git a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx index 604bff4db5..723f21c3aa 100644 --- a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx +++ b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx @@ -1665,7 +1665,7 @@ export function PluginManagerPage(props: PluginManagerPageProps): ReactNode { : { role: 'tabpanel', id: `${tabsId}-${INSTALLED_TAB}-panel`, 'aria-labelledby': `${tabsId}-${INSTALLED_TAB}` } const activated = listed.find(pkg => pkg.name === activation && pkg.enabled && !state.busy.includes(pkg.name)) const setBundleEnabled = (name: string, enabled: boolean): void => { - setActivation(enabled && openPkg?.name !== name ? name : null) + setActivation(enabled ? name : null) props.setEnabled(name, enabled) } const setRowEnabled = (row: PackageRow, enabled: boolean): void => { diff --git a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx index 9fda6e168d..cda830bd43 100644 --- a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx +++ b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx @@ -2988,7 +2988,7 @@ describe('on-demand Official bundles', () => { }) }) -it('skips activation guidance when enabling from the bundle detail switch', () => { +it('uses the same activation guidance from a package detail switch', () => { const name = 'dsh-better-sidebar' const { set, actions } = renderTab({ packages: [pkg({ enabled: false })] }, { bundles: new Set([name]) }, { [`plugins.bundle.activation:${name}`]: (_view, owner) => , @@ -3001,6 +3001,7 @@ it('skips activation guidance when enabling from the bundle detail switch', () = set({ packages: [pkg()], busy: [name] }) expect(screen.queryByText('Finish setup')).toBeNull() set({ busy: [] }) + fireEvent.click(screen.getByText('Finish setup')) expect(screen.queryByText('Finish setup')).toBeNull() expect(screen.getByText('Bundle setup')).toBeTruthy() fireEvent.click(screen.getByRole('switch')) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 0e75e92b7d..8e64e3a68e 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: 2bbb3928379273b8 - zh: ac28451f9e96ff77 + en: abb42615f37267fa + zh: 6a3fc3da94464d83 /deepseek-ai-dsh-cua/understand-the-implementation: en: 0bb61400e72a836a zh: b60cb64e5ce36394 diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index f60087c5e4..e534a7198f 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -76,7 +76,7 @@ The page refreshes on entry, window focus, and completed actions. System-permiss System-permission operations affect the computer running DSH. When accessing DSH remotely, complete authorization on that computer. -Enabling from the plugin list shows setup guidance when system permissions need attention, with **Later** and **Open settings** actions; enabling from the bundle's own detail page stays on the page without opening the dialog. Choose the default for new sessions in **Settings → Agent presets**. +Enabling from the plugin list or detail page shows setup guidance when system permissions need attention, with **Later** and **Open settings** actions. Choose the default for new sessions in **Settings → Agent presets**. The page lists always-allowed applications and refusals from any session. A refusal in one session does not cancel another session’s grant or prevent a new session from asking. Session-only grants remain effective within their sessions and are omitted from this page. **Revoke** removes the selected application's access and cancels affected work. Input already delivered to an application cannot be undone; observe the application before any further action. **Allow asking again** clears that application’s refusal records across all sessions; the next application selection still requires a new decision. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 4a7ede8025..a6e7580b0b 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -76,7 +76,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 系统权限操作作用于运行 DSH 的电脑。远程访问时,请在该电脑上完成授权。 -从插件列表启用后,系统权限尚未就绪时会显示设置引导,提供“稍后”和“前往设置”;在插件详情页内启用时停留在当前页,不弹出引导弹窗。新会话的默认模式可在全局设置的“Agent 预设”页面选择。 +从插件列表或详情页启用后,系统权限尚未就绪时会显示设置引导,提供“稍后”和“前往设置”。新会话的默认模式可在全局设置的“Agent 预设”页面选择。 页面展示“始终允许的应用”和“不允许访问的应用”。后者汇总任一会话的拒绝记录,不取消其他会话已有的授权,也不阻止新会话询问授权。会话授权仍在对应会话中生效,详情页不展示这类应用。“撤销”会移除对应应用的访问许可并取消相关操作。已发送到应用的输入无法撤回,继续操作前需重新观察应用。“允许再次询问”清除该应用在所有会话中的拒绝记录;下次选择应用时仍需用户重新决定。 From 949afbfe5c58c6b3ecf7dabb6d1f5f73e797f0ca Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 16:59:13 +0800 Subject: [PATCH 09/17] fix(cua): address review findings on permission notices and platform copy - Show the provider lookup failure in place of the native query error when the platform is still unknown, so one notice reports the governing cause. - Mark standing Windows desktop conditions as notes; only failures alert. - List supported platforms with a dedicated localized separator and keep the refusal-code comment on CODE_KEYS. - Drop the unused UnsupportedBundlePlatformError.platform field and make its test fail when nothing is thrown. - Type the Agent presets section id against ui-agent-preset's export. --- packages/boot/app-boot/src/bundle-platform.ts | 3 -- .../app-boot/tests/bundle-platform.spec.ts | 7 +--- .../ui-agent-preset/src/client/index.ts | 6 +++ .../tests/apply.client.spec.ts | 4 +- .../ui-plugin-manager/src/client/locales.ts | 8 ++++ .../src/client/presentation.ts | 5 ++- packages/experimental/cua/README.i18n.yaml | 4 +- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- packages/experimental/cua/package.json | 3 +- .../cua/src/client/PermissionPanel.tsx | 14 +++++-- .../experimental/cua/src/client/locales.ts | 8 ++++ packages/experimental/cua/src/client/mount.ts | 7 +++- .../cua/tests/panel.client.spec.tsx | 42 ++++++++++++------- .../experimental/cua/tsconfig.client.json | 3 ++ pnpm-lock.yaml | 3 ++ 16 files changed, 84 insertions(+), 37 deletions(-) diff --git a/packages/boot/app-boot/src/bundle-platform.ts b/packages/boot/app-boot/src/bundle-platform.ts index de56867bf9..9900592ae0 100644 --- a/packages/boot/app-boot/src/bundle-platform.ts +++ b/packages/boot/app-boot/src/bundle-platform.ts @@ -9,8 +9,6 @@ const NODE_PLATFORMS: readonly string[] = Object.freeze([ export class UnsupportedBundlePlatformError extends Error { /** Node platform names or `wsl` supported by the bundle. */ readonly platforms: readonly string[] - /** Operating system of the DSH Host. */ - readonly platform: string /** * @param platforms Node platform names or `wsl` supported by the bundle. * @param platform Operating system of the DSH Host. @@ -19,7 +17,6 @@ export class UnsupportedBundlePlatformError extends Error { super(`Bundle supports Host platforms ${platforms.join(', ')}; the DSH Host is running ${platform}`) this.name = 'UnsupportedBundlePlatformError' this.platforms = [...platforms] - this.platform = platform } } diff --git a/packages/boot/app-boot/tests/bundle-platform.spec.ts b/packages/boot/app-boot/tests/bundle-platform.spec.ts index 87b84ddee7..bccb8a2095 100644 --- a/packages/boot/app-boot/tests/bundle-platform.spec.ts +++ b/packages/boot/app-boot/tests/bundle-platform.spec.ts @@ -21,11 +21,8 @@ it.each(['darwin', 'win32', 'linux'])('allows undeclared platforms and an explic it.each(['win32', 'linux'])('rejects macOS-only bundles on %s Hosts', (platform) => { expect(() => { assertBundlePlatform(['darwin'], platform) }).toThrow(UnsupportedBundlePlatformError) expect(() => { assertBundlePlatform(['darwin'], platform) }).toThrow(`the DSH Host is running ${platform}`) - try { assertBundlePlatform(['darwin', 'wsl'], platform) } catch (error) { - expect(error).toBeInstanceOf(UnsupportedBundlePlatformError) - expect((error as UnsupportedBundlePlatformError).platforms).toEqual(['darwin', 'wsl']) - expect((error as UnsupportedBundlePlatformError).platform).toBe(platform) - } + expect(() => { assertBundlePlatform(['darwin', 'wsl'], platform) }) + .toThrow(expect.objectContaining({ platforms: ['darwin', 'wsl'] })) }) it.each([null, true, 'darwin', [], [1], [''], ['Darwin'], [' darwin'], ['macos'], ['darwin', 'linxu'], ['darwin', false]].map(platforms => ({ platforms })))('rejects malformed platform metadata $platforms', ({ platforms }) => { diff --git a/packages/client/ui-agent-preset/src/client/index.ts b/packages/client/ui-agent-preset/src/client/index.ts index 2b9e420561..1ee1fb36ef 100644 --- a/packages/client/ui-agent-preset/src/client/index.ts +++ b/packages/client/ui-agent-preset/src/client/index.ts @@ -61,6 +61,12 @@ export type { AgentPresetSectionState, PresetView } from './section-store.ts' export type { AgentPresetOption, AgentPresetSettingsState } from './settings-store.ts' export { AGENT_PRESET_SETTINGS_NS, writeDefaultPreset } from './settings-store.ts' +/** + * `settings.section` id of the Agent presets page, for callers of `settingsNavigation.open`. + * The registration repeats it literally so the Client slot catalog can read it. + */ +export const AGENT_PRESETS_SECTION_ID = 'agent-presets' + /** Required services (cordis fiber inject); `uiResponsive` owns the hero chip's `useMediaQuery` prop. */ export const inject = [ 'slots', 'sessions', 'locale', 'remote', 'remote.agentPresets', 'remote.settings', 'configForms', 'uiResponsive', diff --git a/packages/client/ui-agent-preset/tests/apply.client.spec.ts b/packages/client/ui-agent-preset/tests/apply.client.spec.ts index bb16881265..4372ff528d 100644 --- a/packages/client/ui-agent-preset/tests/apply.client.spec.ts +++ b/packages/client/ui-agent-preset/tests/apply.client.spec.ts @@ -14,7 +14,7 @@ import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-c import { RemoteError, StaticUiResponsive, TestRemote } from '@deepseek-ai/dsh-client-test-runtime' import type { SessionId } from '@deepseek-ai/dsh-session' import { apply as settingsApply, inject as settingsInject } from '@deepseek-ai/dsh-client-ui-settings/client' -import { apply, inject } from '@deepseek-ai/dsh-client-ui-agent-preset/client' +import { AGENT_PRESETS_SECTION_ID, apply, inject } from '@deepseek-ai/dsh-client-ui-agent-preset/client' import { AgentPresetLabel } from '../src/client/AgentPresetLabel.tsx' import type { AgentPresetLabelInjected } from '../src/client/AgentPresetLabel.tsx' import { AgentPresetSection } from '../src/client/AgentPresetSection.tsx' @@ -365,7 +365,7 @@ describe('ui-agent-preset apply', () => { expect(slots.entries('settings.general.item')).toHaveLength(0) const section = slots.entries('settings.section')[0]! expect(section.component).toBe(AgentPresetSection) - expect(section.options).toMatchObject({ id: 'agent-presets', order: 20 }) + expect(section.options).toMatchObject({ id: AGENT_PRESETS_SECTION_ID, order: 20 }) // The nav label is a locale-following thunk; owners resolve it at read time. expect(resolveSlotLabel(section.options.label)).toBe('Agent 预设') }) diff --git a/packages/client/ui-plugin-manager/src/client/locales.ts b/packages/client/ui-plugin-manager/src/client/locales.ts index 0f77548982..c2729e167d 100644 --- a/packages/client/ui-plugin-manager/src/client/locales.ts +++ b/packages/client/ui-plugin-manager/src/client/locales.ts @@ -296,6 +296,7 @@ export const zh = { reasonIncompatibleVersionUnnamed: '这个插件与当前 DSH 版本不兼容,运行它可能导致崩溃或数据丢失。', reasonUnsupportedPlatform: '此插件不支持当前操作系统', reasonUnsupportedPlatformList: '此插件仅支持 {platforms}', + platformListSeparator: '、', platformListLastSeparator: ' 和 ', platformDarwin: 'macOS', platformWin32: 'Windows', @@ -609,6 +610,7 @@ export const en = { reasonIncompatibleVersionUnnamed: 'This plugin is incompatible with the running DSH version; running it may cause crashes or data loss.', reasonUnsupportedPlatform: 'This plugin does not support this operating system.', reasonUnsupportedPlatformList: 'This plugin only supports {platforms}.', + platformListSeparator: ', ', platformListLastSeparator: ' and ', platformDarwin: 'macOS', platformWin32: 'Windows', @@ -632,6 +634,7 @@ export const en = { export const ja = { 'reasonUnsupportedPlatform': 'このプラグインは現在の OS に対応していません。', 'reasonUnsupportedPlatformList': 'このプラグインは {platforms} にのみ対応しています。', + 'platformListSeparator': '、', 'platformListLastSeparator': ' と ', 'platformDarwin': 'macOS', 'platformWin32': 'Windows', @@ -942,6 +945,7 @@ export const ja = { export const es = { reasonUnsupportedPlatform: 'Este complemento no es compatible con este sistema operativo.', reasonUnsupportedPlatformList: 'Este complemento solo es compatible con {platforms}.', + platformListSeparator: ', ', platformListLastSeparator: ' y ', platformDarwin: 'macOS', platformWin32: 'Windows', @@ -1252,6 +1256,7 @@ export const es = { export const fr = { reasonUnsupportedPlatform: 'Ce plugin n’est pas compatible avec ce système d’exploitation.', reasonUnsupportedPlatformList: 'Ce plugin est uniquement compatible avec {platforms}.', + platformListSeparator: ', ', platformListLastSeparator: ' et ', platformDarwin: 'macOS', platformWin32: 'Windows', @@ -1562,6 +1567,7 @@ export const fr = { export const de = { reasonUnsupportedPlatform: 'Dieses Plugin unterstützt dieses Betriebssystem nicht.', reasonUnsupportedPlatformList: 'Dieses Plugin unterstützt nur {platforms}.', + platformListSeparator: ', ', platformListLastSeparator: ' und ', platformDarwin: 'macOS', platformWin32: 'Windows', @@ -1872,6 +1878,7 @@ export const de = { export const ru = { reasonUnsupportedPlatform: 'Этот плагин не поддерживает текущую операционную систему.', reasonUnsupportedPlatformList: 'Этот плагин поддерживает только {platforms}.', + platformListSeparator: ', ', platformListLastSeparator: ' и ', platformDarwin: 'macOS', platformWin32: 'Windows', @@ -2182,6 +2189,7 @@ export const ru = { export const pt = { reasonUnsupportedPlatform: 'Este plugin não é compatível com este sistema operacional.', reasonUnsupportedPlatformList: 'Este plugin é compatível apenas com {platforms}.', + platformListSeparator: ', ', platformListLastSeparator: ' e ', platformDarwin: 'macOS', platformWin32: 'Windows', diff --git a/packages/client/ui-plugin-manager/src/client/presentation.ts b/packages/client/ui-plugin-manager/src/client/presentation.ts index 93a2dde059..7cf9d79df2 100644 --- a/packages/client/ui-plugin-manager/src/client/presentation.ts +++ b/packages/client/ui-plugin-manager/src/client/presentation.ts @@ -45,7 +45,7 @@ function registryHost(registry: string): string { } } -/** The sentence each of the Host's refusal codes reads as. */ +/** Display names for the Node platform ids and `wsl` that bundle metadata declares; other ids render verbatim. */ const PLATFORM_KEYS = new Map([ ['darwin', 'platformDarwin'], ['win32', 'platformWin32'], @@ -59,9 +59,10 @@ function platformList(platforms: readonly string[], t: Translate): string { return key === undefined ? name : t(key) }) if (labels.length === 1) return labels.join('') - return `${labels.slice(0, -1).join(t('registryListSeparator'))}${t('platformListLastSeparator')}${labels.at(-1)}` + return `${labels.slice(0, -1).join(t('platformListSeparator'))}${t('platformListLastSeparator')}${labels.at(-1)}` } +/** The sentence each of the Host's refusal codes reads as. */ const CODE_KEYS = { 'management-required': 'reasonManagementRequired', 'unaddressable': 'reasonUnaddressable', diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 8e64e3a68e..10dd1c4a10 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -21,8 +21,8 @@ en: abb42615f37267fa zh: 6a3fc3da94464d83 /deepseek-ai-dsh-cua/understand-the-implementation: - en: 0bb61400e72a836a - zh: b60cb64e5ce36394 + en: 9defaaf1e0113f11 + zh: 752c7e02a8709eab /deepseek-ai-dsh-cua/further-exploration: en: c174fb5a00ea3681 zh: 039340042676881d diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index e534a7198f..81955b3adc 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -133,7 +133,7 @@ Check `methods` and `keyboard` in the result of `await cua.getCapabilities()` fo Platform providers import `CuaConfigFields` from `@deepseek-ai/dsh-cua/config` to extend the shared configuration. The root Host entry exports `installCua`, `CuaConfig`, and the Typert-discovered `CuaAccess` service; its `apply()` only marks the optional Client contribution. `/client` loads the permission UI through the existing module loader. Separate Host and Client compiler projects keep React, CSS, and browser registrations out of headless imports. `/api` owns the app/window API and its types; `/bridge`, `/native-client`, and `/protocol` retain runtime and platform consumers. `/types` exports only the named types required by generated Remote declarations. The Client uses package-local types. `/typert` supplies Host reflection and `/remote` supplies generated browser descriptors and codecs; permission authority remains on the Host. -The optional browser contribution mounts the native provider's permission Remote and reuses the Plugins activation and configuration slots. The system permission rows remain visible while unknown fields use placeholders; platform-specific guidance updates once the platform is identified. System checks, application decisions, and application icons fill in as each query completes. Application names and actions do not wait for icons; icon positions retain their space. User actions run in order without waiting for pending observation queries. Disposal waits for both actions and queries to settle before releasing the separately owned Remote mount. Known query errors stay visible while management operations or retries run, with their actions disabled. Query errors stay with the affected section, and activation guidance depends only on system checks. The injection layer observes Plugin Manager operations independently of the page. Bundle and row changes pause permission queries and invalidate in-flight results; settlement refreshes observations even after the page closes. Last known errors remain until a successful read. Disposal discards late results. When no native system observation is available, the controller reads the Host plugin inventory to identify an enabled Windows provider so startup helper failures still render the Windows warning layout. It projects queries into the page and setup dialog; reconnects refresh it. Page entry, focus and completed actions read the current permission store. Operation notices live in the shell overlay, so closing the page does not remove them. The provider owns permission checks, persisted decisions, and cancellation; the browser owns no authorization state. +The optional browser contribution mounts the native provider's permission Remote and reuses the Plugins activation and configuration slots. The system permission rows remain visible while unknown fields use placeholders; platform-specific guidance updates once the platform is identified. System checks, application decisions, and application icons fill in as each query completes. Application names and actions do not wait for icons; icon positions retain their space. User actions run in order without waiting for pending observation queries. Disposal waits for both actions and queries to settle before releasing the separately owned Remote mount. Known query errors stay visible while management operations or retries run, with their actions disabled. Query errors stay with the affected section, and activation guidance depends only on system checks. The injection layer observes Plugin Manager operations independently of the page. Bundle and row changes pause permission queries and invalidate in-flight results; settlement refreshes observations even after the page closes. Last known errors remain until a successful read. Disposal discards late results. When no native system observation is available, the controller reads the Host plugin inventory to identify an enabled Windows provider so startup helper failures still render the Windows warning layout. If that lookup also fails, the page shows the lookup failure in place of the native query error and offers a retry. It projects queries into the page and setup dialog; reconnects refresh it. Page entry, focus and completed actions read the current permission store. Operation notices live in the shell overlay, so closing the page does not remove them. The provider owns permission checks, persisted decisions, and cancellation; the browser owns no authorization state. ----- diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index a6e7580b0b..4ad9c0b2fd 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -133,7 +133,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 平台提供方从 `@deepseek-ai/dsh-cua/config` 导入 `CuaConfigFields` 来扩展共享配置。根 Host 入口导出 `installCua`、`CuaConfig` 和供 Typert 发现的 `CuaAccess` 服务,`apply()` 只标记可选 Client 贡献。`/client` 通过现有模块加载器加载权限界面。Host 和 Client 使用独立编译项目,headless 导入不会加载 React、CSS 或浏览器注册。`/api` 提供应用、窗口 API 及其类型;`/bridge`、`/native-client` 和 `/protocol` 保留运行时和平台消费者。`/types` 仅导出生成 Remote 声明所需的命名类型,Client 使用包内类型。`/typert` 提供 Host 反射,`/remote` 提供浏览器描述和编解码,权限判断仍由 Host 执行。 -可选浏览器插件挂载原生 provider 的权限 Remote,复用插件页的启用引导和配置插槽。系统权限始终可见,未加载的字段保留占位;平台确认后按平台展示对应说明。系统权限、应用列表和应用图标分别查询,结果返回后各自显示。应用名称和操作按钮不等待图标,图标位置保留空位。用户操作按顺序执行,不等待尚未完成的查询;卸载时等待操作和查询全部结束,再释放独立持有的 Remote 挂载。已知查询错误在管理操作或重试期间保持可见,操作按钮禁用。查询错误只显示在对应部分,启用引导只等待系统权限结果。注入层独立于页面观察插件管理操作。组合包和组件行变更会暂停权限查询,并使进行中的结果失效;操作结束后即使页面已关闭,也会重新查询。已知错误保留至读取成功;卸载后的迟到结果会被丢弃。首次读取系统权限失败时,控制器会查询主机插件清单以识别已启用的 Windows 提供方,使启动失败仍按 Windows 警告布局展示。重新连接后会刷新状态。进入页面、窗口聚焦或操作完成后读取当前授权存储。操作提示挂载到 shell overlay,关闭页面后仍可显示。provider 负责权限检查、持久授权和取消;浏览器不保存授权决定。 +可选浏览器插件挂载原生 provider 的权限 Remote,复用插件页的启用引导和配置插槽。系统权限始终可见,未加载的字段保留占位;平台确认后按平台展示对应说明。系统权限、应用列表和应用图标分别查询,结果返回后各自显示。应用名称和操作按钮不等待图标,图标位置保留空位。用户操作按顺序执行,不等待尚未完成的查询;卸载时等待操作和查询全部结束,再释放独立持有的 Remote 挂载。已知查询错误在管理操作或重试期间保持可见,操作按钮禁用。查询错误只显示在对应部分,启用引导只等待系统权限结果。注入层独立于页面观察插件管理操作。组合包和组件行变更会暂停权限查询,并使进行中的结果失效;操作结束后即使页面已关闭,也会重新查询。已知错误保留至读取成功;卸载后的迟到结果会被丢弃。首次读取系统权限失败时,控制器会查询主机插件清单以识别已启用的 Windows 提供方,使启动失败仍按 Windows 警告布局展示。该查询也失败时,页面以查询失败原因替代原生查询错误,并提供重试。重新连接后会刷新状态。进入页面、窗口聚焦或操作完成后读取当前授权存储。操作提示挂载到 shell overlay,关闭页面后仍可显示。provider 负责权限检查、持久授权和取消;浏览器不保存授权决定。 ----- diff --git a/packages/experimental/cua/package.json b/packages/experimental/cua/package.json index 63a3ff2940..5cdce2848d 100644 --- a/packages/experimental/cua/package.json +++ b/packages/experimental/cua/package.json @@ -168,7 +168,8 @@ "@deepseek-ai/dsh-client-ui-user-questions": "workspace:*", "@deepseek-ai/dsh-client-ui-approval": "workspace:*", "@deepseek-ai/dsh-client-ui-conversation": "workspace:*", - "@deepseek-ai/dsh-client-ui-settings-general": "workspace:*" + "@deepseek-ai/dsh-client-ui-settings-general": "workspace:*", + "@deepseek-ai/dsh-client-ui-agent-preset": "workspace:*" }, "dsh": { "client": { diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 99af359d2f..8bc208d1a1 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -134,12 +134,13 @@ function WindowsGuidance({ system, error, busy, refresh, canOpenPresets, openPre {error !== null && {t('retry')}} />} + {/* Standing desktop conditions are notes so that opening the page does not interrupt assistive technology. */} {error === null && system !== null && <> - {system.sessionLocked === true && } - {system.sessionLocked === null && } - {system.elevated && } {system.sessionLocked === false && !system.captureAvailable && } @@ -175,6 +176,8 @@ export function PermissionPanel(props: PermissionPanelProps) { const mac = observed?.platform === 'darwin' ? observed : null const win = observed?.platform === 'windows' ? observed : null const application = state.system.error !== null ? undefined : mac?.launchApplication + // An unidentified platform outranks the native query failure because the page cannot tell which guidance applies. + const providerError = observed === null ? state.windowsProvider.error : null useEffect(() => { refresh() window.addEventListener('focus', refresh) @@ -190,7 +193,10 @@ export function PermissionPanel(props: PermissionPanelProps) {

{t('title')}

{state.system.error !== null && {t('retry')}} />} {(observed !== null || state.system.error === null) &&

= { previewNotice: '自动电脑操作仍处于实验阶段,不保证操作结果。智能体可能误点按钮或在错误的窗口中输入内容,请谨慎在重要或生产环境中使用。', ptcModeLink: 'PTC 模式', ptcRecommendation: '建议配合 {ptcMode} 使用,让智能体在同一段代码中完成应用操作并调用其他工具。', + providerLookupFailed: '无法识别自动电脑操作后端:{message}', approvalRisks: '风险提示', approvalRiskTitle: '自动电脑操作风险提示', approvalRiskNotice: '智能体只能访问你已授权的应用,并可在后台读取应用内容、操作应用。\n\n网络游戏、即时通讯等应用可能对自动化操作有所限制。违反相关规则可能导致你在该应用中的账号被暂停使用或封禁。\n\n请自行承担使用风险。如需停止自动化操作,可随时点击 DeepSeek Harness 中的停止按钮。', @@ -96,6 +98,7 @@ export const ja = { previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', ptcModeLink: 'PTC モード', ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、{ptcMode} の使用をおすすめします。', + providerLookupFailed: 'Computer Use のプロバイダーを特定できませんでした:{message}', windowsSetupTitle: 'デスクトップ実行環境を確認', windowsSetupBody: 'デスクトップがロックされています。ロックを解除して再試行してください。', windowsSessionUnknownTitle: 'デスクトップセッションを利用できません', @@ -155,6 +158,7 @@ export const es = { previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', ptcModeLink: 'modo PTC', ptcRecommendation: 'Recomendamos usar el {ptcMode} para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', + providerLookupFailed: 'No se pudo identificar el proveedor de Computer Use: {message}', windowsSetupTitle: 'Comprobar el entorno del escritorio', windowsSetupBody: 'El escritorio está bloqueado. Desbloquéalo e inténtalo de nuevo.', windowsSessionUnknownTitle: 'Sesión de escritorio no disponible', @@ -200,6 +204,7 @@ export const fr = { previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', ptcModeLink: 'mode PTC', ptcRecommendation: 'Nous recommandons d’utiliser le {ptcMode} afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', + providerLookupFailed: 'Impossible d’identifier le fournisseur de Computer Use : {message}', windowsSetupTitle: 'Vérifier l’environnement de bureau', windowsSetupBody: 'Le bureau est verrouillé. Déverrouillez-le puis réessayez.', windowsSessionUnknownTitle: 'Session de bureau indisponible', @@ -245,6 +250,7 @@ export const de = { previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', ptcModeLink: 'PTC-Modus', ptcRecommendation: 'Wir empfehlen den {ptcMode}, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', + providerLookupFailed: 'Der Computer-Use-Anbieter konnte nicht ermittelt werden: {message}', windowsSetupTitle: 'Desktopumgebung prüfen', windowsSetupBody: 'Der Desktop ist gesperrt. Entsperren Sie ihn und versuchen Sie es erneut.', windowsSessionUnknownTitle: 'Desktopsitzung nicht verfügbar', @@ -290,6 +296,7 @@ export const ru = { previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', ptcModeLink: 'режим PTC', ptcRecommendation: 'Рекомендуем использовать {ptcMode}, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', + providerLookupFailed: 'Не удалось определить поставщика Computer Use: {message}', windowsSetupTitle: 'Проверить среду рабочего стола', windowsSetupBody: 'Рабочий стол заблокирован. Разблокируйте его и повторите попытку.', windowsSessionUnknownTitle: 'Сеанс рабочего стола недоступен', @@ -335,6 +342,7 @@ export const pt = { previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', ptcModeLink: 'modo PTC', ptcRecommendation: 'Recomendamos usar o {ptcMode} para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', + providerLookupFailed: 'Não foi possível identificar o provedor do Computer Use: {message}', windowsSetupTitle: 'Verificar ambiente da área de trabalho', windowsSetupBody: 'A área de trabalho está bloqueada. Desbloqueie-a e tente novamente.', windowsSessionUnknownTitle: 'Sessão de área de trabalho indisponível', diff --git a/packages/experimental/cua/src/client/mount.ts b/packages/experimental/cua/src/client/mount.ts index 331104abda..fc7d2e82af 100644 --- a/packages/experimental/cua/src/client/mount.ts +++ b/packages/experimental/cua/src/client/mount.ts @@ -8,6 +8,7 @@ import type {} from '@deepseek-ai/dsh-client-ui-renderer/client' import type {} from '@deepseek-ai/dsh-client-ui-layout/client' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' import type {} from '@deepseek-ai/dsh-client-ui-settings-general/client' +import type { AGENT_PRESETS_SECTION_ID } from '@deepseek-ai/dsh-client-ui-agent-preset/client' import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' import type { ComposerChainProps } from '@deepseek-ai/dsh-client-ui-conversation/client' import { ApplicationApproval, selectApplicationApproval } from './ApplicationApproval.tsx' @@ -57,10 +58,12 @@ export async function mountCuaPermissions(ctx: Context, contribution: TypertRemo }) ctx.effect(() => () => controller.dispose()) ctx.on('connection/reset', face.refresh) + // A type-only import keeps the Agent presets Client out of this bundle while typechecking the section id it owns. + const presetsSection: typeof AGENT_PRESETS_SECTION_ID = 'agent-presets' const canOpenPresets = createSnapshotStore(false) ctx.inject(['settingsNavigation'], (scope) => { const sync = () => { - canOpenPresets.set(ctx.slots.entries('settings.section').some(entry => entry.options.id === 'agent-presets')) + canOpenPresets.set(ctx.slots.entries('settings.section').some(entry => entry.options.id === presetsSection)) } sync() scope.effect(() => { @@ -73,7 +76,7 @@ export async function mountCuaPermissions(ctx: Context, contribution: TypertRemo inject: () => ({ ...face, hooks: { ...face.hooks, canOpenPresets }, - openPresets: () => { ctx.get('settingsNavigation')?.open('agent-presets') }, + openPresets: () => { ctx.get('settingsNavigation')?.open(presetsSection) }, }), }, PermissionPanel)) ctx.slots.inject('plugins.bundle.activation', () => ctx.slots.register({ diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index 4112e66f99..40cf6c61f9 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -433,24 +433,22 @@ it.each([true, false, null] as const)('omits system permissions on Windows and p expect(instructions.compareDocumentPosition(privileges) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(privileges.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() if (sessionLocked === true) { - const alert = screen.getByRole('alert') - expect(within(alert).getByText(en.windowsLockedTitle)).toBeTruthy() - expect(within(alert).getByText(en.windowsLockedBody)).toBeTruthy() - expect(alert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + const note = screen.getByText(en.windowsLockedTitle).closest('[role="note"]')! + expect(within(note as HTMLElement).getByText(en.windowsLockedBody)).toBeTruthy() + expect(note.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() } else if (sessionLocked === null) { - const alert = screen.getByRole('alert') - expect(within(alert).getByText(en.windowsSessionUnknownTitle)).toBeTruthy() - expect(within(alert).getByText(en.windowsSessionUnknown)).toBeTruthy() - expect(alert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() - } else { - expect(screen.queryByRole('alert')).toBeNull() + const note = screen.getByText(en.windowsSessionUnknownTitle).closest('[role="note"]')! + expect(within(note as HTMLElement).getByText(en.windowsSessionUnknown)).toBeTruthy() + expect(note.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() } + // Standing desktop conditions never interrupt assistive technology. + expect(screen.queryByRole('alert')).toBeNull() f.publish({ system: { value: { platform: 'windows', sessionLocked: false, captureAvailable: false, elevated: true, helper: {} }, error: null, busy: false } }) - const adminAlert = screen.getByRole('alert') - expect(within(adminAlert).getByText(en.windowsElevatedTitle)).toBeTruthy() - expect(within(adminAlert).getByText(en.windowsElevatedWarning)).toBeTruthy() - expect(adminAlert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + expect(screen.queryByRole('alert')).toBeNull() + const adminNote = screen.getByText(en.windowsElevatedTitle).closest('[role="note"]')! + expect(within(adminNote as HTMLElement).getByText(en.windowsElevatedWarning)).toBeTruthy() + expect(adminNote.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() const captureNotice = screen.getByText(en.windowsCaptureUnavailableTitle) expect(screen.getByText(en.windowsCaptureUnavailableNotice)).toBeTruthy() expect(captureNotice.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() @@ -480,6 +478,22 @@ it('shows the Windows helper warning above the experimental notice when startup expect(alert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() }) +it('reports a failed provider lookup instead of the native error until the platform is known', () => { + const f = fixture() + f.publish({ system: { value: null, error: 'helper missing', busy: false }, windowsProvider: { value: null, error: 'offline', busy: false } }) + render() + const alert = screen.getByRole('alert') + expect(within(alert).getByText(en.providerLookupFailed.replace('{message}', 'offline'))).toBeTruthy() + expect(within(alert).getByText(en.queryFailedHint)).toBeTruthy() + expect(screen.queryByText(en.queryFailed.replace('{message}', 'helper missing'))).toBeNull() + fireEvent.click(within(alert).getByRole('button', { name: en.retry })) + expect(f.props.refresh).toHaveBeenCalledTimes(2) + f.publish({ system: { value: null, error: 'helper missing', busy: false }, windowsProvider: { value: false, error: null, busy: false } }) + expect(within(screen.getByRole('alert')).getByText(en.queryFailed.replace('{message}', 'helper missing'))).toBeTruthy() + f.publish({ system: { value: value.system, error: null, busy: false } }) + expect(screen.queryByRole('alert')).toBeNull() +}) + it.each([[true, true], [false, true], [false, false], [null, true]] as const)('offers Windows setup for lock=%s and capture=%s', (sessionLocked, captureAvailable) => { const f = fixture(), onDismiss = vi.fn() f.publish({ system: { value: { platform: 'windows', sessionLocked, captureAvailable, diff --git a/packages/experimental/cua/tsconfig.client.json b/packages/experimental/cua/tsconfig.client.json index e1c704ea1a..10eb441e74 100644 --- a/packages/experimental/cua/tsconfig.client.json +++ b/packages/experimental/cua/tsconfig.client.json @@ -60,6 +60,9 @@ }, { "path": "../../client/ui-settings-general/tsconfig.client.json" + }, + { + "path": "../../client/ui-agent-preset/tsconfig.json" } ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e88683a6cc..b1af17d870 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11185,6 +11185,9 @@ importers: '@deepseek-ai/dsh-client-test-runtime': specifier: workspace:* version: link:../../test-support/client-runtime + '@deepseek-ai/dsh-client-ui-agent-preset': + specifier: workspace:* + version: link:../../client/ui-agent-preset '@deepseek-ai/dsh-client-ui-approval': specifier: workspace:* version: link:../../client/ui-approval From c878796e5ea714826fac842e89445c8681b8fede Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 17:56:59 +0800 Subject: [PATCH 10/17] fix(cua): settle platform-refusal tests and the pending Windows lookup - Update the bundle-platform and preview-boot Web e2e tests for the supported-platform list; the bundle-platform fixture declares freebsd so one golden matches every CI Host. - Assert the returned platform list in the plugin manager refusal tests. - Keep the system permissions placeholder while the Host inventory lookup decides whether a Windows provider is enabled, instead of flashing the macOS failure layout. - Use the macOS German names for Accessibility and Screen Recording. --- apps/web/tests/bundle-platform.e2e.ts | 9 +++++---- .../bundle-platform/unsupported-platform.expected.md | 2 +- apps/web/tests/preview-boot.e2e.ts | 2 +- packages/boot/plugin-manager/tests/manager.spec.ts | 11 +++++++---- .../experimental/cua/src/client/PermissionPanel.tsx | 9 ++++++--- packages/experimental/cua/src/client/locales.ts | 2 +- packages/experimental/cua/tests/panel.client.spec.tsx | 5 +++++ 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/apps/web/tests/bundle-platform.e2e.ts b/apps/web/tests/bundle-platform.e2e.ts index 6ade4d22f3..406028a4fa 100644 --- a/apps/web/tests/bundle-platform.e2e.ts +++ b/apps/web/tests/bundle-platform.e2e.ts @@ -19,7 +19,7 @@ it('disables unsupported bundles, shows the Host restriction, and refuses direct }) const name = 'host-platform-only' await writeFile(join(root, 'package.json'), JSON.stringify({ name, version: '1.0.0', dsh: { bundle: { - patch: './cordis.patch.yml', platforms: [process.platform === 'darwin' ? 'win32' : 'darwin'], + patch: './cordis.patch.yml', platforms: ['freebsd'], } } })) await writeFile(join(root, 'cordis.patch.yml'), '- id: ptc-runtime\n config:\n executionMode: persistent-in-memory\n replScoped: false\n') const scaffold = owned.scaffold = await launchWebScaffold({ profile: { packages: [{ dir: root }] } }) @@ -28,7 +28,8 @@ it('disables unsupported bundles, shows the Host restriction, and refuses direct await page.goto(scaffold.authenticatedUrl) await connectFreshWorkspaceZh(page, scaffold.workspaceCwd) await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click() - const reason = '此插件不支持运行 DSH 的主机操作系统' + // No CI runner is FreeBSD, so one golden covers every Host; the id has no localized label and renders verbatim. + const reason = '此插件仅支持 freebsd' const card = page.locator(`[data-plugin-package="${name}"]`) await card.getByText(reason, { exact: true }).waitFor() expect(await card.getByRole('switch').isEnabled()).toBe(false) @@ -48,12 +49,12 @@ it('disables unsupported bundles, shows the Host restriction, and refuses direct expect(await cua.count()).toBe(cuaSupported ? 1 : 0) if (!cuaSupported) { expect((await scaffold.ctx.pluginManager.listBundles()).find(bundle => bundle.name === '@deepseek-ai/dsh-cua-bundle')) - .toMatchObject({ listedByDefault: false, enabled: false, error: { code: 'unsupported-platform' } }) + .toMatchObject({ listedByDefault: false, enabled: false, error: { code: 'unsupported-platform', platforms: ['freebsd'] } }) names.push('@deepseek-ai/dsh-cua-bundle') } for (const bundle of names) { expect(await scaffold.ctx.pluginManager.setBundleEnabled(bundle, true)).toMatchObject({ - changed: false, application: 'failed', error: { code: 'unsupported-platform' }, + changed: false, application: 'failed', error: { code: 'unsupported-platform', platforms: ['freebsd'] }, }) } expect(await readFile(manifest, 'utf8')).toBe(before) diff --git a/apps/web/tests/expected/bundle-platform/unsupported-platform.expected.md b/apps/web/tests/expected/bundle-platform/unsupported-platform.expected.md index b6aa94aa05..e6cbff4e4c 100644 --- a/apps/web/tests/expected/bundle-platform/unsupported-platform.expected.md +++ b/apps/web/tests/expected/bundle-platform/unsupported-platform.expected.md @@ -1 +1 @@ -- status: 此插件不支持运行 DSH 的主机操作系统 +- status: 此插件仅支持 freebsd diff --git a/apps/web/tests/preview-boot.e2e.ts b/apps/web/tests/preview-boot.e2e.ts index 576f9621a1..2679610dbe 100644 --- a/apps/web/tests/preview-boot.e2e.ts +++ b/apps/web/tests/preview-boot.e2e.ts @@ -730,7 +730,7 @@ async function toggleOptionalBundles(page: Page): Promise { expect(result.toggles.map(toggle => toggle.name).filter(name => standalone.includes(name))).toEqual([]) expect(result.optional.filter(entry => entry.enabled || entry.availability !== 'installation')).toEqual([]) expect(result.optional.filter(entry => entry.error !== null)).toEqual([ - expect.objectContaining({ name: '@deepseek-ai/dsh-cua-bundle', error: { code: 'unsupported-platform' } }), + expect.objectContaining({ name: '@deepseek-ai/dsh-cua-bundle', error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] } }), ]) // Metadata resolves through the Worker's Node internal modules: every optional bundle shows its title and icon. expect(result.optional.filter(entry => entry.metaError !== null || entry.title !== 'object' || entry.icon !== 'string')).toEqual([]) diff --git a/packages/boot/plugin-manager/tests/manager.spec.ts b/packages/boot/plugin-manager/tests/manager.spec.ts index b17c4b58ad..c798e86b4d 100644 --- a/packages/boot/plugin-manager/tests/manager.spec.ts +++ b/packages/boot/plugin-manager/tests/manager.spec.ts @@ -110,9 +110,12 @@ it.each(['live', 'startup'] as const)('refuses an unsupported bundle before savi const before = readFileSync(join(dir, 'package.json'), 'utf8') const patchBefore = readFileSync(join(dir, 'cordis.patch.yml'), 'utf8') expect((await manager.listBundles()).find(row => row.name === 'extra')).toMatchObject({ - enabled: false, installed: true, listedByDefault: false, description: 'Platform-limited bundle', error: { code: 'unsupported-platform' }, + enabled: false, installed: true, listedByDefault: false, description: 'Platform-limited bundle', + error: { code: 'unsupported-platform', platforms: [process.platform === 'darwin' ? 'win32' : 'darwin'] }, + }) + expect(await manager.setBundleEnabled('extra', true)).toMatchObject({ + changed: false, application: 'failed', error: { code: 'unsupported-platform', platforms: [process.platform === 'darwin' ? 'win32' : 'darwin'] }, }) - expect(await manager.setBundleEnabled('extra', true)).toMatchObject({ changed: false, application: 'failed', error: { code: 'unsupported-platform' } }) expect(readFileSync(join(dir, 'package.json'), 'utf8')).toBe(before) expect(ctx.get('managedProbe')).toBeUndefined() expect(readFileSync(join(dir, 'cordis.patch.yml'), 'utf8')).toBe(patchBefore) @@ -1836,7 +1839,7 @@ it('lists absent Official entries offline without resolving their packages or co name: entry.packageName, official: true, availability: 'missing', enabled: false, installed: false, optional: false, removable: false, rows: [], overrides: [], meta: entry.meta, ...entry.platforms !== undefined && !entry.platforms.includes(process.platform) - ? { listedByDefault: false, error: { code: 'unsupported-platform' } } : {}, + ? { listedByDefault: false, error: { code: 'unsupported-platform', platforms: [...entry.platforms] } } : {}, installTarget: { spec: `${entry.packageName}@${getDshRuntimeVersion()}`, version: getDshRuntimeVersion() }, }]) expect(resolve.mock.calls.some(([name]) => name === entry.packageName)).toBe(false) @@ -1860,7 +1863,7 @@ it.each([false, true])('applies offline platform admission to an uninstalled Off } expect((await manager.listBundles()).find(bundle => bundle.name === entry.packageName)).toMatchObject({ installed: false, availability: 'missing', enabled: selected, listedByDefault: false, - error: { code: 'unsupported-platform' }, + error: { code: 'unsupported-platform', platforms: [process.platform === 'darwin' ? 'linux' : 'darwin'] }, }) if (selected) { expect(await manager.setBundleEnabled(entry.packageName, false)).toMatchObject({ changed: true, enabled: false }) diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 8bc208d1a1..f294cf16a9 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -172,7 +172,10 @@ export function PermissionPanel(props: PermissionPanelProps) { const transitioning = state.changing const busy = transitioning || state.system.busy const appsBusy = transitioning || state.applications.busy - const loading = observed === null && state.system.error === null + // A failed native query leaves the platform unknown until the Host inventory says whether a Windows provider is enabled. + const platformPending = observed === null && state.system.error !== null + && state.windowsProvider.value === null && state.windowsProvider.error === null + const loading = observed === null && (state.system.error === null || platformPending) const mac = observed?.platform === 'darwin' ? observed : null const win = observed?.platform === 'windows' ? observed : null const application = state.system.error !== null ? undefined : mac?.launchApplication @@ -192,13 +195,13 @@ export function PermissionPanel(props: PermissionPanelProps) {

{t('title')}

- {state.system.error !== null && {t('retry')}} />} - {(observed !== null || state.system.error === null) &&

diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index 11db25aa72..c610bce436 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -275,7 +275,7 @@ export const de = { setupBody: 'Computer Use ist aktiviert und benötigt die Berechtigungen für Bedienungshilfen und Bildschirmaufnahme. Öffnen Sie die Plugin-Details, um die Einrichtung abzuschließen.', setupQueryFailed: 'Computer Use ist aktiviert, aber die Systemberechtigungen konnten nicht geprüft werden. Öffnen Sie die Plugin-Details, um den Fehler anzuzeigen und es erneut zu versuchen.', openSetup: 'Einstellungen öffnen', later: 'Später', close: 'Schließen', - accessibility: 'Barrierefreiheit', screenRecording: 'Bildschirmaufzeichnung', + accessibility: 'Bedienungshilfen', screenRecording: 'Bildschirmaufnahme', accessibilityUse: 'Oberflächeninhalte lesen, klicken und tippen.', screenRecordingUse: 'Das Fenster der ausgewählten Anwendung aufnehmen.', accessibilityPermission: 'Erlauben Sie {application}, Oberflächeninhalte zu lesen, zu klicken und zu tippen.', screenRecordingPermission: 'Erlauben Sie {application}, das Fenster der ausgewählten Anwendung aufzunehmen.', diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index 40cf6c61f9..0c1623a264 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -92,6 +92,11 @@ it.each([en, zh])('waits for platform identification before offering system perm expect(screen.queryByRole('group', { name: dictionary.accessibility })).toBeNull() expect(screen.getByText(dictionary.permissionsIntro).getAttribute('aria-hidden')).toBe('true') f.publish({ system: { ...f.state.getSnapshot().system, busy: false, error: 'connection lost' }, busy: false }) + // The provider lookup has not answered yet, so neither platform's layout or failure appears. + expect(screen.queryByRole('alert')).toBeNull() + expect(screen.queryAllByText(dictionary.unknown)).toHaveLength(0) + expect(screen.getByText(dictionary.permissionsIntro).getAttribute('aria-hidden')).toBe('true') + f.publish({ windowsProvider: { value: false, error: null, busy: false } }) expect(screen.getAllByText(dictionary.unknown)).toHaveLength(2) expect(screen.queryByText(dictionary.granted)).toBeNull() expect(screen.queryByRole('button', { name: dictionary.request })).toBeNull() From 6bac0e3e41665e04e65cddd4efe79c32d4104230 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 18:11:25 +0800 Subject: [PATCH 11/17] test(web): expect the Computer Use bundle's own platforms on unsupported Hosts The Linux branch of the bundle-platform e2e checks the real Computer Use bundle, which declares darwin and win32, not the synthetic fixture's freebsd. --- apps/web/tests/bundle-platform.e2e.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/tests/bundle-platform.e2e.ts b/apps/web/tests/bundle-platform.e2e.ts index 406028a4fa..918346e7d4 100644 --- a/apps/web/tests/bundle-platform.e2e.ts +++ b/apps/web/tests/bundle-platform.e2e.ts @@ -42,19 +42,19 @@ it('disables unsupported bundles, shows the Host restriction, and refuses direct const beforeRuntime = runtimeId() expect(beforeRuntime).toBeTypeOf('number') expect(scaffold.ctx.ptcRuntime.programFormat).toBe('scoped-repl') - const names = [name] + const refusals: [string, string[]][] = [[name, ['freebsd']]] await page.locator('[data-plugin-panel]').getByRole('button', { name: '更多', exact: true }).click() const cua = page.locator('[data-plugin-package="@deepseek-ai/dsh-cua-bundle"]') const cuaSupported = process.platform === 'darwin' || process.platform === 'win32' expect(await cua.count()).toBe(cuaSupported ? 1 : 0) if (!cuaSupported) { expect((await scaffold.ctx.pluginManager.listBundles()).find(bundle => bundle.name === '@deepseek-ai/dsh-cua-bundle')) - .toMatchObject({ listedByDefault: false, enabled: false, error: { code: 'unsupported-platform', platforms: ['freebsd'] } }) - names.push('@deepseek-ai/dsh-cua-bundle') + .toMatchObject({ listedByDefault: false, enabled: false, error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] } }) + refusals.push(['@deepseek-ai/dsh-cua-bundle', ['darwin', 'win32']]) } - for (const bundle of names) { + for (const [bundle, platforms] of refusals) { expect(await scaffold.ctx.pluginManager.setBundleEnabled(bundle, true)).toMatchObject({ - changed: false, application: 'failed', error: { code: 'unsupported-platform', platforms: ['freebsd'] }, + changed: false, application: 'failed', error: { code: 'unsupported-platform', platforms }, }) } expect(await readFile(manifest, 'utf8')).toBe(before) From 0443300f4cb4092ecb1e1535556280651cb90a80 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 21:32:23 +0800 Subject: [PATCH 12/17] revert(cua): drop the PTC mode link to Settings Keeps the PR focused on copy and layout: removes the settingsNavigation service, the Agent presets section id export, and the inline link; the PTC recommendation stays as plain text. --- apps/web/tests/cua-permissions.e2e.ts | 6 ---- .../cua-permissions/missing.expected.md | 5 +-- .../ui-agent-preset/src/client/index.ts | 6 ---- .../tests/apply.client.spec.ts | 4 +-- .../ui-settings-general/README.i18n.yaml | 4 +-- packages/client/ui-settings-general/README.md | 2 +- .../client/ui-settings-general/README.zh.md | 2 +- .../ui-settings-general/src/client/index.ts | 21 +----------- .../tests/apply.client.spec.ts | 15 --------- packages/experimental/cua/README.i18n.yaml | 4 +-- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- packages/experimental/cua/package.json | 4 +-- .../cua/src/client/PermissionPanel.module.css | 16 ---------- .../cua/src/client/PermissionPanel.tsx | 32 +++---------------- .../experimental/cua/src/client/locales.ts | 24 +++++--------- packages/experimental/cua/src/client/mount.ts | 23 +------------ .../cua/tests/mount.client.spec.ts | 29 ----------------- .../cua/tests/panel.client.spec.tsx | 24 +++++--------- .../experimental/cua/tsconfig.client.json | 6 ---- pnpm-lock.yaml | 6 ---- scripts/gen-cordis-catalog.ts | 1 - 22 files changed, 35 insertions(+), 203 deletions(-) diff --git a/apps/web/tests/cua-permissions.e2e.ts b/apps/web/tests/cua-permissions.e2e.ts index 5c7fa5aa9c..825012939f 100644 --- a/apps/web/tests/cua-permissions.e2e.ts +++ b/apps/web/tests/cua-permissions.e2e.ts @@ -170,12 +170,6 @@ it.skipIf(process.platform !== 'darwin')('keeps system requests pending until fr await expect.poll(() => accessibility.locator('img').evaluate((image: HTMLImageElement) => image.naturalWidth)).toBe(1) await expect.poll(() => panel.getAttribute('aria-busy')).toBe('false') await compareOrRefreshGolden(expected, await captureStableAria(page, '[data-cua-settings]', scaffold.workspaceCwd), webSnapshotMode()) - await panel.getByRole('button', { name: 'PTC mode', exact: true }).click() - const settingsDialog = page.getByRole('dialog', { name: 'Settings', exact: true }) - await settingsDialog.waitFor() - expect(await settingsDialog.getByRole('button', { name: 'Agent presets', exact: true }).getAttribute('aria-current')).toBe('true') - await page.keyboard.press('Escape') - await settingsDialog.waitFor({ state: 'hidden' }) try { for (const width of [1680, 390]) { await page.setViewportSize({ width, height: 1000 }) diff --git a/apps/web/tests/expected/cua-permissions/missing.expected.md b/apps/web/tests/expected/cua-permissions/missing.expected.md index b3ea362800..835fdc977b 100644 --- a/apps/web/tests/expected/cua-permissions/missing.expected.md +++ b/apps/web/tests/expected/cua-permissions/missing.expected.md @@ -2,10 +2,7 @@ - note: - paragraph: Experimental feature - paragraph: Computer use is experimental and results are not guaranteed. The agent may click the wrong button or type in the wrong window. Use caution in important or production environments. - - paragraph: - - text: We recommend using - - button "PTC mode" - - text: so the agent can operate apps and call other tools in the same program. + - paragraph: We recommend using PTC mode so the agent can operate apps and call other tools in the same program. - heading "System permissions" [level=3] - paragraph: "Computer use requires the following system permissions to run:" - group "Accessibility": diff --git a/packages/client/ui-agent-preset/src/client/index.ts b/packages/client/ui-agent-preset/src/client/index.ts index 1ee1fb36ef..2b9e420561 100644 --- a/packages/client/ui-agent-preset/src/client/index.ts +++ b/packages/client/ui-agent-preset/src/client/index.ts @@ -61,12 +61,6 @@ export type { AgentPresetSectionState, PresetView } from './section-store.ts' export type { AgentPresetOption, AgentPresetSettingsState } from './settings-store.ts' export { AGENT_PRESET_SETTINGS_NS, writeDefaultPreset } from './settings-store.ts' -/** - * `settings.section` id of the Agent presets page, for callers of `settingsNavigation.open`. - * The registration repeats it literally so the Client slot catalog can read it. - */ -export const AGENT_PRESETS_SECTION_ID = 'agent-presets' - /** Required services (cordis fiber inject); `uiResponsive` owns the hero chip's `useMediaQuery` prop. */ export const inject = [ 'slots', 'sessions', 'locale', 'remote', 'remote.agentPresets', 'remote.settings', 'configForms', 'uiResponsive', diff --git a/packages/client/ui-agent-preset/tests/apply.client.spec.ts b/packages/client/ui-agent-preset/tests/apply.client.spec.ts index 4372ff528d..bb16881265 100644 --- a/packages/client/ui-agent-preset/tests/apply.client.spec.ts +++ b/packages/client/ui-agent-preset/tests/apply.client.spec.ts @@ -14,7 +14,7 @@ import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-c import { RemoteError, StaticUiResponsive, TestRemote } from '@deepseek-ai/dsh-client-test-runtime' import type { SessionId } from '@deepseek-ai/dsh-session' import { apply as settingsApply, inject as settingsInject } from '@deepseek-ai/dsh-client-ui-settings/client' -import { AGENT_PRESETS_SECTION_ID, apply, inject } from '@deepseek-ai/dsh-client-ui-agent-preset/client' +import { apply, inject } from '@deepseek-ai/dsh-client-ui-agent-preset/client' import { AgentPresetLabel } from '../src/client/AgentPresetLabel.tsx' import type { AgentPresetLabelInjected } from '../src/client/AgentPresetLabel.tsx' import { AgentPresetSection } from '../src/client/AgentPresetSection.tsx' @@ -365,7 +365,7 @@ describe('ui-agent-preset apply', () => { expect(slots.entries('settings.general.item')).toHaveLength(0) const section = slots.entries('settings.section')[0]! expect(section.component).toBe(AgentPresetSection) - expect(section.options).toMatchObject({ id: AGENT_PRESETS_SECTION_ID, order: 20 }) + expect(section.options).toMatchObject({ id: 'agent-presets', order: 20 }) // The nav label is a locale-following thunk; owners resolve it at read time. expect(resolveSlotLabel(section.options.label)).toBe('Agent 预设') }) diff --git a/packages/client/ui-settings-general/README.i18n.yaml b/packages/client/ui-settings-general/README.i18n.yaml index 06198397bf..a2a637d92f 100644 --- a/packages/client/ui-settings-general/README.i18n.yaml +++ b/packages/client/ui-settings-general/README.i18n.yaml @@ -15,8 +15,8 @@ en: c70d04baca0434f1 zh: e0361f83e76dd846 /deepseek-ai-dsh-client-ui-settings-general/use-this-package: - en: 07ace7bbc5588e78 - zh: 5fe17edbe0d05b19 + en: 2b3320655142ffdf + zh: 20dde077885f62aa /deepseek-ai-dsh-client-ui-settings-general/use-this-package/the-general-section: en: 3cc285b666850b78 zh: 3604a582f112d61e diff --git a/packages/client/ui-settings-general/README.md b/packages/client/ui-settings-general/README.md index 46f108e0ae..292b912d39 100644 --- a/packages/client/ui-settings-general/README.md +++ b/packages/client/ui-settings-general/README.md @@ -41,7 +41,7 @@ When the section navigation exceeds the panel's available height, the list scrol In Desktop, the account-row update control shows availability, progress, verification, readiness, and persistent retry feedback. It shares the connection indicator’s 28px height, 8px corners, 14px icon slot, 4px icon gap, and 12px medium text with an 18px line height; update-state border, fill, and text colors remain independently defined. Retry text and its dot use the same brand blue as other update labels; numeric download progress has no ellipsis and uses tabular digits with space for three digits and the percent sign to keep its width stable. The preload carries semantic phase, version, progress, and classified failures; the component resolves every visible and accessible string from the active `settings` locale, including after an in-application language change. Selecting the download percentage opens the shell’s download-status dialog; closing it leaves the download running. Selecting an available update starts downloading; installation requires a separate shell-owned confirmation. A collapsed sidebar shows the same status as a brand-blue dot on its top expand button, including failures. Connection feedback takes priority except during shell-reported installation, when the expected backend disconnect must not hide update status. Failure restores connection feedback. Both controls share one carrier subscription; browser code cannot choose packages or authorize installation. [Desktop updates](../../../apps/desktop/README.md) owns the release workflow. Checking, verifying, and preparing-to-restart tooltips show only the supplied version; without a version, they retain the state label. Desktop update tooltips preserve the complete version and prerelease suffix without adding v or V; their error summaries match the shell update dialogs, including guidance to exit fullscreen and retry after a fullscreen-transition timeout. -Settings visibility and section selection live in the shell owner store. While the Settings shell has access to `settings/describe`, it provides the optional `settingsNavigation` service so other Client plugins can open Settings or jump directly to a contributed `settings.section` id via `open(sectionId?)`. The shell supplies the effective Settings binding to the contributed launcher for menu keycaps and `aria-keyshortcuts`; the fallback button uses the same binding for hover and keyboard-focus hints and `aria-keyshortcuts`. The Settings command (Desktop: `Mod+,`; Windows/macOS Web: `Mod+Alt+,`) toggles the dialog when Settings is in front or no modal is open; the sidebar control opens the same dialog. The command cannot open or close Settings while the shortcut reference or another modal is in front. Held-key repeats do nothing. The account menu opens General settings; closing the dialog clears the section selection. Onboarding can open a specified section. Initial focus lands on the selected section in the navigation, or on the title when no sections are available, without drawing a focus outline. The section buttons precede header actions and Close in the Tab order. Tab and directional navigation retain their visible focus indicators. `Mod+/` can open the shortcut reference above Settings; `Escape` closes the top dialog and restores focus to its invoking control. Return focus omits outlines after shortcut, Escape, or pointer dismissal. +Settings visibility and section selection live in the shell owner store. The shell supplies the effective Settings binding to the contributed launcher for menu keycaps and `aria-keyshortcuts`; the fallback button uses the same binding for hover and keyboard-focus hints and `aria-keyshortcuts`. The Settings command (Desktop: `Mod+,`; Windows/macOS Web: `Mod+Alt+,`) toggles the dialog when Settings is in front or no modal is open; the sidebar control opens the same dialog. The command cannot open or close Settings while the shortcut reference or another modal is in front. Held-key repeats do nothing. The account menu opens General settings; closing the dialog clears the section selection. Onboarding can open a specified section. Initial focus lands on the selected section in the navigation, or on the title when no sections are available, without drawing a focus outline. The section buttons precede header actions and Close in the Tab order. Tab and directional navigation retain their visible focus indicators. `Mod+/` can open the shortcut reference above Settings; `Escape` closes the top dialog and restores focus to its invoking control. Return focus omits outlines after shortcut, Escape, or pointer dismissal. ### The General section diff --git a/packages/client/ui-settings-general/README.zh.md b/packages/client/ui-settings-general/README.zh.md index bc36a4b842..77f4e4cc4f 100644 --- a/packages/client/ui-settings-general/README.zh.md +++ b/packages/client/ui-settings-general/README.zh.md @@ -41,7 +41,7 @@ kind: "package-reference" 在 Desktop 中,账户行更新控件显示可用版本、进度、验证、就绪和持久重试反馈。它与连接指示器共用 28px 高度、8px 圆角、14px 图标占位、4px 图文间距,以及 12px 中等字重文字和 18px 行高;更新状态的边框、填充和文字颜色独立定义。重试文字及其圆点与其他更新文案使用相同的品牌蓝色;数字下载进度不带省略号,采用等宽数字并预留三位数字及百分号的空间,使宽度保持稳定。预加载仅传递语义化阶段、版本、进度和失败类别;组件从当前 `settings` locale 解析全部可见与无障碍文案,并在应用内语言变化后同步更新。选择下载百分比会打开壳的下载状态提示,关闭提示不影响下载。选择可用更新即开始下载;安装需要独立的壳拥有的确认。侧栏收起时,其顶部展开按钮以品牌蓝色圆点显示相同状态,包括失败状态。连接反馈通常优先展示,但壳报告正在安装时,预期的后端断开不能遮盖更新状态;失败后恢复连接反馈。两个控件共用一次载体订阅;浏览器代码不能选择安装包或授权安装。[Desktop 更新](../../../apps/desktop/README.zh.md)负责发布流程。检查中、校验中和准备重启状态的悬浮提示只显示已提供的版本号;没有版本号时保留状态文案。桌面更新提示完整保留版本号及预发布后缀,不额外添加 v 或 V;错误提示与桌面升级弹窗保持一致,包括全屏切换超时后退出全屏并重试的指引。 -设置的可见状态和分区选择由 shell owner store 保存。当设置外壳具备 `settings/describe` 权限时,它提供可选的 `settingsNavigation` 服务,供其他 Client 插件通过 `open(sectionId?)` 打开设置或直接跳转到指定的 `settings.section` 分区。外壳将设置命令的有效绑定传给入口贡献,用于菜单键帽和 `aria-keyshortcuts`;回退按钮使用相同绑定提供悬停、键盘聚焦提示和 `aria-keyshortcuts`。设置位于最前方或没有模态弹窗时,设置命令(Desktop 为 `Mod+,`,Windows/macOS Web 为 `Mod+Alt+,`)切换设置弹窗的开关;侧栏控件打开同一弹窗。快捷键速查或其他模态弹窗位于前方时,该命令不能打开或关闭设置。长按产生的重复按键不执行操作。账号菜单打开通用设置;关闭弹窗会清空分区选择。引导流程可以打开指定分区。初始焦点落在导航中选中的分区;没有可用分区时落在标题上,均不绘制焦点外轮廓线。Tab 顺序中,分区按钮先于头部操作和关闭按钮。Tab 和方向键导航保留可见焦点提示。`Mod+/` 可在设置上方打开快捷键速查;`Escape` 关闭最上层弹窗,焦点返回触发该弹窗的控件。通过快捷键、Esc 或鼠标关闭后的回焦均不绘制外轮廓线。 +设置的可见状态和分区选择由 shell owner store 保存。外壳将设置命令的有效绑定传给入口贡献,用于菜单键帽和 `aria-keyshortcuts`;回退按钮使用相同绑定提供悬停、键盘聚焦提示和 `aria-keyshortcuts`。设置位于最前方或没有模态弹窗时,设置命令(Desktop 为 `Mod+,`,Windows/macOS Web 为 `Mod+Alt+,`)切换设置弹窗的开关;侧栏控件打开同一弹窗。快捷键速查或其他模态弹窗位于前方时,该命令不能打开或关闭设置。长按产生的重复按键不执行操作。账号菜单打开通用设置;关闭弹窗会清空分区选择。引导流程可以打开指定分区。初始焦点落在导航中选中的分区;没有可用分区时落在标题上,均不绘制焦点外轮廓线。Tab 顺序中,分区按钮先于头部操作和关闭按钮。Tab 和方向键导航保留可见焦点提示。`Mod+/` 可在设置上方打开快捷键速查;`Escape` 关闭最上层弹窗,焦点返回触发该弹窗的控件。通过快捷键、Esc 或鼠标关闭后的回焦均不绘制外轮廓线。 ### 「通用」分区 diff --git a/packages/client/ui-settings-general/src/client/index.ts b/packages/client/ui-settings-general/src/client/index.ts index ab516cbcaf..21710ffe46 100644 --- a/packages/client/ui-settings-general/src/client/index.ts +++ b/packages/client/ui-settings-general/src/client/index.ts @@ -70,19 +70,6 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { } } -declare module '@deepseek-ai/cordis' { - interface Context { - /** Cross-plugin navigation to the Settings modal. */ - settingsNavigation: { - /** - * Open Settings, optionally selecting a contributed section by id. - * @param sectionId - optional `settings.section` registration id. - */ - open(sectionId?: string): void - } - } -} - /** Dictionary namespace owned by this plugin (shell chrome + General copy). */ const NS = 'settings' @@ -305,13 +292,7 @@ export function apply(ctx: ClientContext): void { }, inject: shellInjected, }, SettingsRoot) - const disposeNavigation = ctx.reflect.provide('settingsNavigation', { - open: (sectionId?: string) => { - if (sectionId === undefined) shellInstance.actions.open() - else shellInstance.actions.openSection(sectionId) - }, - }) - return () => { void disposeNavigation(); disposeCommand(); disposeSlot() } + return () => { disposeCommand(); disposeSlot() } })) ctx.slots.inject('settings.trigger', () => diff --git a/packages/client/ui-settings-general/tests/apply.client.spec.ts b/packages/client/ui-settings-general/tests/apply.client.spec.ts index 2c06f322f1..cadf647d8e 100644 --- a/packages/client/ui-settings-general/tests/apply.client.spec.ts +++ b/packages/client/ui-settings-general/tests/apply.client.spec.ts @@ -430,19 +430,4 @@ describe('ui-settings-general apply', () => { await c.flush() expect(overlay()).toBeUndefined() }) - - it('exposes settingsNavigation for cross-plugin section jumps and removes it on unload', async ({ mock, start }) => { - const { c } = await client(mock, start) - const store = c.ctx.slots.entries('sidebar.settings')[0]!.store - if (store === undefined || !('create' in store)) throw new Error('expected root store handle') - const shell = store.create() - expect(shell.getSnapshot()).toEqual({ open: false, activeId: undefined }) - c.ctx.settingsNavigation.open() - expect(shell.getSnapshot()).toEqual({ open: true, activeId: undefined }) - c.ctx.settingsNavigation.open('agent-presets') - expect(shell.getSnapshot()).toEqual({ open: true, activeId: 'agent-presets' }) - await c.unload(SELF) - await c.flush() - expect(c.ctx.get('settingsNavigation')).toBeUndefined() - }) }) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 10dd1c4a10..43c02e5506 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: abb42615f37267fa - zh: 6a3fc3da94464d83 + en: 01518dfb2e7a622d + zh: 53ea58cfa19bbd1b /deepseek-ai-dsh-cua/understand-the-implementation: en: 9defaaf1e0113f11 zh: 752c7e02a8709eab diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index 81955b3adc..a22b91e18e 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -70,7 +70,7 @@ On the Computer Use detail page, permission cards, component rows, and source fa The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **System permissions** introduces the required permissions and groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. -The enabled bundle highlights the experimental notice and places the PTC recommendation in a separate paragraph; when Settings and Agent presets are available, **PTC mode** acts as an inline link that opens **Settings → Agent presets**. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. +The enabled bundle highlights the experimental notice and places the PTC recommendation in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. The page refreshes on entry, window focus, and completed actions. System-permission query failures appear directly beneath the section heading with recovery guidance and **Retry**, while retaining the last observation as unknown. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 4ad9c0b2fd..78dddd2ef6 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -70,7 +70,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 [Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限”先说明运行所需权限,再将辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 -启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议;设置与 Agent 预设可用时,其中的“PTC 模式”为行内链接,点击直接打开**设置 → Agent 预设**。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 +启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 进入页面、返回窗口和操作结束后会刷新状态。系统权限检查失败直接显示在分组标题下方,附带排查建议与“重试”,同时将上次观测标为未确认。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 diff --git a/packages/experimental/cua/package.json b/packages/experimental/cua/package.json index 5cdce2848d..e85a2f43af 100644 --- a/packages/experimental/cua/package.json +++ b/packages/experimental/cua/package.json @@ -167,9 +167,7 @@ "@deepseek-ai/dsh-storage-json": "workspace:*", "@deepseek-ai/dsh-client-ui-user-questions": "workspace:*", "@deepseek-ai/dsh-client-ui-approval": "workspace:*", - "@deepseek-ai/dsh-client-ui-conversation": "workspace:*", - "@deepseek-ai/dsh-client-ui-settings-general": "workspace:*", - "@deepseek-ai/dsh-client-ui-agent-preset": "workspace:*" + "@deepseek-ai/dsh-client-ui-conversation": "workspace:*" }, "dsh": { "client": { diff --git a/packages/experimental/cua/src/client/PermissionPanel.module.css b/packages/experimental/cua/src/client/PermissionPanel.module.css index 8524255c0f..21d9e81507 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.module.css +++ b/packages/experimental/cua/src/client/PermissionPanel.module.css @@ -44,22 +44,6 @@ color: var(--dsw-alias-label-primary); font-weight: 500; } -.inlineLink { - display: inline; - padding: 0; - border: 0; - background: transparent; - color: var(--dsw-alias-link); - font: inherit; - text-decoration: underline; - text-underline-offset: 2px; - cursor: pointer; -} -.inlineLink:focus-visible { - outline: 2px solid var(--dsw-alias-link); - outline-offset: 2px; - border-radius: var(--dsw-radius-xs); -} .card { min-width: 0; border: 0.5px solid var(--dsw-alias-border-l3); border-radius: var(--dsw-radius-md); } .card > * + * { border-top: 0.5px solid var(--dsw-alias-border-l3); } .panel h3 { margin: 0; font-size: 14px; font-weight: 500; } diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index f294cf16a9..80aad4bf09 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -2,7 +2,6 @@ import { useEffect, type ReactNode } from 'react' import { Button, IconLayersOutlineRegular, IconSettingsOutlineRegular, IconWarningOutlineRegular, Modal, Toast } from '@deepseek-ai/dsh-client-ui-primitives' import { assertNever } from '@deepseek-ai/dsh-util-values' -import type { SnapshotStore } from '@deepseek-ai/dsh-client-store' import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' import type { CuaApplicationGrant, CuaSystemPermissionState } from '../access-types.ts' @@ -13,12 +12,6 @@ import css from './PermissionPanel.module.css' /** Renderer-bound permission observation and localized controls. */ export type PermissionProps = InjectFace & PropsLocale -/** Permission page controls plus optional Settings navigation to Agent presets. */ -export type PermissionPanelProps = PermissionProps & InjectFace<{ - hooks: { canOpenPresets: SnapshotStore } - openPresets: () => void -}> - /** Permission guidance only navigates to the existing bundle details. */ export type PermissionSetupProps = PermissionProps & Pick, 'onDismiss' | 'onOpenDetails'> @@ -112,23 +105,10 @@ function NoticeBox({ tone, role, title, body, action }: {

} -function PtcRecommendation({ canOpenPresets, openPresets, t }: Pick & { - canOpenPresets: boolean -}) { - const [before, after] = t('ptcRecommendation').split('{ptcMode}') - const label = t('ptcModeLink') - return

- {before} - {canOpenPresets ? : label} - {after} -

-} - -function WindowsGuidance({ system, error, busy, refresh, canOpenPresets, openPresets, t }: Pick & { +function WindowsGuidance({ system, error, busy, refresh, t }: Pick & { system: Extract | null error: string | null busy: boolean - canOpenPresets: boolean }) { return
{error !== null &&

{t('windowsInstructions')}

{error === null && system !== null && !system.elevated &&

{t('standardPrivileges')}

} - +

{t('ptcRecommendation')}

} @@ -162,10 +142,9 @@ function systemReady(system: CuaSystemPermissionState): boolean { } /** @param props Host observation and explicit user actions. @returns Permission controls without automatic system prompts. */ -export function PermissionPanel(props: PermissionPanelProps) { +export function PermissionPanel(props: PermissionProps) { const { t, refresh } = props const state = props.useCuaPermissions(value => value) - const canOpenPresets = props.useCanOpenPresets(value => value) const observed = state.system.value const windows = observed?.platform === 'windows' || (observed === null && state.windowsProvider.value === true) const apps = state.applications.value @@ -187,12 +166,11 @@ export function PermissionPanel(props: PermissionPanelProps) { return () => { window.removeEventListener('focus', refresh) } }, [refresh]) return
- {windows ? + {windows ? :
- +

{t('ptcRecommendation')}

{t('title')}

{state.system.error !== null && !platformPending && = { previewNoticeTitle: '实验性功能提示', previewNotice: '自动电脑操作仍处于实验阶段,不保证操作结果。智能体可能误点按钮或在错误的窗口中输入内容,请谨慎在重要或生产环境中使用。', - ptcModeLink: 'PTC 模式', - ptcRecommendation: '建议配合 {ptcMode} 使用,让智能体在同一段代码中完成应用操作并调用其他工具。', + ptcRecommendation: '建议配合 PTC 模式使用,让智能体在同一段代码中完成应用操作并调用其他工具。', providerLookupFailed: '无法识别自动电脑操作后端:{message}', approvalRisks: '风险提示', approvalRiskTitle: '自动电脑操作风险提示', @@ -96,8 +94,7 @@ export const zh: Record = { export const ja = { previewNoticeTitle: '実験的機能について', previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', - ptcModeLink: 'PTC モード', - ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、{ptcMode} の使用をおすすめします。', + ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', providerLookupFailed: 'Computer Use のプロバイダーを特定できませんでした:{message}', windowsSetupTitle: 'デスクトップ実行環境を確認', windowsSetupBody: 'デスクトップがロックされています。ロックを解除して再試行してください。', @@ -156,8 +153,7 @@ export const ja = { export const es = { previewNoticeTitle: 'Función experimental', previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', - ptcModeLink: 'modo PTC', - ptcRecommendation: 'Recomendamos usar el {ptcMode} para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', + ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', providerLookupFailed: 'No se pudo identificar el proveedor de Computer Use: {message}', windowsSetupTitle: 'Comprobar el entorno del escritorio', windowsSetupBody: 'El escritorio está bloqueado. Desbloquéalo e inténtalo de nuevo.', @@ -202,8 +198,7 @@ export const es = { export const fr = { previewNoticeTitle: 'Fonctionnalité expérimentale', previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', - ptcModeLink: 'mode PTC', - ptcRecommendation: 'Nous recommandons d’utiliser le {ptcMode} afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', + ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', providerLookupFailed: 'Impossible d’identifier le fournisseur de Computer Use : {message}', windowsSetupTitle: 'Vérifier l’environnement de bureau', windowsSetupBody: 'Le bureau est verrouillé. Déverrouillez-le puis réessayez.', @@ -248,8 +243,7 @@ export const fr = { export const de = { previewNoticeTitle: 'Experimentelle Funktion', previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', - ptcModeLink: 'PTC-Modus', - ptcRecommendation: 'Wir empfehlen den {ptcMode}, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', + ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', providerLookupFailed: 'Der Computer-Use-Anbieter konnte nicht ermittelt werden: {message}', windowsSetupTitle: 'Desktopumgebung prüfen', windowsSetupBody: 'Der Desktop ist gesperrt. Entsperren Sie ihn und versuchen Sie es erneut.', @@ -294,8 +288,7 @@ export const de = { export const ru = { previewNoticeTitle: 'Экспериментальная функция', previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', - ptcModeLink: 'режим PTC', - ptcRecommendation: 'Рекомендуем использовать {ptcMode}, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', + ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', providerLookupFailed: 'Не удалось определить поставщика Computer Use: {message}', windowsSetupTitle: 'Проверить среду рабочего стола', windowsSetupBody: 'Рабочий стол заблокирован. Разблокируйте его и повторите попытку.', @@ -340,8 +333,7 @@ export const ru = { export const pt = { previewNoticeTitle: 'Recurso experimental', previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', - ptcModeLink: 'modo PTC', - ptcRecommendation: 'Recomendamos usar o {ptcMode} para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', + ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', providerLookupFailed: 'Não foi possível identificar o provedor do Computer Use: {message}', windowsSetupTitle: 'Verificar ambiente da área de trabalho', windowsSetupBody: 'A área de trabalho está bloqueada. Desbloqueie-a e tente novamente.', diff --git a/packages/experimental/cua/src/client/mount.ts b/packages/experimental/cua/src/client/mount.ts index fc7d2e82af..cf86dc9f02 100644 --- a/packages/experimental/cua/src/client/mount.ts +++ b/packages/experimental/cua/src/client/mount.ts @@ -7,9 +7,6 @@ import type {} from '@deepseek-ai/dsh-client-locale/client' import type {} from '@deepseek-ai/dsh-client-ui-renderer/client' import type {} from '@deepseek-ai/dsh-client-ui-layout/client' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' -import type {} from '@deepseek-ai/dsh-client-ui-settings-general/client' -import type { AGENT_PRESETS_SECTION_ID } from '@deepseek-ai/dsh-client-ui-agent-preset/client' -import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' import type { ComposerChainProps } from '@deepseek-ai/dsh-client-ui-conversation/client' import { ApplicationApproval, selectApplicationApproval } from './ApplicationApproval.tsx' import { PermissionController } from './controller.ts' @@ -58,26 +55,8 @@ export async function mountCuaPermissions(ctx: Context, contribution: TypertRemo }) ctx.effect(() => () => controller.dispose()) ctx.on('connection/reset', face.refresh) - // A type-only import keeps the Agent presets Client out of this bundle while typechecking the section id it owns. - const presetsSection: typeof AGENT_PRESETS_SECTION_ID = 'agent-presets' - const canOpenPresets = createSnapshotStore(false) - ctx.inject(['settingsNavigation'], (scope) => { - const sync = () => { - canOpenPresets.set(ctx.slots.entries('settings.section').some(entry => entry.options.id === presetsSection)) - } - sync() - scope.effect(() => { - const off = ctx.slots.subscribe('settings.section', sync) - return () => { off(); canOpenPresets.set(false) } - }) - }) ctx.slots.inject('plugins.bundle.config', () => ctx.slots.register({ - name: 'plugins.bundle.config', key: '@deepseek-ai/dsh-cua-bundle', locale: NS, - inject: () => ({ - ...face, - hooks: { ...face.hooks, canOpenPresets }, - openPresets: () => { ctx.get('settingsNavigation')?.open(presetsSection) }, - }), + name: 'plugins.bundle.config', key: '@deepseek-ai/dsh-cua-bundle', locale: NS, inject: () => face, }, PermissionPanel)) ctx.slots.inject('plugins.bundle.activation', () => ctx.slots.register({ name: 'plugins.bundle.activation', key: '@deepseek-ai/dsh-cua-bundle', locale: NS, inject: () => face, diff --git a/packages/experimental/cua/tests/mount.client.spec.ts b/packages/experimental/cua/tests/mount.client.spec.ts index 66421c7f21..29e7a77cf2 100644 --- a/packages/experimental/cua/tests/mount.client.spec.ts +++ b/packages/experimental/cua/tests/mount.client.spec.ts @@ -61,7 +61,6 @@ async function fixture(fail = false) { 'plugins.bundle.activation': { kind: 'keyed', scope: 'root' }, 'plugins.bundle.config': { kind: 'keyed', scope: 'root' }, 'shell.overlay': { kind: 'list', scope: 'root' }, 'conversation.composer': { kind: 'chain', scope: 'session' }, - 'settings.section': { kind: 'list', scope: 'root' }, } } as never, () => null) if (fail) vi.spyOn(ctx.slots, 'inject').mockImplementationOnce(() => { throw new Error('slot unavailable') }) return { ctx, changes, unmount, status, systemStatus, applicationIcons, list, @@ -69,34 +68,6 @@ async function fixture(fail = false) { } } -it('enables the PTC mode link only while settings navigation and the Agent presets section are mounted', async () => { - const f = await fixture() - try { - await f.ctx.plugin({ inject: [...inject], apply: ctx => mountCuaPermissions(ctx, contribution) }) - const injected = f.ctx.slots.entries('plugins.bundle.config')[0]!.inject!() as { - hooks: { canOpenPresets: { getSnapshot(): boolean } } - openPresets(): void - } - expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) - injected.openPresets() - const open = vi.fn() - const navFiber = f.ctx.plugin((scope) => { scope.provide('settingsNavigation', { open }) }) - await navFiber - expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) - const disposeSection = f.ctx.slots.register({ name: 'settings.section', id: 'agent-presets' } as never, () => null) - await vi.waitFor(() => { expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(true) }) - injected.openPresets() - expect(open).toHaveBeenCalledExactlyOnceWith('agent-presets') - disposeSection() - await vi.waitFor(() => { expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) }) - const disposeAgain = f.ctx.slots.register({ name: 'settings.section', id: 'agent-presets' } as never, () => null) - await vi.waitFor(() => { expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(true) }) - await navFiber.dispose() - expect(injected.hooks.canOpenPresets.getSnapshot()).toBe(false) - disposeAgain() - } finally { await f.ctx.fiber.dispose() } -}) - it('reads the Windows provider from the Host inventory when the helper cannot report permissions', async () => { const f = await fixture() try { diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index 0c1623a264..973586a498 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -5,7 +5,7 @@ import { bindSnapshotSelector, makeTranslate } from '@deepseek-ai/dsh-client-tes import { createSnapshotStore } from '@deepseek-ai/dsh-client-store' import type { CuaApplicationId, CuaApplicationState, CuaSystemPermissionState } from '../src/access-types.ts' import { afterEach, expect, it, vi } from 'vitest' -import { PermissionPanel, PermissionSetup, PermissionToast, type PermissionPanelProps } from '../src/client/PermissionPanel.tsx' +import { PermissionPanel, PermissionSetup, PermissionToast, type PermissionProps } from '../src/client/PermissionPanel.tsx' import type { PermissionView } from '../src/client/controller.ts' import { en, zh } from '../src/client/locales.ts' @@ -26,15 +26,13 @@ function fixture() { system: { value: null, busy: true, error: null }, applications: { value: null, busy: true, error: null }, icons: { value: null, busy: true, error: null }, busy: true, changing: false, toast: null, }) - const canOpenPresets = createSnapshotStore(false) const refresh = vi.fn() - const props = { useCuaPermissions: bindSnapshotSelector(state), useCanOpenPresets: bindSnapshotSelector(canOpenPresets), - t: makeTranslate(en), refresh, request: vi.fn(), openSettings: vi.fn(), openPresets: vi.fn(), revoke: vi.fn(), + const props = { useCuaPermissions: bindSnapshotSelector(state), t: makeTranslate(en), + refresh, request: vi.fn(), openSettings: vi.fn(), revoke: vi.fn(), retryApproval: vi.fn(), dismissToast: vi.fn(), - } satisfies PermissionPanelProps - return { state, canOpenPresets, props, + } satisfies PermissionProps + return { state, props, publish(patch: Partial) { act(() => { state.set({ ...state.getSnapshot(), ...patch }) }) }, - setPresetsAvailable(available: boolean) { act(() => { canOpenPresets.set(available) }) }, } } @@ -404,17 +402,11 @@ it.each([en, zh])('highlights the experimental notice and keeps the PTC recommen const note = screen.getByRole('note') expect(within(note).getByText(dictionary.previewNoticeTitle)).toBeTruthy() expect(within(note).getByText(dictionary.previewNotice)).toBeTruthy() - const fullPtc = dictionary.ptcRecommendation.replace('{ptcMode}', dictionary.ptcModeLink) - expect(within(note).queryByText(fullPtc)).toBeNull() - const ptc = screen.getByText(fullPtc) + expect(within(note).queryByText(dictionary.ptcRecommendation)).toBeNull() + const ptc = screen.getByText(dictionary.ptcRecommendation) const heading = screen.getByRole('heading', { name: dictionary.title }) expect(note.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(ptc.compareDocumentPosition(heading) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() - expect(screen.queryByRole('button', { name: dictionary.ptcModeLink })).toBeNull() - f.setPresetsAvailable(true) - const link = screen.getByRole('button', { name: dictionary.ptcModeLink }) - fireEvent.click(link) - expect(f.props.openPresets).toHaveBeenCalledOnce() }) it.each([true, false, null] as const)('omits system permissions on Windows and places warnings above the experimental notice for lock=%s', (sessionLocked) => { @@ -433,7 +425,7 @@ it.each([true, false, null] as const)('omits system permissions on Windows and p const experimental = screen.getByText(en.previewNoticeTitle) const instructions = screen.getByText(en.windowsInstructions) const privileges = screen.getByText(en.standardPrivileges) - const ptc = screen.getByText(en.ptcRecommendation.replace('{ptcMode}', en.ptcModeLink)) + const ptc = screen.getByText(en.ptcRecommendation) expect(experimental.compareDocumentPosition(instructions) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(instructions.compareDocumentPosition(privileges) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(privileges.compareDocumentPosition(ptc) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() diff --git a/packages/experimental/cua/tsconfig.client.json b/packages/experimental/cua/tsconfig.client.json index 10eb441e74..18ecf577b6 100644 --- a/packages/experimental/cua/tsconfig.client.json +++ b/packages/experimental/cua/tsconfig.client.json @@ -57,12 +57,6 @@ }, { "path": "../../client/ui-conversation/tsconfig.client.json" - }, - { - "path": "../../client/ui-settings-general/tsconfig.client.json" - }, - { - "path": "../../client/ui-agent-preset/tsconfig.json" } ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1af17d870..bfc297f736 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11185,9 +11185,6 @@ importers: '@deepseek-ai/dsh-client-test-runtime': specifier: workspace:* version: link:../../test-support/client-runtime - '@deepseek-ai/dsh-client-ui-agent-preset': - specifier: workspace:* - version: link:../../client/ui-agent-preset '@deepseek-ai/dsh-client-ui-approval': specifier: workspace:* version: link:../../client/ui-approval @@ -11206,9 +11203,6 @@ importers: '@deepseek-ai/dsh-client-ui-renderer': specifier: workspace:* version: link:../../client/ui-renderer - '@deepseek-ai/dsh-client-ui-settings-general': - specifier: workspace:* - version: link:../../client/ui-settings-general '@deepseek-ai/dsh-client-ui-slots': specifier: workspace:* version: link:../../client/ui-slots diff --git a/scripts/gen-cordis-catalog.ts b/scripts/gen-cordis-catalog.ts index 0f826ffb2f..b47c105403 100644 --- a/scripts/gen-cordis-catalog.ts +++ b/scripts/gen-cordis-catalog.ts @@ -230,7 +230,6 @@ export const SERVICE_WALK_EXEMPTIONS: Record = { conversation: 'client-side interface-typed browser service — packages/client/ui-conversation/README.md owns the API', layout: 'client-side interface-typed browser service — packages/client/ui-layout/README.md owns the API', pluginNavigation: 'client-side bundle navigation — packages/client/ui-plugin-manager/README.md owns the API', - settingsNavigation: 'client-side settings modal navigation — packages/client/ui-settings-general/README.md owns the API', pluginChanges: 'client-side read-only management activity — packages/client/ui-plugin-manager/README.md owns the API', accountSignIn: 'client-side account sign-in entry — packages/client/ui-settings-account/README.md owns the API', locale: 'client-side interface-typed browser service — packages/client/locale/README.md owns the API', From 39bdf49ea92070f7a1b4b50d4c95e7a2d946f153 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 22:42:47 +0800 Subject: [PATCH 13/17] =?UTF-8?q?fix(cua):=20point=20the=20PTC=20recommend?= =?UTF-8?q?ation=20to=20Settings=20=E2=86=92=20Agent=20presets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plain-text hint in all eight locales, using each locale's Settings and Agent presets labels. --- .../expected/cua-permissions/missing.expected.md | 2 +- packages/experimental/cua/README.i18n.yaml | 4 ++-- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- packages/experimental/cua/src/client/locales.ts | 16 ++++++++-------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/web/tests/expected/cua-permissions/missing.expected.md b/apps/web/tests/expected/cua-permissions/missing.expected.md index 835fdc977b..a570ec9372 100644 --- a/apps/web/tests/expected/cua-permissions/missing.expected.md +++ b/apps/web/tests/expected/cua-permissions/missing.expected.md @@ -2,7 +2,7 @@ - note: - paragraph: Experimental feature - paragraph: Computer use is experimental and results are not guaranteed. The agent may click the wrong button or type in the wrong window. Use caution in important or production environments. - - paragraph: We recommend using PTC mode so the agent can operate apps and call other tools in the same program. + - paragraph: We recommend using PTC mode so the agent can operate apps and call other tools in the same program. You can set it as the default in Settings → Agent presets. - heading "System permissions" [level=3] - paragraph: "Computer use requires the following system permissions to run:" - group "Accessibility": diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 43c02e5506..1b9a3fff66 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: 01518dfb2e7a622d - zh: 53ea58cfa19bbd1b + en: 2413af19d01d9afc + zh: a72323f9e9b09390 /deepseek-ai-dsh-cua/understand-the-implementation: en: 9defaaf1e0113f11 zh: 752c7e02a8709eab diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index a22b91e18e..65f0b2e414 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -70,7 +70,7 @@ On the Computer Use detail page, permission cards, component rows, and source fa The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **System permissions** introduces the required permissions and groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. -The enabled bundle highlights the experimental notice and places the PTC recommendation in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. +The enabled bundle highlights the experimental notice and places the PTC recommendation, which points to **Settings → Agent presets** for making PTC mode the default, in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. The page refreshes on entry, window focus, and completed actions. System-permission query failures appear directly beneath the section heading with recovery guidance and **Retry**, while retaining the last observation as unknown. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 78dddd2ef6..48e4a8fb73 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -70,7 +70,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 [Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限”先说明运行所需权限,再将辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 -启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 +启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议,提示可在**设置 → Agent 预设**中将其设为默认。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 进入页面、返回窗口和操作结束后会刷新状态。系统权限检查失败直接显示在分组标题下方,附带排查建议与“重试”,同时将上次观测标为未确认。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index 99030e6afe..dd31d29dab 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -4,7 +4,7 @@ export const NS = 'cuaPermissions' export const en = { previewNoticeTitle: 'Experimental feature', previewNotice: 'Computer use is experimental and results are not guaranteed. The agent may click the wrong button or type in the wrong window. Use caution in important or production environments.', - ptcRecommendation: 'We recommend using PTC mode so the agent can operate apps and call other tools in the same program.', + ptcRecommendation: 'We recommend using PTC mode so the agent can operate apps and call other tools in the same program. You can set it as the default in Settings → Agent presets.', providerLookupFailed: 'Could not identify the computer use provider: {message}', approvalRisks: 'Risks', approvalRiskTitle: 'Computer use risks', @@ -50,7 +50,7 @@ export type CuaPermissionLocaleKey = keyof typeof en export const zh: Record = { previewNoticeTitle: '实验性功能提示', previewNotice: '自动电脑操作仍处于实验阶段,不保证操作结果。智能体可能误点按钮或在错误的窗口中输入内容,请谨慎在重要或生产环境中使用。', - ptcRecommendation: '建议配合 PTC 模式使用,让智能体在同一段代码中完成应用操作并调用其他工具。', + ptcRecommendation: '建议配合 PTC 模式使用,让智能体在同一段代码中完成应用操作并调用其他工具。可在“设置 → Agent 预设”中将其设为默认。', providerLookupFailed: '无法识别自动电脑操作后端:{message}', approvalRisks: '风险提示', approvalRiskTitle: '自动电脑操作风险提示', @@ -94,7 +94,7 @@ export const zh: Record = { export const ja = { previewNoticeTitle: '実験的機能について', previewNotice: 'Computer Use は実験的な機能であり、操作結果は保証されません。エージェントが誤ったボタンをクリックしたり、別のウィンドウに入力したりする可能性があります。重要な環境や本番環境では慎重に使用してください。', - ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。', + ptcRecommendation: '同じプログラム内でアプリの操作と他のツールの呼び出しを行えるよう、PTC モードの使用をおすすめします。「設定 → エージェントプリセット」でデフォルトに設定できます。', providerLookupFailed: 'Computer Use のプロバイダーを特定できませんでした:{message}', windowsSetupTitle: 'デスクトップ実行環境を確認', windowsSetupBody: 'デスクトップがロックされています。ロックを解除して再試行してください。', @@ -153,7 +153,7 @@ export const ja = { export const es = { previewNoticeTitle: 'Función experimental', previewNotice: 'Computer Use es experimental y sus resultados no están garantizados. El agente puede pulsar el botón equivocado o escribir en la ventana incorrecta. Úsala con precaución en entornos importantes o de producción.', - ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa.', + ptcRecommendation: 'Recomendamos usar el modo PTC para que el agente pueda controlar aplicaciones y llamar a otras herramientas en el mismo programa. Puedes establecerlo como predeterminado en Configuración → Ajustes preestablecidos del agente.', providerLookupFailed: 'No se pudo identificar el proveedor de Computer Use: {message}', windowsSetupTitle: 'Comprobar el entorno del escritorio', windowsSetupBody: 'El escritorio está bloqueado. Desbloquéalo e inténtalo de nuevo.', @@ -198,7 +198,7 @@ export const es = { export const fr = { previewNoticeTitle: 'Fonctionnalité expérimentale', previewNotice: 'Computer Use est une fonctionnalité expérimentale dont les résultats ne sont pas garantis. L’agent peut cliquer sur le mauvais bouton ou saisir du texte dans la mauvaise fenêtre. Soyez prudent dans les environnements importants ou de production.', - ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme.', + ptcRecommendation: 'Nous recommandons d’utiliser le mode PTC afin que l’agent puisse piloter des applications et appeler d’autres outils dans le même programme. Vous pouvez le définir par défaut dans Paramètres → Préréglages d\'agent.', providerLookupFailed: 'Impossible d’identifier le fournisseur de Computer Use : {message}', windowsSetupTitle: 'Vérifier l’environnement de bureau', windowsSetupBody: 'Le bureau est verrouillé. Déverrouillez-le puis réessayez.', @@ -243,7 +243,7 @@ export const fr = { export const de = { previewNoticeTitle: 'Experimentelle Funktion', previewNotice: 'Computer Use ist experimentell und Ergebnisse werden nicht garantiert. Der Agent kann auf die falsche Schaltfläche klicken oder im falschen Fenster tippen. Seien Sie in wichtigen oder produktiven Umgebungen vorsichtig.', - ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann.', + ptcRecommendation: 'Wir empfehlen den PTC-Modus, damit der Agent Anwendungen bedienen und andere Werkzeuge im selben Programm aufrufen kann. Sie können ihn unter Einstellungen → Agentenvoreinstellungen als Standard festlegen.', providerLookupFailed: 'Der Computer-Use-Anbieter konnte nicht ermittelt werden: {message}', windowsSetupTitle: 'Desktopumgebung prüfen', windowsSetupBody: 'Der Desktop ist gesperrt. Entsperren Sie ihn und versuchen Sie es erneut.', @@ -288,7 +288,7 @@ export const de = { export const ru = { previewNoticeTitle: 'Экспериментальная функция', previewNotice: 'Управление компьютером находится на экспериментальной стадии, и результат не гарантируется. Агент может нажать не ту кнопку или ввести текст не в то окно. Будьте осторожны в важных и рабочих средах.', - ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе.', + ptcRecommendation: 'Рекомендуем использовать режим PTC, чтобы агент мог управлять приложениями и вызывать другие инструменты в одной программе. Его можно сделать режимом по умолчанию в разделе «Настройки → Настройки агента».', providerLookupFailed: 'Не удалось определить поставщика Computer Use: {message}', windowsSetupTitle: 'Проверить среду рабочего стола', windowsSetupBody: 'Рабочий стол заблокирован. Разблокируйте его и повторите попытку.', @@ -333,7 +333,7 @@ export const ru = { export const pt = { previewNoticeTitle: 'Recurso experimental', previewNotice: 'Computer Use é experimental e os resultados não são garantidos. O agente pode clicar no botão errado ou digitar na janela errada. Use com cautela em ambientes importantes ou de produção.', - ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa.', + ptcRecommendation: 'Recomendamos usar o modo PTC para que o agente possa operar aplicativos e chamar outras ferramentas no mesmo programa. Você pode defini-lo como padrão em Configurações → Predefinições de agente.', providerLookupFailed: 'Não foi possível identificar o provedor do Computer Use: {message}', windowsSetupTitle: 'Verificar ambiente da área de trabalho', windowsSetupBody: 'A área de trabalho está bloqueada. Desbloqueie-a e tente novamente.', From 042024d946176f2bf28b319bdd25e2c7eee081f7 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Wed, 25 Nov 2026 22:58:37 +0800 Subject: [PATCH 14/17] fix(cua): drop the Windows administrator privileges warning --- packages/experimental/cua/README.i18n.yaml | 4 ++-- packages/experimental/cua/README.md | 2 +- packages/experimental/cua/README.zh.md | 2 +- .../cua/src/client/PermissionPanel.tsx | 2 -- packages/experimental/cua/src/client/locales.ts | 16 ---------------- .../experimental/cua/tests/panel.client.spec.tsx | 6 ++---- 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/packages/experimental/cua/README.i18n.yaml b/packages/experimental/cua/README.i18n.yaml index 1b9a3fff66..f8d5fc9bbc 100644 --- a/packages/experimental/cua/README.i18n.yaml +++ b/packages/experimental/cua/README.i18n.yaml @@ -18,8 +18,8 @@ en: f04acee552aa1a44 zh: 38600adaf4cf7fa2 /deepseek-ai-dsh-cua/use-this-package/permission-controls: - en: 2413af19d01d9afc - zh: a72323f9e9b09390 + en: 2061107eb1bb3ea9 + zh: 14917f8fc4979992 /deepseek-ai-dsh-cua/understand-the-implementation: en: 9defaaf1e0113f11 zh: 752c7e02a8709eab diff --git a/packages/experimental/cua/README.md b/packages/experimental/cua/README.md index 65f0b2e414..2e7d334477 100644 --- a/packages/experimental/cua/README.md +++ b/packages/experimental/cua/README.md @@ -70,7 +70,7 @@ On the Computer Use detail page, permission cards, component rows, and source fa The [Computer Use bundle](../cua-bundle/README.md) mounts this page with its native provider. On macOS, **System permissions** introduces the required permissions and groups Accessibility and Screen Recording inside one border. Each permission row shows the responsible application’s name and icon. **Request permission** delegates to the provider with the selected permission and current Client language; the [macOS provider](../cua-macos/README.md) owns the native drag guide. An outlined **Allowed** button opens settings for revocation; unknown status uses **Unknown**. Application grants remain in a separate group. -The enabled bundle highlights the experimental notice and places the PTC recommendation, which points to **Settings → Agent presets** for making PTC mode the default, in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, administrator privileges, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. +The enabled bundle highlights the experimental notice and places the PTC recommendation, which points to **Settings → Agent presets** for making PTC mode the default, in a separate paragraph. On macOS, Accessibility and Screen Recording controls appear under **System permissions**. On Windows, the page omits the system permissions section, places active warnings (helper failure, locked or unavailable desktop, or unavailable window capture) above the experimental notice, and places desktop-unlock and standard-privilege guidance between the experimental notice and the PTC recommendation. The page refreshes on entry, window focus, and completed actions. System-permission query failures appear directly beneath the section heading with recovery guidance and **Retry**, while retaining the last observation as unknown. Opening settings or requesting permission does not establish consent. The provider owns native guidance, its configuration, and localized recovery instructions. diff --git a/packages/experimental/cua/README.zh.md b/packages/experimental/cua/README.zh.md index 48e4a8fb73..95c9f85d52 100644 --- a/packages/experimental/cua/README.zh.md +++ b/packages/experimental/cua/README.zh.md @@ -70,7 +70,7 @@ Computer Use 详情页的权限卡片、组件列表和来源信息使用 l3 边 [Computer Use 组合](../cua-bundle/README.zh.md)将本页与原生 provider 一起挂载。在 macOS 上,“系统权限”先说明运行所需权限,再将辅助功能和屏幕录制放在同一个边框内。每条权限要求显示责任应用的名称和图标。“申请权限”将所选权限和当前界面语言交给 provider;原生拖动引导由 [macOS provider](../cua-macos/README.zh.md)负责。“已允许”描边按钮打开设置以撤销权限;未知状态使用“未确认”。应用访问授权保持独立分组。 -启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议,提示可在**设置 → Agent 预设**中将其设为默认。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常或高风险警告(辅助程序连接失败、桌面锁定或不可用、管理员权限运行、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 +启用组合包后,页面高亮显示实验性功能提示,并另起一段给出 PTC 模式建议,提示可在**设置 → Agent 预设**中将其设为默认。macOS 在“系统权限”下提供辅助功能和屏幕录制授权操作;Windows 不展示系统权限分区,改为在实验性提示上方展示当前异常警告(辅助程序连接失败、桌面锁定或不可用、窗口截图不可用),并在实验性提示与 PTC 建议之间说明保持桌面解锁与普通用户权限限制。 进入页面、返回窗口和操作结束后会刷新状态。系统权限检查失败直接显示在分组标题下方,附带排查建议与“重试”,同时将上次观测标为未确认。打开设置或申请权限不代表授权完成。原生引导、配置和本地化恢复提示由 provider 负责。 diff --git a/packages/experimental/cua/src/client/PermissionPanel.tsx b/packages/experimental/cua/src/client/PermissionPanel.tsx index 80aad4bf09..18aab4096d 100644 --- a/packages/experimental/cua/src/client/PermissionPanel.tsx +++ b/packages/experimental/cua/src/client/PermissionPanel.tsx @@ -120,8 +120,6 @@ function WindowsGuidance({ system, error, busy, refresh, t }: Pick} {system.sessionLocked === null && } - {system.elevated && } {system.sessionLocked === false && !system.captureAvailable && } } diff --git a/packages/experimental/cua/src/client/locales.ts b/packages/experimental/cua/src/client/locales.ts index dd31d29dab..ab5923362b 100644 --- a/packages/experimental/cua/src/client/locales.ts +++ b/packages/experimental/cua/src/client/locales.ts @@ -21,8 +21,6 @@ export const en = { windowsCaptureUnavailableTitle: 'Window screenshots unavailable', windowsCaptureUnavailable: 'This desktop environment does not support window capture. Check your OS version and graphics driver, then try again.', windowsCaptureUnavailableNotice: 'Window capture is unavailable in this environment. Check or update your OS version and graphics driver, then try again. DeepSeek Harness can still operate apps through accessibility, with reduced capability.', - windowsElevatedTitle: 'Running with administrator privileges', - windowsElevatedWarning: 'DeepSeek Harness is running as an administrator and can access almost everything on this computer. Proceed only if you are fully aware of the risks.', windowsHelperFailed: 'Could not connect to the computer use helper: {message}', windowsInstructions: 'Keep the desktop unlocked while in use. Some actions require bringing the target app to the front.', standardPrivileges: 'Currently running with standard user privileges. Apps running with higher privileges (such as as administrator) may not be controllable.', @@ -69,8 +67,6 @@ export const zh: Record = { windowsCaptureUnavailableTitle: '窗口截图不可用', windowsCaptureUnavailable: '当前桌面环境不支持窗口截图。请检查系统版本与显卡驱动后重试。', windowsCaptureUnavailableNotice: '当前环境不支持窗口截图。请检查或更新系统版本与显卡驱动后重试。DeepSeek Harness 仍可通过辅助功能操作应用,但识别与操作能力会受限。', - windowsElevatedTitle: '当前以管理员权限运行', - windowsElevatedWarning: 'DeepSeek Harness 正以管理员权限运行,可以访问这台电脑上的几乎所有内容。请仅在充分了解风险的情况下继续使用。', windowsHelperFailed: '无法连接自动电脑操作辅助程序:{message}', windowsInstructions: '使用时请保持桌面处于解锁状态。部分操作需要将目标应用切到前台。', standardPrivileges: '当前以普通用户权限运行,以管理员等更高权限运行的应用可能无法操作。', @@ -105,8 +101,6 @@ export const ja = { windowsCaptureUnavailableTitle: 'ウィンドウのスクリーンショットを利用できません', windowsCaptureUnavailable: '現在のデスクトップ環境はウィンドウキャプチャに対応していません。OS のバージョンとグラフィックスドライバーを確認して再試行してください。', windowsCaptureUnavailableNotice: 'この環境ではウィンドウキャプチャを利用できません。OS のバージョンやグラフィックスドライバーを確認・更新して再試行してください。アクセシビリティ機能による操作は引き続き可能ですが、性能や対応範囲が制限されます。', - windowsElevatedTitle: '管理者権限で実行中です', - windowsElevatedWarning: 'DeepSeek Harness は管理者権限で実行されており、このコンピューター上のほぼすべての内容にアクセスできます。リスクを十分理解したうえでのみ続行してください。', windowsHelperFailed: 'Computer Use 補助プログラムに接続できませんでした:{message}', windowsInstructions: '使用中はデスクトップのロックを解除しておいてください。一部の操作では対象アプリを最前面に表示する必要があります。', standardPrivileges: '現在、標準ユーザー権限で実行中です。管理者などより高い権限で実行中のアプリは操作できない場合があります。', @@ -164,8 +158,6 @@ export const es = { windowsCaptureUnavailableTitle: 'Capturas de ventana no disponibles', windowsCaptureUnavailable: 'Este entorno de escritorio no admite la captura de ventanas. Comprueba la versión del sistema operativo y el controlador gráfico, y vuelve a intentarlo.', windowsCaptureUnavailableNotice: 'La captura de ventanas no está disponible en este entorno. Comprueba o actualiza la versión del sistema operativo y el controlador gráfico, y vuelve a intentarlo. DeepSeek Harness puede seguir operando aplicaciones mediante accesibilidad, pero con capacidad reducida.', - windowsElevatedTitle: 'Ejecutándose con privilegios de administrador', - windowsElevatedWarning: 'DeepSeek Harness se ejecuta como administrador y puede acceder a casi todo en este equipo. Continúa solo si eres plenamente consciente de los riesgos.', windowsHelperFailed: 'No se pudo conectar con el programa auxiliar de Computer Use: {message}', windowsInstructions: 'Mantén el escritorio desbloqueado durante el uso. Algunas acciones requieren poner la aplicación en primer plano.', standardPrivileges: 'Actualmente se ejecuta con privilegios de usuario estándar. Es posible que no se puedan controlar aplicaciones con mayores privilegios (como las ejecutadas como administrador).', @@ -209,8 +201,6 @@ export const fr = { windowsCaptureUnavailableTitle: 'Captures de fenêtre indisponibles', windowsCaptureUnavailable: 'Cet environnement de bureau ne prend pas en charge la capture de fenêtres. Vérifiez la version du système et le pilote graphique, puis réessayez.', windowsCaptureUnavailableNotice: 'La capture de fenêtres n’est pas disponible dans cet environnement. Vérifiez ou mettez à jour la version du système et le pilote graphique, puis réessayez. DeepSeek Harness peut toujours contrôler les applications via l’accessibilité, avec des capacités réduites.', - windowsElevatedTitle: 'Exécution avec des privilèges d’administrateur', - windowsElevatedWarning: 'DeepSeek Harness s’exécute en tant qu’administrateur et peut accéder à presque tout sur cet ordinateur. Ne continuez que si vous avez pleinement conscience des risques.', windowsHelperFailed: 'Impossible de se connecter au programme auxiliaire Computer Use : {message}', windowsInstructions: 'Gardez le bureau déverrouillé pendant l’utilisation. Certaines actions nécessitent de placer l’application au premier plan.', standardPrivileges: 'Fonctionne actuellement avec des privilèges d’utilisateur standard. Les applications exécutées avec des privilèges supérieurs (comme en tant qu’administrateur) peuvent ne pas être contrôlables.', @@ -254,8 +244,6 @@ export const de = { windowsCaptureUnavailableTitle: 'Fenster-Screenshots nicht verfügbar', windowsCaptureUnavailable: 'Diese Desktopumgebung unterstützt keine Fensteraufnahme. Prüfen Sie die Betriebssystemversion und den Grafiktreiber und versuchen Sie es erneut.', windowsCaptureUnavailableNotice: 'Die Fensteraufnahme ist in dieser Umgebung nicht verfügbar. Prüfen oder aktualisieren Sie Betriebssystemversion und Grafiktreiber und versuchen Sie es erneut. DeepSeek Harness kann Apps weiterhin über Bedienungshilfen steuern, jedoch mit eingeschränkter Leistungsfähigkeit.', - windowsElevatedTitle: 'Ausführung mit Administratorrechten', - windowsElevatedWarning: 'DeepSeek Harness wird als Administrator ausgeführt und hat Zugriff auf nahezu alles auf diesem Computer. Fahren Sie nur fort, wenn Sie sich der Risiken voll bewusst sind.', windowsHelperFailed: 'Verbindung zum Computer-Use-Hilfsprogramm fehlgeschlagen: {message}', windowsInstructions: 'Lassen Sie den Desktop während der Nutzung entsperrt. Einige Aktionen erfordern die Zielanwendung im Vordergrund.', standardPrivileges: 'Wird derzeit mit Standardbenutzerrechten ausgeführt. Apps mit höheren Berechtigungen (z. B. als Administrator) lassen sich möglicherweise nicht steuern.', @@ -299,8 +287,6 @@ export const ru = { windowsCaptureUnavailableTitle: 'Снимки окон недоступны', windowsCaptureUnavailable: 'Текущая среда рабочего стола не поддерживает захват окон. Проверьте версию ОС и графический драйвер, затем повторите попытку.', windowsCaptureUnavailableNotice: 'Захват окон недоступен в этой среде. Проверьте или обновите версию ОС и графический драйвер, затем повторите попытку. DeepSeek Harness по-прежнему может управлять приложениями через средства доступности, но с ограниченными возможностями.', - windowsElevatedTitle: 'Запуск с правами администратора', - windowsElevatedWarning: 'DeepSeek Harness запущен от имени администратора и имеет доступ почти ко всему на этом компьютере. Продолжайте только если полностью осознаёте риски.', windowsHelperFailed: 'Не удалось подключиться к вспомогательному компоненту управления компьютером: {message}', windowsInstructions: 'Во время работы держите рабочий стол разблокированным. Для некоторых действий нужно вывести приложение на передний план.', standardPrivileges: 'Сейчас запущено с обычными правами пользователя. Приложения с повышенными привилегиями (например, от имени администратора) могут не поддаваться управлению.', @@ -344,8 +330,6 @@ export const pt = { windowsCaptureUnavailableTitle: 'Capturas de janela indisponíveis', windowsCaptureUnavailable: 'Este ambiente de área de trabalho não oferece suporte à captura de janelas. Verifique a versão do sistema operacional e o driver gráfico e tente novamente.', windowsCaptureUnavailableNotice: 'A captura de janelas não está disponível neste ambiente. Verifique ou atualize a versão do sistema operacional e o driver gráfico e tente novamente. O DeepSeek Harness ainda pode operar aplicativos por acessibilidade, com capacidade reduzida.', - windowsElevatedTitle: 'Executando com privilégios de administrador', - windowsElevatedWarning: 'O DeepSeek Harness está sendo executado como administrador e pode acessar quase tudo neste computador. Prossiga apenas se estiver plenamente ciente dos riscos.', windowsHelperFailed: 'Não foi possível conectar ao auxiliar do Computer Use: {message}', windowsInstructions: 'Mantenha a área de trabalho desbloqueada durante o uso. Algumas ações exigem colocar o aplicativo em primeiro plano.', standardPrivileges: 'Atualmente em execução com privilégios de usuário padrão. Aplicativos executados com privilégios mais altos (como administrador) podem não ser controláveis.', diff --git a/packages/experimental/cua/tests/panel.client.spec.tsx b/packages/experimental/cua/tests/panel.client.spec.tsx index 973586a498..5174b80f3e 100644 --- a/packages/experimental/cua/tests/panel.client.spec.tsx +++ b/packages/experimental/cua/tests/panel.client.spec.tsx @@ -443,9 +443,8 @@ it.each([true, false, null] as const)('omits system permissions on Windows and p f.publish({ system: { value: { platform: 'windows', sessionLocked: false, captureAvailable: false, elevated: true, helper: {} }, error: null, busy: false } }) expect(screen.queryByRole('alert')).toBeNull() - const adminNote = screen.getByText(en.windowsElevatedTitle).closest('[role="note"]')! - expect(within(adminNote as HTMLElement).getByText(en.windowsElevatedWarning)).toBeTruthy() - expect(adminNote.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + // Administrator privileges add no warning; they only withhold the standard-privilege limitation. + expect(screen.queryAllByRole('note').filter(note => note.textContent?.includes('administrator'))).toEqual([]) const captureNotice = screen.getByText(en.windowsCaptureUnavailableTitle) expect(screen.getByText(en.windowsCaptureUnavailableNotice)).toBeTruthy() expect(captureNotice.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() @@ -455,7 +454,6 @@ it.each([true, false, null] as const)('omits system permissions on Windows and p expect(within(helperAlert).getByText(en.windowsHelperFailed.replace('{message}', 'offline'))).toBeTruthy() expect(within(helperAlert).getByText(en.queryFailedHint)).toBeTruthy() expect(helperAlert.compareDocumentPosition(experimental) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() - expect(screen.queryByText(en.windowsElevatedTitle)).toBeNull() expect(screen.queryByText(en.windowsCaptureUnavailableTitle)).toBeNull() fireEvent.click(within(helperAlert).getByRole('button', { name: en.retry })) expect(f.props.refresh).toHaveBeenCalledTimes(2) From 8c1e598b1e5c9f0ab6040c23d90563384a19ae7e Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Thu, 26 Nov 2026 12:38:48 +0800 Subject: [PATCH 15/17] refactor(ui-plugin-manager): keep the Host's management error whole The failed-action notice, the install failure, and RemoteAnswerError now carry the Host's ManagementError instead of copying its code, incompatible packages, and supported platforms into separate fields, and managementText takes ManagementError directly. A new error detail therefore reaches the page without another copy at each carrier. UnsupportedBundlePlatformError keeps the platforms it receives instead of copying them a second time. --- packages/boot/app-boot/src/bundle-platform.ts | 5 +-- .../src/client/PluginManagerPage.tsx | 14 ++----- .../src/client/manager-store.ts | 39 +++++-------------- .../src/client/presentation.ts | 18 +++------ .../tests/components.client.spec.tsx | 18 ++++----- .../tests/manager-store.client.spec.ts | 28 ++++++------- 6 files changed, 43 insertions(+), 79 deletions(-) diff --git a/packages/boot/app-boot/src/bundle-platform.ts b/packages/boot/app-boot/src/bundle-platform.ts index 9900592ae0..a8183d7e9e 100644 --- a/packages/boot/app-boot/src/bundle-platform.ts +++ b/packages/boot/app-boot/src/bundle-platform.ts @@ -7,16 +7,13 @@ const NODE_PLATFORMS: readonly string[] = Object.freeze([ /** A valid bundle declaration excludes the operating system running DSH. */ export class UnsupportedBundlePlatformError extends Error { - /** Node platform names or `wsl` supported by the bundle. */ - readonly platforms: readonly string[] /** * @param platforms Node platform names or `wsl` supported by the bundle. * @param platform Operating system of the DSH Host. */ - constructor(platforms: readonly string[], platform: string) { + constructor(readonly platforms: readonly string[], platform: string) { super(`Bundle supports Host platforms ${platforms.join(', ')}; the DSH Host is running ${platform}`) this.name = 'UnsupportedBundlePlatformError' - this.platforms = [...platforms] } } diff --git a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx index 723f21c3aa..86d322358d 100644 --- a/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx +++ b/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx @@ -995,10 +995,7 @@ function registryOption(registry: Registry, t: Translate, resolved: string | nul function failureText(failure: InstallState['failure'], t: Translate, install?: Pick): string { if (failure === null) return t('installFailureGeneric') // A compatibility refusal is the package's own answer, whatever pnpm's exit classified the run as. - if (failure.code === 'incompatible-version') { - const incompatible = failure.incompatible === undefined ? {} : { incompatible: failure.incompatible } - return managementText({ code: failure.code, installing: true, ...incompatible }, t) - } + if (failure.error?.code === 'incompatible-version') return managementText({ ...failure.error, installing: true }, t) // Blocked scripts the Host could not name leave the person to allow them in the profile's pnpm settings by hand. if (failure.kind === 'build-blocked' && !failure.pendingBuilds?.length) return t('installFailureBuildBlockedManual') const host = install?.subject?.host @@ -1008,12 +1005,7 @@ function failureText(failure: InstallState['failure'], t: Translate, install?: P return t('installFailureNetworkAll', { registries: registryList(asked, t, install?.registries?.resolved ?? null) }) } if (failure.kind !== undefined) return t(FAILURE_KIND_KEYS[failure.kind]) - if (failure.code !== undefined) { - return managementText({ - code: failure.code, diagnostic: failure.reason, - ...failure.platforms === undefined ? {} : { platforms: failure.platforms }, - }, t) - } + if (failure.error !== undefined) return managementText(failure.error, t) if (failure.reason !== '') return failure.reason // An enabled install that failed applying the bundle names that step, never the install command it already finished. return failure.stage === 'enable' && failure.enabled === true ? t('installFailedEnabling') : t('installFailureGeneric') @@ -1455,7 +1447,7 @@ function InstallDialog({ {phase === 'done' && subject?.bundled ?

{t('installBundledDescription')}

: null} {phase === 'failed' ?

{failureText(install.failure, t, install)}

: null} {phase === 'failed' && failure?.stage === 'enable' && failure.enabled === true - && (failure.code !== undefined || failure.reason !== '') + && (failure.error !== undefined || failure.reason !== '') ?

{t('installFailedEnabling')}

: null} {attemptLine === null ? null :

{attemptLine}

} diff --git a/packages/client/ui-plugin-manager/src/client/manager-store.ts b/packages/client/ui-plugin-manager/src/client/manager-store.ts index 7e2dfb56f3..f39aa4ac40 100644 --- a/packages/client/ui-plugin-manager/src/client/manager-store.ts +++ b/packages/client/ui-plugin-manager/src/client/manager-store.ts @@ -12,7 +12,6 @@ import type { Context as ClientContext } from '@deepseek-ai/cordis' import type { BundleInfo, ChangeResult, - IncompatiblePlugin, ManagementError, PluginEntryId, PluginInfo, @@ -71,13 +70,9 @@ export type ManagerNotice = /** What was being done when it failed. */ readonly action: FailedAction /** The Host's refusal, when the Host refused; absent when the transport failed. */ - readonly code?: ManagementError['code'] + readonly error?: ManagementError /** The Host's diagnostic or the transport's words, shown verbatim; empty when the code says it all. */ readonly reason: string - /** The packages an `incompatible-version` refusal names. */ - readonly incompatible?: readonly IncompatiblePlugin[] - /** The supported Host platforms an `unsupported-platform` refusal names. */ - readonly platforms?: readonly string[] readonly packageName?: string readonly seq: number } @@ -278,11 +273,8 @@ export interface InstallState { */ readonly failure: { readonly reason: string - readonly code?: ManagementError['code'] - /** The packages an `incompatible-version` refusal names. */ - readonly incompatible?: readonly IncompatiblePlugin[] - /** The supported Host platforms an `unsupported-platform` refusal names. */ - readonly platforms?: readonly string[] + /** The Host's refusal, when the Host refused. */ + readonly error?: ManagementError readonly kind?: PluginInstallFailureKind /** The step the failed change reached; `enable` means the installation finished and applying the bundle failed. */ readonly stage?: ChangeResult['stage'] @@ -543,12 +535,9 @@ type Answer = | { readonly ok: true; readonly value: T } | { readonly ok: false; readonly error: { readonly code: string; readonly message: string; readonly details?: unknown } } -/** A refused answer or a change the Host could not apply, carrying what it said and, for a refusal, its code. */ +/** A refused answer or a change the Host could not apply, carrying what it said and, for a refusal, the Host's error. */ class RemoteAnswerError extends Error { - constructor( - readonly reason: string, readonly code?: ManagementError['code'], readonly incompatible?: readonly IncompatiblePlugin[], - readonly platforms?: readonly string[], - ) { + constructor(readonly reason: string, readonly error?: ManagementError) { super(reason) this.name = 'RemoteAnswerError' } @@ -561,9 +550,7 @@ function failureOf( ): NonNullable { return { reason: error?.diagnostic ?? '', - ...error === undefined ? {} : { code: error.code }, - ...error?.incompatible === undefined ? {} : { incompatible: error.incompatible }, - ...error?.platforms === undefined ? {} : { platforms: error.platforms }, + ...error === undefined ? {} : { error }, ...kind === undefined ? {} : { kind }, stage, ...enabled === undefined ? {} : { enabled }, @@ -572,16 +559,10 @@ function failureOf( } } -/** The notice a thrown failure becomes: a refusal keeps its code, anything else its words. */ +/** The notice a thrown failure becomes: a refusal keeps the Host's error, anything else its words. */ function failedNotice(error: unknown, subject: { action: FailedAction; packageName?: string }, seq: number): ManagerNotice { - const code = error instanceof RemoteAnswerError ? error.code : undefined - const incompatible = error instanceof RemoteAnswerError ? error.incompatible : undefined - const platforms = error instanceof RemoteAnswerError ? error.platforms : undefined - return { - kind: 'failed', reason: reasonOf(error), ...code === undefined ? {} : { code }, - ...incompatible === undefined ? {} : { incompatible }, - ...platforms === undefined ? {} : { platforms }, ...subject, seq, - } + const refusal = error instanceof RemoteAnswerError ? error.error : undefined + return { kind: 'failed', reason: reasonOf(error), ...refusal === undefined ? {} : { error: refusal }, ...subject, seq } } /** The runs with every one still open settled at `exitCode`. */ @@ -1601,7 +1582,7 @@ export class PluginManagerController { const result = answer.value switch (result.application) { case 'failed': - throw new RemoteAnswerError(result.error?.diagnostic ?? '', result.error?.code, result.error?.incompatible, result.error?.platforms) + throw new RemoteAnswerError(result.error?.diagnostic ?? '', result.error) case 'cancelled': this.patch({ notice: { kind: 'cancelled', seq: ++this.noticeSeq } }) return diff --git a/packages/client/ui-plugin-manager/src/client/presentation.ts b/packages/client/ui-plugin-manager/src/client/presentation.ts index 7cf9d79df2..052b44fab1 100644 --- a/packages/client/ui-plugin-manager/src/client/presentation.ts +++ b/packages/client/ui-plugin-manager/src/client/presentation.ts @@ -1,7 +1,7 @@ /** Display labels and toast sentences for global plugin management. */ import { EXPERIMENTAL_BUNDLES } from '@deepseek-ai/dsh-official-bundles' -import type { IncompatiblePlugin, ManagementError, Registry, RestartReason } from '@deepseek-ai/dsh-api-remotes/client' +import type { ManagementError, Registry, RestartReason } from '@deepseek-ai/dsh-api-remotes/client' import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots' import type { PluginManagerLocaleKey } from './locales.ts' import type { FailedAction, ManagerNotice, PackageRow, PackageView, PluginManagerFace } from './manager-store.ts' @@ -92,16 +92,13 @@ const FAILED_KEYS = { /** * What a management error reads as: the code's sentence; for an incompatibility, one sentence per - * package it names, then the remedy for an install or for an installed plugin; or, for an operation error, the Host's diagnostic as it is. - * @param error - the Host's code, its diagnostic, and the packages an incompatibility names. + * package it names, then the remedy for an install or for an installed plugin; for a platform refusal, the supported + * platforms it names; or, for an operation error, the Host's diagnostic as it is. + * @param error - the Host's error. * @param t - the manager's translate seat. * @returns the sentence. */ -export function managementText(error: { - readonly code: ManagementError['code'] - readonly diagnostic?: string - readonly incompatible?: readonly IncompatiblePlugin[] - readonly platforms?: readonly string[] +export function managementText(error: ManagementError & { /** Set when the refused package is being installed rather than already installed; selects the incompatibility remedy. */ readonly installing?: true }, t: Translate): string { @@ -204,10 +201,7 @@ export function noticeText(notice: ManagerNotice, t: Translate): string { unconfirmed: 'installBackgroundUnconfirmed', applying: 'installBackgroundApplying', unknown: 'installBackgroundUnknown', } as const)[notice.outcome]) case 'failed': { - const reason = notice.code === undefined ? notice.reason : managementText({ - code: notice.code, diagnostic: notice.reason, ...notice.incompatible === undefined ? {} : { incompatible: notice.incompatible }, - ...notice.platforms === undefined ? {} : { platforms: notice.platforms }, - }, t) + const reason = notice.error === undefined ? notice.reason : managementText(notice.error, t) return t(FAILED_KEYS[notice.action], { reason: reason === '' ? t('reasonOperationError') : reason }) } } diff --git a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx index cda830bd43..d16a68ab09 100644 --- a/packages/client/ui-plugin-manager/tests/components.client.spec.tsx +++ b/packages/client/ui-plugin-manager/tests/components.client.spec.tsx @@ -1824,9 +1824,9 @@ describe('PluginManagerPage', () => { expect(screen.getByRole('switch', { name: en.enableToggle.replace('{name}', 'dsh-better-sidebar') })).toHaveProperty('disabled', false) set({ packages: [pkg({ enabled: false, error: { code: 'unsupported-platform', platforms: ['freebsd'] } })] }) expect(screen.getByText('This plugin only supports freebsd.')).toBeTruthy() - set({ notice: { kind: 'failed', action: 'enable', code: 'unsupported-platform', platforms: ['darwin', 'win32'], reason: '', packageName: 'dsh-better-sidebar', seq: 1 } }) + set({ notice: { kind: 'failed', action: 'enable', error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] }, reason: '', packageName: 'dsh-better-sidebar', seq: 1 } }) expect(screen.getByRole('alert').textContent).toContain('This plugin only supports macOS and Windows.') - set({ notice: null, install: { ...IDLE_INSTALL, open: true, spec: 'dsh-cua', phase: 'failed', failure: { code: 'unsupported-platform', platforms: ['darwin', 'win32'], reason: '' } } }) + set({ notice: null, install: { ...IDLE_INSTALL, open: true, spec: 'dsh-cua', phase: 'failed', failure: { error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] }, reason: '' } } }) expect(screen.getByText('This plugin only supports macOS and Windows.')).toBeTruthy() set({ install: IDLE_INSTALL }) // A bundle that leaves the list drops back to the cards. @@ -2247,15 +2247,15 @@ describe('PluginManagerPage', () => { expect(screen.getByText(sentence)).toBeTruthy() } // A failure without a kind reads by its code, else in the Host's words; without words, or without a failure at all, generically. - set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: '', code: 'not-bundle' } } }) + set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: '', error: { code: 'not-bundle' } } } }) expect(screen.getByText(en.reasonNotBundle)).toBeTruthy() - set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: 'ERR_PNPM_ADDING_TO_ROOT', code: 'operation-error' } } }) + set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: 'ERR_PNPM_ADDING_TO_ROOT', error: { code: 'operation-error', diagnostic: 'ERR_PNPM_ADDING_TO_ROOT' } } } }) expect(screen.getByText('ERR_PNPM_ADDING_TO_ROOT')).toBeTruthy() // A compatibility refusal outranks the kind pnpm's exit was classified as. set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', - failure: { reason: '', code: 'incompatible-version', incompatible: [INCOMPATIBLE], kind: 'unknown' } } }) + failure: { reason: '', error: { code: 'incompatible-version', incompatible: [INCOMPATIBLE] }, kind: 'unknown' } } }) expect(screen.getByText(`${incompatibleText()} ${en.reasonIncompatibleInstall}`)).toBeTruthy() - set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: '', code: 'incompatible-version' } } }) + set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: '', error: { code: 'incompatible-version' } } } }) expect(screen.getByText(`${en.reasonIncompatibleVersionUnnamed} ${en.reasonIncompatibleInstall}`)).toBeTruthy() set({ install: { ...IDLE_INSTALL, open: true, spec: 'x', phase: 'failed', failure: { reason: 'the transport said so' } } }) expect(screen.getByText('the transport said so')).toBeTruthy() @@ -2716,11 +2716,11 @@ describe('PluginManagerPage', () => { // A failure names what was being done; a refusal is worded by its code, a silent one generically. set({ notice: { kind: 'failed', action: 'enable', reason: 'the tree rejected it', packageName: 'pkg-1', seq: 4 } }) expect(screen.getByRole('alert').textContent).toContain(en.failedEnable.replace('{reason}', 'the tree rejected it')) - set({ notice: { kind: 'failed', action: 'uninstall', code: 'bundle-in-use', reason: '', packageName: 'pkg-1', seq: 5 } }) + set({ notice: { kind: 'failed', action: 'uninstall', error: { code: 'bundle-in-use' }, reason: '', packageName: 'pkg-1', seq: 5 } }) expect(screen.getByRole('alert').textContent).toContain(en.failedUninstall.replace('{reason}', en.reasonBundleInUse)) - set({ notice: { kind: 'failed', action: 'enable', code: 'incompatible-version', incompatible: [INCOMPATIBLE], reason: '', packageName: 'pkg-1', seq: 5 } }) + set({ notice: { kind: 'failed', action: 'enable', error: { code: 'incompatible-version', incompatible: [INCOMPATIBLE] }, reason: '', packageName: 'pkg-1', seq: 5 } }) expect(screen.getByRole('alert').textContent).toContain(en.failedEnable.replace('{reason}', `${incompatibleText()} ${en.reasonIncompatibleInstalled}`)) - set({ notice: { kind: 'failed', action: 'rowDisable', code: 'operation-error', reason: 'EACCES', packageName: 'pkg-1', seq: 6 } }) + set({ notice: { kind: 'failed', action: 'rowDisable', error: { code: 'operation-error', diagnostic: 'EACCES' }, reason: 'EACCES', packageName: 'pkg-1', seq: 6 } }) expect(screen.getByRole('alert').textContent).toContain(en.failedRowDisable.replace('{reason}', 'EACCES')) set({ notice: { kind: 'failed', action: 'disable', reason: '', packageName: 'pkg-1', seq: 7 } }) expect(screen.getByRole('alert').textContent).toContain(en.failedDisable.replace('{reason}', en.reasonOperationError)) diff --git a/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts b/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts index db260c4551..8806440d23 100644 --- a/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts +++ b/packages/client/ui-plugin-manager/tests/manager-store.client.spec.ts @@ -541,7 +541,7 @@ describe('PluginManagerController', () => { }) await controller.load() face.setEnabled(BUNDLE.name, true) - await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'enable', code: 'operation-error', reason: 'the tree rejected it', packageName: BUNDLE.name, seq: 1 }) }) + await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'enable', error: { code: 'operation-error', diagnostic: 'the tree rejected it' }, reason: 'the tree rejected it', packageName: BUNDLE.name, seq: 1 }) }) face.setEnabled(BUNDLE.name, false) await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'disable', reason: 'offline', packageName: BUNDLE.name, seq: 2 }) }) face.setEnabled(BUNDLE.name, true) @@ -550,7 +550,7 @@ describe('PluginManagerController', () => { await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'enable', reason: 'odd', packageName: BUNDLE.name, seq: 4 }) }) // A refusal keeps its code with no words of its own; a failure without a code has neither. face.setEnabled(BUNDLE.name, true) - await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'enable', code: 'bundle-in-use', reason: '', packageName: BUNDLE.name, seq: 5 }) }) + await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'enable', error: { code: 'bundle-in-use' }, reason: '', packageName: BUNDLE.name, seq: 5 }) }) face.setEnabled(BUNDLE.name, true) await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'enable', reason: '', packageName: BUNDLE.name, seq: 6 }) }) // A change the Host stopped is said in passing. @@ -560,13 +560,13 @@ describe('PluginManagerController', () => { face.setEnabled(BUNDLE.name, true) await vi.waitFor(() => { expect(state().notice).toEqual({ - kind: 'failed', action: 'enable', code: 'incompatible-version', incompatible: [INCOMPATIBLE], reason: '', packageName: BUNDLE.name, seq: 8, + kind: 'failed', action: 'enable', error: { code: 'incompatible-version', incompatible: [INCOMPATIBLE] }, reason: '', packageName: BUNDLE.name, seq: 8, }) }) face.setEnabled(BUNDLE.name, true) await vi.waitFor(() => { expect(state().notice).toEqual({ - kind: 'failed', action: 'enable', code: 'unsupported-platform', platforms: ['darwin', 'win32'], reason: '', packageName: BUNDLE.name, seq: 9, + kind: 'failed', action: 'enable', error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] }, reason: '', packageName: BUNDLE.name, seq: 9, }) }) face.dismissNotice() @@ -593,7 +593,7 @@ describe('PluginManagerController', () => { plugins.removeBundle.mockResolvedValueOnce(ok({ ...failed(), stage: 'remove', error: { code: 'not-removable' } }) as never) face.uninstall(BUNDLE.name) face.confirm() - await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'uninstall', code: 'not-removable', reason: '', packageName: BUNDLE.name, seq: 1 }) }) + await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'uninstall', error: { code: 'not-removable' }, reason: '', packageName: BUNDLE.name, seq: 1 }) }) }) it('switches rows under their own busy keys and reports what the Host said', async () => { @@ -610,7 +610,7 @@ describe('PluginManagerController', () => { gate.resolve(ok(APPLIED)) await vi.waitFor(() => { expect(state().busy).toEqual([]) }) face.setRowEnabled(ROW_ENTRY, true) - await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'rowEnable', code: 'unaddressable', reason: '', packageName: ROW_ENTRY, seq: 1 }) }) + await vi.waitFor(() => { expect(state().notice).toEqual({ kind: 'failed', action: 'rowEnable', error: { code: 'unaddressable' }, reason: '', packageName: ROW_ENTRY, seq: 1 }) }) }) it('installs a Discover spec through the dialog, asking its registry first, and reopens a hidden installation instead', async () => { @@ -838,7 +838,7 @@ describe('PluginManagerController', () => { face.editInstallSpec('dsh-x') face.runInstall() await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) - expect(state().install.failure).toEqual({ reason: 'ERR', code: 'operation-error', kind: 'network', stage: 'install' }) + expect(state().install.failure).toEqual({ reason: 'ERR', error: { code: 'operation-error', diagnostic: 'ERR' }, kind: 'network', stage: 'install' }) face.cancelInstall() expect(state().install).toMatchObject({ open: true, phase: 'idle', spec: 'dsh-x', failure: null, subject: null }) }) @@ -1213,7 +1213,7 @@ describe('PluginManagerController', () => { face.enableInstalled() await vi.waitFor(() => { expect(state().install.open).toBe(false) }) expect(plugins.setBundleEnabled).toHaveBeenCalledTimes(2) - expect(state().notice).toEqual({ kind: 'failed', action: 'enable', code: 'operation-error', reason: 'the tree rejected it', packageName: 'dsh-a', seq: 2 }) + expect(state().notice).toEqual({ kind: 'failed', action: 'enable', error: { code: 'operation-error', diagnostic: 'the tree rejected it' }, reason: 'the tree rejected it', packageName: 'dsh-a', seq: 2 }) expect(state().highlight).toBe('dsh-a') // An install that named no bundle has nothing to enable or mark: the screen just closes. @@ -1250,7 +1250,7 @@ describe('PluginManagerController', () => { pendingBuilds: ['native'], })) await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) - expect(state().install.failure).toEqual({ reason: 'ERR_PNPM_IGNORED_BUILDS', code: 'operation-error', kind: 'build-blocked', pendingBuilds: ['native'], stage: 'install' }) + expect(state().install.failure).toEqual({ reason: 'ERR_PNPM_IGNORED_BUILDS', error: { code: 'operation-error', diagnostic: 'ERR_PNPM_IGNORED_BUILDS' }, kind: 'build-blocked', pendingBuilds: ['native'], stage: 'install' }) // The retry keeps the subject the check produced and carries the approved names under a new request id. face.approveBuildsAndRetry() const second = await started() @@ -1324,7 +1324,7 @@ describe('PluginManagerController', () => { answer(ok(failed({ code: 'operation-error', diagnostic: 'ERR_PNPM' }, { exitCode: 1, output: 'ERR_PNPM', truncated: false, logPath: '/l', kind: 'network' }))) await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) expect(state().install.runs).toEqual([]) - expect(state().install.failure).toEqual({ reason: 'ERR_PNPM', code: 'operation-error', kind: 'network', stage: 'install' }) + expect(state().install.failure).toEqual({ reason: 'ERR_PNPM', error: { code: 'operation-error', diagnostic: 'ERR_PNPM' }, kind: 'network', stage: 'install' }) expect(state().install.subject).toEqual({ spec: 'x', ...INSPECTED }) // A lost answer cannot establish whether the Host stopped the process. await installing() @@ -1352,17 +1352,17 @@ describe('PluginManagerController', () => { { jobId: 'j', command: 'pnpm add x', cwd: '/p', output: 'partial', exitCode: 0 }, { jobId: 'k', command: 'pnpm add x', cwd: '/p', output: 'open', exitCode: null }, ]) - expect(state().install.failure).toEqual({ reason: '', code: 'not-bundle', stage: 'install' }) + expect(state().install.failure).toEqual({ reason: '', error: { code: 'not-bundle' }, stage: 'install' }) // An incompatibility keeps the packages it names. await installing() answer(ok(failed({ code: 'incompatible-version', incompatible: [INCOMPATIBLE] }))) await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) - expect(state().install.failure).toEqual({ reason: '', code: 'incompatible-version', incompatible: [INCOMPATIBLE], stage: 'install' }) + expect(state().install.failure).toEqual({ reason: '', error: { code: 'incompatible-version', incompatible: [INCOMPATIBLE] }, stage: 'install' }) // A platform refusal keeps the supported Host platforms it names. await installing() answer(ok(failed({ code: 'unsupported-platform', platforms: ['darwin', 'win32'] }))) await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) - expect(state().install.failure).toEqual({ reason: '', code: 'unsupported-platform', platforms: ['darwin', 'win32'], stage: 'install' }) + expect(state().install.failure).toEqual({ reason: '', error: { code: 'unsupported-platform', platforms: ['darwin', 'win32'] }, stage: 'install' }) // A failure the Host does not explain has neither code nor words. await installing() answer(ok(failed())) @@ -1416,7 +1416,7 @@ describe('PluginManagerController', () => { face.runInstall() await vi.waitFor(() => { expect(state().install.phase).toBe('failed') }) // The Host laid the failure at activation, and the details keep the run's complete log. - expect(state().install.failure).toEqual({ reason: 'activation refused', code: 'operation-error', stage: 'enable', enabled: true }) + expect(state().install.failure).toEqual({ reason: 'activation refused', error: { code: 'operation-error', diagnostic: 'activation refused' }, stage: 'enable', enabled: true }) expect(state().install.logPath).toBe(failedLog) // Retrying forgets the settled run's log until the next answer names its own. face.runInstall() From 4b290afda6e9652f5f6a4e0cbf840819422b89b0 Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Thu, 26 Nov 2026 14:05:12 +0800 Subject: [PATCH 16/17] docs(ui-plugin-manager): name error in the install failure JSDoc --- packages/client/ui-plugin-manager/src/client/manager-store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/ui-plugin-manager/src/client/manager-store.ts b/packages/client/ui-plugin-manager/src/client/manager-store.ts index f39aa4ac40..28cc7890d9 100644 --- a/packages/client/ui-plugin-manager/src/client/manager-store.ts +++ b/packages/client/ui-plugin-manager/src/client/manager-store.ts @@ -264,8 +264,8 @@ export interface InstallState { /** Why it waits, when the Host says. */ readonly restartReason?: RestartReason /** - * The run's failure, once one settled the dialog: the Host's refusal - * `code` with its diagnostic as `reason`, or the transport's words alone; + * The run's failure, once one settled the dialog: the Host's refusal as + * `error` with its diagnostic as `reason`, or the transport's words alone; * `kind` classifies a pnpm failure, and `pendingBuilds` names the packages * whose install scripts pnpm left undecided, offered for approval. * `uncertainty` distinguishes a lost installation reply, an unconfirmed From 46b37ce64d031655ef4dbb25506820276a80a10b Mon Sep 17 00:00:00 2001 From: Yixiang Tu Date: Thu, 26 Nov 2026 21:12:58 +0800 Subject: [PATCH 17/17] docs: regenerate event graphs and CUA README pairing after rebase --- docs/event-producer-consumer.md | 10 +++++----- docs/event-producer-consumer.zh.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/event-producer-consumer.md b/docs/event-producer-consumer.md index 76c4c702e9..5e7463f91e 100644 --- a/docs/event-producer-consumer.md +++ b/docs/event-producer-consumer.md @@ -74,11 +74,11 @@ Application listeners are outside this package matrix. Desktop Host subscribes t | `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:78`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title), [`timeline`](../packages/experimental/timeline) | | `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:49`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | [`mcp-account`](../packages/mcp/mcp-account) | | `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:62`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` | -| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:460`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | [`plugin-recommendations`](../packages/extensions/plugin-recommendations), `remotes` | -| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:466`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | -| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:473`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | -| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:452`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - | -| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:480`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | +| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:462`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | [`plugin-recommendations`](../packages/extensions/plugin-recommendations), `remotes` | +| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | +| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:475`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | +| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:454`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - | +| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:482`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | | `plugin-market/changed` | `emit` | [`packages/boot/plugin-market/src/types.ts:174`](../packages/boot/plugin-market/src/types.ts) | [`plugin-market`](../packages/boot/plugin-market) (`emit`) | `remotes` | | `schedule/changed` | `emit` | [`packages/schedule/schedule/src/types.ts:640`](../packages/schedule/schedule/src/types.ts) | [`schedule`](../packages/schedule/schedule) (`emit`) | `remotes` | | `schedule/resolve-agent` | `waterfall` | [`packages/schedule/schedule/src/index.ts:78`](../packages/schedule/schedule/src/index.ts) | [`schedule`](../packages/schedule/schedule) (`waterfall`) | `server` | diff --git a/docs/event-producer-consumer.zh.md b/docs/event-producer-consumer.zh.md index 8306df7001..96f6053e24 100644 --- a/docs/event-producer-consumer.zh.md +++ b/docs/event-producer-consumer.zh.md @@ -76,11 +76,11 @@ | `llm/stream` | `waterfall` | [`packages/llm/llm/src/index.ts:78`](../packages/llm/llm/src/index.ts) | [`llm`](../packages/llm/llm) (`waterfall`) | [`llm-replay`](../packages/test-support/llm-replay), [`session-checkpoint-policy`](../packages/session/session-checkpoint-policy), [`session-title`](../packages/session/session-title), [`timeline`](../packages/experimental/timeline) | | `mcp-manager/status` | `parallel` | [`packages/mcp/mcp-manager/src/types.ts:49`](../packages/mcp/mcp-manager/src/types.ts) | [`mcp-manager`](../packages/mcp/mcp-manager) (`parallel`) | [`mcp-account`](../packages/mcp/mcp-account) | | `permission-presets/catalog-changed` | `emit` | [`packages/interaction/permission-presets/src/types.ts:62`](../packages/interaction/permission-presets/src/types.ts) | [`permission-presets`](../packages/interaction/permission-presets) (`events.dispatch`) | `remotes` | -| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:460`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | [`plugin-recommendations`](../packages/extensions/plugin-recommendations), `remotes` | -| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:466`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | -| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:473`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | -| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:452`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - | -| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:480`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | +| `plugin-manager/changed` | `emit` | [`packages/boot/plugin-manager/src/types.ts:462`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | [`plugin-recommendations`](../packages/extensions/plugin-recommendations), `remotes` | +| `plugin-manager/install-log` | `emit` | [`packages/boot/plugin-manager/src/types.ts:468`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | +| `plugin-manager/install-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:475`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | +| `plugin-manager/operation` | `parallel` | [`packages/boot/plugin-manager/src/types.ts:454`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`parallel`) | - | +| `plugin-manager/update-state` | `emit` | [`packages/boot/plugin-manager/src/types.ts:482`](../packages/boot/plugin-manager/src/types.ts) | [`plugin-manager`](../packages/boot/plugin-manager) (`emit`) | `remotes` | | `plugin-market/changed` | `emit` | [`packages/boot/plugin-market/src/types.ts:174`](../packages/boot/plugin-market/src/types.ts) | [`plugin-market`](../packages/boot/plugin-market) (`emit`) | `remotes` | | `schedule/changed` | `emit` | [`packages/schedule/schedule/src/types.ts:640`](../packages/schedule/schedule/src/types.ts) | [`schedule`](../packages/schedule/schedule) (`emit`) | `remotes` | | `schedule/resolve-agent` | `waterfall` | [`packages/schedule/schedule/src/index.ts:78`](../packages/schedule/schedule/src/index.ts) | [`schedule`](../packages/schedule/schedule) (`waterfall`) | `server` |