(Alleged) Leaked source of Claude Code
1import { z } from 'zod/v4'
2import { lazySchema } from '../../utils/lazySchema.js'
3import type { SettingsJson } from '../../utils/settings/types.js'
4
5/**
6 * Schema for the remotely managed settings response.
7 * Note: Uses permissive z.record() instead of SettingsSchema to avoid circular dependency.
8 * Full validation is performed in index.ts after parsing using SettingsSchema.safeParse().
9 */
10export const RemoteManagedSettingsResponseSchema = lazySchema(() =>
11 z.object({
12 uuid: z.string(), // Settings UUID
13 checksum: z.string(),
14 settings: z.record(z.string(), z.unknown()) as z.ZodType<SettingsJson>,
15 }),
16)
17
18export type RemoteManagedSettingsResponse = z.infer<
19 ReturnType<typeof RemoteManagedSettingsResponseSchema>
20>
21
22/**
23 * Result of fetching remotely managed settings
24 */
25export type RemoteManagedSettingsFetchResult = {
26 success: boolean
27 settings?: SettingsJson | null // null means 304 Not Modified (cache is valid)
28 checksum?: string
29 error?: string
30 skipRetry?: boolean // If true, don't retry on failure (e.g., auth errors)
31}