Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
245 commits
Select commit Hold shift + click to select a range
5f8931b
feat: add LiteLLM RPC service and integration
akash9676 Mar 30, 2026
721b931
chore: update LiteLLM dependency to version 1.82.6
akash9676 Mar 30, 2026
8e6968d
Merge branch 'project-1-ai-standardization' into feat-138-litellm_rpc
akash9676 Apr 14, 2026
8f8a27f
docs: add author annotation to LiteLLMRPC.js file
akash9676 Apr 20, 2026
da9c540
feat: implement AIService for handling AI/LLM requests and integrate …
akash9676 Apr 20, 2026
ed479b5
refactor: rename RPC call tests and update health check implementatio…
akash9676 Apr 20, 2026
b275d49
Merge branch 'project-1-ai-standardization' into feat-138-litellm_rpc
akash9676 Apr 20, 2026
a654e9e
feat: add abortChatCompletion functionality to AIService and LiteLLMR…
akash9676 Apr 22, 2026
b707e58
Revert "feat: add abortChatCompletion functionality to AIService and …
akash9676 Apr 22, 2026
d832ce1
feat: implement abortChatCompletion method in LiteLLMRPC and AIServic…
Apr 27, 2026
2043473
Merge pull request #158 from UKPLab/feat-138-litellm_rpc
akash9676 Apr 27, 2026
f344b9a
feat(db): add AI credential, model, share, and log tables with Sequel…
junaidferoz May 4, 2026
a586c09
fix: removed redundant code and resolved defaultValue/allowNull issue
junaidferoz May 4, 2026
529a0ba
changed autoTable value to false
junaidferoz May 4, 2026
da1c969
fix: converted variable to camelCase
junaidferoz May 4, 2026
ff7b5d1
Merge pull request #193 from UKPLab/feat-142-tables_and_schema
akash9676 May 4, 2026
5e62e7d
Merge branch 'dev' into project-1-ai-standardization
May 4, 2026
e0ef306
fix(migration): update foreign key reference from 'study' to 'user_role'
May 4, 2026
086a47e
feat(migration): add foreign key references for ai_log table
May 4, 2026
bb133df
feat(Socket): add 'apiKey' to default excludes in attribute filtering
May 4, 2026
027b045
feat(migration): add AI navigation elements and user role permissions
May 4, 2026
87debc0
feat(ai_model): implement credential ownership validation and add hoo…
May 4, 2026
6ae9059
feat(AIService): add testModel command for model usability validation…
May 4, 2026
e882698
feat(AI): enhance AI logging and dashboard components for better trac…
May 4, 2026
0aea285
fix(AiLog): enable autoTable for AiLog model and update status in AI …
May 4, 2026
2e24800
feat(AIService): implement #extractInputText method for improved mess…
May 4, 2026
c848888
refactor(AIModels): update button titles and styles for credential an…
May 4, 2026
803378f
feat(AIModelShare): implement model sharing functionality with user, …
May 4, 2026
408789d
feat(AIModels): refactor AI credential and model forms into separate …
May 4, 2026
416adeb
refactor(AIModelShareStepper): update selection handling and improve …
May 4, 2026
c217dc9
feat(AIOverview): add model overview component and integrate with AI …
May 4, 2026
36fa378
refactor(AIService): streamline command handling and enhance model ow…
May 4, 2026
e0af6e9
feat(AIService): implement cascading updates for AI credentials and e…
May 4, 2026
30c0e3b
feat(AIModelShareStepper): enhance selection handling and add refresh…
May 4, 2026
b048931
feat(AIService): add bulk update handling for AI credential transacti…
May 4, 2026
6aa8946
feat(LiteLLMRPC): add getValidModels method to fetch available models…
May 5, 2026
af3cabd
fix(chat): update status from "test_failed" to "failed" for improved …
May 5, 2026
5ccf4c3
feat(LiteLLMRPC): implement router functionality for model handling a…
May 5, 2026
59f554d
feat(LiteLLMRPC): enhance chatCompletion with async handling and canc…
May 5, 2026
94fc5e5
refactor(LiteLLMRPC): simplify credential management and enhance mode…
May 5, 2026
4468743
refactor(LiteLLMRPC): improve model retrieval robustness by handling …
May 5, 2026
cda15f0
refactor(AIService): streamline provider normalization and model reso…
May 5, 2026
7591a9c
refactor(AIService): replace response cost extraction and reasoning h…
May 5, 2026
300e01e
refactor(AIHelpers): simplify user display label and share recipient …
May 5, 2026
750f196
refactor(LiteLLMRPC, AIService): enforce __requestId presence in chat…
May 5, 2026
cc647e7
refactor(RPC, AI components): clean up unused code and improve loggin…
May 5, 2026
a48898c
refactor(AI components): remove unused credential properties and stre…
May 5, 2026
c2fe5f7
refactor(migration): update provider field to allow null values and s…
May 5, 2026
b204048
refactor(AI components): add provider field to credentials and update…
May 5, 2026
8c318f9
refactor(AI components): update credential label for improved user cl…
May 5, 2026
471d885
refactor(AI components): enhance input labels with tooltips for bette…
May 5, 2026
ca5618f
refactor(AI components): enhance AiCredential and AiModel classes for…
May 11, 2026
e9bf4ec
refactor(AI chat service): rename runtime and helpers imports for con…
May 11, 2026
c4dc372
refactor(AI components): add detailed JSDoc comments to models and se…
May 11, 2026
e3bfb0a
refactor(AI components): remove study-related functionality from ai_m…
May 11, 2026
40934f0
Merge branch 'dev' into project-1-ai-standardization
May 11, 2026
db038e2
Merge branch 'project-1-ai-standardization' into feat-139-ai-dashboard
May 11, 2026
738ee05
fix(AIModel.vue): update button label from "Create" to "Add" for clar…
May 11, 2026
13a9f02
feat(chat service): enhance chatCompletion and testModel functions wi…
akash9676 May 18, 2026
0c79262
refactor(ai_credential): update foreign key column naming to support …
akash9676 May 18, 2026
db6e6a8
feat(AIService): add getAiModelOwnerSummaries function and integrate …
akash9676 May 18, 2026
74d018f
Merge pull request #195 from UKPLab/feat-139-ai-dashboard
akash9676 May 18, 2026
805a20d
feat: added migrations for budge related columns
MRawhani May 22, 2026
5aa9b4d
feat: update schema definitions to reflec migrations
MRawhani May 22, 2026
186f397
feat: add budget relted functionalities
MRawhani May 22, 2026
e2586d8
feat: add prompt templates and placeholder resolution
mohammadsherif0 May 25, 2026
7a7dfbc
feat: add template placeholder editor preview mode
mohammadsherif0 May 25, 2026
f788107
fix: refresh detached templates before editing
mohammadsherif0 May 25, 2026
7e4efd6
docs: update template documentation for prompt placeholders
mohammadsherif0 May 25, 2026
d680b1b
fix : change the name of the file
MRawhani May 26, 2026
7795338
feat: add sessionId migration to shares for limit
MRawhani May 27, 2026
983cc26
feat: add budget limit fucntion on session, and on cap of study owner
MRawhani May 27, 2026
0c1d72b
feat: add reset funcitonality and adapt share and chat functions to b…
MRawhani May 27, 2026
7996842
feat: add budget guard for deleted share
MRawhani May 27, 2026
11b8599
feat: append shares table with flag fro session
MRawhani May 31, 2026
5864075
fix: bypass locks when testing + add test log to ai logs
MRawhani May 31, 2026
adea965
fix: flag test prompts
MRawhani May 31, 2026
096ef72
feat: add mapping after creation and after find ai budget updates to …
MRawhani May 31, 2026
86dd273
fix: remove enablaed from filtering
MRawhani Jun 1, 2026
4cff3c3
feat: enable prefill study edit and adjust share service to recieve n…
MRawhani Jun 1, 2026
38678ab
feat: add new frontend funcitonality for budget
MRawhani Jun 1, 2026
260438e
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jun 1, 2026
2139806
feat(Makefile): add docker-recompose target for rebuilding and starti…
akash9676 Jun 1, 2026
07fdc1e
feat(migrations): add trigger, trigger_event, trigger_action, and tri…
akash9676 Jun 1, 2026
22ba67c
feat(navigation): add triggers and trigger logs navigation components…
akash9676 Jun 1, 2026
5a43a72
fix: register the get study ai budget in cmd
MRawhani Jun 1, 2026
35bd144
feat: add resetting functionality
MRawhani Jun 1, 2026
d77a4f4
feat: add last reset info
MRawhani Jun 1, 2026
ad8a17a
feat(trigger): implement trigger management system with dashboard con…
akash9676 Jun 1, 2026
2232f23
refactor(dashboard): streamline TriggerLogs and Triggers components b…
akash9676 Jun 1, 2026
e27e252
feat(migrations): update trigger actions to include AI preprocessing …
akash9676 Jun 1, 2026
b20e65f
Merge pull request #231 from UKPLab/feat-203-make-docker-recompose
dennis-zyska Jun 2, 2026
e190362
refactor(dashboard): remove legacy trigger dashboard configurations a…
akash9676 Jun 2, 2026
535dbeb
refactor(migrations): update label for submission uploaded trigger to…
akash9676 Jun 2, 2026
e4da8b9
feat(trigger): enhance submission trigger with group selection and up…
akash9676 Jun 2, 2026
2f8a2fe
refactor(dashboard): replace legacy dashboard configurations with int…
akash9676 Jun 2, 2026
2b2c9d1
feat(dashboard): introduce TriggerStepperModal for streamlined trigge…
akash9676 Jun 2, 2026
1630b48
refactor(dashboard): enhance validation logic in TriggerStepperModal …
akash9676 Jun 2, 2026
486f7dd
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jun 2, 2026
dfa7f1b
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 Jun 2, 2026
e6c5bba
refactor(trigger): update trigger event configuration to use assignme…
akash9676 Jun 2, 2026
f9d64b7
refactor(trigger): enforce required email template selection in migra…
akash9676 Jun 2, 2026
c39f4be
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jun 2, 2026
72c61ee
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 Jun 2, 2026
a90ae96
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jun 2, 2026
163cb56
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 Jun 2, 2026
c3544f6
feat(trigger): add review & confirm step in TriggerStepperModal with …
akash9676 Jun 2, 2026
ac2b5b2
feat(trigger): implement preprocessing configuration in TriggerSteppe…
akash9676 Jun 2, 2026
7aea4a8
refactor: change prompt template type from 7 to 8
mohammadsherif0 Jun 7, 2026
cba8bcd
docs: update prompt template type and editorText placeholder notes
mohammadsherif0 Jun 7, 2026
b42c264
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jun 8, 2026
bf28cc8
feat: add AI hooks migration and navigation elements
akash9676 Jun 8, 2026
819b1b8
feat: implement AI hooks and output mode handling
akash9676 Jun 8, 2026
c2abd76
feat: enhance AIHookStepperModal with review step and validation impr…
akash9676 Jun 8, 2026
d414185
feat: implement AI hook fallback management in dashboard
akash9676 Jun 8, 2026
481db00
Merge branch 'project-1-ai-standardization' into feat-192-prompt_temp…
mohammadsherif0 Jun 8, 2026
69ad0e9
feat: enhance AIHookFallbackModal with fallback change detection
akash9676 Jun 8, 2026
8a06a05
Merge branch 'project-1-ai-standardization' into feat-192-prompt_temp…
mohammadsherif0 Jun 8, 2026
2e02a84
fix: lint error in placeholderExamplePreview.js
mohammadsherif0 Jun 8, 2026
b56e36a
add nodemon
MRawhani Jun 8, 2026
6737dde
feat: refactor AI hook models and remove fallback model
akash9676 Jun 9, 2026
e403afb
feat: refactor AI hook model management and introduce new modals
akash9676 Jun 9, 2026
f4ba49c
feat: update AI hook model emission with aiHookId
akash9676 Jun 9, 2026
3e2cc8d
feat: remove IMAGE output mode from AI hook configurations
akash9676 Jun 9, 2026
2aaa895
docs: add author tag to studyNlpDocumentData.js
mohammadsherif0 Jun 9, 2026
cf8d537
feat: refactor AIHookModelOrder component to use BasicTable for model…
akash9676 Jun 10, 2026
9d31aaa
feat: implement AI hook sharing functionality
akash9676 Jun 10, 2026
3ca8b2d
feat: update AIHookModelOrder component layout and table options
akash9676 Jun 10, 2026
aab0ae8
feat: add hook overview functionality and refactor AI overview component
akash9676 Jun 10, 2026
9a9df60
feat: enhance sharing functionality for AI models and hooks
akash9676 Jun 10, 2026
23a28f1
Merge pull request #237 from UKPLab/feat-192-prompt_templates
MRawhani Jun 11, 2026
0fe6b01
Merge branch 'project-1-ai-standardization' into feat-223-ai-hooks
MRawhani Jun 13, 2026
3034ca9
Merge branch 'feat-223-ai-hooks' into feat-186-budget-management
MRawhani Jun 14, 2026
9c9e858
feat: added runhook service request
MRawhani Jun 15, 2026
8e877a4
fix: fix the null deleted column in table hook
MRawhani Jun 16, 2026
6884621
feat: integrate ai hooks into study
MRawhani Jun 16, 2026
c109a90
feat: integrate ai hooks into loading modal and run hook
MRawhani Jun 16, 2026
219bb40
feat: extend workflows with hooks
MRawhani Jun 16, 2026
22d81e4
feat: oporimize the ai hook integration
MRawhani Jun 18, 2026
0f5eabb
Merge branch 'feat-223-ai-hooks-integration' into feat-186-budget-man…
MRawhani Jun 18, 2026
50c5792
feat: add 'enabled' field check in AppSocket update logic
akash9676 Jun 18, 2026
e9688fa
feat: update budget enforcement
MRawhani Jun 18, 2026
09b4297
fix : add author name
MRawhani Jun 18, 2026
62193ef
feat: refine prompt template visibility in AIHookStepperModal
akash9676 Jun 18, 2026
31150af
fix: update ownership fucniton
MRawhani Jun 21, 2026
5e498ff
feat: optimize the budget into seprate table
MRawhani Jun 22, 2026
6acaaf2
feat: map th new table to the budget enforcement pipeline
MRawhani Jun 23, 2026
5b5f7dc
fix: add userid to the ai budget table
MRawhani Jun 24, 2026
0b2157d
feat: add unzipping for submission selection in hook
MRawhani Jun 25, 2026
4d56f5e
feat: add reset functionality
MRawhani Jun 25, 2026
e5ee698
fix: change checkbox into radio selection in submission input
MRawhani Jun 26, 2026
fc21d32
fix: optimize some UI
MRawhani Jun 26, 2026
c17b343
fix: enhance ui in budget related elements
MRawhani Jun 29, 2026
dc7de4d
fix: optemize the ai budgets table
MRawhani Jun 29, 2026
0034a26
fix: remove unused userfilter
MRawhani Jun 29, 2026
e31ff7f
feat : add mirrored placeholder token helpers
mohammadsherif0 Jun 29, 2026
d6db09d
feat : resolve bracket placeholders in templateResolver
mohammadsherif0 Jun 29, 2026
e7e2792
feat : block duplicate bracket placeholders on template save
mohammadsherif0 Jun 29, 2026
68b18b4
feat : add bracket placeholder support in template editor
mohammadsherif0 Jun 29, 2026
c3715df
feat : expand hook input map rows per placeholder index
mohammadsherif0 Jun 29, 2026
044b2cf
docs : update submissionFiles placeholder copy for indexed slots
mohammadsherif0 Jun 29, 2026
9e29114
feat: enhance AI credential handling and model discovery
akash9676 Jun 30, 2026
9e0a84a
fix: update navigation element names for consistency
akash9676 Jun 30, 2026
cfd694c
fix: correct naming of AI Hooks in migration file
akash9676 Jun 30, 2026
ff4a11a
feat(trigger): add trigger handling for submission uploads and reuplo…
akash9676 Jul 1, 2026
10bff6f
feat(trigger): enhance trigger configuration by adding component sche…
akash9676 Jul 1, 2026
eb06f69
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jul 1, 2026
4385b37
Merge branch 'project-1-ai-standardization' into feat-223-ai-hooks
akash9676 Jul 1, 2026
706033f
fix: update API key field to allow null values and adjust validation …
akash9676 Jul 1, 2026
6a9e4fc
Merge pull request #240 from UKPLab/feat-223-ai-hooks
akash9676 Jul 1, 2026
346fcca
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 Jul 1, 2026
78b7d94
Merge branch 'project-1-ai-standardization' into feat-186-budget-mana…
MRawhani Jul 4, 2026
692aefc
Merge branch 'feat-248-placeholder_numbering_extension' into feat-186…
MRawhani Jul 6, 2026
f77675e
fix: add basic form + fix assessment check bug
MRawhani Jul 6, 2026
4e728aa
refactor: optimize the ai integration flow
MRawhani Jul 6, 2026
b353e7f
feat(trigger): enforce project ID requirement, add indexes to trigger…
akash9676 Jul 6, 2026
3a854d2
refactor(trigger): streamline transaction handling and improve query …
akash9676 Jul 7, 2026
bd3172b
feat(trigger): add status filter options to TriggerLogs component for…
akash9676 Jul 7, 2026
c22aa69
feat(trigger): enhance TriggerStepperModal to display detailed trigge…
akash9676 Jul 7, 2026
df88c93
fix: change bypass to free and make elements in ui into basic forms
MRawhani Jul 9, 2026
7451a55
fix(trigger): update project ID field to allow null values and remove…
akash9676 Jul 9, 2026
8edcb63
feat(trigger): add soft-delete functionality to TriggerQueue model an…
akash9676 Jul 9, 2026
451993e
fix: revert extension migrations for ai models
MRawhani Jul 9, 2026
0fe9dc4
Merge pull request #222 from UKPLab/feat-186-budget-management
MRawhani Jul 9, 2026
c5cba66
fix: generic bypasssing userId check for shareing models
MRawhani Jul 13, 2026
1b8ad1f
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 Jul 13, 2026
cc7ed07
refactor: remove share.js file and trigger subscribing
MRawhani Jul 13, 2026
1cde84f
Merge branch 'dev' into project-1-ai-standardization
mohammadsherif0 Jul 13, 2026
d74a0f2
feat(trigger): implement AI hook execution in trigger handling and en…
Jul 13, 2026
7fea88a
feat(trigger): add rerun functionality for completed queue items in t…
akash9676 Jul 14, 2026
4719b21
feat: enhance AI hook integration across services, updating key gener…
akash9676 Jul 14, 2026
0dba4b4
fix(assignment): update template check to use optional chaining for s…
akash9676 Jul 14, 2026
c6ad2e9
feat: introduce document data key normalization and enhance key gener…
akash9676 Jul 14, 2026
0cfd9d5
feat: add getHookResultKeyCandidates function to streamline key gener…
akash9676 Jul 14, 2026
88a50c1
fix: update API key validation to require either apiKey or apiBaseUrl
akash9676 Jul 16, 2026
8512f2c
feat: add button-click event handling to form components for enhanced…
akash9676 Jul 16, 2026
6714a14
refactor: simplify AI credential form by integrating BasicForm compon…
akash9676 Jul 16, 2026
6a6ba7e
fix: enforce requirement for either API key or base URL in AI credent…
akash9676 Jul 16, 2026
3f13b4f
feat(trigger): add new steps for trigger configuration including sett…
akash9676 Jul 16, 2026
271fcdf
refactor(trigger): streamline trigger components by consolidating pro…
akash9676 Jul 16, 2026
23026ad
Merge branch 'project-1-ai-standardization' into feat-224-triggers
akash9676 Jul 16, 2026
2a81324
Merge pull request #258 from UKPLab/feat-224-triggers
akash9676 Jul 16, 2026
8e64c01
refactor: refactor the validate forign owner
MRawhani Jul 17, 2026
b046249
fix: fixed the role-base budget capping
MRawhani Jul 17, 2026
ec30892
Merge branch 'project-1-ai-standardization' into feat-264-enhance_sha…
MRawhani Jul 17, 2026
8221717
Merge pull request #271 from UKPLab/feat-264-enhance_sharing_function…
MRawhani Jul 17, 2026
876db72
fix: add study sessions associate into AI log model
MRawhani Jul 20, 2026
957ebb0
fix: add hook access check in budget capping
MRawhani Jul 20, 2026
e2cb304
fix: add test informaiton to ai log output
MRawhani Jul 20, 2026
2992063
fix: change cap type 0 bug
MRawhani Jul 20, 2026
a9f1f7f
feat: add testing file for budget caps 29 cases
MRawhani Jul 20, 2026
89cd80a
Merge branch 'dev' into project-1-ai-standardization
MRawhani Jul 21, 2026
8978704
refactor: standardize deleted field definition across AI models and a…
akash9676 Jul 22, 2026
4f7c42a
refactor: enhance associations and soft-delete logic in AI credential…
akash9676 Jul 22, 2026
de2799f
refactor: replace getOwnedById with requireOwnedCredential for improv…
akash9676 Jul 22, 2026
0eddb1e
refactor: remove unnecessary whitespace in study session model for cl…
akash9676 Jul 22, 2026
2ee5d26
refactor: improve foreign key value retrieval logic in MetaModel for …
akash9676 Jul 22, 2026
dad0e10
refactor: optimize post-upload email and trigger handling to run asyn…
akash9676 Jul 22, 2026
a9e12f8
refactor: implement execution queue for trigger handling to enforce p…
akash9676 Jul 22, 2026
4bcf288
Merge branch 'project-1-ai-standardization' of https://github.com/UKP…
MRawhani Jul 24, 2026
95a59f6
refactor: change author name
MRawhani Jul 24, 2026
b4ff038
refactor: remove comments from models to ensure conistentcy
MRawhani Jul 24, 2026
c15224c
refactor: merge extenison migration to old one that is not merged int…
MRawhani Jul 24, 2026
2d6e299
refactor: remove legacy limits types helper
MRawhani Jul 24, 2026
f027af7
refactor: clean docs and formatting
MRawhani Jul 24, 2026
87d2cf6
refactor: fix default false in ai budget
MRawhani Jul 24, 2026
09e5410
refactor: change opts to options
MRawhani Jul 24, 2026
67f4ae4
refactor: remove legacy pdf extraction in server
MRawhani Jul 24, 2026
c33c368
refactor : clarify placeholder helpers and simplify early returns
mohammadsherif0 Jul 27, 2026
8fbae89
refactor: change comments in radio
MRawhani Jul 28, 2026
f65d371
Merge branch 'dev' into project-1-ai-standardization
akash9676 Jul 31, 2026
9fbabf0
feat: implement provider selection for LiteLLM integration
akash9676 Aug 3, 2026
5987268
refactor: update nav_group order in migration to position Settings last
akash9676 Aug 3, 2026
f24a362
fix: update trigger name display for deleted triggers in TriggerLogs …
akash9676 Aug 3, 2026
147fdf4
feat: add searchable select functionality to form component
akash9676 Aug 3, 2026
29cf498
fix: adjust input mapping logic for table-based sources in InputMap c…
akash9676 Aug 3, 2026
7c399df
fix: update Select component to improve value handling and emit logic
akash9676 Aug 3, 2026
fe2d275
Merge branch 'dev' into project-1-ai-standardization
akash9676 Aug 4, 2026
d910dc8
fix: improve fallback handling and skill loading in NLPService
akash9676 Aug 4, 2026
b356ba4
refactor: use fs.promises for asynchronous file operations in nlp.js
akash9676 Aug 4, 2026
d412eb9
refactor: remove the hook name from document data
MRawhani Aug 5, 2026
2f6d208
Merge branch 'project-1-ai-standardization' of https://github.com/UKP…
MRawhani Aug 5, 2026
8985f3b
refactor: remove hook name form document data
MRawhani Aug 6, 2026
d31ece2
refactor: change column namings to match patterns
MRawhani Aug 7, 2026
a2f2b69
refactor: change name of the budget js file
MRawhani Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ RPC_MOODLE_PORT=3011
RPC_PDF_HOST=127.0.0.1
RPC_PDF_PORT=3012

RPC_LITELLM_HOST=127.0.0.1
RPC_LITELLM_PORT=3013

# System Statistics
# PG_STATS_INTERVAL_MS:
# Interval in milliseconds between each PostgreSQL statistics snapshot
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ help:
@echo "make build Create a dockerized production build including frontend, backend, nlp, services"
@echo "make build-clean Clean the environment of production build"
@echo "make docker Start docker images"
@echo "make docker-recompose Rebuild and start the dev Docker stack (postgres, rpc_*)"
@echo "make backup_db CONTAINER=<name/id> Backup the database in the given container"
@echo "make recover_db CONTAINER=<name/id> DUMP=<name in db_dumps folder> Recover database into container"
@echo "make anonymize_dump CONTAINER=<name/id> DUMP=<name in db_dumps folder> [SEED=<int>] [NUM=<int>] Create anonymized dump (consent-filtered + pseudonymized)"
Expand Down Expand Up @@ -77,7 +78,11 @@ lint: frontend/node_modules/.uptodate

.PHONY: docker
docker:
@docker compose -f docker-compose.yml -f docker-dev.yml up postgres rpc_test rpc_moodle rpc_pdf
@docker compose -f docker-compose.yml -f docker-dev.yml up postgres rpc_test rpc_moodle rpc_pdf rpc_litellm

.PHONY: docker-recompose
docker-recompose:
@docker compose -f docker-compose.yml -f docker-dev.yml up --build postgres rpc_test rpc_moodle rpc_pdf rpc_litellm

.PHONY: db
db: backend/node_modules/.uptodate $(UTILS_MODULES_UPTODATE)
Expand Down
32 changes: 32 additions & 0 deletions backend/db/MetaModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ module.exports = class MetaModel extends Model {
*/
static fields = [];

/**
* Lets appDataUpdate accept a foreign userId when the requester owns the parent row.
* @type {{column: string, table: string}|null}
*/
static foreignOwner = null;

/**
* Checks whether `requesterId` owns the parent row referenced by `foreignOwner.column`.
* Called generically from AppSocket#updateData's foreign-userId guard.
* @param {Object} payload Incoming appDataUpdate payload.
* @param {number} requesterId The socket's authenticated user id.
* @param {import("sequelize").Transaction} [transaction]
* @returns {Promise<boolean>}
*/
static async validateForeignUserId(payload, requesterId, transaction) {
if (!this.foreignOwner) return false;
const {column, table} = this.foreignOwner;

let fkValue = payload[column];
if (!fkValue && payload.id) {
const existing = await this.findByPk(payload.id, {transaction});
fkValue = existing?.[column];
}
if (!fkValue) return false;

const parent = await this.sequelize.models[table].findOne({
where: {id: fkValue, deleted: false},
transaction,
});
return Boolean(parent) && Number(parent.userId) === Number(requesterId);
}

/**
* Filter object by keys
* @param {Object} obj
Expand Down
82 changes: 82 additions & 0 deletions backend/db/migrations/20260331100037-create-ai_credential.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('ai_credential', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
apiKey: {
type: Sequelize.TEXT,
allowNull: true,
defaultValue: null,
},
provider: {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null,
},
apiBaseUrl: {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null,
},
apiVersion: {
type: Sequelize.STRING,
allowNull: true,
defaultValue: null,
},
additionalParameters: {
type: Sequelize.JSONB,
allowNull: true,
defaultValue: {},
},
enabled: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: true,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('ai_credential');
},
};
86 changes: 86 additions & 0 deletions backend/db/migrations/20260331101522-create-ai_model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('ai_model', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
aiCredentialId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
references: {
model: 'ai_credential',
key: 'id',
},
onDelete: 'SET NULL',
onUpdate: 'CASCADE',
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
model: {
type: Sequelize.STRING,
allowNull: false,
},
description: {
type: Sequelize.TEXT,
allowNull: true,
defaultValue: null,
},
additionalParameters: {
type: Sequelize.JSONB,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add allowNull for consistency

defaultValue: {},
},
enabled: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: true,
},
freeModel: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('ai_model');
},
};
74 changes: 74 additions & 0 deletions backend/db/migrations/20260331102200-create-ai_model_share.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('ai_model_share', {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
aiModelId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'ai_model',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
userId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
references: {
model: 'user',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
roleId: {
type: Sequelize.INTEGER,
allowNull: true,
defaultValue: null,
references: {
model: 'user_role',
key: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
},
expiryDate: {
type: Sequelize.DATE,
allowNull: false,
},
deleted: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deletedAt: {
type: Sequelize.DATE,
allowNull: true,
defaultValue: null,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
updatedAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.dropTable('ai_model_share');
},
};
Loading
Loading