index.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. export const DEFAULT_GRANT_FLAGS = {
  2. accessibility: false,
  3. screenRecording: false,
  4. }
  5. export const API_RESIZE_PARAMS = {}
  6. export function targetImageSize(width: number, height: number) {
  7. return [width, height] as const
  8. }
  9. export function buildComputerUseTools() {
  10. return [] as Array<{ name: string }>
  11. }
  12. export function createComputerUseMcpServer() {
  13. return {
  14. async connect() {},
  15. setRequestHandler() {},
  16. async close() {},
  17. }
  18. }
  19. export function bindSessionContext() {
  20. return async () => ({
  21. is_error: true,
  22. content: [
  23. {
  24. type: 'text',
  25. text: 'Computer use is unavailable in the restored development build.',
  26. },
  27. ],
  28. })
  29. }
  30. export type DisplayGeometry = Record<string, unknown>
  31. export type FrontmostApp = Record<string, unknown>
  32. export type InstalledApp = { name?: string; bundleId?: string }
  33. export type ResolvePrepareCaptureResult = Record<string, unknown>
  34. export type RunningApp = Record<string, unknown>
  35. export type ScreenshotResult = Record<string, unknown>
  36. export type ScreenshotDims = {
  37. width: number
  38. height: number
  39. displayWidth?: number
  40. displayHeight?: number
  41. displayId?: number
  42. originX?: number
  43. originY?: number
  44. }
  45. export type CuPermissionRequest = Record<string, unknown>
  46. export type CuPermissionResponse = Record<string, unknown>
  47. export type CuCallToolResult = {
  48. is_error?: boolean
  49. content?: Array<{ type: string; text?: string }>
  50. telemetry?: Record<string, unknown>
  51. }
  52. export type ComputerUseSessionContext = Record<string, unknown>
  53. export type ComputerExecutor = Record<string, unknown>