{"version":3,"sources":["../core/types/load-content.ts"],"names":["isLoadContentResult","value","isLoadContentResultURL","isLoadContentResultHTML"],"mappings":";;;AAqEO,SAASA,oBAAoBC,KAAc,EAAA;AAChD,EACE,OAAA,OAAOA,KAAU,KAAA,QAAA,IACjBA,KAAU,KAAA,IAAA,IACV,SAAaA,IAAAA,KAAAA,IACb,UAAcA,IAAAA,KAAAA,IACd,UAAcA,IAAAA,KAAAA,IACd,UAAcA,IAAAA,KAAAA;AAElB;AATgBD,MAAAA,CAAAA,mBAAAA,EAAAA,qBAAAA,CAAAA;AAsCT,SAASE,uBAAuBD,KAAc,EAAA;AACnD,EAAA,OAAOD,mBAAoBC,CAAAA,KAAAA,CACzB,IAAA,KAAA,IAASA,SACT,QAAYA,IAAAA,KAAAA;AAChB;AAJgBC,MAAAA,CAAAA,sBAAAA,EAAAA,wBAAAA,CAAAA;AAoBT,SAASC,wBAAwBF,KAAc,EAAA;AACpD,EAAOD,OAAAA,mBAAAA,CAAoBC,KAAAA,CAAAA,IACzB,MAAUA,IAAAA,KAAAA;AACd;AAHgBE,MAAAA,CAAAA,uBAAAA,EAAAA,yBAAAA,CAAAA","file":"chunk-TZUIAYSF.mjs","sourcesContent":["/**\n * Type definitions for content loading with metadata support\n *\n * USAGE GUIDE:\n *\n * - Use `isLoadContentResult(value)` when:\n *   - Validating INPUT to factory functions (before wrapping)\n *   - Checking items INSIDE arrays (may still be unwrapped)\n *   - In factory/utility layers that create StructuredValue\n *\n * - Use `isStructuredValue(value)` when:\n *   - Checking values in the evaluation pipeline\n *   - Values from evaluate() or evaluateDirective()\n *   - After Phase 3 migration, most values are StructuredValue\n *\n * - Use `isFileLoadedValue(value)` when:\n *   - Need to handle BOTH old and new formats\n *   - During migration period or backward compatibility\n *   - In code that might receive either format\n *   - Defined in: interpreter/utils/load-content-structured.ts\n *\n * MIGRATION STATUS (Phase 3 complete):\n * - Array handling: Use isStructuredValue && value.type === 'array'\n * - Individual items: Use isFileLoadedValue() for dual-format support\n * - Factory code: Keeps isLoadContentResult for input validation\n * - 33 legitimate isLoadContentResult usages remain in factory/conversion layers\n */\n\n/**\n * Result of loading content with rich metadata\n */\nexport interface LoadContentResult {\n  // Always available properties\n  content: string;              // File contents (or section if extracted)\n  filename: string;             // \"README.md\"\n  relative: string;             // \"./docs/README.md\"\n  absolute: string;             // \"/Users/adam/project/docs/README.md\"\n  // StructuredValue surface (content-first)\n  readonly type?: 'text' | 'object' | 'array' | 'html' | (string & {});\n  readonly text?: string;\n  readonly data?: unknown;\n  readonly mx?: {\n    filename?: string;\n    relative?: string;\n    absolute?: string;\n    url?: string;\n    domain?: string;\n    title?: string;\n    description?: string;\n    status?: number;\n    headers?: Record<string, unknown>;\n    html?: string;\n    tokest?: number;\n    tokens?: number;\n    fm?: unknown;\n    json?: unknown;\n    type?: 'text' | 'object' | 'array' | 'html' | (string & {});\n  };\n  \n  // Lazy-evaluated properties (implemented as getters)\n  tokest: number;               // Estimated tokens (KB-based)\n  tokens: number;               // Exact tokens (tiktoken)\n  fm: any | undefined;          // Frontmatter (markdown only)\n  json: any | undefined;        // Parsed JSON (JSON files only)\n}\n\n/**\n * Type guard for LoadContentResult\n */\nexport function isLoadContentResult(value: unknown): value is LoadContentResult {\n  return (\n    typeof value === 'object' &&\n    value !== null &&\n    'content' in value &&\n    'filename' in value &&\n    'relative' in value &&\n    'absolute' in value\n  );\n}\n\n\n/**\n * Extended metadata for URL content\n */\nexport interface LoadContentResultURL extends LoadContentResult {\n  // URL-specific properties\n  url: string;                  // The source URL\n  domain: string;               // Just the domain part\n  title?: string;               // Page title from HTML\n  description?: string;         // Meta description from HTML\n  \n  // Response metadata\n  status?: number;              // HTTP status code\n  headers?: Record<string, string>; // Response headers\n  rawContent: string;           // Raw response (before conversion)\n  \n  // Content type properties\n  contentType?: string;         // MIME type from headers\n  html?: string;                // Raw HTML (same as rawContent for HTML)\n  text?: string;                // Plain text extraction (HTML stripped)\n  json?: any;                   // Parsed JSON (for JSON responses)\n  md?: string;                  // Markdown (deprecated, use content)\n}\n\n/**\n * Type guard for URL content results\n */\nexport function isLoadContentResultURL(value: unknown): value is LoadContentResultURL {\n  return isLoadContentResult(value) && \n    'url' in value && \n    'domain' in value;\n}\n\n/**\n * Extended metadata for HTML file content\n */\nexport interface LoadContentResultHTML extends LoadContentResult {\n  // HTML-specific properties\n  title?: string;               // Page title from <title> tag\n  description?: string;         // Meta description\n  html: string;                 // Raw HTML content\n  text?: string;                // Plain text extraction (lazy)\n}\n\n/**\n * Type guard for HTML content results\n */\nexport function isLoadContentResultHTML(value: unknown): value is LoadContentResultHTML {\n  return isLoadContentResult(value) && \n    'html' in value;\n}\n"]}