{"version":3,"sources":["/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-C5Z52GMN.cjs","../src/profiles/resolveProfileForAsk.ts","../src/profiles/profileResolveKey.ts","../src/profiles/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,+CAAiC;ADMjC;AACA;AEPA;AACE;AACA;AACA;AACA;AACA;AACA;AAAA;AAKF,SAAS,iBAAA,CAAkB,QAAA,EAA8B,KAAA,EAAwB;AAC/E,EAAA,MAAM,IAAA,EAAM,KAAA,CAAM,IAAA,CAAK,CAAA,CAAE,WAAA,CAAY,CAAA;AACrC,EAAA,GAAA,CAAI,CAAC,IAAA,GAAO,kDAAA,GAA4B,CAAA,EAAG,OAAO,KAAA;AAClD,EAAA,OAAO,2CAAA,MAAkB,CAAO,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,EAAG,GAAG,EAAA,IAAM,KAAA,CAAA;AACpE;AAQO,SAAS,6BAAA,CACd,QAAA,EACA,KAAA,EACA,cAAA,EACe;AACf,EAAA,MAAM,QAAA,EAAU,KAAA,CAAM,IAAA,CAAK,CAAA;AAC3B,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,OAAO,IAAA;AAErB,EAAA,GAAA,CAAI,cAAA,EAAgB;AAClB,IAAA,MAAM,WAAA,EAAa,kDAAA,OAAgC,EAAA,EAC/C,+CAAA,OAA6B,CAAA,CAAG,QAAA,EAChC,OAAA;AACJ,IAAA,OAAO,gDAAA,UAAuB,EAAY,cAAc,CAAA;AAAA,EAC1D;AAEA,EAAA,MAAM,OAAA,EAAS,iDAAA,QAAwB,EAAU,OAAO,CAAA;AACxD,EAAA,GAAA,iBAAI,MAAA,2BAAQ,OAAA,IAAS,eAAA,EAAiB;AACpC,IAAA,OAAO,gDAAA,MAAuB,CAAO,OAAA,EAAS,MAAA,CAAO,MAAM,CAAA;AAAA,EAC7D;AAEA,EAAA,OAAO,IAAA;AACT;AAGO,SAAS,oCAAA,CACd,QAAA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F,CAAA;AACF;AAOA,MAAA,SAAsB,oBAAA,CACpB,KAAA,EACgC;AAChC,EAAA,MAAM,QAAA,mBACJ,KAAA,CAAM,OAAA,UAAA,CACL,KAAA,CAAM,OAAA,IAAW,KAAA,EAAA,GAAa,KAAA,CAAM,OAAA,IAAW,OAAA,EAAS,KAAA,EAAO,KAAA,CAAA,GAAA;AAClE,EAAA,MAAM,IAAA,EAAM,MAAM,wBAAA,CAAyB,KAAA,CAAM,OAAA,EAAS;AAAA,IACxD,MAAA,EAAQ,KAAA,CAAM,MAAA;AAAA,IACd,OAAA;AAAA,IACA,MAAA,EAAQ,KAAA,CAAM;AAAA,EAChB,CAAC,CAAA;AACD,EAAA,MAAM,SAAA,EAAW,MAAM,0CAAA,GAAiB,EAAK;AAAA,IAC3C,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,IACnB,MAAA,EAAQ,KAAA,CAAM,MAAA;AAAA,IACd;AAAA,EACF,CAAC,CAAA;AACD,EAAA,OAAO,yBAAA,CAA0B,QAAQ,CAAA;AAC3C;ADUA;AACA;AG/EA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AHkFF;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,miDAAC","file":"/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-C5Z52GMN.cjs","sourcesContent":[null,"import { resolveAIProfile } from \"@x12i/ai-profiles\";\nimport { requireProfileResolveKey } from \"./profileResolveKey.js\";\nimport type {\n  AIProfileBackend,\n  InstructionTier,\n  ProfileCatalogLane,\n  RegistrySourceMode,\n  ResolvedAIProfile,\n} from \"@x12i/ai-profiles\";\n\nexport type ResolveProfileForAskInput = {\n  profile: string;\n  /** OpenRouter catalog lane — must match the profile (e.g. `text`, `image`). */\n  catalogLane: ProfileCatalogLane;\n  choice?: string;\n  source?: RegistrySourceMode;\n  refresh?: boolean;\n};\n\n/** FuncX / ask-node model config derived from {@link ResolvedAIProfile}. */\nexport type AskProfileModelConfig = {\n  provider: ResolvedAIProfile[\"provider\"];\n  model: string;\n  instructionTier: InstructionTier;\n  backend: AIProfileBackend;\n  profile: string;\n  choice: string;\n  temperature: number;\n  outputMode: ResolvedAIProfile[\"runtime\"][\"outputMode\"];\n  toolPolicy: ResolvedAIProfile[\"runtime\"][\"toolPolicy\"];\n  reasoningEffort: ResolvedAIProfile[\"runtime\"][\"reasoningEffort\"];\n  executionMode: ResolvedAIProfile[\"runtime\"][\"executionMode\"];\n  requireCitations: boolean;\n  allowWeb: boolean;\n  allowFileSearch: boolean;\n  allowCodeExecution: boolean;\n  humanReview: ResolvedAIProfile[\"runtime\"][\"humanReview\"];\n  metadata?: Record<string, unknown>;\n  pricing?: ResolvedAIProfile[\"pricing\"];\n  resolved: ResolvedAIProfile;\n};\n\nexport function profileConfigFromResolved(\n  resolved: ResolvedAIProfile,\n): AskProfileModelConfig {\n  return {\n    provider: resolved.provider,\n    model: resolved.modelId,\n    instructionTier: resolved.instructionTier,\n    backend: resolved.backend,\n    profile: resolved.profile,\n    choice: resolved.choice,\n    temperature: resolved.runtime.temperature,\n    outputMode: resolved.runtime.outputMode,\n    toolPolicy: resolved.runtime.toolPolicy,\n    reasoningEffort: resolved.runtime.reasoningEffort,\n    executionMode: resolved.runtime.executionMode,\n    requireCitations: resolved.runtime.requireCitations,\n    allowWeb: resolved.runtime.allowWeb,\n    allowFileSearch: resolved.runtime.allowFileSearch,\n    allowCodeExecution: resolved.runtime.allowCodeExecution,\n    humanReview: resolved.runtime.humanReview,\n    ...(resolved.metadata !== undefined ? { metadata: resolved.metadata } : {}),\n    ...(resolved.pricing !== undefined ? { pricing: resolved.pricing } : {}),\n    resolved,\n  };\n}\n\n/**\n * Resolve a profile (+ optional choice) into ask-node / FuncX model configuration.\n * Uses {@link ResolvedAIProfile.instructionTier} and {@link ResolvedAIProfile.backend}\n * from `@x12i/ai-profiles` — do not duplicate preset tables locally.\n */\nexport async function resolveProfileForAsk(\n  input: ResolveProfileForAskInput,\n): Promise<AskProfileModelConfig> {\n  const refresh =\n    input.refresh ??\n    (input.source !== undefined && input.source !== \"auto\" ? true : undefined);\n  const key = await requireProfileResolveKey(input.profile, {\n    source: input.source,\n    refresh,\n    choice: input.choice,\n  });\n  const resolved = await resolveAIProfile(key, {\n    catalogLane: input.catalogLane,\n    source: input.source,\n    refresh,\n  });\n  return profileConfigFromResolved(resolved);\n}\n","import {\n  formatProfileChoiceKey,\n  isProfileChoiceKeyFormat,\n  loadAIProfilesRegistry,\n  matchStrictProfileInput,\n  parseProfileChoiceKey,\n  resolveSegmentKey,\n} from \"@x12i/ai-profiles\";\nimport type { AIProfilesRegistry, RegistrySourceMode } from \"@x12i/ai-profiles\";\nimport { ProfileResolveKeyRequiredError } from \"../errors.js\";\n\nfunction isBareProfileName(registry: AIProfilesRegistry, input: string): boolean {\n  const key = input.trim().toLowerCase();\n  if (!key || isProfileChoiceKeyFormat(key)) return false;\n  return resolveSegmentKey(Object.keys(registry.profiles), key) !== undefined;\n}\n\n/**\n * Build an ai-profiles resolve key when the input is profile intent.\n *\n * Returns `null` for concrete model SKUs (e.g. `gemini-2.5-flash-lite`) so callers\n * can use catalog / registry index paths instead of {@link resolveAIProfile}.\n */\nexport function profileResolveKeyFromRegistry(\n  registry: AIProfilesRegistry,\n  input: string,\n  explicitChoice?: string,\n): string | null {\n  const trimmed = input.trim();\n  if (!trimmed) return null;\n\n  if (explicitChoice) {\n    const profileKey = isProfileChoiceKeyFormat(trimmed)\n      ? parseProfileChoiceKey(trimmed)!.profile\n      : trimmed;\n    return formatProfileChoiceKey(profileKey, explicitChoice);\n  }\n\n  const strict = matchStrictProfileInput(registry, trimmed);\n  if (strict?.kind === \"profileChoice\") {\n    return formatProfileChoiceKey(strict.profile, strict.choice);\n  }\n\n  return null;\n}\n\n/** Require `profile/choice` or `profile` + explicit `choice`. */\nexport function requireProfileResolveKeyFromRegistry(\n  registry: AIProfilesRegistry,\n  input: string,\n  explicitChoice?: string,\n): string {\n  const key = profileResolveKeyFromRegistry(registry, input, explicitChoice);\n  if (key) return key;\n\n  const trimmed = input.trim();\n  if (trimmed && isBareProfileName(registry, trimmed)) {\n    throw new ProfileResolveKeyRequiredError(trimmed);\n  }\n\n  throw new ProfileResolveKeyRequiredError(trimmed, {\n    reason: \"not_profile_intent\",\n  });\n}\n\nexport async function requireProfileResolveKey(\n  input: string,\n  options: { source?: RegistrySourceMode; refresh?: boolean; choice?: string } = {},\n): Promise<string> {\n  const source = options.source ?? \"auto\";\n  const registry = await loadAIProfilesRegistry({\n    source,\n    ...(source !== \"auto\" || options.refresh ? { refresh: true as const } : {}),\n  });\n  return requireProfileResolveKeyFromRegistry(registry, input, options.choice);\n}\n\nexport async function profileResolveKey(\n  input: string,\n  options: { source?: RegistrySourceMode; refresh?: boolean; choice?: string } = {},\n): Promise<string | null> {\n  const source = options.source ?? \"auto\";\n  const registry = await loadAIProfilesRegistry({\n    source,\n    ...(source !== \"auto\" || options.refresh ? { refresh: true as const } : {}),\n  });\n  return profileResolveKeyFromRegistry(registry, input, options.choice);\n}\n","export {\n  resolveProfileForAsk,\n  profileConfigFromResolved,\n} from \"./resolveProfileForAsk.js\";\nexport type {\n  AskProfileModelConfig,\n  ResolveProfileForAskInput,\n} from \"./resolveProfileForAsk.js\";\n\nexport type {\n  ResolvedAIProfile,\n  InstructionTier,\n  AIProfileBackend,\n  AIProfileSummary,\n  AIProfileChoiceSummary,\n  ResolveAIProfileOptions,\n  RegistrySourceMode,\n  ProfileCatalogLane,\n} from \"@x12i/ai-profiles\";\n\nexport { TEXT_CATALOG_LANE } from \"./catalogLane.js\";\n\nexport {\n  resolveAIProfile,\n  listAIProfiles,\n  listAIProfileChoices,\n  resolveAIProfileByTags,\n  isKnownProfileChoice,\n  isKnownProfileChoiceInput,\n  isKnownProfileInput,\n  isKnownProfileOrShortcut,\n  formatProfileChoiceKey,\n  listRegistryProfileChoiceKeys,\n  ensureConcreteModel,\n  resolveBundledInput,\n  resolveInput,\n  resolveModelIdentity,\n  listAICatalogModels,\n  resolvePreferOpenRouter,\n  readPreferOpenRouterFromEnv,\n  parsePreferOpenRouter,\n} from \"@x12i/ai-profiles\";\n\nexport type {\n  CatalogModelSummary,\n  ListAICatalogModelsOptions,\n  ResolveInput,\n  ResolveInputOptions,\n} from \"@x12i/ai-profiles\";\n\nexport {\n  profileResolveKey,\n  profileResolveKeyFromRegistry,\n  requireProfileResolveKey,\n  requireProfileResolveKeyFromRegistry,\n} from \"./profileResolveKey.js\";\n"]}