@@ -13,7 +13,6 @@ import {
1313 createWorkspaceFileByPath ,
1414 updateWorkspaceFileContentByPath ,
1515} from '@/lib/workspace-files/application/write-workspace-file-by-path'
16- import { SIM_PAGE_CONTENT_TYPE } from '@/lib/workspace-files/page-compile'
1716
1817const logger = createLogger ( 'CreateFileServerTool' )
1918const CREATE_FILE_TOOL_ID = 'create_empty_file'
@@ -58,20 +57,11 @@ export const createFileServerTool: BaseServerTool<CreateFileArgs, CreateFileResu
5857 }
5958 const outputPath =
6059 outputFile ?. path ?? ( fileName . startsWith ( 'files/' ) ? fileName : `files/${ fileName } ` )
61- // A copilot-created .html file IS a Sim page unless the model says
62- // otherwise: an explicit contentType (the skill declares
63- // text/x-sim-page for pages and text/html for a bespoke raw page)
64- // always wins; with no declaration the .html default is a page. Either
65- // way the record advertises the file's nature from birth, so the viewer
66- // renders (never raw code) from the very first streamed byte, and the
67- // first apply_file_edit re-confirms from the actual content. User
68- // uploads never pass through here and stay text/html.
69- const declaredType = outputFile ?. mimeType ?? explicitType
70- const inferredType = inferContentType ( outputPath , declaredType )
71- const contentType =
72- ! declaredType && inferredType === 'text/html' && outputPath . toLowerCase ( ) . endsWith ( '.html' )
73- ? SIM_PAGE_CONTENT_TYPE
74- : inferredType
60+ // .html defaults to plain text/html; a file is a Sim page only when the
61+ // model DECLARES it (the skill passes contentType text/x-sim-page at
62+ // creation) — or when the first apply_file_edit finds actual page
63+ // source, which re-stamps the record from reality either way.
64+ const contentType = outputFile ?. mimeType ?? inferContentType ( outputPath , explicitType )
7565 assertServerToolNotAborted ( context )
7666 const mode = outputFile ?. mode ?? 'create'
7767 // An empty shell provably contains no secrets; recording that keeps the
0 commit comments