@thanh01.pmt/curriculum-kit 1.4.29 → 1.4.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -765,7 +765,7 @@ declare function buildHeadingDirective(artifactType: string, slcMarkdown?: Recor
765
765
  * Provides typed, structured, and traceable error codes for all pipeline failures,
766
766
  * API exceptions, safeguard blocks, and contract violations.
767
767
  */
768
- type CurriculumErrorCode = 'ERR_AI_NO_API_KEY' | 'ERR_AI_RATE_LIMIT' | 'ERR_AI_AUTH_FAILED' | 'ERR_AI_NETWORK_TIMEOUT' | 'ERR_AI_RESPONSE_MALFORMED' | 'ERR_AI_ALL_PROVIDERS_FAILED' | 'ERR_SOT_MISSING' | 'ERR_SOT_INVALID_SCHEMA' | 'ERR_TASK_GATE_BLOCKED' | 'ERR_METERED_LIMIT_EXCEEDED' | 'ERR_SCHEMA_CONTRACT_VIOLATION' | 'ERR_STORAGE_IO_FAILED' | 'ERR_LESSON_NOT_IN_SOT' | 'ERR_CONTEXT_MISSING';
768
+ type CurriculumErrorCode = 'ERR_AI_NO_API_KEY' | 'ERR_AI_RATE_LIMIT' | 'ERR_AI_AUTH_FAILED' | 'ERR_AI_NETWORK_TIMEOUT' | 'ERR_AI_RESPONSE_MALFORMED' | 'ERR_AI_ALL_PROVIDERS_FAILED' | 'ERR_CUSTOM_INFERENCE_REQUIRED' | 'ERR_SOT_MISSING' | 'ERR_SOT_INVALID_SCHEMA' | 'ERR_TASK_GATE_BLOCKED' | 'ERR_METERED_LIMIT_EXCEEDED' | 'ERR_SCHEMA_CONTRACT_VIOLATION' | 'ERR_STORAGE_IO_FAILED' | 'ERR_LESSON_NOT_IN_SOT' | 'ERR_CONTEXT_MISSING';
769
769
  interface CurriculumErrorDetail {
770
770
  errorCode: CurriculumErrorCode;
771
771
  agent?: string;
package/dist/index.d.ts CHANGED
@@ -765,7 +765,7 @@ declare function buildHeadingDirective(artifactType: string, slcMarkdown?: Recor
765
765
  * Provides typed, structured, and traceable error codes for all pipeline failures,
766
766
  * API exceptions, safeguard blocks, and contract violations.
767
767
  */
768
- type CurriculumErrorCode = 'ERR_AI_NO_API_KEY' | 'ERR_AI_RATE_LIMIT' | 'ERR_AI_AUTH_FAILED' | 'ERR_AI_NETWORK_TIMEOUT' | 'ERR_AI_RESPONSE_MALFORMED' | 'ERR_AI_ALL_PROVIDERS_FAILED' | 'ERR_SOT_MISSING' | 'ERR_SOT_INVALID_SCHEMA' | 'ERR_TASK_GATE_BLOCKED' | 'ERR_METERED_LIMIT_EXCEEDED' | 'ERR_SCHEMA_CONTRACT_VIOLATION' | 'ERR_STORAGE_IO_FAILED' | 'ERR_LESSON_NOT_IN_SOT' | 'ERR_CONTEXT_MISSING';
768
+ type CurriculumErrorCode = 'ERR_AI_NO_API_KEY' | 'ERR_AI_RATE_LIMIT' | 'ERR_AI_AUTH_FAILED' | 'ERR_AI_NETWORK_TIMEOUT' | 'ERR_AI_RESPONSE_MALFORMED' | 'ERR_AI_ALL_PROVIDERS_FAILED' | 'ERR_CUSTOM_INFERENCE_REQUIRED' | 'ERR_SOT_MISSING' | 'ERR_SOT_INVALID_SCHEMA' | 'ERR_TASK_GATE_BLOCKED' | 'ERR_METERED_LIMIT_EXCEEDED' | 'ERR_SCHEMA_CONTRACT_VIOLATION' | 'ERR_STORAGE_IO_FAILED' | 'ERR_LESSON_NOT_IN_SOT' | 'ERR_CONTEXT_MISSING';
769
769
  interface CurriculumErrorDetail {
770
770
  errorCode: CurriculumErrorCode;
771
771
  agent?: string;
package/dist/index.mjs CHANGED
@@ -504,6 +504,13 @@ Guidelines:
504
504
  });
505
505
  }
506
506
  }
507
+ if (!options.customInference && resolveApiKey("CURRICULUM_KIT_REQUIRE_CUSTOM_INFERENCE") === "1") {
508
+ throw createAiInferenceError({
509
+ errorCode: "ERR_CUSTOM_INFERENCE_REQUIRED",
510
+ message: "customInference is REQUIRED (CURRICULUM_KIT_REQUIRE_CUSTOM_INFERENCE=1): pass buildKitCustomInference(...) so every LLM call flows through the host AI SDK gateway and its unified Langfuse tracing. Raw-fetch provider routes are disabled by mandate.",
511
+ rawError: { mandate: "CURRICULUM_KIT_REQUIRE_CUSTOM_INFERENCE", hasCustomInference: false }
512
+ });
513
+ }
507
514
  const formattedMessages = [
508
515
  { role: "system", content: systemInstruction },
509
516
  ...messages.map((m) => ({