index.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // Library exports
  2. export { SandboxManager } from "./sandbox/sandbox-manager.js";
  3. export type { WrapWithSandboxOptions } from "./sandbox/sandbox-manager.js";
  4. export { SandboxViolationStore } from "./sandbox/sandbox-violation-store.js";
  5. // Configuration types and schemas
  6. export type {
  7. SandboxRuntimeConfig,
  8. NetworkConfig,
  9. FilesystemConfig,
  10. CredentialsConfig,
  11. CredentialFileConfig,
  12. CredentialEnvVarConfig,
  13. CredentialMode,
  14. IgnoreViolationsConfig,
  15. } from "./sandbox/sandbox-config.js";
  16. export {
  17. SandboxRuntimeConfigSchema,
  18. NetworkConfigSchema,
  19. FilesystemConfigSchema,
  20. CredentialsConfigSchema,
  21. IgnoreViolationsConfigSchema,
  22. RipgrepConfigSchema,
  23. } from "./sandbox/sandbox-config.js";
  24. // Schema types and utilities
  25. export type {
  26. SandboxAskCallback,
  27. FsReadRestrictionConfig,
  28. FsWriteRestrictionConfig,
  29. CredentialRestrictionConfig,
  30. NetworkRestrictionConfig,
  31. NetworkHostPattern,
  32. } from "./sandbox/sandbox-schemas.js";
  33. // Per-request filter
  34. export type {
  35. FilterRequestCallback,
  36. RequestDecision,
  37. MutateForwardedHeaders,
  38. } from "./sandbox/request-filter.js";
  39. // Platform-specific utilities
  40. export type { SandboxViolationEvent } from "./sandbox/macos-sandbox-utils.js";
  41. export { type SandboxDependencyCheck } from "./sandbox/linux-sandbox-utils.js";
  42. // Windows install/status API
  43. export {
  44. WindowsSandboxError,
  45. getSrtWinPath,
  46. resolveSrtWin,
  47. VENDORED_SRT_WIN_EXE,
  48. checkWindowsSandboxStatus,
  49. checkWindowsSandboxStatusAsync,
  50. getWindowsWfpStatus,
  51. getWindowsWfpStatusAsync,
  52. verifyWindowsWfpEgress,
  53. getWindowsSandboxUserStatus,
  54. getWindowsSandboxUserStatusAsync,
  55. getWindowsSandboxCaCert,
  56. windowsTrustCa,
  57. windowsTrustCaAsync,
  58. ensurePersistentWindowsCa,
  59. windowsStateDir,
  60. installWindowsSandbox,
  61. installWindowsSandboxAsync,
  62. checkWindowsDependenciesAsync,
  63. uninstallWindowsSandbox,
  64. windowsInstallInstructions,
  65. stampWindowsAcl,
  66. restoreWindowsAcl,
  67. grantWindowsAcl,
  68. revokeWindowsAcl,
  69. expandWindowsFsPaths,
  70. buildGitConfigEnv,
  71. parseWindowsBinShell,
  72. parseWindowsSandboxError,
  73. isUncPath,
  74. DEFAULT_WINDOWS_PROXY_PORT_RANGE,
  75. SRT_WIN_DISPATCH_ARG1,
  76. } from "./sandbox/windows-sandbox-utils.js";
  77. export type {
  78. WindowsSandboxErrorCode,
  79. WindowsSandboxStatus,
  80. WindowsBinShell,
  81. MappedDriveCwdError,
  82. WindowsInstallOptions,
  83. WindowsInstallResult,
  84. WindowsWfpStatus,
  85. WindowsAclStampOptions,
  86. WindowsAclGrantOptions,
  87. WindowsAclAceOutcome,
  88. WindowsWfpStatusResult,
  89. WindowsWfpVerifyResult,
  90. WindowsSandboxUserStatus,
  91. WindowsPersistentCa,
  92. SrtWinSpawn,
  93. } from "./sandbox/windows-sandbox-utils.js";
  94. // TLS-termination CA generation/validation (mitm-ca.ts). Embedders that
  95. // manage CA persistence themselves (rather than relying on the Windows
  96. // persistent-CA default) use these to generate and validate a pair.
  97. export {
  98. generateCa,
  99. validateCaPair,
  100. certThumbprint,
  101. } from "./sandbox/mitm-ca.js";
  102. export type { GeneratedCa, CaPairValidation } from "./sandbox/mitm-ca.js";
  103. export type {
  104. WindowsConfig,
  105. SrtWinConfig,
  106. GitConfig,
  107. } from "./sandbox/sandbox-config.js";
  108. export {
  109. WindowsConfigSchema,
  110. SrtWinConfigSchema,
  111. GitConfigSchema,
  112. } from "./sandbox/sandbox-config.js";
  113. // Utility functions
  114. export { getDefaultWritePaths } from "./sandbox/sandbox-utils.js";
  115. // Platform utilities
  116. export { getWslVersion } from "./utils/platform.js";
  117. export type { Platform } from "./utils/platform.js";