@thanh01.pmt/curriculum-kit 1.4.26 → 1.4.27
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/LICENSE +21 -0
- package/dist/ai/index.cjs +68 -5
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +4 -4
- package/dist/ai/index.d.ts +4 -4
- package/dist/ai/index.mjs +68 -6
- package/dist/ai/index.mjs.map +1 -1
- package/dist/index.cjs +69 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +69 -6
- package/dist/index.mjs.map +1 -1
- package/dist/media/index.cjs +52 -4
- package/dist/media/index.cjs.map +1 -1
- package/dist/media/index.d.cts +1 -1
- package/dist/media/index.d.ts +1 -1
- package/dist/media/index.mjs +52 -4
- package/dist/media/index.mjs.map +1 -1
- package/dist/{milestoneBundleGenerator-CzSOeAzU.d.cts → milestoneBundleGenerator-CN6F1zPs.d.cts} +1 -1
- package/dist/{milestoneBundleGenerator-Bkba8OPG.d.ts → milestoneBundleGenerator-DTiJ5gIh.d.ts} +1 -1
- package/dist/pipeline/index.cjs +23 -4
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +3 -3
- package/dist/pipeline/index.d.ts +3 -3
- package/dist/pipeline/index.mjs +23 -4
- package/dist/pipeline/index.mjs.map +1 -1
- package/dist/{provider-factory-DxzOVEmh.d.cts → provider-factory-Bv-eIkhg.d.cts} +1 -1
- package/dist/{provider-factory-DxzOVEmh.d.ts → provider-factory-Bv-eIkhg.d.ts} +1 -1
- package/dist/storage/index.d.cts +2 -2
- package/dist/storage/index.d.ts +2 -2
- package/dist/{streamRunner-CYESG6IE.d.cts → streamRunner-kpS4MZP1.d.cts} +2 -1
- package/dist/{streamRunner-CYESG6IE.d.ts → streamRunner-kpS4MZP1.d.ts} +2 -1
- package/dist/workflow/index.cjs +67 -5
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.d.cts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.mjs +67 -5
- package/dist/workflow/index.mjs.map +1 -1
- package/package.json +22 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LessonPlan, ActivityLab, CodeLab, Handout, ProjectInstruction, SelfLab, DiagnosticQuiz, RoadmapInput, ProjectGraph, MilestoneInput, SelfPacedBundle } from '../schemas/index.cjs';
|
|
2
|
-
import { B as BundleTier, M as MilestoneCurriculumBundle, a as AutoRepairResult } from '../milestoneBundleGenerator-
|
|
3
|
-
export { A as AutoRepairOptions, G as GenerateMilestoneBundleOptions, g as generateMilestoneCurriculumBundle, w as withAutoRepair } from '../milestoneBundleGenerator-
|
|
4
|
-
import { M as ModelResolutionOptions } from '../provider-factory-
|
|
2
|
+
import { B as BundleTier, M as MilestoneCurriculumBundle, a as AutoRepairResult } from '../milestoneBundleGenerator-CN6F1zPs.cjs';
|
|
3
|
+
export { A as AutoRepairOptions, G as GenerateMilestoneBundleOptions, g as generateMilestoneCurriculumBundle, w as withAutoRepair } from '../milestoneBundleGenerator-CN6F1zPs.cjs';
|
|
4
|
+
import { M as ModelResolutionOptions } from '../provider-factory-Bv-eIkhg.cjs';
|
|
5
5
|
import { I as ICurriculumStorage, P as ProjectStatusReport } from '../types-BUJGYiep.cjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
package/dist/pipeline/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LessonPlan, ActivityLab, CodeLab, Handout, ProjectInstruction, SelfLab, DiagnosticQuiz, RoadmapInput, ProjectGraph, MilestoneInput, SelfPacedBundle } from '../schemas/index.js';
|
|
2
|
-
import { B as BundleTier, M as MilestoneCurriculumBundle, a as AutoRepairResult } from '../milestoneBundleGenerator-
|
|
3
|
-
export { A as AutoRepairOptions, G as GenerateMilestoneBundleOptions, g as generateMilestoneCurriculumBundle, w as withAutoRepair } from '../milestoneBundleGenerator-
|
|
4
|
-
import { M as ModelResolutionOptions } from '../provider-factory-
|
|
2
|
+
import { B as BundleTier, M as MilestoneCurriculumBundle, a as AutoRepairResult } from '../milestoneBundleGenerator-DTiJ5gIh.js';
|
|
3
|
+
export { A as AutoRepairOptions, G as GenerateMilestoneBundleOptions, g as generateMilestoneCurriculumBundle, w as withAutoRepair } from '../milestoneBundleGenerator-DTiJ5gIh.js';
|
|
4
|
+
import { M as ModelResolutionOptions } from '../provider-factory-Bv-eIkhg.js';
|
|
5
5
|
import { I as ICurriculumStorage, P as ProjectStatusReport } from '../types-BUJGYiep.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
package/dist/pipeline/index.mjs
CHANGED
|
@@ -638,14 +638,19 @@ function isModelAllowed(model) {
|
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
function getDesignatedFallbackChain() {
|
|
641
|
-
const rawProviders = resolveApiKey("FALLBACK_AI_PROVIDER") || resolveApiKey("FALLBACK_AI_PROVIDERS") || resolveApiKey("DEFAULT_AI_PROVIDER") || "nvidia,openrouter";
|
|
642
|
-
const rawModels = resolveApiKey("FALLBACK_AI_MODEL") || resolveApiKey("FALLBACK_AI_MODELS") || resolveApiKey("DEFAULT_AI_MODEL") || "
|
|
641
|
+
const rawProviders = resolveApiKey("FALLBACK_AI_PROVIDER") || resolveApiKey("FALLBACK_AI_PROVIDERS") || resolveApiKey("DEFAULT_AI_PROVIDER") || "9router,nvidia,openrouter";
|
|
642
|
+
const rawModels = resolveApiKey("FALLBACK_AI_MODEL") || resolveApiKey("FALLBACK_AI_MODELS") || resolveApiKey("DEFAULT_AI_MODEL") || "fast-reasoning,deep-reasoning,mid-range,free-tier";
|
|
643
643
|
const providerList = rawProviders.split(",").map((p) => p.trim().toLowerCase()).filter((p) => p.length > 0 && isProviderEnabled(p));
|
|
644
644
|
const modelList = rawModels.split(",").map((m) => m.trim()).filter((m) => m.length > 0 && isModelAllowed(m));
|
|
645
645
|
const chain = [];
|
|
646
646
|
for (const provider of providerList) {
|
|
647
647
|
let providerModels = [];
|
|
648
|
-
if (provider === "
|
|
648
|
+
if (provider === "9router" || provider === "ninerouter") {
|
|
649
|
+
providerModels = modelList.filter((m) => ["fast-reasoning", "deep-reasoning", "mid-range", "free-tier"].includes(m));
|
|
650
|
+
if (providerModels.length === 0) {
|
|
651
|
+
providerModels = ["fast-reasoning", "mid-range", "free-tier"];
|
|
652
|
+
}
|
|
653
|
+
} else if (provider === "nvidia") {
|
|
649
654
|
providerModels = modelList.filter((m) => m.startsWith("nvidia/") || m.startsWith("meta/") || m.startsWith("mistralai/"));
|
|
650
655
|
if (providerModels.length === 0) {
|
|
651
656
|
providerModels = ["nvidia/nemotron-3-ultra-550b-a55b:free", "nvidia/nemotron-3.5-lightning-30b-a3b"];
|
|
@@ -684,11 +689,13 @@ function getDesignatedFallbackChain() {
|
|
|
684
689
|
function getDesignatedFallbackConfig() {
|
|
685
690
|
const chain = getDesignatedFallbackChain();
|
|
686
691
|
if (chain.length > 0) return chain[0];
|
|
687
|
-
return { provider: "
|
|
692
|
+
return { provider: "9router", model: "fast-reasoning" };
|
|
688
693
|
}
|
|
689
694
|
|
|
690
695
|
// src/ai/provider-factory.ts
|
|
691
696
|
var DEFAULT_MODELS = {
|
|
697
|
+
"9router": "fast-reasoning",
|
|
698
|
+
ninerouter: "fast-reasoning",
|
|
692
699
|
nvidia: "nvidia/nemotron-3-ultra-550b-a55b:free",
|
|
693
700
|
openrouter: "@preset/coding-free",
|
|
694
701
|
alibaba: "qwen3.7-plus",
|
|
@@ -711,6 +718,15 @@ function getAIModel(options = {}) {
|
|
|
711
718
|
console.warn(`[provider-factory] Model "${resolvedModelName}" is not permitted by ALLOWED_AI_MODELS. Using designated model "${designated.model}".`);
|
|
712
719
|
resolvedModelName = designated.model;
|
|
713
720
|
}
|
|
721
|
+
if (provider === "9router" || provider === "ninerouter") {
|
|
722
|
+
const apiKey = options.apiKey || resolveApiKey("NINEROUTER_API_KEY") || resolveApiKey("NINE_ROUTER_API_KEY") || "";
|
|
723
|
+
const rawUrl = options.baseURL || resolveApiKey("NINEROUTER_BASE_URL") || resolveApiKey("NINE_ROUTER_BASE_URL") || "https://ai-router.orchable.app/v1";
|
|
724
|
+
const ninerouter = createOpenAI({
|
|
725
|
+
apiKey,
|
|
726
|
+
baseURL: rawUrl.replace(/^["']|["']$/g, "").trim()
|
|
727
|
+
});
|
|
728
|
+
return ninerouter.chat(resolvedModelName || "fast-reasoning");
|
|
729
|
+
}
|
|
714
730
|
if (provider === "nvidia") {
|
|
715
731
|
const apiKey = options.apiKey || process.env.NVIDIA_API_KEY || "";
|
|
716
732
|
const nvidia = createOpenAI({
|
|
@@ -779,6 +795,9 @@ function getAIModel(options = {}) {
|
|
|
779
795
|
return fallback.chat(resolvedModelName);
|
|
780
796
|
}
|
|
781
797
|
function detectDefaultProvider() {
|
|
798
|
+
if ((process.env.NINEROUTER_API_KEY || resolveApiKey("NINEROUTER_API_KEY") || resolveApiKey("NINE_ROUTER_API_KEY")) && isProviderEnabled("9router")) {
|
|
799
|
+
return "9router";
|
|
800
|
+
}
|
|
782
801
|
if (process.env.NVIDIA_API_KEY && isProviderEnabled("nvidia")) {
|
|
783
802
|
return "nvidia";
|
|
784
803
|
}
|