Download desktop/src/api/computerUse.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.78 kB
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/computerUse.ts
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/computerUse.ts
-
curl -L -o computerUse.ts https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/computerUse.ts
1.78 kB
| import { api } from './client' | |
| export type ComputerUseStatus = { | |
| platform: string | |
| supported: boolean | |
| python: { | |
| installed: boolean | |
| version: string | null | |
| path: string | null | |
| source: 'custom' | 'system' | 'venv' | null | |
| error: string | null | |
| } | |
| venv: { | |
| created: boolean | |
| path: string | |
| } | |
| dependencies: { | |
| installed: boolean | |
| requirementsFound: boolean | |
| } | |
| permissions: { | |
| accessibility: boolean | null | |
| screenRecording: boolean | null | |
| } | |
| } | |
| export type SetupStep = { | |
| name: string | |
| ok: boolean | |
| message: string | |
| } | |
| export type SetupResult = { | |
| success: boolean | |
| steps: SetupStep[] | |
| } | |
| export type InstalledApp = { | |
| bundleId: string | |
| displayName: string | |
| path: string | |
| } | |
| export type AuthorizedApp = { | |
| bundleId: string | |
| displayName: string | |
| authorizedAt: string | |
| } | |
| export type ComputerUseConfig = { | |
| enabled: boolean | |
| authorizedApps: AuthorizedApp[] | |
| grantFlags: { | |
| clipboardRead: boolean | |
| clipboardWrite: boolean | |
| systemKeyCombos: boolean | |
| } | |
| pythonPath: string | null | |
| } | |
| export const computerUseApi = { | |
| getStatus() { | |
| return api.get<ComputerUseStatus>('/api/computer-use/status') | |
| }, | |
| runSetup() { | |
| return api.post<SetupResult>('/api/computer-use/setup', undefined, { timeout: 300_000 }) | |
| }, | |
| getInstalledApps() { | |
| return api.get<{ apps: InstalledApp[] }>('/api/computer-use/apps') | |
| }, | |
| getAuthorizedApps() { | |
| return api.get<ComputerUseConfig>('/api/computer-use/authorized-apps') | |
| }, | |
| setAuthorizedApps(config: Partial<ComputerUseConfig>) { | |
| return api.put<{ ok: true }>('/api/computer-use/authorized-apps', config) | |
| }, | |
| openSettings(pane: 'Privacy_ScreenCapture' | 'Privacy_Accessibility') { | |
| return api.post<{ ok: true }>('/api/computer-use/open-settings', { pane }) | |
| }, | |
| } | |