@goscribe/server 1.3.4 → 1.6.0
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/.env.example +12 -0
- package/.vscode/settings.json +3 -0
- package/REFACTOR_NOTES.md +60 -0
- package/TESTING_PROMPT.md +225 -0
- package/dist/context.d.ts +14 -1
- package/dist/context.js +23 -2
- package/dist/controllers/admin.controller.d.ts +715 -0
- package/dist/controllers/admin.controller.js +9 -0
- package/dist/controllers/annotations.controller.d.ts +439 -0
- package/dist/controllers/annotations.controller.js +9 -0
- package/dist/controllers/app-router.controller.d.ts +3011 -0
- package/dist/controllers/app-router.controller.js +38 -0
- package/dist/controllers/app-router.controller.test.d.ts +1 -0
- package/dist/controllers/app-router.controller.test.js +36 -0
- package/dist/controllers/auth.controller.d.ts +323 -0
- package/dist/controllers/auth.controller.js +9 -0
- package/dist/controllers/base.controller.d.ts +4 -0
- package/dist/controllers/base.controller.js +5 -0
- package/dist/controllers/chat.controller.d.ts +341 -0
- package/dist/controllers/chat.controller.js +9 -0
- package/dist/controllers/copilot.controller.d.ts +397 -0
- package/dist/controllers/copilot.controller.js +9 -0
- package/dist/controllers/flashcards.controller.d.ts +651 -0
- package/dist/controllers/flashcards.controller.js +9 -0
- package/dist/controllers/members.controller.d.ts +339 -0
- package/dist/controllers/members.controller.js +9 -0
- package/dist/controllers/notifications.controller.d.ts +199 -0
- package/dist/controllers/notifications.controller.js +9 -0
- package/dist/controllers/payment.controller.d.ts +181 -0
- package/dist/controllers/payment.controller.js +9 -0
- package/dist/controllers/podcast.controller.d.ts +575 -0
- package/dist/controllers/podcast.controller.js +9 -0
- package/dist/controllers/router-module.controller.d.ts +5 -0
- package/dist/controllers/router-module.controller.js +6 -0
- package/dist/controllers/studyguide.controller.d.ts +73 -0
- package/dist/controllers/studyguide.controller.js +9 -0
- package/dist/controllers/worksheets.controller.d.ts +829 -0
- package/dist/controllers/worksheets.controller.js +9 -0
- package/dist/controllers/workspace.controller.d.ts +1207 -0
- package/dist/controllers/workspace.controller.js +9 -0
- package/dist/lib/activity_human_description.test.js +16 -15
- package/dist/lib/activity_log_service.test.js +28 -23
- package/dist/lib/ai/config.d.ts +20 -0
- package/dist/lib/ai/config.js +31 -0
- package/dist/lib/ai/embedding-client.d.ts +8 -0
- package/dist/lib/ai/embedding-client.js +30 -0
- package/dist/lib/ai/index.d.ts +48 -0
- package/dist/lib/ai/index.js +29 -0
- package/dist/lib/ai/inference-backend/client.d.ts +28 -0
- package/dist/lib/ai/inference-backend/client.js +301 -0
- package/dist/lib/ai/inference-backend/mocks.d.ts +12 -0
- package/dist/lib/ai/inference-backend/mocks.js +133 -0
- package/dist/lib/ai/inference-backend/types.d.ts +44 -0
- package/dist/lib/ai/inference-backend/types.js +1 -0
- package/dist/lib/ai/json-parse.d.ts +2 -0
- package/dist/lib/ai/json-parse.js +34 -0
- package/dist/lib/ai/llm-client.d.ts +7 -0
- package/dist/lib/ai/llm-client.js +36 -0
- package/dist/lib/ai/mock.d.ts +2 -0
- package/dist/lib/ai/mock.js +10 -0
- package/dist/lib/ai/types.d.ts +9 -0
- package/dist/lib/ai/types.js +1 -0
- package/dist/lib/chunking.d.ts +19 -0
- package/dist/lib/chunking.js +47 -0
- package/dist/lib/curated-kb-seed.d.ts +12 -0
- package/dist/lib/curated-kb-seed.js +155 -0
- package/dist/lib/email.js +67 -108
- package/dist/lib/embeddings.d.ts +2 -0
- package/dist/lib/embeddings.js +1 -0
- package/dist/lib/ensure-curated-kb-catalog.d.ts +6 -0
- package/dist/lib/ensure-curated-kb-catalog.js +53 -0
- package/dist/lib/env.d.ts +1 -5
- package/dist/lib/env.js +2 -7
- package/dist/lib/inference.d.ts +1 -8
- package/dist/lib/inference.js +1 -19
- package/dist/lib/kb-meta.d.ts +8 -0
- package/dist/lib/kb-meta.js +77 -0
- package/dist/lib/note-text.d.ts +1 -0
- package/dist/lib/note-text.js +47 -0
- package/dist/lib/notification-service.test.js +37 -36
- package/dist/lib/pdf.d.ts +11 -0
- package/dist/lib/pdf.js +11 -0
- package/dist/lib/usage_service.d.ts +2 -1
- package/dist/lib/usage_service.js +30 -12
- package/dist/lib/worksheet-generation.js +4 -4
- package/dist/lib/worksheet-generation.test.js +32 -17
- package/dist/lib/workspace-kb.d.ts +5 -0
- package/dist/lib/workspace-kb.js +7 -0
- package/dist/models/controller-context.model.d.ts +8 -0
- package/dist/models/controller-context.model.js +1 -0
- package/dist/repositories/artifact.repository.d.ts +60 -0
- package/dist/repositories/artifact.repository.js +40 -0
- package/dist/repositories/base.repository.d.ts +14 -0
- package/dist/repositories/base.repository.js +14 -0
- package/dist/repositories/invitation.repository.d.ts +94 -0
- package/dist/repositories/invitation.repository.js +44 -0
- package/dist/repositories/notification.repository.d.ts +72 -0
- package/dist/repositories/notification.repository.js +44 -0
- package/dist/repositories/router-module.repository.d.ts +10 -0
- package/dist/repositories/router-module.repository.js +14 -0
- package/dist/repositories/user.repository.d.ts +74 -0
- package/dist/repositories/user.repository.js +37 -0
- package/dist/repositories/workspace-member.repository.d.ts +31 -0
- package/dist/repositories/workspace-member.repository.js +31 -0
- package/dist/repositories/workspace.repository.d.ts +97 -0
- package/dist/repositories/workspace.repository.js +79 -0
- package/dist/routers/_app.d.ts +566 -111
- package/dist/routers/_app.js +4 -0
- package/dist/routers/admin.d.ts +0 -4
- package/dist/routers/admin.js +21 -549
- package/dist/routers/annotations.js +12 -170
- package/dist/routers/artifactVersions.d.ts +65 -0
- package/dist/routers/artifactVersions.js +14 -0
- package/dist/routers/auth.d.ts +0 -6
- package/dist/routers/auth.js +37 -422
- package/dist/routers/chat.js +15 -229
- package/dist/routers/copilot.d.ts +14 -13
- package/dist/routers/copilot.js +13 -532
- package/dist/routers/flashcards.d.ts +17 -6
- package/dist/routers/flashcards.js +23 -349
- package/dist/routers/knowledgeBase.d.ts +421 -0
- package/dist/routers/knowledgeBase.js +118 -0
- package/dist/routers/members.d.ts +0 -41
- package/dist/routers/members.js +22 -710
- package/dist/routers/notes.d.ts +94 -0
- package/dist/routers/notes.js +37 -0
- package/dist/routers/notifications.js +7 -109
- package/dist/routers/payment.d.ts +2 -12
- package/dist/routers/payment.js +11 -393
- package/dist/routers/podcast.d.ts +1 -1
- package/dist/routers/podcast.js +11 -784
- package/dist/routers/studyguide.js +3 -129
- package/dist/routers/worksheets.d.ts +29 -14
- package/dist/routers/worksheets.js +49 -628
- package/dist/routers/workspace.d.ts +27 -71
- package/dist/routers/workspace.js +29 -922
- package/dist/scripts/purge-deleted-users.js +2 -2
- package/dist/server.js +10 -3
- package/dist/services/activity/activity-human-description.service.d.ts +13 -0
- package/dist/services/activity/activity-human-description.service.js +221 -0
- package/dist/services/activity/activity-human-description.service.test.d.ts +1 -0
- package/dist/services/activity/activity-human-description.service.test.js +16 -0
- package/dist/services/activity/activity-log.service.d.ts +87 -0
- package/dist/services/activity/activity-log.service.js +276 -0
- package/dist/services/activity/activity-log.service.test.d.ts +1 -0
- package/dist/services/activity/activity-log.service.test.js +27 -0
- package/dist/services/activity-human-description.service.d.ts +13 -0
- package/dist/services/activity-human-description.service.js +221 -0
- package/dist/services/activity-human-description.service.test.d.ts +1 -0
- package/dist/services/activity-human-description.service.test.js +16 -0
- package/dist/services/activity-log.service.d.ts +87 -0
- package/dist/services/activity-log.service.js +276 -0
- package/dist/services/activity-log.service.test.d.ts +1 -0
- package/dist/services/activity-log.service.test.js +27 -0
- package/dist/services/admin/admin.service.d.ts +270 -0
- package/dist/services/admin/admin.service.js +476 -0
- package/dist/services/admin.service.d.ts +270 -0
- package/dist/services/admin.service.js +476 -0
- package/dist/services/ai/ai-session.service.d.ts +5 -0
- package/dist/services/ai/ai-session.service.js +4 -0
- package/dist/services/ai-session.service.d.ts +60 -0
- package/dist/services/ai-session.service.js +561 -0
- package/dist/services/annotation.service.d.ts +177 -0
- package/dist/services/annotation.service.js +154 -0
- package/dist/services/artifact-notification.service.d.ts +14 -0
- package/dist/services/artifact-notification.service.js +20 -0
- package/dist/services/artifact-version.service.d.ts +38 -0
- package/dist/services/artifact-version.service.js +129 -0
- package/dist/services/artifacts/annotation.service.d.ts +177 -0
- package/dist/services/artifacts/annotation.service.js +154 -0
- package/dist/services/artifacts/artifact-version.service.d.ts +38 -0
- package/dist/services/artifacts/artifact-version.service.js +129 -0
- package/dist/services/artifacts/chat.service.d.ts +127 -0
- package/dist/services/artifacts/chat.service.js +182 -0
- package/dist/services/artifacts/study-guide.service.d.ts +18 -0
- package/dist/services/artifacts/study-guide.service.js +65 -0
- package/dist/services/auth/auth.service.d.ts +94 -0
- package/dist/services/auth/auth.service.js +368 -0
- package/dist/services/auth.service.d.ts +94 -0
- package/dist/services/auth.service.js +368 -0
- package/dist/services/base.service.d.ts +14 -0
- package/dist/services/base.service.js +14 -0
- package/dist/services/billing/payment.service.d.ts +44 -0
- package/dist/services/billing/payment.service.js +365 -0
- package/dist/services/billing/subscription.service.d.ts +37 -0
- package/dist/services/billing/subscription.service.js +654 -0
- package/dist/services/billing/usage.service.d.ts +47 -0
- package/dist/services/billing/usage.service.js +149 -0
- package/dist/services/chat.service.d.ts +127 -0
- package/dist/services/chat.service.js +182 -0
- package/dist/services/content/copilot.service.d.ts +113 -0
- package/dist/services/content/copilot.service.js +439 -0
- package/dist/services/content/flashcard-progress.service.d.ts +159 -0
- package/dist/services/content/flashcard-progress.service.js +432 -0
- package/dist/services/content/flashcard.service.d.ts +184 -0
- package/dist/services/content/flashcard.service.js +339 -0
- package/dist/services/content/media-analysis.service.d.ts +23 -0
- package/dist/services/content/media-analysis.service.js +404 -0
- package/dist/services/content/podcast.service.d.ts +267 -0
- package/dist/services/content/podcast.service.js +653 -0
- package/dist/services/content/worksheet-content.service.d.ts +37 -0
- package/dist/services/content/worksheet-content.service.js +84 -0
- package/dist/services/content/worksheet-content.service.test.d.ts +1 -0
- package/dist/services/content/worksheet-content.service.test.js +69 -0
- package/dist/services/content/worksheet-generation.service.d.ts +91 -0
- package/dist/services/content/worksheet-generation.service.js +95 -0
- package/dist/services/content/worksheet-generation.service.test.d.ts +1 -0
- package/dist/services/content/worksheet-generation.service.test.js +20 -0
- package/dist/services/content/worksheet.service.d.ts +347 -0
- package/dist/services/content/worksheet.service.js +599 -0
- package/dist/services/copilot.service.d.ts +116 -0
- package/dist/services/copilot.service.js +447 -0
- package/dist/services/flashcard-progress.service.d.ts +2 -2
- package/dist/services/flashcard-progress.service.js +3 -2
- package/dist/services/flashcard.service.d.ts +140 -0
- package/dist/services/flashcard.service.js +325 -0
- package/dist/services/invitation.service.d.ts +66 -0
- package/dist/services/invitation.service.js +348 -0
- package/dist/services/knowledge/knowledge-base.service.d.ts +316 -0
- package/dist/services/knowledge/knowledge-base.service.js +544 -0
- package/dist/services/knowledge-base.service.d.ts +316 -0
- package/dist/services/knowledge-base.service.js +536 -0
- package/dist/services/media-analysis.service.d.ts +23 -0
- package/dist/services/media-analysis.service.js +384 -0
- package/dist/services/member.service.d.ts +36 -0
- package/dist/services/member.service.js +193 -0
- package/dist/services/members/invitation.service.d.ts +66 -0
- package/dist/services/members/invitation.service.js +348 -0
- package/dist/services/members/member.service.d.ts +36 -0
- package/dist/services/members/member.service.js +193 -0
- package/dist/services/note.service.d.ts +55 -0
- package/dist/services/note.service.js +111 -0
- package/dist/services/notification.service.d.ts +214 -0
- package/dist/services/notification.service.js +550 -0
- package/dist/services/notification.service.test.d.ts +1 -0
- package/dist/services/notification.service.test.js +87 -0
- package/dist/services/notifications/notification.service.d.ts +214 -0
- package/dist/services/notifications/notification.service.js +550 -0
- package/dist/services/notifications/notification.service.test.d.ts +1 -0
- package/dist/services/notifications/notification.service.test.js +87 -0
- package/dist/services/payment.service.d.ts +55 -0
- package/dist/services/payment.service.js +368 -0
- package/dist/services/podcast.service.d.ts +267 -0
- package/dist/services/podcast.service.js +654 -0
- package/dist/services/router-module.service.d.ts +7 -0
- package/dist/services/router-module.service.js +10 -0
- package/dist/services/study-guide.service.d.ts +18 -0
- package/dist/services/study-guide.service.js +65 -0
- package/dist/services/subscription.service.d.ts +37 -0
- package/dist/services/subscription.service.js +654 -0
- package/dist/services/usage-limit-policy.service.d.ts +12 -0
- package/dist/services/usage-limit-policy.service.js +22 -0
- package/dist/services/usage-limit-policy.service.test.d.ts +1 -0
- package/dist/services/usage-limit-policy.service.test.js +46 -0
- package/dist/services/usage.service.d.ts +27 -0
- package/dist/services/usage.service.js +77 -0
- package/dist/services/worksheet-content.service.d.ts +42 -0
- package/dist/services/worksheet-content.service.js +84 -0
- package/dist/services/worksheet-content.service.test.d.ts +1 -0
- package/dist/services/worksheet-content.service.test.js +69 -0
- package/dist/services/worksheet-generation.service.d.ts +91 -0
- package/dist/services/worksheet-generation.service.js +95 -0
- package/dist/services/worksheet-generation.service.test.d.ts +1 -0
- package/dist/services/worksheet-generation.service.test.js +20 -0
- package/dist/services/worksheet.service.d.ts +385 -0
- package/dist/services/worksheet.service.js +596 -0
- package/dist/services/workspace/workspace-analytics.service.d.ts +24 -0
- package/dist/services/workspace/workspace-analytics.service.js +95 -0
- package/dist/services/workspace/workspace-kb.service.d.ts +40 -0
- package/dist/services/workspace/workspace-kb.service.js +184 -0
- package/dist/services/workspace/workspace.service.d.ts +263 -0
- package/dist/services/workspace/workspace.service.js +401 -0
- package/dist/services/workspace-analytics.service.d.ts +24 -0
- package/dist/services/workspace-analytics.service.js +95 -0
- package/dist/services/workspace-kb.service.d.ts +40 -0
- package/dist/services/workspace-kb.service.js +184 -0
- package/dist/services/workspace-progress.service.d.ts +27 -0
- package/dist/services/workspace-progress.service.js +56 -0
- package/dist/services/workspace-progress.service.test.d.ts +1 -0
- package/dist/services/workspace-progress.service.test.js +49 -0
- package/dist/services/workspace.service.d.ts +307 -0
- package/dist/services/workspace.service.js +390 -0
- package/dist/trpc.d.ts +12 -4
- package/dist/trpc.js +7 -13
- package/package.json +5 -6
- package/prisma/migrations/20260509000001_add_knowledge_base/migration.sql +99 -0
- package/prisma/migrations/20260509000002_curate_knowledge_base/migration.sql +52 -0
- package/prisma/migrations/20260522000000_add_notes/migration.sql +27 -0
- package/prisma/migrations/20260524000000_remove_notes/migration.sql +3 -0
- package/prisma/schema.prisma +150 -48
- package/prisma/seed.mjs +67 -0
- package/scripts/debug/README.md +4 -0
- package/src/README.md +63 -0
- package/src/context.ts +33 -3
- package/src/lib/ai/config.ts +34 -0
- package/src/lib/ai/embedding-client.ts +47 -0
- package/src/lib/ai/index.ts +65 -0
- package/src/lib/ai/inference-backend/client.ts +479 -0
- package/src/lib/ai/inference-backend/mocks.ts +171 -0
- package/src/lib/ai/inference-backend/types.ts +50 -0
- package/src/lib/ai/json-parse.ts +35 -0
- package/src/lib/ai/llm-client.ts +54 -0
- package/src/lib/ai/mock.ts +12 -0
- package/src/lib/ai/types.ts +11 -0
- package/src/lib/chunking.ts +81 -0
- package/src/lib/curated-kb-seed.ts +164 -0
- package/src/lib/email.ts +77 -115
- package/src/lib/embeddings.ts +9 -0
- package/src/lib/ensure-curated-kb-catalog.ts +60 -0
- package/src/lib/env.ts +2 -7
- package/src/lib/inference.ts +1 -21
- package/src/lib/kb-meta.ts +81 -0
- package/src/lib/pdf.ts +23 -0
- package/src/lib/workspace-kb.ts +7 -0
- package/src/repositories/artifact.repository.ts +55 -0
- package/src/repositories/base.repository.ts +19 -0
- package/src/repositories/invitation.repository.ts +53 -0
- package/src/repositories/notification.repository.ts +53 -0
- package/src/repositories/user.repository.ts +44 -0
- package/src/repositories/workspace-member.repository.ts +38 -0
- package/src/repositories/workspace.repository.ts +89 -0
- package/src/routers/_app.ts +4 -0
- package/src/routers/admin.ts +124 -692
- package/src/routers/annotations.ts +25 -203
- package/src/routers/artifactVersions.ts +32 -0
- package/src/routers/auth.ts +82 -520
- package/src/routers/chat.ts +42 -245
- package/src/routers/copilot.ts +41 -666
- package/src/routers/flashcards.ts +108 -404
- package/src/routers/knowledgeBase.ts +216 -0
- package/src/routers/members.ts +60 -782
- package/src/routers/notifications.ts +15 -117
- package/src/routers/payment.ts +37 -446
- package/src/routers/podcast.ts +36 -898
- package/src/routers/studyguide.ts +5 -144
- package/src/routers/worksheets.ts +171 -735
- package/src/routers/workspace.ts +141 -1108
- package/src/scripts/purge-deleted-users.ts +2 -2
- package/src/server.ts +10 -3
- package/src/{lib/activity_human_description.test.ts → services/activity/activity-human-description.service.test.ts} +1 -1
- package/src/{lib/activity_log_service.test.ts → services/activity/activity-log.service.test.ts} +1 -1
- package/src/{lib/activity_log_service.ts → services/activity/activity-log.service.ts} +2 -2
- package/src/services/admin/admin.service.ts +612 -0
- package/src/services/ai/ai-session.service.ts +5 -0
- package/src/services/artifacts/annotation.service.ts +189 -0
- package/src/services/artifacts/artifact-version.service.ts +151 -0
- package/src/services/artifacts/chat.service.ts +197 -0
- package/src/services/artifacts/study-guide.service.ts +72 -0
- package/src/services/auth/auth.service.ts +473 -0
- package/src/services/base.service.ts +19 -0
- package/src/services/billing/payment.service.ts +433 -0
- package/src/{lib/subscription_service.ts → services/billing/subscription.service.ts} +5 -5
- package/src/services/billing/usage.service.ts +207 -0
- package/src/services/content/copilot.service.ts +587 -0
- package/src/services/{flashcard-progress.service.ts → content/flashcard-progress.service.ts} +18 -12
- package/src/services/content/flashcard.service.ts +417 -0
- package/src/services/content/media-analysis.service.ts +561 -0
- package/src/services/content/podcast.service.ts +777 -0
- package/src/services/content/worksheet-content.service.test.ts +83 -0
- package/src/services/content/worksheet-content.service.ts +117 -0
- package/src/{lib/worksheet-generation.test.ts → services/content/worksheet-generation.service.test.ts} +3 -3
- package/src/services/content/worksheet.service.ts +751 -0
- package/src/services/knowledge/knowledge-base.service.ts +705 -0
- package/src/services/members/invitation.service.ts +427 -0
- package/src/services/members/member.service.ts +241 -0
- package/src/{lib/notification-service.test.ts → services/notifications/notification.service.test.ts} +2 -2
- package/src/{lib/notification-service.ts → services/notifications/notification.service.ts} +102 -1
- package/src/services/workspace/workspace-analytics.service.ts +107 -0
- package/src/services/workspace/workspace-kb.service.ts +273 -0
- package/src/services/workspace/workspace.service.ts +488 -0
- package/src/trpc.ts +7 -15
- package/src/lib/ai-session.ts +0 -704
- package/src/lib/usage_service.ts +0 -74
- package/src/lib/workspace-access.ts +0 -13
- /package/{check-difficulty.cjs → scripts/debug/check-difficulty.cjs} +0 -0
- /package/{check-questions.cjs → scripts/debug/check-questions.cjs} +0 -0
- /package/{db-summary.cjs → scripts/debug/db-summary.cjs} +0 -0
- /package/{mcq-test.cjs → scripts/debug/mcq-test.cjs} +0 -0
- /package/{test-generate.js → scripts/debug/test-generate.js} +0 -0
- /package/{test-ratio.cjs → scripts/debug/test-ratio.cjs} +0 -0
- /package/{zod-test.cjs → scripts/debug/zod-test.cjs} +0 -0
- /package/src/{lib/activity_human_description.ts → services/activity/activity-human-description.service.ts} +0 -0
- /package/src/{lib/worksheet-generation.ts → services/content/worksheet-generation.service.ts} +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export function mockStudyGuide() {
|
|
2
|
+
return `# Mock Study Guide
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
This is a mock study guide generated for testing purposes.
|
|
6
|
+
|
|
7
|
+
## Key Concepts
|
|
8
|
+
1. **Concept A**: Mock concept derived from uploaded materials
|
|
9
|
+
2. **Concept B**: Another mock concept with explanations
|
|
10
|
+
3. **Concept C**: A third concept with examples
|
|
11
|
+
|
|
12
|
+
## Summary
|
|
13
|
+
Mock study guide for local development when \`DONT_TEST_INFERENCE=true\`.`;
|
|
14
|
+
}
|
|
15
|
+
export function mockFlashcards(numQuestions, difficulty) {
|
|
16
|
+
return Array.from({ length: numQuestions }, (_, i) => ({
|
|
17
|
+
id: `mock-flashcard-${i + 1}`,
|
|
18
|
+
question: `Mock question ${i + 1}: What is the main concept covered in this material?`,
|
|
19
|
+
answer: `Mock answer ${i + 1}: Sample answer based on uploaded content.`,
|
|
20
|
+
difficulty,
|
|
21
|
+
category: `Mock Category ${(i % 3) + 1}`,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
export function mockWorksheet(numQuestions, difficulty, options) {
|
|
25
|
+
const mode = options?.mode ?? 'practice';
|
|
26
|
+
const isQuiz = mode === 'quiz';
|
|
27
|
+
return {
|
|
28
|
+
title: isQuiz ? `Mock Quiz - ${difficulty}` : `Mock Worksheet - ${difficulty} Level`,
|
|
29
|
+
description: 'Mock generated content',
|
|
30
|
+
difficulty,
|
|
31
|
+
estimatedTime: `${numQuestions * 2} min`,
|
|
32
|
+
problems: Array.from({ length: numQuestions }, (_, i) => {
|
|
33
|
+
if (isQuiz) {
|
|
34
|
+
return {
|
|
35
|
+
question: `Mock MCQ ${i + 1}: What is 2+2?`,
|
|
36
|
+
answer: '1',
|
|
37
|
+
type: 'MULTIPLE_CHOICE',
|
|
38
|
+
options: ['3', '4', '5', '6'],
|
|
39
|
+
mark_scheme: {
|
|
40
|
+
points: [{ point: 1, requirements: 'Select correct option' }],
|
|
41
|
+
totalPoints: 1,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
question: `Mock question ${i + 1}: Explain a concept.`,
|
|
47
|
+
answer: 'Mock answer',
|
|
48
|
+
type: 'TEXT',
|
|
49
|
+
options: [],
|
|
50
|
+
mark_scheme: {
|
|
51
|
+
points: [{ point: 1, requirements: 'Clear explanation' }],
|
|
52
|
+
totalPoints: 1,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function mockProcessFile(fileType) {
|
|
59
|
+
const mockPageCount = fileType === 'pdf' ? 15 : 1;
|
|
60
|
+
return {
|
|
61
|
+
status: 'success',
|
|
62
|
+
textContent: `Mock extracted text content from ${fileType} file.`,
|
|
63
|
+
imageDescriptions: Array.from({ length: mockPageCount }, (_, i) => ({
|
|
64
|
+
page: i + 1,
|
|
65
|
+
description: `Page ${i + 1} contains educational content with diagrams and text.`,
|
|
66
|
+
hasVisualContent: true,
|
|
67
|
+
})),
|
|
68
|
+
comprehensiveDescription: `DOCUMENT SUMMARY (${mockPageCount} ${mockPageCount === 1 ? 'page' : 'pages'})\n\nTEXT CONTENT:\nMock extracted text content...`,
|
|
69
|
+
pageCount: mockPageCount,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function mockPodcastStructure(title, speakers) {
|
|
73
|
+
const voiceId = speakers[0]?.id || 'mock-voice-1';
|
|
74
|
+
return {
|
|
75
|
+
success: true,
|
|
76
|
+
structure: {
|
|
77
|
+
episodeTitle: `${title} - AI Generated Episode`,
|
|
78
|
+
totalEstimatedDuration: '15 minutes',
|
|
79
|
+
segments: [
|
|
80
|
+
{
|
|
81
|
+
title: 'Welcome & Introduction',
|
|
82
|
+
content: "HOST: Welcome to today's episode!\nGUEST: Thanks for having me!\nHOST: Let's dive into the topic.",
|
|
83
|
+
speaker: 'dialogue',
|
|
84
|
+
voiceId,
|
|
85
|
+
keyPoints: ['Introduction', 'What to expect'],
|
|
86
|
+
estimatedDuration: '3 minutes',
|
|
87
|
+
order: 1,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'Main Discussion',
|
|
91
|
+
content: 'This is the main content section where we explore the key concepts in detail.',
|
|
92
|
+
speaker: 'host',
|
|
93
|
+
voiceId,
|
|
94
|
+
keyPoints: ['Key concept 1', 'Key concept 2'],
|
|
95
|
+
estimatedDuration: '8 minutes',
|
|
96
|
+
order: 2,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: 'Conclusion & Takeaways',
|
|
100
|
+
content: "HOST: Let's wrap up what we've learned today.\nGUEST: The main takeaway is...\nHOST: Thanks for joining us!",
|
|
101
|
+
speaker: 'dialogue',
|
|
102
|
+
voiceId,
|
|
103
|
+
keyPoints: ['Summary', 'Next steps'],
|
|
104
|
+
estimatedDuration: '4 minutes',
|
|
105
|
+
order: 3,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function mockPodcastAudio(user, sessionId, podcastId, segmentIndex, text) {
|
|
112
|
+
const isDialogue = text.includes('HOST:') || text.includes('GUEST:');
|
|
113
|
+
return {
|
|
114
|
+
success: true,
|
|
115
|
+
segmentIndex,
|
|
116
|
+
objectKey: `${user}/${sessionId}/podcasts/${podcastId}/segment_${segmentIndex}.mp3`,
|
|
117
|
+
duration: 45 + Math.floor(Math.random() * 30),
|
|
118
|
+
type: isDialogue ? 'dialogue' : 'monologue',
|
|
119
|
+
...(isDialogue ? { partCount: 4 } : {}),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export function mockStudyGuideSegmentation() {
|
|
123
|
+
return [
|
|
124
|
+
{ hint: 'Overview', content: 'Mock segment 1 content' },
|
|
125
|
+
{ hint: 'Key concepts', content: 'Mock segment 2 content' },
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
export function mockSegmentSummaryValidation() {
|
|
129
|
+
return {
|
|
130
|
+
valid: true,
|
|
131
|
+
feedback: 'Mock validation feedback for local development.',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface AISession {
|
|
2
|
+
id: string;
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
status: 'initialized' | 'processing' | 'ready' | 'error';
|
|
5
|
+
files: string[];
|
|
6
|
+
instructionText?: string;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
}
|
|
10
|
+
export interface ProcessFileResult {
|
|
11
|
+
status: 'success' | 'error';
|
|
12
|
+
textContent: string | null;
|
|
13
|
+
imageDescriptions: Array<{
|
|
14
|
+
page: number;
|
|
15
|
+
description: string;
|
|
16
|
+
hasVisualContent: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
comprehensiveDescription: string | null;
|
|
19
|
+
pageCount: number;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PodcastSpeaker {
|
|
23
|
+
id: string;
|
|
24
|
+
role: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface WorksheetGenerationOptions {
|
|
28
|
+
mode?: 'practice' | 'quiz';
|
|
29
|
+
mcqRatio?: number;
|
|
30
|
+
questionTypes?: string[];
|
|
31
|
+
prompt?: string;
|
|
32
|
+
ragContext?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface BackendGenerationOptions {
|
|
35
|
+
ragContext?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface StudyGuideSegment {
|
|
38
|
+
hint: string;
|
|
39
|
+
content: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SegmentSummaryValidation {
|
|
42
|
+
valid: boolean;
|
|
43
|
+
feedback: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function extractJson(content) {
|
|
2
|
+
const fencedMatch = content.match(/```json\s*([\s\S]*?)```/i);
|
|
3
|
+
if (fencedMatch?.[1]) {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(fencedMatch[1]);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
// fall through
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const objectMatch = content.match(/\{[\s\S]*\}/);
|
|
12
|
+
if (objectMatch?.[0]) {
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(objectMatch[0]);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
export function parseJsonField(value, field) {
|
|
23
|
+
if (typeof value === 'string') {
|
|
24
|
+
return JSON.parse(value);
|
|
25
|
+
}
|
|
26
|
+
if (value && typeof value === 'object' && field in value) {
|
|
27
|
+
const nested = value[field];
|
|
28
|
+
if (typeof nested === 'string') {
|
|
29
|
+
return JSON.parse(nested);
|
|
30
|
+
}
|
|
31
|
+
return nested;
|
|
32
|
+
}
|
|
33
|
+
throw new Error(`Expected JSON field "${field}" in AI response`);
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChatCompletion } from 'openai/resources/chat/completions';
|
|
2
|
+
import type { ChatMessage, CompleteOptions } from './types.js';
|
|
3
|
+
export declare function complete(messages: ChatMessage[], options?: CompleteOptions): Promise<ChatCompletion>;
|
|
4
|
+
export declare function completeText(messages: ChatMessage[], options?: CompleteOptions): Promise<string>;
|
|
5
|
+
export declare function streamComplete(messages: ChatMessage[], onDelta: (delta: string) => void | Promise<void>, options?: CompleteOptions): Promise<string>;
|
|
6
|
+
/** @deprecated Use `complete()` from the ai module instead. */
|
|
7
|
+
export default complete;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import OpenAI from 'openai';
|
|
2
|
+
import { aiConfig } from './config.js';
|
|
3
|
+
const client = new OpenAI({
|
|
4
|
+
apiKey: aiConfig.llm.apiKey,
|
|
5
|
+
baseURL: aiConfig.llm.baseUrl,
|
|
6
|
+
});
|
|
7
|
+
export async function complete(messages, options = {}) {
|
|
8
|
+
return client.chat.completions.create({
|
|
9
|
+
model: options.model ?? aiConfig.llm.model,
|
|
10
|
+
messages,
|
|
11
|
+
...(options.temperature !== undefined ? { temperature: options.temperature } : {}),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export async function completeText(messages, options = {}) {
|
|
15
|
+
const response = await complete(messages, options);
|
|
16
|
+
return response.choices?.[0]?.message?.content ?? '';
|
|
17
|
+
}
|
|
18
|
+
export async function streamComplete(messages, onDelta, options = {}) {
|
|
19
|
+
const stream = await client.chat.completions.create({
|
|
20
|
+
model: options.model ?? aiConfig.llm.model,
|
|
21
|
+
messages,
|
|
22
|
+
stream: true,
|
|
23
|
+
...(options.temperature !== undefined ? { temperature: options.temperature } : {}),
|
|
24
|
+
});
|
|
25
|
+
let content = '';
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
const delta = chunk.choices?.[0]?.delta?.content ?? '';
|
|
28
|
+
if (!delta)
|
|
29
|
+
continue;
|
|
30
|
+
content += delta;
|
|
31
|
+
await onDelta(delta);
|
|
32
|
+
}
|
|
33
|
+
return content;
|
|
34
|
+
}
|
|
35
|
+
/** @deprecated Use `complete()` from the ai module instead. */
|
|
36
|
+
export default complete;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { aiConfig } from './config.js';
|
|
2
|
+
export function isAiMockMode() {
|
|
3
|
+
return aiConfig.inferenceBackend.mockEnabled;
|
|
4
|
+
}
|
|
5
|
+
export async function mockDelay() {
|
|
6
|
+
const delay = aiConfig.inferenceBackend.mockDelayMs;
|
|
7
|
+
if (delay > 0) {
|
|
8
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Approximate text chunker for RAG indexing.
|
|
3
|
+
*
|
|
4
|
+
* Splits a long document into overlapping windows aimed at a target token
|
|
5
|
+
* count. We don't have a tokenizer dependency, so we approximate using
|
|
6
|
+
* `chars / 4` (a rule of thumb that matches GPT-style BPE within ~10-20%).
|
|
7
|
+
* Chunk boundaries snap to paragraph / sentence breaks when possible so we
|
|
8
|
+
* don't slice mid-thought.
|
|
9
|
+
*/
|
|
10
|
+
export interface ChunkOptions {
|
|
11
|
+
targetTokens?: number;
|
|
12
|
+
overlapTokens?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface Chunk {
|
|
15
|
+
index: number;
|
|
16
|
+
content: string;
|
|
17
|
+
approxTokens: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function chunkText(text: string, opts?: ChunkOptions): Chunk[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const CHARS_PER_TOKEN = 4;
|
|
2
|
+
export function chunkText(text, opts = {}) {
|
|
3
|
+
const targetTokens = opts.targetTokens ?? 500;
|
|
4
|
+
const overlapTokens = opts.overlapTokens ?? 60;
|
|
5
|
+
const targetChars = targetTokens * CHARS_PER_TOKEN;
|
|
6
|
+
const overlapChars = overlapTokens * CHARS_PER_TOKEN;
|
|
7
|
+
const cleaned = text.replace(/\r\n/g, '\n').replace(/[ \t]+/g, ' ').trim();
|
|
8
|
+
if (!cleaned)
|
|
9
|
+
return [];
|
|
10
|
+
const chunks = [];
|
|
11
|
+
let cursor = 0;
|
|
12
|
+
let index = 0;
|
|
13
|
+
while (cursor < cleaned.length) {
|
|
14
|
+
const hardEnd = Math.min(cleaned.length, cursor + targetChars);
|
|
15
|
+
let end = hardEnd;
|
|
16
|
+
if (hardEnd < cleaned.length) {
|
|
17
|
+
// Prefer a paragraph break, then a sentence break, then a space.
|
|
18
|
+
const window = cleaned.slice(cursor, hardEnd);
|
|
19
|
+
const lastPara = window.lastIndexOf('\n\n');
|
|
20
|
+
const lastSentence = Math.max(window.lastIndexOf('. '), window.lastIndexOf('! '), window.lastIndexOf('? '), window.lastIndexOf('.\n'));
|
|
21
|
+
const lastSpace = window.lastIndexOf(' ');
|
|
22
|
+
const minBreak = Math.floor(targetChars * 0.5);
|
|
23
|
+
if (lastPara >= minBreak) {
|
|
24
|
+
end = cursor + lastPara + 2;
|
|
25
|
+
}
|
|
26
|
+
else if (lastSentence >= minBreak) {
|
|
27
|
+
end = cursor + lastSentence + 2;
|
|
28
|
+
}
|
|
29
|
+
else if (lastSpace >= minBreak) {
|
|
30
|
+
end = cursor + lastSpace + 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const piece = cleaned.slice(cursor, end).trim();
|
|
34
|
+
if (piece) {
|
|
35
|
+
chunks.push({
|
|
36
|
+
index,
|
|
37
|
+
content: piece,
|
|
38
|
+
approxTokens: Math.max(1, Math.round(piece.length / CHARS_PER_TOKEN)),
|
|
39
|
+
});
|
|
40
|
+
index += 1;
|
|
41
|
+
}
|
|
42
|
+
if (end >= cleaned.length)
|
|
43
|
+
break;
|
|
44
|
+
cursor = Math.max(end - overlapChars, cursor + 1);
|
|
45
|
+
}
|
|
46
|
+
return chunks;
|
|
47
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated AP & IB knowledge bases seeded on server startup.
|
|
3
|
+
* Each entry uses a stable slug in `meta` so the client can pick icons/colors.
|
|
4
|
+
*/
|
|
5
|
+
export interface CuratedKbSeed {
|
|
6
|
+
slug: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
category: 'AP' | 'IB';
|
|
10
|
+
subject: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const CURATED_KB_SEEDS: CuratedKbSeed[];
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated AP & IB knowledge bases seeded on server startup.
|
|
3
|
+
* Each entry uses a stable slug in `meta` so the client can pick icons/colors.
|
|
4
|
+
*/
|
|
5
|
+
export const CURATED_KB_SEEDS = [
|
|
6
|
+
// ── AP ──────────────────────────────────────────────────────────
|
|
7
|
+
{
|
|
8
|
+
slug: 'ap-biology',
|
|
9
|
+
name: 'AP Biology',
|
|
10
|
+
description: 'Cell biology, genetics, evolution, and ecology aligned with the AP Biology curriculum.',
|
|
11
|
+
category: 'AP',
|
|
12
|
+
subject: 'biology',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
slug: 'ap-chemistry',
|
|
16
|
+
name: 'AP Chemistry',
|
|
17
|
+
description: 'Atomic structure, bonding, thermodynamics, and kinetics for AP Chemistry.',
|
|
18
|
+
category: 'AP',
|
|
19
|
+
subject: 'chemistry',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
slug: 'ap-physics-1',
|
|
23
|
+
name: 'AP Physics 1',
|
|
24
|
+
description: 'Algebra-based mechanics, waves, and electricity for AP Physics 1.',
|
|
25
|
+
category: 'AP',
|
|
26
|
+
subject: 'physics',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
slug: 'ap-calculus-ab',
|
|
30
|
+
name: 'AP Calculus AB',
|
|
31
|
+
description: 'Limits, derivatives, integrals, and the Fundamental Theorem of Calculus.',
|
|
32
|
+
category: 'AP',
|
|
33
|
+
subject: 'calculus',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
slug: 'ap-calculus-bc',
|
|
37
|
+
name: 'AP Calculus BC',
|
|
38
|
+
description: 'Series, parametric equations, polar coordinates, and advanced integration.',
|
|
39
|
+
category: 'AP',
|
|
40
|
+
subject: 'calculus',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
slug: 'ap-us-history',
|
|
44
|
+
name: 'AP US History',
|
|
45
|
+
description: 'Colonial America through the modern era with primary source analysis.',
|
|
46
|
+
category: 'AP',
|
|
47
|
+
subject: 'history',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
slug: 'ap-world-history',
|
|
51
|
+
name: 'AP World History',
|
|
52
|
+
description: 'Global civilizations, trade networks, and historical thinking skills.',
|
|
53
|
+
category: 'AP',
|
|
54
|
+
subject: 'history',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
slug: 'ap-english-lang',
|
|
58
|
+
name: 'AP English Language',
|
|
59
|
+
description: 'Rhetorical analysis, argumentation, and synthesis writing strategies.',
|
|
60
|
+
category: 'AP',
|
|
61
|
+
subject: 'english',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
slug: 'ap-english-lit',
|
|
65
|
+
name: 'AP English Literature',
|
|
66
|
+
description: 'Literary analysis, poetry, prose fiction, and critical essay writing.',
|
|
67
|
+
category: 'AP',
|
|
68
|
+
subject: 'literature',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
slug: 'ap-psychology',
|
|
72
|
+
name: 'AP Psychology',
|
|
73
|
+
description: 'Biological bases of behavior, cognition, development, and social psychology.',
|
|
74
|
+
category: 'AP',
|
|
75
|
+
subject: 'psychology',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
slug: 'ap-environmental-science',
|
|
79
|
+
name: 'AP Environmental Science',
|
|
80
|
+
description: 'Ecosystems, biodiversity, pollution, and sustainability concepts.',
|
|
81
|
+
category: 'AP',
|
|
82
|
+
subject: 'environmental',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
slug: 'ap-macroeconomics',
|
|
86
|
+
name: 'AP Macroeconomics',
|
|
87
|
+
description: 'GDP, inflation, fiscal and monetary policy, and international trade.',
|
|
88
|
+
category: 'AP',
|
|
89
|
+
subject: 'economics',
|
|
90
|
+
},
|
|
91
|
+
// ── IB ──────────────────────────────────────────────────────────
|
|
92
|
+
{
|
|
93
|
+
slug: 'ib-biology-hl',
|
|
94
|
+
name: 'IB Biology HL',
|
|
95
|
+
description: 'Higher Level biology: molecular biology, genetics, ecology, and human physiology.',
|
|
96
|
+
category: 'IB',
|
|
97
|
+
subject: 'biology',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
slug: 'ib-chemistry-hl',
|
|
101
|
+
name: 'IB Chemistry HL',
|
|
102
|
+
description: 'Higher Level chemistry: organic, inorganic, physical, and analytical topics.',
|
|
103
|
+
category: 'IB',
|
|
104
|
+
subject: 'chemistry',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
slug: 'ib-physics-hl',
|
|
108
|
+
name: 'IB Physics HL',
|
|
109
|
+
description: 'Higher Level physics: mechanics, fields, waves, and nuclear physics.',
|
|
110
|
+
category: 'IB',
|
|
111
|
+
subject: 'physics',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
slug: 'ib-math-aa-hl',
|
|
115
|
+
name: 'IB Math AA HL',
|
|
116
|
+
description: 'Analysis & Approaches HL: calculus, proof, vectors, and complex numbers.',
|
|
117
|
+
category: 'IB',
|
|
118
|
+
subject: 'math',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
slug: 'ib-math-ai-hl',
|
|
122
|
+
name: 'IB Math AI HL',
|
|
123
|
+
description: 'Applications & Interpretation HL: statistics, modelling, and technology use.',
|
|
124
|
+
category: 'IB',
|
|
125
|
+
subject: 'math',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
slug: 'ib-history-hl',
|
|
129
|
+
name: 'IB History HL',
|
|
130
|
+
description: 'Higher Level history: 20th century world history and historical investigation.',
|
|
131
|
+
category: 'IB',
|
|
132
|
+
subject: 'history',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
slug: 'ib-english-a-hl',
|
|
136
|
+
name: 'IB English A HL',
|
|
137
|
+
description: 'Language & Literature HL: textual analysis, comparative study, and IO prep.',
|
|
138
|
+
category: 'IB',
|
|
139
|
+
subject: 'literature',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
slug: 'ib-economics-hl',
|
|
143
|
+
name: 'IB Economics HL',
|
|
144
|
+
description: 'Microeconomics, macroeconomics, international economics, and development.',
|
|
145
|
+
category: 'IB',
|
|
146
|
+
subject: 'economics',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
slug: 'ib-psychology-hl',
|
|
150
|
+
name: 'IB Psychology HL',
|
|
151
|
+
description: 'Biological, cognitive, sociocultural, and abnormal psychology at HL depth.',
|
|
152
|
+
category: 'IB',
|
|
153
|
+
subject: 'psychology',
|
|
154
|
+
},
|
|
155
|
+
];
|