fix: streamline document parsing settings
This commit is contained in:
@@ -85,7 +85,8 @@ import type {
|
||||
DocumentOcrResult,
|
||||
DocumentParsingDiagnostic,
|
||||
DocumentParsingSettings,
|
||||
DocumentParsingSnapshot
|
||||
DocumentParsingSnapshot,
|
||||
DocumentParsingTestPurpose
|
||||
} from '../shared/document-parsing-contracts'
|
||||
import type { AgentRuntimeSelection } from '../shared/runtime-selection-contracts'
|
||||
import type { WeixinBindingSnapshot } from '../shared/weixin-channel-contracts'
|
||||
@@ -435,9 +436,10 @@ const desktopApi: DesktopApi = {
|
||||
ipcChannels.documentParsingUpdate,
|
||||
input
|
||||
) as Promise<DocumentParsingSnapshot>,
|
||||
test: () =>
|
||||
test: (purpose: DocumentParsingTestPurpose) =>
|
||||
ipcRenderer.invoke(
|
||||
ipcChannels.documentParsingTest
|
||||
ipcChannels.documentParsingTest,
|
||||
{ purpose }
|
||||
) as Promise<DocumentParsingDiagnostic | undefined>,
|
||||
installOcrModel: (modelId: string) =>
|
||||
ipcRenderer.invoke(
|
||||
|
||||
@@ -50,6 +50,19 @@ describe('sandboxed preload', () => {
|
||||
expect(source).not.toContain('importOcrModel:')
|
||||
})
|
||||
|
||||
it('passes an explicit parsing scenario to document diagnostics', () => {
|
||||
const source = readFileSync(
|
||||
join(process.cwd(), 'src', 'preload', 'index.ts'),
|
||||
'utf8'
|
||||
)
|
||||
expect(source).toContain(
|
||||
'test: (purpose: DocumentParsingTestPurpose)'
|
||||
)
|
||||
expect(source).toContain(
|
||||
'ipcChannels.documentParsingTest,\n { purpose }'
|
||||
)
|
||||
})
|
||||
|
||||
it('exposes a removable attachment parsing progress listener', () => {
|
||||
const source = readFileSync(
|
||||
join(process.cwd(), 'src', 'preload', 'index.ts'),
|
||||
|
||||
Reference in New Issue
Block a user