mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
The win32 tier is exactly the koffi IFileOpenDialog child process; any failure surfaces as-is. The pwsh -> Windows PowerShell 5.1 cascade, the shared WinForms script, and the triple-miss AggregateError are deleted: koffi is a packaged dependency whose availability the install guarantees, so no mechanism fallback exists (the browse backend remains the fallback at the composition level). The pwsh-first DPI picker-fix note is consolidated into a new simplification note recording the reversal.
35 lines
1.5 KiB
TypeScript
35 lines
1.5 KiB
TypeScript
/**
|
|
* Native backend of the directory-picker seam: registers `ctx.directoryPicker`
|
|
* with the `native` capability, opening one native OS chooser on the host
|
|
* display per pick (macOS `osascript`, Linux Zenity with a KDialog fallback;
|
|
* Windows opens the modern `IFileOpenDialog` in a spawned child process — a
|
|
* koffi-driven COM conversation on the child's main thread). Only viable when
|
|
* the operator sits at the host's screen; remote deployments compose the
|
|
* browse backend instead.
|
|
* @module @deepseek-ai/dsh-host-directory-picker-native
|
|
*/
|
|
|
|
import { DirectoryPicker } from '@deepseek-ai/dsh-host-directory-picker'
|
|
import type { DirectoryPickerCapability } from '@deepseek-ai/dsh-host-directory-picker'
|
|
import { pickNativeDirectory } from './native-picker.ts'
|
|
|
|
export type { DirectoryPickerInternals, DirectoryPickerRunner } from './native-picker.ts'
|
|
export { pickNativeDirectory } from './native-picker.ts'
|
|
|
|
/** The `ctx.directoryPicker` native implementation (stable capability object per service life). */
|
|
export default class NativeDirectoryPicker extends DirectoryPicker {
|
|
private readonly nativeCapability: DirectoryPickerCapability = {
|
|
kind: 'native',
|
|
/* v8 ignore next -- pure forward to pickNativeDirectory (its spec owns behavior); invoking here opens a real chooser. */
|
|
pick: signal => pickNativeDirectory(signal),
|
|
}
|
|
|
|
/**
|
|
* The native interaction capability.
|
|
* @returns the stable `native` capability object.
|
|
*/
|
|
capability(): DirectoryPickerCapability {
|
|
return this.nativeCapability
|
|
}
|
|
}
|