From 57af330bf5ba7ce7fa16ee6568d1aa28ad54f18d Mon Sep 17 00:00:00 2001 From: creatixchu Date: Mon, 19 Oct 2026 19:48:35 +0800 Subject: [PATCH] test(cua): keep Host marker checks out of the Client compiler --- .../experimental/cua/tests/export-types.spec.ts | 13 ++++++++++++- .../experimental/cua/tests/mount.client.spec.ts | 2 -- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/experimental/cua/tests/export-types.spec.ts b/packages/experimental/cua/tests/export-types.spec.ts index d71093f281..399fd84355 100644 --- a/packages/experimental/cua/tests/export-types.spec.ts +++ b/packages/experimental/cua/tests/export-types.spec.ts @@ -1,5 +1,7 @@ /** CUA's public types distinguish object consumers from its generated permission transport. */ -import { expectTypeOf, it } from 'vitest' +import { expect, expectTypeOf, it } from 'vitest' +import { Context } from '@deepseek-ai/cordis' +import * as Cua from '../src/index.ts' import type { CuaApi } from '@deepseek-ai/dsh-cua/api' import type { CuaApplicationState } from '@deepseek-ai/dsh-cua/types' // @ts-expect-error Permission payloads are not part of the platform-provider root entry. @@ -16,3 +18,12 @@ it('keeps application operations and the necessary Remote payload types availabl expectTypeOf().toHaveProperty('allowedApps') expectTypeOf<[RemovedRoot, RemovedApi, RemovedTypes, RemovedGrant]>().toBeArray() }) + +it('mounts the Host marker without installing native or browser services', async () => { + const ctx = new Context() + try { + await ctx.plugin(Cua) + expect(ctx.get('cuaAccess')).toBeUndefined() + expect(ctx.get('computerUse')).toBeUndefined() + } finally { await ctx.fiber.dispose() } +}) diff --git a/packages/experimental/cua/tests/mount.client.spec.ts b/packages/experimental/cua/tests/mount.client.spec.ts index dbf16c9a3b..02145516f6 100644 --- a/packages/experimental/cua/tests/mount.client.spec.ts +++ b/packages/experimental/cua/tests/mount.client.spec.ts @@ -10,7 +10,6 @@ import type { CuaApplicationState, CuaSystemPermissionState } from '../src/acces import { expect, it, vi } from 'vitest' import type { PermissionFace } from '../src/client/controller.ts' import { mountCuaPermissions, inject } from '../src/client/mount.ts' -import { apply as hostApply } from '../src/index.ts' const contribution: TypertRemoteContribution = { package: '@deepseek-ai/dsh-cua', descriptors: [] } const value: CuaApplicationState & { system: CuaSystemPermissionState } = { @@ -72,7 +71,6 @@ async function fixture(fail = false) { } it('withdraws the permission Remote and all controls with the optional plugin', async () => { - hostApply() const f = await fixture() try { const fiber = f.ctx.plugin({ inject: [...inject], apply: ctx => mountCuaPermissions(ctx, contribution) })