coreTypes.ts
1 // SDK Core Types - Common serializable types used by both SDK consumers and SDK builders. 2 // 3 // Types are generated from Zod schemas in coreSchemas.ts. 4 // To modify types: 5 // 1. Edit Zod schemas in coreSchemas.ts 6 // 2. Run: bun scripts/generate-sdk-types.ts 7 // 8 // Schemas are available in coreSchemas.ts for runtime validation but are not 9 // part of the public API. 10 11 // Re-export sandbox types for SDK consumers 12 export type { 13 SandboxFilesystemConfig, 14 SandboxIgnoreViolations, 15 SandboxNetworkConfig, 16 SandboxSettings, 17 } from '../sandboxTypes.js' 18 // Re-export all generated types 19 export * from './coreTypes.generated.js' 20 21 // Re-export utility types that can't be expressed as Zod schemas 22 export type { NonNullableUsage } from './sdkUtilityTypes.js' 23 24 // Const arrays for runtime usage 25 export const HOOK_EVENTS = [ 26 'PreToolUse', 27 'PostToolUse', 28 'PostToolUseFailure', 29 'Notification', 30 'UserPromptSubmit', 31 'SessionStart', 32 'SessionEnd', 33 'Stop', 34 'StopFailure', 35 'SubagentStart', 36 'SubagentStop', 37 'PreCompact', 38 'PostCompact', 39 'PermissionRequest', 40 'PermissionDenied', 41 'Setup', 42 'TeammateIdle', 43 'TaskCreated', 44 'TaskCompleted', 45 'Elicitation', 46 'ElicitationResult', 47 'ConfigChange', 48 'WorktreeCreate', 49 'WorktreeRemove', 50 'InstructionsLoaded', 51 'CwdChanged', 52 'FileChanged', 53 ] as const 54 55 export const EXIT_REASONS = [ 56 'clear', 57 'resume', 58 'logout', 59 'prompt_input_exit', 60 'other', 61 'bypass_permissions_disabled', 62 ] as const