Commit Graph

3425 Commits

Author SHA1 Message Date
KernelDeimos 0201b93013 fix: redundant report-usage call in FakeChatService 2025-04-09 14:34:32 -04:00
KernelDeimos d0edb2c1f3 fix: async handling for events
There were issues with async handling in events which can make it
difficult to use event handlers to mutate values provided by an emitter.

This is not an optimal solution: this will await event listeners in
sequence. Ideally, event listeners should be awaited concurrently.
2025-04-09 14:34:32 -04:00
KernelDeimos 1f7073ef76 dev: add services property to extensions
A small change that adds ".services" to the "extension" global in an
extension, so extensions can more easily talk to other services.
2025-04-09 14:34:32 -04:00
KernelDeimos 21bd427cef refactor: generalize handling of costly services
Usage/cost tracking per user was over-fitted to LLM/AI services. This
commit adds CostService and updates AIChatService to use that instead of
updating the `ai_usage` table. The `ai_usage` table is now considered
deprecated.

A service called PermissiveCreditService is enabled by default in
SelfHostedModule. This is so users who host their own Puter instances
don't have to worry about usage limits, since they're providing their
own keys anyway.
2025-04-09 14:34:32 -04:00
KernelDeimos 0347a38136 fix: handle all temp user errors by reloading 2025-04-09 13:27:30 -04:00
KernelDeimos c8d52b3203 style: captcha refresh button 2025-04-08 16:54:36 -04:00
KernelDeimos d0e06e83c0 dev: add ip to captcha middleware event 2025-04-08 16:54:36 -04:00
jelveh 592acbcae6 remove "anthropic/" from model name 2025-04-08 12:34:23 -07:00
KernelDeimos 27fd7b3670 fix: broken model parameter 2025-04-08 13:27:56 -04:00
Nariman Jelveh fd910f36cf Merge pull request #1169 from shushannap/FAtranslation
tweak: reorder and fix Farsi translation of i18n keys
2025-04-08 08:41:16 -07:00
KernelDeimos 95ddfe3909 fix: error handling in ThreadService 2025-04-07 19:02:52 -04:00
KernelDeimos fc11eba070 fix: puter.js threads error handling 2025-04-07 18:43:21 -04:00
KernelDeimos 3e98d13f6b doc: document driver endpoint 2025-04-07 14:37:45 -04:00
KernelDeimos 9a12db2066 fix: .startsWith on undefined 2025-04-04 17:58:06 -04:00
jelveh 4fb772796f Update AI.js 2025-04-04 14:43:53 -07:00
EvaNtziou dad72c5bd7 feat: button to remove profile image #1245 (#1246)
* Restored and updated UITabAccount.js, style.css
* Update UITabAccount.js

Closes: 1245
2025-04-04 16:00:53 -04:00
jelveh 80060e863d Use openrouter for llama models 2025-04-03 17:23:26 -07:00
Nariman Jelveh ddb04431cc Update README.md 2025-04-02 18:48:22 -07:00
jelveh 590973f50d Update AI.js 2025-04-02 12:04:38 -07:00
KernelDeimos fb01bb474a fix: edge case during email change
Previous logic was:
- on email change, update temporary value
- send email to confirm new email
- temporary value is moved to real email

This doesn't work when an account has not yet confirmed their email
after signup (i.e. user's email_confirmed is still 0). Well, it actually
does work, but the user is only able to confirm the change to their
email and not set their account as having a confirmed email.

New logic has a branch for this case; IFF email_confirmed=0:
- change account confirm code
- send new account confirm email
2025-04-01 12:41:49 -04:00
KernelDeimos 7a3365a25c refactor: begin migrating utility code
I'm calling this approach a "re-core"; see src/backend-core-0/README.md
for more information about this.
2025-03-31 22:09:29 -04:00
KernelDeimos f2305ff289 fix: how did this get here 2025-03-31 20:22:13 -04:00
KernelDeimos e5f23e815d dev: disable textex by default
it's too verbose now
2025-03-31 20:07:19 -04:00
KernelDeimos f80105af6d fix: sure, but how 'bout a logo that isn't broken
A logo addition from another PR snuck in. This definitely makes it
consistent with signup, but this logo broken! This commit makes it be
not broken anymore.
2025-03-31 19:33:55 -04:00
Eric Dubé b7defab2d2 refactor: Migrate interfaces.js to new registration mechanism (#1239)
* refactor: migrate interfaces.js to new registration mechanism

- Created EntityStoreInterfaceService for crud-q interface\n- Created AnalyticsInterfaceService for puter-analytics interface\n- Added InterfacesModule to load these services\n- Removed interfaces.js\n\nCloses #1131

ai: true

* chore: remove interfaces.js file

ai: true

* fix: DRY CRUD interfaces

This comment is flagged as AI-generated, but Claude rate-limited before
it could actually make the commit so this commit was made by hand. Well,
while I'm writing this commit message I may as well mention that Claud's
rate limits are relentless and it has become impossible to use Claude
for some purposes as a result.

ai: true

* refactor: replace interfaces module with separate Module.js files for entitystore and analytics

- Removed interfaces module\n- Added EntityStoreModule.js to entitystore module\n- Added AnalyticsModule.js to analytics module\n- Updated main index.js to use the new modules directly\n\nai: true

ai: true

* fix: modules exported and registered incorrectly

* feat: add KVStoreModule for puter-kvstore interface

- Created KVStoreModule.js\n- Created KVStoreInterfaceService.js to register the puter-kvstore interface\n- Updated exports.js to include the new module\n\nai: true

* fix: remove index.js from kvstore module

- Removed unnecessary index.js file from kvstore module\n\nai: true

* fix: remove index.js files from analytics and entitystore modules

- Removed unnecessary index.js files from analytics and entitystore modules\n\nai: true

* fix: cleanup mycoder mistakes again

...because it actually threw out my previous commit where I already did
this.
2025-03-31 19:32:38 -04:00
Krista Vlastou 647ae35c84 Added a confirm password field and a show password option 2025-03-31 16:30:55 -04:00
KernelDeimos 6451f1b4e9 fix: error handling error in UIWindowSignup
Caused-By: ad4b3e7aeb
2025-03-31 13:22:31 -04:00
jelveh da2a8de307 Update UITabUsage.js 2025-03-29 16:51:24 -07:00
jelveh 1d1b4f81b5 clean up html and css 2025-03-29 12:31:23 -07:00
KernelDeimos a276a82e44 fix: put guard around startup chime 2025-03-29 14:57:45 -04:00
KernelDeimos 7c1fb4c3bf dev: improve puter.js convert interface 2025-03-28 22:39:28 -04:00
Jonathan Mahrt Guyou ad4b3e7aeb feat: captcha
* Added Revis distributed cash to enhance our Captcha Verification system so that we prevent our system from replay attacks

* Fix: There was an error with the implementation of Redis, so I reverted to our previous version that uses in memory storage

* Integrated the captcha verification system into our sign in Form. The captcha verification system now works on both login and sign int

* Remove test files from captcha module

* Update src/backend/src/modules/captcha/middleware/captcha-middleware.js

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>

* Update src/backend/src/modules/captcha/middleware/captcha-middleware.js

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>

* Now the captcha can be requested on condition, this llaows extenstions to control wether a captcha should be required,
I fixed the code in CaptchaModule to use config
and got rid of the lines that made captcha middleware available since it wasn't used anywhre

* I split the middleware into two distinct parts, so that the frontend can now determine captach requirements. PuterHomePageService can set GUI parameters for captcha requirements. The /whoarewe endpoint provides captcha requirement information and the extensuo system integration is maintained

* Fix security issues with password handling in URL query parameters

* Made sure that the enter key, submits the login request instead of refreshing the captcha

* In development we can now disable the Captcha verification system by running it with CAPTCHA_ENABLED=false npm start

* Went back and modified checkCaptcha so that it checks at the start to check what CAPTCHA_ENABLED is equal to

* Refactor captcha system to use configuration values instead of environment variables

* Fix captcha verification and align with project standards

* Update src/backend/src/modules/captcha/README.md

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>

* fix: incorrect service name

* dev: use Endpoint for captcha endpoints

Use Endpoint class, which uses eggspress behind the scenes, which handles
async errors in handlers automatically.

* dev: add extension support and simplify captcha

- removed extra error handling
- removed dormant code
- no distinction between login and signup (for now)

* clean: remove local files

* fix: undefined edge case

---------

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>
2025-03-28 19:46:56 -04:00
KernelDeimos f73958ee8c chore: update package-lock.json 2025-03-28 05:01:49 -04:00
Eric Dubé 45c072ff93 feat: add public endpoint for models list (#1228)
* feat: add public endpoint for models list

- Created ChatAPIService for public endpoints\n- Added /chat/models and /chat/models/details endpoints\n- Registered service in CoreModule\n- Added tests for the new service\n\nCloses #1227

ai: true

* Update src/backend/src/services/ChatAPIService.js
2025-03-27 17:12:09 -04:00
Ntwari Bruce 39048a9e2e dev: ai command tool use / function calling (#1194)
* Enhanced ai command to perfom other commands

* Enhance AI Command in Puter's shell

* Enahanced ai command to use tooling/function calling

* Fixed circular dependency and added list function to Builtincommand

* Fixed circular dependency and system prompt
2025-03-27 14:31:24 -04:00
KernelDeimos 9180261472 doc: add style doc for backend 2025-03-26 18:07:12 -04:00
Krista Vlastou 4b7e09e157 fix: npm install error on Windows (spawn EINVAL) (#1214) 2025-03-26 14:58:46 -04:00
KernelDeimos 3d3af13979 feat: add startup chime feature
Added ability to play Puter chime sound at startup after login
with a toggle in personalization settings to enable/disable it.

ai: true
2025-03-24 23:19:36 -04:00
KernelDeimos bcd8d0cc82 tweak: clarify Nodemailer section in email testing documentation
- Clarified that the Nodemailer example is for testing MailHog setup\n- Added information about how Puter uses Nodemailer\n- Added references to the EmailService class

ai: true
2025-03-24 21:55:34 -04:00
KernelDeimos 71fd94131e tweak: improve email testing documentation formatting and flow
- Reorganized sections for better readability\n- Added clearer headings and instructions\n- Improved troubleshooting section\n- Enhanced overall document structure

ai: true
2025-03-24 21:50:36 -04:00
gautamthegozi 94d148430a doc: Documentation for Email Testing (#1204)
* Documentation for Email Testing

* Documentation fix

* Fix
2025-03-24 21:48:36 -04:00
KernelDeimos 7bd0c8e3f2 doc: add documentation for robots 2025-03-24 17:58:47 -04:00
Eric Dubé c683b812bc doc: Improve PuterAI module documentation structure (#1216)
* docs: improve PuterAI module documentation structure

- Update docmeta.md to describe top-level doc structure\n- Create README.md for PuterAI module documentation\n- Move requests.md content to api_examples.md\n- Add ai_usage_testing.md in contributors directory\n\nCloses #1215\n\nai: true

* docs: remove original requests.md after content migration

Content has been migrated to api_examples.md with improved organization and structure.\n\nai: true
2025-03-24 17:52:00 -04:00
KernelDeimos 6a3b20f0a8 fix: clarify variable names in puter.ai.chat method
- Renamed 'options' to 'requestParams' to clearly indicate parameters sent to the backend driver\n- Renamed 'settings' to 'userParams' to clearly indicate parameters provided by the user\n- Updated comments to be more descriptive about the purpose of each variable\n\nFixes #1212\n\nai: true
2025-03-24 16:17:58 -04:00
KernelDeimos 64d1b6e663 dev: allow specifying chat driver in puter.js 2025-03-24 15:58:32 -04:00
KernelDeimos 617fb49178 fix: allow fake-chat to report usage for costly model
Modified the event handler in AIChatService to only skip usage reporting for fake-chat when it's not using the costly model, allowing the costly model to properly report its usage and costs.

ai: true
2025-03-24 15:54:40 -04:00
KernelDeimos 7a2851d2cc fix: add _init method to register FakeChatService as a provider
Added _init method to FakeChatService to register itself as a provider with AIChatService, ensuring that the service and its models are properly recognized by the system.

ai: true
2025-03-24 15:54:40 -04:00
KernelDeimos 42c6f92048 feat: add costly model to FakeChatService
Added a new 'costly' model to FakeChatService that simulates incurring costs similar to real AI services. This model can be used for testing cost tracking without incurring actual external API costs.

ai: true
2025-03-24 15:54:40 -04:00
Eric Dubé 67a898ea33 fix: update check_usage_ to only consider past month usage (#1209)
This change modifies the SQL query in check_usage_ to only consider AI usage from the past month when checking against limits, rather than all historical usage.

ai: true
2025-03-24 13:40:01 -04:00
Eric Dubé 1266ef2179 fix(ux): Make it easier to add file extensions to an app in bulk (#1205)
* Add support for pasting multiple file extensions at once in Dev Center

* Fix bulk file extension paste functionality in Dev Center

* fix: add try-catch around tippy

* Fix issues with bulk file extension pasting and add comma key support

* Fix issue with duplicate red tags appearing temporarily

* Implement robust bulk file extension paste functionality in Dev Center

* Fix security issue with JSON.stringify to properly escape < characters
2025-03-23 23:00:17 -04:00