diff --git a/src/backend/src/CoreModule.js b/src/backend/src/CoreModule.js index 70833785..acc24e78 100644 --- a/src/backend/src/CoreModule.js +++ b/src/backend/src/CoreModule.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/ai/PuterAIChatModule.js b/src/backend/src/modules/ai/PuterAIChatModule.js index 9bdbb4bd..8be0f08e 100644 --- a/src/backend/src/modules/ai/PuterAIChatModule.js +++ b/src/backend/src/modules/ai/PuterAIChatModule.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import { AdvancedBase } from '@heyputer/putility'; import config from '../../config.js'; import { AIInterfaceService } from '../../services/ai/AIInterfaceService.js'; diff --git a/src/backend/src/modules/apps/AppInformationService.js b/src/backend/src/modules/apps/AppInformationService.js index 9957f367..d9767d6a 100644 --- a/src/backend/src/modules/apps/AppInformationService.js +++ b/src/backend/src/modules/apps/AppInformationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/apps/ProtectedAppService.js b/src/backend/src/modules/apps/ProtectedAppService.js index ccd6a188..7b176443 100644 --- a/src/backend/src/modules/apps/ProtectedAppService.js +++ b/src/backend/src/modules/apps/ProtectedAppService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/captcha/CaptchaModule.js b/src/backend/src/modules/captcha/CaptchaModule.js index 5acdcdbc..4a28027a 100644 --- a/src/backend/src/modules/captcha/CaptchaModule.js +++ b/src/backend/src/modules/captcha/CaptchaModule.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/captcha/services/CaptchaService.js b/src/backend/src/modules/captcha/services/CaptchaService.js index 1260dcda..84129a03 100644 --- a/src/backend/src/modules/captcha/services/CaptchaService.js +++ b/src/backend/src/modules/captcha/services/CaptchaService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/AlarmService.js b/src/backend/src/modules/core/AlarmService.js index 46368014..6ae3b789 100644 --- a/src/backend/src/modules/core/AlarmService.js +++ b/src/backend/src/modules/core/AlarmService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/ErrorService.js b/src/backend/src/modules/core/ErrorService.js index 7b2f7a7f..972d65c6 100644 --- a/src/backend/src/modules/core/ErrorService.js +++ b/src/backend/src/modules/core/ErrorService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/ExpectationService.js b/src/backend/src/modules/core/ExpectationService.js index 795e177b..ebe91e52 100644 --- a/src/backend/src/modules/core/ExpectationService.js +++ b/src/backend/src/modules/core/ExpectationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/LogService.js b/src/backend/src/modules/core/LogService.js index f6b01a03..73473233 100644 --- a/src/backend/src/modules/core/LogService.js +++ b/src/backend/src/modules/core/LogService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/PagerService.js b/src/backend/src/modules/core/PagerService.js index 7b24dded..1f4fc6aa 100644 --- a/src/backend/src/modules/core/PagerService.js +++ b/src/backend/src/modules/core/PagerService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/ParameterService.js b/src/backend/src/modules/core/ParameterService.js index ffe7e435..84f11c7d 100644 --- a/src/backend/src/modules/core/ParameterService.js +++ b/src/backend/src/modules/core/ParameterService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/ProcessEventService.js b/src/backend/src/modules/core/ProcessEventService.js index adac88f3..8110431e 100644 --- a/src/backend/src/modules/core/ProcessEventService.js +++ b/src/backend/src/modules/core/ProcessEventService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/ServerHealthService.js b/src/backend/src/modules/core/ServerHealthService.js index 775c5451..3b7c9938 100644 --- a/src/backend/src/modules/core/ServerHealthService.js +++ b/src/backend/src/modules/core/ServerHealthService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/lib/identifier.js b/src/backend/src/modules/core/lib/identifier.js index 2570e77a..f6244c16 100644 --- a/src/backend/src/modules/core/lib/identifier.js +++ b/src/backend/src/modules/core/lib/identifier.js @@ -1,4 +1,3 @@ -// METADATA // {"def":"core.util.identutil","ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/lib/log.js b/src/backend/src/modules/core/lib/log.js index caa98b8c..994f1f64 100644 --- a/src/backend/src/modules/core/lib/log.js +++ b/src/backend/src/modules/core/lib/log.js @@ -1,4 +1,3 @@ -// METADATA // {"def":"core.util.logutil","ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/core/lib/stdio.js b/src/backend/src/modules/core/lib/stdio.js index 07f4552b..f61b1d38 100644 --- a/src/backend/src/modules/core/lib/stdio.js +++ b/src/backend/src/modules/core/lib/stdio.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/entitystore/EntityStoreInterfaceService.js b/src/backend/src/modules/entitystore/EntityStoreInterfaceService.js index 5b6e7ff2..08236b40 100644 --- a/src/backend/src/modules/entitystore/EntityStoreInterfaceService.js +++ b/src/backend/src/modules/entitystore/EntityStoreInterfaceService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const BaseService = require('../../services/BaseService'); /** diff --git a/src/backend/src/modules/puterfs/MountpointService.js b/src/backend/src/modules/puterfs/MountpointService.js index e7a95ba9..5250d8da 100644 --- a/src/backend/src/modules/puterfs/MountpointService.js +++ b/src/backend/src/modules/puterfs/MountpointService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/modules/web/SocketioService.js b/src/backend/src/modules/web/SocketioService.js index 55309c6f..fcd75df8 100644 --- a/src/backend/src/modules/web/SocketioService.js +++ b/src/backend/src/modules/web/SocketioService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-params":{"service":"claude"},"ai-commented":{"service":"claude"}} const BaseService = require('../../services/BaseService'); const socketio = require('socket.io'); diff --git a/src/backend/src/modules/web/WebServerService.js b/src/backend/src/modules/web/WebServerService.js index bf2f8898..a699976a 100644 --- a/src/backend/src/modules/web/WebServerService.js +++ b/src/backend/src/modules/web/WebServerService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/AnomalyService.js b/src/backend/src/services/AnomalyService.js index 25455826..dbf7cde2 100644 --- a/src/backend/src/services/AnomalyService.js +++ b/src/backend/src/services/AnomalyService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/BaseService.js b/src/backend/src/services/BaseService.js index df6d7620..2fda6ee7 100644 --- a/src/backend/src/services/BaseService.js +++ b/src/backend/src/services/BaseService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-params":{"service":"xai"},"ai-refs":["../../doc/contributors/boot-sequence.md"],"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/BootScriptService.js b/src/backend/src/services/BootScriptService.js index 139a4040..2a217260 100644 --- a/src/backend/src/services/BootScriptService.js +++ b/src/backend/src/services/BootScriptService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} const { Context } = require('../util/context'); const BaseService = require('./BaseService'); diff --git a/src/backend/src/services/ChatAPIService.js b/src/backend/src/services/ChatAPIService.js index 1cadc48a..b5933e7f 100644 --- a/src/backend/src/services/ChatAPIService.js +++ b/src/backend/src/services/ChatAPIService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const { Endpoint } = require('../util/expressutil'); const BaseService = require('./BaseService'); const APIError = require('../api/APIError'); diff --git a/src/backend/src/services/CleanEmailService.js b/src/backend/src/services/CleanEmailService.js index 06542a7a..d455f69e 100644 --- a/src/backend/src/services/CleanEmailService.js +++ b/src/backend/src/services/CleanEmailService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const BaseService = require('./BaseService'); /** diff --git a/src/backend/src/services/ClientOperationService.js b/src/backend/src/services/ClientOperationService.js index 573e9139..bf3fe8b6 100644 --- a/src/backend/src/services/ClientOperationService.js +++ b/src/backend/src/services/ClientOperationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/CommandService.js b/src/backend/src/services/CommandService.js index db57aabf..ba98342a 100644 --- a/src/backend/src/services/CommandService.js +++ b/src/backend/src/services/CommandService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ConfigurableCountingService.js b/src/backend/src/services/ConfigurableCountingService.js index 86d308b1..6f742022 100644 --- a/src/backend/src/services/ConfigurableCountingService.js +++ b/src/backend/src/services/ConfigurableCountingService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/Container.js b/src/backend/src/services/Container.js index 0cd61b8e..2cc5a7f0 100644 --- a/src/backend/src/services/Container.js +++ b/src/backend/src/services/Container.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ContextInitService.js b/src/backend/src/services/ContextInitService.js index ea72c4e6..253e3eac 100644 --- a/src/backend/src/services/ContextInitService.js +++ b/src/backend/src/services/ContextInitService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/DetailProviderService.js b/src/backend/src/services/DetailProviderService.js index 0425169c..bb8e34ea 100644 --- a/src/backend/src/services/DetailProviderService.js +++ b/src/backend/src/services/DetailProviderService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/DevConsoleService.js b/src/backend/src/services/DevConsoleService.js index 8e523137..6d7f3864 100644 --- a/src/backend/src/services/DevConsoleService.js +++ b/src/backend/src/services/DevConsoleService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/DevTODService.js b/src/backend/src/services/DevTODService.js index 63c923bf..4fc9768f 100644 --- a/src/backend/src/services/DevTODService.js +++ b/src/backend/src/services/DevTODService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/EmailService.js b/src/backend/src/services/EmailService.js index 66f27e28..f2b619f9 100644 --- a/src/backend/src/services/EmailService.js +++ b/src/backend/src/services/EmailService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/EngPortalService.js b/src/backend/src/services/EngPortalService.js index cfb63c24..06e6c9d2 100644 --- a/src/backend/src/services/EngPortalService.js +++ b/src/backend/src/services/EngPortalService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/EntityStoreService.js b/src/backend/src/services/EntityStoreService.js index 413e11fd..a3637ff1 100644 --- a/src/backend/src/services/EntityStoreService.js +++ b/src/backend/src/services/EntityStoreService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/EventService.js b/src/backend/src/services/EventService.js index d2aaf46e..3b287960 100644 --- a/src/backend/src/services/EventService.js +++ b/src/backend/src/services/EventService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/FeatureFlagService.js b/src/backend/src/services/FeatureFlagService.js index a014e84e..6424cf5c 100644 --- a/src/backend/src/services/FeatureFlagService.js +++ b/src/backend/src/services/FeatureFlagService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const { Context } = require('../util/context'); const { PermissionUtil } = require('./auth/permissionUtils.mjs'); const BaseService = require('./BaseService'); diff --git a/src/backend/src/services/FilesystemAPIService.js b/src/backend/src/services/FilesystemAPIService.js index 103b6852..ed08e1ad 100644 --- a/src/backend/src/services/FilesystemAPIService.js +++ b/src/backend/src/services/FilesystemAPIService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/GetUserService.js b/src/backend/src/services/GetUserService.js index d9092ef7..048bf6b5 100644 --- a/src/backend/src/services/GetUserService.js +++ b/src/backend/src/services/GetUserService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/HelloWorldService.js b/src/backend/src/services/HelloWorldService.js index 49fd8d68..c8eb6eba 100644 --- a/src/backend/src/services/HelloWorldService.js +++ b/src/backend/src/services/HelloWorldService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} const BaseService = require('./BaseService'); /** diff --git a/src/backend/src/services/HostDiskUsageService.js b/src/backend/src/services/HostDiskUsageService.js index 6ee2bf43..65e1a562 100644 --- a/src/backend/src/services/HostDiskUsageService.js +++ b/src/backend/src/services/HostDiskUsageService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/KernelInfoService.js b/src/backend/src/services/KernelInfoService.js index bea7dc87..71ed00df 100644 --- a/src/backend/src/services/KernelInfoService.js +++ b/src/backend/src/services/KernelInfoService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const configurable_auth = require('../middleware/configurable_auth'); const { Context } = require('../util/context'); const { Endpoint } = require('../util/expressutil'); diff --git a/src/backend/src/services/LocalDiskStorageService.js b/src/backend/src/services/LocalDiskStorageService.js index 1ef1bb81..1b7d9f95 100644 --- a/src/backend/src/services/LocalDiskStorageService.js +++ b/src/backend/src/services/LocalDiskStorageService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/LockService.js b/src/backend/src/services/LockService.js index e11fabdf..3a379e0a 100644 --- a/src/backend/src/services/LockService.js +++ b/src/backend/src/services/LockService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/MakeProdDebuggingLessAwfulService.js b/src/backend/src/services/MakeProdDebuggingLessAwfulService.js index 7da554ad..b97b1144 100644 --- a/src/backend/src/services/MakeProdDebuggingLessAwfulService.js +++ b/src/backend/src/services/MakeProdDebuggingLessAwfulService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/MemoryStorageService.js b/src/backend/src/services/MemoryStorageService.js index 875b1645..74afabf7 100644 --- a/src/backend/src/services/MemoryStorageService.js +++ b/src/backend/src/services/MemoryStorageService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/NotificationService.js b/src/backend/src/services/NotificationService.js index 1fcddbf2..1afceacb 100644 --- a/src/backend/src/services/NotificationService.js +++ b/src/backend/src/services/NotificationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/OperationTraceService.js b/src/backend/src/services/OperationTraceService.js index 24a52dca..f7b1aa47 100644 --- a/src/backend/src/services/OperationTraceService.js +++ b/src/backend/src/services/OperationTraceService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/PermissionAPIService.js b/src/backend/src/services/PermissionAPIService.js index 13bc1d3a..7649e719 100644 --- a/src/backend/src/services/PermissionAPIService.js +++ b/src/backend/src/services/PermissionAPIService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/PuterAPIService.js b/src/backend/src/services/PuterAPIService.js index 9096fd27..335d0cf9 100644 --- a/src/backend/src/services/PuterAPIService.js +++ b/src/backend/src/services/PuterAPIService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/PuterHomepageService.js b/src/backend/src/services/PuterHomepageService.js index dd15fab2..22be3550 100644 --- a/src/backend/src/services/PuterHomepageService.js +++ b/src/backend/src/services/PuterHomepageService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/PuterSiteService.js b/src/backend/src/services/PuterSiteService.js index 68e27ef6..98073edc 100644 --- a/src/backend/src/services/PuterSiteService.js +++ b/src/backend/src/services/PuterSiteService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/PuterVersionService.js b/src/backend/src/services/PuterVersionService.js index aa444f1a..506cb4c4 100644 --- a/src/backend/src/services/PuterVersionService.js +++ b/src/backend/src/services/PuterVersionService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ReferralCodeService.js b/src/backend/src/services/ReferralCodeService.js index bd3da382..7c8cde93 100644 --- a/src/backend/src/services/ReferralCodeService.js +++ b/src/backend/src/services/ReferralCodeService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/RefreshAssociationsService.js b/src/backend/src/services/RefreshAssociationsService.js index bcc35b46..291a1f32 100644 --- a/src/backend/src/services/RefreshAssociationsService.js +++ b/src/backend/src/services/RefreshAssociationsService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/RegistrantService.js b/src/backend/src/services/RegistrantService.js index ec270608..f3c5289f 100644 --- a/src/backend/src/services/RegistrantService.js +++ b/src/backend/src/services/RegistrantService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/RegistryService.js b/src/backend/src/services/RegistryService.js index a9cac4b8..63c0614f 100644 --- a/src/backend/src/services/RegistryService.js +++ b/src/backend/src/services/RegistryService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/SUService.js b/src/backend/src/services/SUService.js index 0e99ae98..3dcf09d1 100644 --- a/src/backend/src/services/SUService.js +++ b/src/backend/src/services/SUService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} import { TeePromise } from '@heyputer/putility/src/libs/promise.js'; import { Context } from '../util/context.js'; import { Actor, UserActorType } from './auth/Actor.js'; diff --git a/src/backend/src/services/ScriptService.js b/src/backend/src/services/ScriptService.js index d2b99437..cabb8427 100644 --- a/src/backend/src/services/ScriptService.js +++ b/src/backend/src/services/ScriptService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ServeGUIService.js b/src/backend/src/services/ServeGUIService.js index fee427b4..4255d6d1 100644 --- a/src/backend/src/services/ServeGUIService.js +++ b/src/backend/src/services/ServeGUIService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ServicePatch.js b/src/backend/src/services/ServicePatch.js index 20931407..d557f22d 100644 --- a/src/backend/src/services/ServicePatch.js +++ b/src/backend/src/services/ServicePatch.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/SessionService.js b/src/backend/src/services/SessionService.js index 63cd8e3f..14c12c70 100644 --- a/src/backend/src/services/SessionService.js +++ b/src/backend/src/services/SessionService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ShareService.js b/src/backend/src/services/ShareService.js index 63c7833f..e6c6d941 100644 --- a/src/backend/src/services/ShareService.js +++ b/src/backend/src/services/ShareService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ShutdownService.js b/src/backend/src/services/ShutdownService.js index 18b2b408..12bb4c5c 100644 --- a/src/backend/src/services/ShutdownService.js +++ b/src/backend/src/services/ShutdownService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const BaseService = require('./BaseService'); /** diff --git a/src/backend/src/services/StorageService.js b/src/backend/src/services/StorageService.js index b033c5fd..4361ab4c 100644 --- a/src/backend/src/services/StorageService.js +++ b/src/backend/src/services/StorageService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/StrategizedService.js b/src/backend/src/services/StrategizedService.js index 580dcde9..85003712 100644 --- a/src/backend/src/services/StrategizedService.js +++ b/src/backend/src/services/StrategizedService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/SystemDataService.js b/src/backend/src/services/SystemDataService.js index 7d7ebaa5..1467c354 100644 --- a/src/backend/src/services/SystemDataService.js +++ b/src/backend/src/services/SystemDataService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"xai"}} const { LLRead } = require('../filesystem/ll_operations/ll_read'); const { Context } = require('../util/context'); const { stream_to_buffer } = require('../util/streamutil'); diff --git a/src/backend/src/services/SystemValidationService.js b/src/backend/src/services/SystemValidationService.js index 75e04d36..651da647 100644 --- a/src/backend/src/services/SystemValidationService.js +++ b/src/backend/src/services/SystemValidationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/TraceService.js b/src/backend/src/services/TraceService.js index 050305a8..9ff86fd5 100644 --- a/src/backend/src/services/TraceService.js +++ b/src/backend/src/services/TraceService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/WSPushService.js b/src/backend/src/services/WSPushService.js index aee978e5..bc209970 100644 --- a/src/backend/src/services/WSPushService.js +++ b/src/backend/src/services/WSPushService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/abuse-prevention/AuthAuditService.js b/src/backend/src/services/abuse-prevention/AuthAuditService.js index c0cc54bc..7f48ef0e 100644 --- a/src/backend/src/services/abuse-prevention/AuthAuditService.js +++ b/src/backend/src/services/abuse-prevention/AuthAuditService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/abuse-prevention/EdgeRateLimitService.js b/src/backend/src/services/abuse-prevention/EdgeRateLimitService.js index ef2224dc..13392afa 100644 --- a/src/backend/src/services/abuse-prevention/EdgeRateLimitService.js +++ b/src/backend/src/services/abuse-prevention/EdgeRateLimitService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/abuse-prevention/IdentificationService.js b/src/backend/src/services/abuse-prevention/IdentificationService.js index 97f0ba9f..aea41d28 100644 --- a/src/backend/src/services/abuse-prevention/IdentificationService.js +++ b/src/backend/src/services/abuse-prevention/IdentificationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/ai/AIInterfaceService.js b/src/backend/src/services/ai/AIInterfaceService.js index 988d1964..cd6d760b 100644 --- a/src/backend/src/services/ai/AIInterfaceService.js +++ b/src/backend/src/services/ai/AIInterfaceService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const BaseService = require('../BaseService'); /** diff --git a/src/backend/src/services/ai/chat/AIChatService.ts b/src/backend/src/services/ai/chat/AIChatService.ts index 90d421bd..277b9c7d 100644 --- a/src/backend/src/services/ai/chat/AIChatService.ts +++ b/src/backend/src/services/ai/chat/AIChatService.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import { createId as cuid2 } from '@paralleldrive/cuid2'; import { PassThrough } from 'stream'; import { APIError } from '../../../api/APIError.js'; diff --git a/src/backend/src/services/ai/chat/providers/ClaudeProvider/ClaudeProvider.ts b/src/backend/src/services/ai/chat/providers/ClaudeProvider/ClaudeProvider.ts index 24bce237..0d46e672 100644 --- a/src/backend/src/services/ai/chat/providers/ClaudeProvider/ClaudeProvider.ts +++ b/src/backend/src/services/ai/chat/providers/ClaudeProvider/ClaudeProvider.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import Anthropic, { toFile } from '@anthropic-ai/sdk'; import { Message } from '@anthropic-ai/sdk/resources'; import { BetaUsage } from '@anthropic-ai/sdk/resources/beta.js'; diff --git a/src/backend/src/services/ai/chat/providers/FakeChatProvider.ts b/src/backend/src/services/ai/chat/providers/FakeChatProvider.ts index 733e7609..74d3b93f 100644 --- a/src/backend/src/services/ai/chat/providers/FakeChatProvider.ts +++ b/src/backend/src/services/ai/chat/providers/FakeChatProvider.ts @@ -16,7 +16,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import dedent from 'dedent'; import { LoremIpsum } from 'lorem-ipsum'; diff --git a/src/backend/src/services/ai/chat/providers/OllamaProvider.ts b/src/backend/src/services/ai/chat/providers/OllamaProvider.ts index 04ad9064..ba6fdd7e 100644 --- a/src/backend/src/services/ai/chat/providers/OllamaProvider.ts +++ b/src/backend/src/services/ai/chat/providers/OllamaProvider.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import axios from 'axios'; import { default as openai, default as OpenAI } from 'openai'; import { Context } from '../../../../util/context.js'; diff --git a/src/backend/src/services/ai/chat/providers/OpenAiProvider/OpenAiChatProvider.ts b/src/backend/src/services/ai/chat/providers/OpenAiProvider/OpenAiChatProvider.ts index 6e72bee6..4adee51c 100644 --- a/src/backend/src/services/ai/chat/providers/OpenAiProvider/OpenAiChatProvider.ts +++ b/src/backend/src/services/ai/chat/providers/OpenAiProvider/OpenAiChatProvider.ts @@ -31,7 +31,6 @@ import { OPEN_AI_MODELS } from './models.js'; ; -// METADATA // {"ai-commented":{"service":"claude"}} // We're capping at 5MB, which sucks, but Chat Completions doesn't suuport // file inputs. diff --git a/src/backend/src/services/ai/chat/providers/OpenRouterProvider/OpenRouterProvider.ts b/src/backend/src/services/ai/chat/providers/OpenRouterProvider/OpenRouterProvider.ts index 73e32b72..872986bd 100644 --- a/src/backend/src/services/ai/chat/providers/OpenRouterProvider/OpenRouterProvider.ts +++ b/src/backend/src/services/ai/chat/providers/OpenRouterProvider/OpenRouterProvider.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import axios from 'axios'; import { OpenAI } from 'openai'; import { ChatCompletionCreateParams } from 'openai/resources'; diff --git a/src/backend/src/services/ai/chat/providers/UsageLimitedChatProvider.ts b/src/backend/src/services/ai/chat/providers/UsageLimitedChatProvider.ts index e26cb17c..d849e5fc 100644 --- a/src/backend/src/services/ai/chat/providers/UsageLimitedChatProvider.ts +++ b/src/backend/src/services/ai/chat/providers/UsageLimitedChatProvider.ts @@ -16,7 +16,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import dedent from 'dedent'; import { PassThrough } from 'stream'; diff --git a/src/backend/src/services/ai/image/AIImageGenerationService.ts b/src/backend/src/services/ai/image/AIImageGenerationService.ts index 11247615..2954fab9 100644 --- a/src/backend/src/services/ai/image/AIImageGenerationService.ts +++ b/src/backend/src/services/ai/image/AIImageGenerationService.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import { APIError } from '../../../api/APIError.js'; import { ErrorService } from '../../../modules/core/ErrorService.js'; import { Context } from '../../../util/context.js'; diff --git a/src/backend/src/services/ai/image/providers/GeminiImageGenerationProvider/GeminiImageGenerationProvider.ts b/src/backend/src/services/ai/image/providers/GeminiImageGenerationProvider/GeminiImageGenerationProvider.ts index facada7c..d4004fe7 100644 --- a/src/backend/src/services/ai/image/providers/GeminiImageGenerationProvider/GeminiImageGenerationProvider.ts +++ b/src/backend/src/services/ai/image/providers/GeminiImageGenerationProvider/GeminiImageGenerationProvider.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import { GenerateContentResponse, GoogleGenAI } from '@google/genai'; import APIError from '../../../../../api/APIError.js'; import { ErrorService } from '../../../../../modules/core/ErrorService.js'; diff --git a/src/backend/src/services/ai/image/providers/OpenAiImageGenerationProvider/OpenAiImageGenerationProvider.ts b/src/backend/src/services/ai/image/providers/OpenAiImageGenerationProvider/OpenAiImageGenerationProvider.ts index 84d6ceec..f9d9ff09 100644 --- a/src/backend/src/services/ai/image/providers/OpenAiImageGenerationProvider/OpenAiImageGenerationProvider.ts +++ b/src/backend/src/services/ai/image/providers/OpenAiImageGenerationProvider/OpenAiImageGenerationProvider.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import openai, { OpenAI } from 'openai'; import { ImageGenerateParamsNonStreaming } from 'openai/resources/images.js'; import APIError from '../../../../../api/APIError.js'; diff --git a/src/backend/src/services/ai/image/providers/TogetherImageGenerationProvider/TogetherImageGenerationProvider.ts b/src/backend/src/services/ai/image/providers/TogetherImageGenerationProvider/TogetherImageGenerationProvider.ts index 2feba2b1..5227c463 100644 --- a/src/backend/src/services/ai/image/providers/TogetherImageGenerationProvider/TogetherImageGenerationProvider.ts +++ b/src/backend/src/services/ai/image/providers/TogetherImageGenerationProvider/TogetherImageGenerationProvider.ts @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import { Together } from 'together-ai'; import APIError from '../../../../../api/APIError.js'; import { ErrorService } from '../../../../../modules/core/ErrorService.js'; diff --git a/src/backend/src/services/ai/ocr/AWSTextractService.js b/src/backend/src/services/ai/ocr/AWSTextractService.js index 1a547c6b..a876b742 100644 --- a/src/backend/src/services/ai/ocr/AWSTextractService.js +++ b/src/backend/src/services/ai/ocr/AWSTextractService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const { TextractClient, AnalyzeDocumentCommand, InvalidS3ObjectException } = require('@aws-sdk/client-textract'); const BaseService = require('../../BaseService'); diff --git a/src/backend/src/services/ai/ocr/MistralOCRService.js b/src/backend/src/services/ai/ocr/MistralOCRService.js index aad45f14..5a607e60 100644 --- a/src/backend/src/services/ai/ocr/MistralOCRService.js +++ b/src/backend/src/services/ai/ocr/MistralOCRService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} import { Context } from '@heyputer/putility/src/libs/context.js'; import { Mistral } from '@mistralai/mistralai'; import mime from 'mime-types'; diff --git a/src/backend/src/services/ai/tts/AWSPollyService.js b/src/backend/src/services/ai/tts/AWSPollyService.js index a7d11fee..2369dd11 100644 --- a/src/backend/src/services/ai/tts/AWSPollyService.js +++ b/src/backend/src/services/ai/tts/AWSPollyService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const { PollyClient, SynthesizeSpeechCommand, DescribeVoicesCommand } = require('@aws-sdk/client-polly'); const BaseService = require('../../BaseService'); const { TypedValue } = require('../../drivers/meta/Runtime'); diff --git a/src/backend/src/services/ai/video/OpenAIVideoGenerationService.js b/src/backend/src/services/ai/video/OpenAIVideoGenerationService.js index 94c85ca0..c810ec41 100644 --- a/src/backend/src/services/ai/video/OpenAIVideoGenerationService.js +++ b/src/backend/src/services/ai/video/OpenAIVideoGenerationService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const APIError = require('../../../api/APIError'); const BaseService = require('../../BaseService'); const { TypedValue } = require('../../drivers/meta/Runtime'); diff --git a/src/backend/src/services/ai/video/TogetherVideoGenerationService.js b/src/backend/src/services/ai/video/TogetherVideoGenerationService.js index c6d0e4be..25434d18 100644 --- a/src/backend/src/services/ai/video/TogetherVideoGenerationService.js +++ b/src/backend/src/services/ai/video/TogetherVideoGenerationService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const APIError = require('../../../api/APIError'); const BaseService = require('../../BaseService'); const { TypedValue } = require('../../drivers/meta/Runtime'); diff --git a/src/backend/src/services/auth/ACLService.js b/src/backend/src/services/auth/ACLService.js index c81fa27e..32401580 100644 --- a/src/backend/src/services/auth/ACLService.js +++ b/src/backend/src/services/auth/ACLService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/Actor.js b/src/backend/src/services/auth/Actor.js index f86c3fa8..e8d62459 100644 --- a/src/backend/src/services/auth/Actor.js +++ b/src/backend/src/services/auth/Actor.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/AntiCSRFService.js b/src/backend/src/services/auth/AntiCSRFService.js index 289e2080..2e720c8e 100644 --- a/src/backend/src/services/auth/AntiCSRFService.js +++ b/src/backend/src/services/auth/AntiCSRFService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/AuthService.js b/src/backend/src/services/auth/AuthService.js index 0d5aa19f..7df1bedc 100644 --- a/src/backend/src/services/auth/AuthService.js +++ b/src/backend/src/services/auth/AuthService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/GroupService.js b/src/backend/src/services/auth/GroupService.js index 94289302..63b40a50 100644 --- a/src/backend/src/services/auth/GroupService.js +++ b/src/backend/src/services/auth/GroupService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/OTPService.js b/src/backend/src/services/auth/OTPService.js index 3db9b506..aa7eec9f 100644 --- a/src/backend/src/services/auth/OTPService.js +++ b/src/backend/src/services/auth/OTPService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/PermissionService.js b/src/backend/src/services/auth/PermissionService.js index ffec3027..d55d6f8a 100644 --- a/src/backend/src/services/auth/PermissionService.js +++ b/src/backend/src/services/auth/PermissionService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/TokenService.js b/src/backend/src/services/auth/TokenService.js index 49728247..f3f8864d 100644 --- a/src/backend/src/services/auth/TokenService.js +++ b/src/backend/src/services/auth/TokenService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/auth/VirtualGroupService.js b/src/backend/src/services/auth/VirtualGroupService.js index 0dd0cd85..f56b3f57 100644 --- a/src/backend/src/services/auth/VirtualGroupService.js +++ b/src/backend/src/services/auth/VirtualGroupService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/database/BaseDatabaseAccessService.js b/src/backend/src/services/database/BaseDatabaseAccessService.js index 6f32ae99..1493e90c 100644 --- a/src/backend/src/services/database/BaseDatabaseAccessService.js +++ b/src/backend/src/services/database/BaseDatabaseAccessService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/database/SqliteDatabaseAccessService.js b/src/backend/src/services/database/SqliteDatabaseAccessService.js index 98ca66b9..d67fa36f 100644 --- a/src/backend/src/services/database/SqliteDatabaseAccessService.js +++ b/src/backend/src/services/database/SqliteDatabaseAccessService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/database/constructs.js b/src/backend/src/services/database/constructs.js index 86748d46..6c34a7de 100644 --- a/src/backend/src/services/database/constructs.js +++ b/src/backend/src/services/database/constructs.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/database/consts.js b/src/backend/src/services/database/consts.js index 1a93d25b..43e24d67 100644 --- a/src/backend/src/services/database/consts.js +++ b/src/backend/src/services/database/consts.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/database/sqlite_setup/0025_system-user.dbmig.js b/src/backend/src/services/database/sqlite_setup/0025_system-user.dbmig.js index 547ff320..6f3b3391 100644 --- a/src/backend/src/services/database/sqlite_setup/0025_system-user.dbmig.js +++ b/src/backend/src/services/database/sqlite_setup/0025_system-user.dbmig.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* Add a user called `system`. diff --git a/src/backend/src/services/database/sqlite_setup/0026_user-groups.dbmig.js b/src/backend/src/services/database/sqlite_setup/0026_user-groups.dbmig.js index 93b758d2..1b0d9f20 100644 --- a/src/backend/src/services/database/sqlite_setup/0026_user-groups.dbmig.js +++ b/src/backend/src/services/database/sqlite_setup/0026_user-groups.dbmig.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} const { insertId: temp_group_id } = await write('INSERT INTO `group` (`uid`, `owner_user_id`, `extra`, `metadata`) ' + 'VALUES (?, ?, ?, ?)', [ diff --git a/src/backend/src/services/database/sqlite_setup/0027_emulator-app.dbmig.js b/src/backend/src/services/database/sqlite_setup/0027_emulator-app.dbmig.js index 86810990..ac984a72 100644 --- a/src/backend/src/services/database/sqlite_setup/0027_emulator-app.dbmig.js +++ b/src/backend/src/services/database/sqlite_setup/0027_emulator-app.dbmig.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"xai"}} const insert = async (tbl, subject) => { const keys = Object.keys(subject); diff --git a/src/backend/src/services/drivers/CoercionService.js b/src/backend/src/services/drivers/CoercionService.js index 91605abe..dfb1715d 100644 --- a/src/backend/src/services/drivers/CoercionService.js +++ b/src/backend/src/services/drivers/CoercionService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/drivers/DriverError.js b/src/backend/src/services/drivers/DriverError.js index 43852779..a5c24073 100644 --- a/src/backend/src/services/drivers/DriverError.js +++ b/src/backend/src/services/drivers/DriverError.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/drivers/DriverService.js b/src/backend/src/services/drivers/DriverService.js index 5f5c1d9f..998a54e3 100644 --- a/src/backend/src/services/drivers/DriverService.js +++ b/src/backend/src/services/drivers/DriverService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/drivers/DriverUsagePolicyService.js b/src/backend/src/services/drivers/DriverUsagePolicyService.js index eb0c1457..f7cabc5c 100644 --- a/src/backend/src/services/drivers/DriverUsagePolicyService.js +++ b/src/backend/src/services/drivers/DriverUsagePolicyService.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} const { PermissionUtil } = require('../auth/permissionUtils.mjs'); const BaseService = require('../BaseService'); diff --git a/src/backend/src/services/drivers/FileFacade.js b/src/backend/src/services/drivers/FileFacade.js index 37b4617c..afa28dfc 100644 --- a/src/backend/src/services/drivers/FileFacade.js +++ b/src/backend/src/services/drivers/FileFacade.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/drivers/meta/Construct.js b/src/backend/src/services/drivers/meta/Construct.js index bf182488..005a7ca4 100644 --- a/src/backend/src/services/drivers/meta/Construct.js +++ b/src/backend/src/services/drivers/meta/Construct.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/drivers/meta/Runtime.js b/src/backend/src/services/drivers/meta/Runtime.js index 1023542c..45f2c881 100644 --- a/src/backend/src/services/drivers/meta/Runtime.js +++ b/src/backend/src/services/drivers/meta/Runtime.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/drivers/types.js b/src/backend/src/services/drivers/types.js index 997b0dad..a9dab62c 100644 --- a/src/backend/src/services/drivers/types.js +++ b/src/backend/src/services/drivers/types.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/file-cache/FileCacheService.js b/src/backend/src/services/file-cache/FileCacheService.js index e58b30bd..4b37f4cb 100644 --- a/src/backend/src/services/file-cache/FileCacheService.js +++ b/src/backend/src/services/file-cache/FileCacheService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/file-cache/FileTracker.js b/src/backend/src/services/file-cache/FileTracker.js index 6e9bab88..34f8e34b 100644 --- a/src/backend/src/services/file-cache/FileTracker.js +++ b/src/backend/src/services/file-cache/FileTracker.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/fs/FSLockService.js b/src/backend/src/services/fs/FSLockService.js index 372828d4..692990cb 100644 --- a/src/backend/src/services/fs/FSLockService.js +++ b/src/backend/src/services/fs/FSLockService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/information/InformationService.js b/src/backend/src/services/information/InformationService.js index 1dfa190e..3614d3d0 100644 --- a/src/backend/src/services/information/InformationService.js +++ b/src/backend/src/services/information/InformationService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/periodic/FSEntryMigrateService.js b/src/backend/src/services/periodic/FSEntryMigrateService.js index 96523afb..fb01737a 100644 --- a/src/backend/src/services/periodic/FSEntryMigrateService.js +++ b/src/backend/src/services/periodic/FSEntryMigrateService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/sla/RateLimitService.js b/src/backend/src/services/sla/RateLimitService.js index d7a3060b..4865a705 100644 --- a/src/backend/src/services/sla/RateLimitService.js +++ b/src/backend/src/services/sla/RateLimitService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/sla/SLAService.js b/src/backend/src/services/sla/SLAService.js index 60985cf2..4b50fddb 100644 --- a/src/backend/src/services/sla/SLAService.js +++ b/src/backend/src/services/sla/SLAService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/thumbnails/HTTPThumbnailService.js b/src/backend/src/services/thumbnails/HTTPThumbnailService.js index b8aa81ab..15368daa 100644 --- a/src/backend/src/services/thumbnails/HTTPThumbnailService.js +++ b/src/backend/src/services/thumbnails/HTTPThumbnailService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/thumbnails/NAPIThumbnailService.js b/src/backend/src/services/thumbnails/NAPIThumbnailService.js index 50dae8d6..e373ebd3 100644 --- a/src/backend/src/services/thumbnails/NAPIThumbnailService.js +++ b/src/backend/src/services/thumbnails/NAPIThumbnailService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/thumbnails/PureJSThumbnailService.js b/src/backend/src/services/thumbnails/PureJSThumbnailService.js index 2855884b..82086ad8 100644 --- a/src/backend/src/services/thumbnails/PureJSThumbnailService.js +++ b/src/backend/src/services/thumbnails/PureJSThumbnailService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/src/services/web/UserProtectedEndpointsService.js b/src/backend/src/services/web/UserProtectedEndpointsService.js index 2297fefa..245fbe24 100644 --- a/src/backend/src/services/web/UserProtectedEndpointsService.js +++ b/src/backend/src/services/web/UserProtectedEndpointsService.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"xai"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/backend/tools/test.mjs b/src/backend/tools/test.mjs index a8ffd5d6..d628c383 100644 --- a/src/backend/tools/test.mjs +++ b/src/backend/tools/test.mjs @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/src/putility/src/libs/string.js b/src/putility/src/libs/string.js index 0e49542e..b6f0efc2 100644 --- a/src/putility/src/libs/string.js +++ b/src/putility/src/libs/string.js @@ -1,4 +1,4 @@ -// METADATA // {"def":"core.util.strutil","ai-params":{"service":"claude"},"ai-commented":{"service":"claude"}} +// METADATA // {"def":"core.util.strutil","ai-params":{"service":"claude"},"":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. diff --git a/tools/README.md b/tools/README.md index e74f2f05..41f89112 100644 --- a/tools/README.md +++ b/tools/README.md @@ -26,16 +26,6 @@ Checks for missing translations in `src/gui/src/i18n/translations` ## Utilities -### `comment-writer` - -Generates comments in source files using generative AI via Puter's AI drivers. - -To use this: -- `cd` into the `tools/comment-writer` directory -- Edit `config.json` and replace `auth_token` with your own -- Run with a specified direcotry; for example: - `node main.js ../../src/backend/services` - ### `module-docgen` Document a module. @@ -49,5 +39,5 @@ comments. ### file-walker -This is used by `license-headers` and `comment-writer` to walk through +This is used by `license-headers` to walk through source files. diff --git a/tools/check-translations.js b/tools/check-translations.js index b7d93eb9..e60166c6 100644 --- a/tools/check-translations.js +++ b/tools/check-translations.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/tools/comment-parser/main.js b/tools/comment-parser/main.js index 53272239..2c46eabf 100644 --- a/tools/comment-parser/main.js +++ b/tools/comment-parser/main.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/tools/comment-writer/config.json b/tools/comment-writer/config.json deleted file mode 100644 index 882ad664..00000000 --- a/tools/comment-writer/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "api_url": "https://api.puter.local", - "auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0IjoicyIsInYiOiIwLjAuMCIsInUiOiJoenFEOSsvYVFpZW9HbmdWc1laMFZRPT0iLCJ1dSI6Ii90RFFPU0dJU3lxMU9TSmg5ZThic2c9PSIsImlhdCI6MTczMjg4OTIwNn0.i4s3H2jvkvPKVW-ji83Gn8nUFBH7NIB4NsprEDgU89Y" -} diff --git a/tools/comment-writer/main.js b/tools/comment-writer/main.js deleted file mode 100644 index 7aacd661..00000000 --- a/tools/comment-writer/main.js +++ /dev/null @@ -1,883 +0,0 @@ -/* - * Copyright (C) 2024-present Puter Technologies Inc. - * - * This file is part of Puter. - * - * Puter is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -// METADATA // {"ai-params":{"service":"claude"},"comment-verbosity": "high","ai-commented":{"service":"claude"}} -const enq = require('enquirer'); -const wrap = require('word-wrap'); -const dedent = require('dedent'); -const axios = require('axios'); - -const { walk, EXCLUDE_LISTS } = require('../file-walker/test'); - -const https = require('https'); -const fs = require('fs'); -const path_ = require('path'); - -const FILE_EXCLUDES = [ - /^\.git/, - /^node_modules\//, - /\/node_modules$/, - /^node_modules$/, - /package-lock\.json/, - /^src\/dev-center\/js/, - /src\/backend\/src\/public\/assets/, - /^src\/gui\/src\/lib/, - /^eslint\.config\.js$/, -]; - -const models_to_try = [ - { - service: 'openai-completion', - model: 'gpt-4o', - }, - { - service: 'claude', - }, - { - service: 'xai', - }, - // === Models that didn't work for this === - // Sometimes outputs source lines despite "no surrounding text" instruction - // { - // service: 'openai-completion', - // model: 'gpt-4o-mini', - // }, - // Was the first to break a source file - // { - // service: 'together-ai', - // model: 'meta-llama/Meta-Llama-3-70B-Instruct-Turbo', - // }, - // Occasionally fails spectacularly - // { - // service: 'mistral', - // model: 'mistral-large-latest', - // } -]; - -const axi = axios.create({ - httpsAgent: new https.Agent({ - rejectUnauthorized: false, - }), -}); - -const cwd = process.cwd(); -const context = {}; - -context.config = JSON.parse(fs.readFileSync('config.json')); - -/** -* @class AI -* @description A class that handles interactions with the Puter API for AI-powered chat completions. -* This class provides an interface to make requests to the Puter chat completion service, -* handling authentication and message formatting. It supports various AI models through -* the puter-chat-completion driver interface. -*/ -class AI { - constructor (context) { - // - } - - /** - * Sends a chat completion request to the Puter API and returns the response message. - * - * @param {Object} params - The parameters for the completion request - * @param {Array} params.messages - Array of message objects to send to the API - * @param {Object} params.driver_params - Additional parameters for the driver interface - * @returns {Promise} The response message from the API - * - * Makes a POST request to the configured API endpoint with the provided messages and - * driver parameters. Authenticates using the configured auth token and returns the - * message content from the response. - */ - async complete ({ messages, driver_params }) { - const response = await axi.post(`${context.config.api_url}/drivers/call`, { - interface: 'puter-chat-completion', - method: 'complete', - ...driver_params, - args: { - messages, - }, - }, { - headers: { - 'Content-Type': 'application/json', - Origin: 'https://puter.local', - Authorization: `Bearer ${context.config.auth_token}`, - }, - }); - - return response.data.result.message; - } -} - -const ai_message_to_lines = text => { - // Extract text content from message object, handling various formats - while ( typeof text === 'object' ) { - if ( Array.isArray(text) ) text = text[0]; - else if ( text.content ) text = text.content; - else if ( text.text ) text = text.text; - else { - console.log('Invalid message object', text); - throw new Error('Invalid message object'); - } - } - return text.split('\n'); -}; - -/** -* @class JavascriptFileProcessor -* @description A class responsible for processing JavaScript source files to identify and extract -* various code definitions and structures. It analyzes the file content line by line using -* configurable pattern matchers to detect classes, methods, functions, control structures, -* and constants. The processor maintains context and parameters for consistent processing -* across multiple files. -*/ -class JavascriptFileProcessor { - constructor (context, parameters) { - this.context = context; - this.parameters = parameters; - } - - process (lines) { - const definitions = []; - // Collect definitions by iterating through each line - for ( let i = 0 ; i < lines.length ; i++ ) { - const line = lines[i]; - // Iterate through each line in the file - for ( const matcher of this.parameters.definition_matchers ) { - const match = matcher.pattern.exec(line); - console.log('match object', match); - - // Check if there is a match for any of the definition patterns - if ( match ) { - definitions.push({ - ...matcher.handler(match), - line: i, - }); - break; - } - } - } - return { definitions }; - } -} - -const js_processor = new JavascriptFileProcessor(context, { - definition_matchers: [ - // { - // name: 'require', - // pattern: /const (\w+) = require\(['"](.+)['"]\);/, - // handler: (match) => { - // const [ , name, path ] = match; - // return { - // type: 'require', - // name, - // path, - // }; - // } - // }, - { - name: 'class', - pattern: /class (\w+)(?: extends (.+))? {/, - handler: (match) => { - const [ , name, parent ] = match; - return { - type: 'class', - name, - parent, - }; - }, - }, - { - name: 'if', - pattern: /^\s*if\s*\(.*\)\s*{/, - /** - * Matches code patterns against a line to identify if it's an if statement - * @param {string} line - The line of code to check - * @returns {Object} Returns an object with type: 'if' if pattern matches - * @description Identifies if statements by matching the pattern /^\s*if\s*\(.*\)\s*{/ - * This handles basic if statement syntax with optional whitespace and any condition - * within the parentheses - */ - handler: () => { - return { type: 'if' }; - }, - }, - { - name: 'while', - pattern: /^\s*while\s*\(.*\)\s*{/, - /** - * Matches lines that begin with a while loop structure. - * @param {void} - Takes no parameters - * @returns {Object} Returns an object with type: 'while' to indicate this is a while loop definition - * @description Used by the definition matcher system to identify while loop structures in code. - * The pattern looks for lines that start with optional whitespace, followed by 'while', - * followed by parentheses containing any characters, and ending with an opening curly brace. - */ - handler: () => { - return { type: 'while' }; - }, - }, - { - name: 'for', - pattern: /^\s*for\s*\(.*\)\s*{/, - /** - * Matches for loop patterns in code and returns a 'for' type definition. - * Used by the JavascriptFileProcessor to identify for loop structures. - * @returns {Object} An object with type 'for' indicating a for loop was found - */ - handler: () => { - return { type: 'for' }; - }, - }, - { - name: 'method', - pattern: /^\s*async .*\(.*\).*{/, - handler: (match) => { - const [ , name ] = match; - return { - async: true, - type: 'method', - name, - }; - }, - }, - { - name: 'method', - pattern: /^\s*[A-Za-z_\$]+.*\(\).*{/, - handler: (match) => { - const [ , name ] = match; - // Extract method name from match array and handle special cases for 'if' and 'while' - if ( name === 'if' ) { - return { type: 'if' }; - } - // Check if the name is 'while' and return appropriate type - if ( name === 'while' ) { - return { type: 'while' }; - } - return { - type: 'method', - name, - }; - }, - }, - { - name: 'function', - pattern: /^\s*function .*\(.*\).*{/, - handler: (match) => { - const [ , name ] = match; - return { - type: 'function', - scope: 'function', - name, - }; - }, - }, - { - name: 'function', - pattern: /const [A-Za-z_]+\s*=\s*\(.*\)\s*=>\s*{/, - handler: (match) => { - const [ , name, args ] = match; - return { - type: 'function', - scope: 'lexical', - name, - args: (args ?? '').split(',').map(arg => arg.trim()), - }; - }, - }, - { - name: 'const', - // pattern to match only uppercase-lettered variable names - pattern: /const ([A-Z_]+) = (.+);/, - handler: (match) => { - const [ , name, value ] = match; - return { - type: 'const', - name, - value, - }; - }, - }, - ], -}); - -/** -* Creates a limited view of the code file by showing specific ranges around key lines. -* Takes an array of lines and key places (anchors with context ranges) and returns -* a formatted string showing relevant code sections with line numbers and descriptions. -* Merges overlapping ranges to avoid duplication. -* @param {string[]} lines - Array of code lines from the file -* @param {Object[]} key_places - Array of objects defining important locations and context -* @returns {string} Formatted string containing the limited code view -*/ -const create_limited_view = (lines, key_places) => { - // Sort key places by starting line - key_places.sort((a, b) => { - const a_start = Math.max(0, a.anchor - a.lines_above); - const b_start = Math.max(0, b.anchor - b.lines_above); - return a_start - b_start; - }); - - const visible_ranges = []; - - // Create visible ranges for each key place - // Create visible ranges for each key place in the limited view - for ( const key_place of key_places ) { - const anchor = key_place.anchor; - const lines_above = key_place.lines_above; - const lines_below = key_place.lines_below; - - const start = Math.max(0, anchor - lines_above); - const end = Math.min(lines.length, anchor + lines_below); - - visible_ranges.push({ - anchor: key_place.anchor, - comment: key_place.comment, - start, - end, - }); - } - - // Merge overlapping visible ranges - const merged_ranges = []; - - // Iterate through each visible range and merge overlapping ones - for ( const range of visible_ranges ) { - range.comments = [{ - anchor: range.anchor, - text: range.comment, - }]; - - // If no merged ranges exist yet, add this range as the first one - if ( ! merged_ranges.length ) { - merged_ranges.push(range); - continue; - } - - const last_range = merged_ranges[merged_ranges.length - 1]; - - // Check if the current range overlaps with the last range in merged_ranges - if ( last_range.end >= range.start ) { - last_range.end = Math.max(last_range.end, range.end); - last_range.comments.push({ - anchor: range.anchor, - text: range.comment, - }); - } else { - merged_ranges.push(range); - } - } - - // Create the limited view, adding line numbers and comments - let limited_view = ''; - - let previous_visible_range = null; - // Iterate through visible ranges and add line numbers and comments - for ( let i = 0 ; i < lines.length ; i++ ) { - const line = lines[i]; - - let visible_range = null; - - if ( i === 22 ) debugger; - - // Iterate through merged ranges to find which range contains the current line - for ( const range of merged_ranges ) { - // Check if current line is within any of the merged ranges - if ( i >= range.start && i < range.end ) { - visible_range = range; - break; - } - } - - // console.log('visible_range', visible_range, i); - - // Check if this line is visible in the current range - if ( visible_range === null ) { - continue; - } - - // Check if visible range is different from previous range - if ( visible_range !== previous_visible_range ) { - if ( i !== 0 ) limited_view += '\n'; - // Check if we're starting a new visible range and add appropriate header - if ( visible_range.comments.length === 1 ) { - const comment = visible_range.comments[0]; - limited_view += `window around line ${comment.anchor}: ${comment.text}\n`; - } else { - limited_view += `window around lines ${visible_range.comments.length} key lines:\n`; - // Iterate through visible range comments and add them to the limited view - for ( const comment of visible_range.comments ) { - limited_view += `- line ${comment.anchor}: ${comment.text}\n`; - } - } - } - - previous_visible_range = visible_range; - - limited_view += `${i + 1}: ${line}\n`; - } - - return limited_view; -}; - -/** - * Inject comments into lines - * @param {*} lines - Array of original file lines - * @param {*} comments - Array of comment objects - * - * Comment object structure: - * { - * position: 0, // Position in lines array - * lines: [ 'comment line 1', 'comment line 2', ... ] - * } - */ -/** -* Injects comments into an array of code lines at specified positions -* @param {string[]} lines - Array of original file lines -* @param {Object[]} comments - Array of comment objects specifying where and what to inject -* @param {number} comments[].position - Line number where comment should be inserted -* @param {string[]} comments[].lines - Array of comment text lines to insert -*/ -const inject_comments = (lines, comments) => { - // Sort comments in reverse order - comments.sort((a, b) => b.position - a.position); - - // Inject comments into lines - // Inject comments into lines array based on comment objects - for ( const comment of comments ) { - // AI might have been stupid and added a comment above a blank line, - // despite that we told it not to do that. So we need to adjust the position. - // Adjust comment position if it would be above a blank line - while ( comment.position < lines.length && !lines[comment.position].trim() ) { - comment.position++; - } - - const indentation = lines[comment.position].match(/^\s*/)[0]; - const comment_lines = comment.lines.map(line => `${indentation}${line}`); - lines.splice(comment.position, 0, ...comment_lines); - - // If the first line of the comment lines starts with '/*`, ensure there is - // a blank line above it. - - // Check if comment starts with '/*' to ensure proper spacing above JSDoc comments - if ( comment_lines[0].trim().startsWith('/*') ) { - // Check if comment starts with JSDoc style to add blank line above - if ( comment.position > 0 && lines[comment.position - 1].trim() === '' ) { - lines.splice(comment.position, 0, ''); - } - } - } -}; - -const textutil = {}; -textutil.format = text => { - return wrap(dedent(text), { - width: 80, - indent: '| ', - }); -}; - -context.ai = new AI(context); - -/** -* Creates a new AI instance for handling chat completions -* @param {Object} context - The application context object -* @description Initializes an AI instance that interfaces with the Puter chat completion API. -* The AI instance is used to generate comments and other text responses through the -* chat completion interface. -*/ -const main = async () => { - // const message = await context.ai.complete({ - // messages: [ - // { - // role: 'user', - // content: ` - // Introduce yourself as the Puter Comment Writer. You are an AI that will - // write comments in code files. A file walker will be used to iterate over - // the source files and present them one at a time, and the user will accept, - // reject, or request edits interactively. For each new file, a clean AI - // context will be created. - // `.trim() - // } - // ] - // }); - // const intro = message.content; - const intro = textutil.format(` - Hello! I am the Puter Comment Writer, an AI designed to enhance your code files with meaningful comments. As you walk through your source files, I will provide insights, explanations, and clarifications tailored to the specific content of each file. You can choose to accept my comments, request edits for more clarity or detail, or even reject them if they don't meet your needs. Each time we move to a new file, I'll start fresh with a clean context, ready to help you improve your code documentation. Let's get started! - `); - console.log(intro); - - console.log(`Enter a path relative to: ${process.cwd()}`); - console.log('arg?', process.argv[2]); - let rootpath = process.argv[2] ? { path: process.argv[2] } : await enq.prompt({ - type: 'input', - name: 'path', - message: 'Enter path:', - }); - - rootpath = path_.resolve(rootpath.path); - console.log('rootpath:', rootpath); - - const walk_iter = walk({ - excludes: FILE_EXCLUDES, - }, rootpath); - - let i = 0, limit = undefined; - for await ( const value of walk_iter ) { - if ( limit !== undefined && i >= limit ) break; - i++; - - // Exit after processing 12 files - if ( value.is_dir ) { - console.log('directory:', value.path); - continue; - } - // Check if file is not a JavaScript file and skip it - if ( ! value.name.endsWith('.js') ) { - continue; - } - console.log('file:', value.path); - const lines = fs.readFileSync(value.path, 'utf8').split('\n'); - - let metadata, has_metadata_line = false; - // Check if metadata line exists and parse it - if ( lines[0].startsWith('// METADATA // ') ) { - has_metadata_line = true; - metadata = JSON.parse(lines[0].slice('// METADATA // '.length)); - // Check if metadata exists and has been parsed from the first line - if ( metadata['ai-commented'] ) { - console.log('File was already commented by AI; skipping...'); - continue; - } - } else metadata = {}; - - let refs = null; - // Check if there are any references in the metadata - if ( metadata['ai-refs'] ) { - const relative_file_paths = metadata['ai-refs']; - // name of file is the key, value is the contents - const references = {}; - - let n = 0; - // Iterate through each relative file path in the metadata - for ( const relative_file_path of relative_file_paths ) { - n++; - const full_path = path_.join(path_.dirname(value.path), relative_file_path); - const ref_text = fs.readFileSync(full_path, 'utf8'); - references[relative_file_path] = ref_text; - } - - // Check if there are any references in the metadata and process them - if ( n === 1 ) { - refs = dedent(` - The following documentation contains relevant information about the code. - The code will follow after this documentation. - `); - - refs += `\n\n${ dedent(references[Object.keys(references)[0]])}`; - } else if ( n > 2 ) { - refs = dedent(` - The following documentation contains relevant information about the code. - The code will follow after a number of documentation files. - `); - - // Iterate through each key in the references object - for ( const key of Object.keys(references) ) { - refs += `\n\n${ dedent(references[key])}`; - } - } - } - - const action = limit === undefined ? await enq.prompt({ - type: 'select', - name: 'action', - message: 'Select action:', - choices: [ - 'generate', - 'skip', - 'all', - 'limit', - 'exit', - ], - }) : 'generate'; - // const action = 'generate'; - - // Check if user wants to exit the program - if ( action.action === 'exit' ) { - break; - } - - // Skip if user chose to exit - if ( action.action === 'skip' ) { - continue; - } - - if ( action.action === 'limit' ) { - limit = await enq.prompt({ - type: 'input', - name: 'limit', - message: 'Enter limit:', - }); - i = 1; - limit = Number(limit.limit); - } - - if ( action.action === 'all' ) { - i = 1; - limit = Infinity; - } - - const { definitions } = js_processor.process(lines); - const key_places = []; - key_places.push({ - anchor: 0, - lines_above: 2, - lines_below: 200, - comment: `Top of file: ${value.path}`, - }); - key_places.push({ - anchor: lines.length - 1, - lines_above: 200, - lines_below: 2, - comment: `Bottom of ${value.name}`, - }); - // Iterate through each definition and add comments based on its type - for ( const definition of definitions ) { - key_places.push({ - anchor: definition.line, - lines_above: 40, - lines_below: 40, - comment: `${definition.type}.`, - }); - } - let limited_view = create_limited_view(lines, key_places); - console.log('--- view ---'); - console.log(limited_view); - - const comments = []; - // comments.push({ - // position: 0, - // }); - // for ( const definition of definitions ) { - // comments.push({ - // position: definition.line, - // definition, - // }); - // } - - // This was worth a try but the LLM is very bad at this - /* - const message = await context.ai.complete({ - messages: [ - { - role: 'user', - content: dedent(` - Respond with comma-separated numbers only, with no surrounding text. - Please write the numbers of the lines above which a comment should be added. - Do not include numbers of lines that are blank, already have comments, or are part of a comment. - Prefer comment locations in a higher level scope, such as a classes, function definitions and class methods, - `).trim() + '\n\n' + limited_view - } - ] - }); - const numbers = message.content.split(',').map(n => Number(n)); - - // Iterate through each number in the array of line numbers - for ( const n of numbers ) { - // Check if the line number is valid and not NaN before adding comment - if ( Number.isNaN(n) ) { - console.log('Invalid number:', n); - continue; - } - - comments.push({ - position: n - 1, - }); - } - */ - - // Iterate through each definition to add comments - for ( const def of definitions ) { - console.log('def?', def); - let instruction = ''; - - // Check if the line starts with an if statement and has curly braces - if ( def.type === 'class' ) { - instruction = dedent(` - Since the comment is going above a class definition, please write a JSDoc style comment. - Make the comment as descriptive as possible, including the class name and its purpose. - `); - } - - // Check if comment is for an if/while/for control structure - if ( def.type === 'if' || def.type === 'while' || def.type === 'for' ) { - if ( metadata['comment-verbosity'] !== 'high' ) continue; - instruction = dedent(` - Since the comment is going above a control structure, please write a short concise comment. - The comment should be only one or two lines long, and should use line comments. - `); - } - - // Check if comment is going above a method definition - if ( def.type === 'method' ) { - instruction = dedent(` - Since the comment is going above a method, please write a JSDoc style comment. - The comment should include a short concise description of the method's purpose, - notes about its behavior, and any parameters or return values. - `); - } - - // Check if comment is for a constant definition and set appropriate instruction - if ( def.type === 'const' ) { - instruction = dedent(` - Since the comment is going above a constant definition, please write a comment that explains - the purpose of the constant and how it is used in the code. - The comment should be only one or two lines long, and should use line comments. - `); - } - - comments.push({ - position: def.line, - instruction: instruction, - }); - } - - const driver_params = metadata['ai-params'] ?? - models_to_try[Math.floor(Math.random() * models_to_try.length)]; - - // Iterate through each comment object to add comments to the code - for ( const comment of comments ) { - // This doesn't work very well yet - /* - const ranges_message = await context.ai.complete({ - messages: [ - { - role: 'user', - content: dedent(` - Please only respond with comma-separated number ranges in this format with no surrounding text: - 11-21, 25-30, 35-40 - - You may also respond with "none". - - A comment will be added above line ${comment.position} in the code which follows. - You are seeing a limited view of the code that includes chunks around interesting lines. - Please specify ranges of lines that might provide useful context for this comment. - Do not include in any range lines which are already visible in the limited view. - Avoid specifying more than a couple hundred lines. - `).trim() + '\n\n' + limited_view - } - ] - }); - - // Check if the comment lines start with '/*' and ensure there's a blank line above it - if ( ranges_message.content.trim() !== 'none' ) { - const ranges = ranges_message.content.split(',').map(range => { - const [ start, end ] = range.split('-').map(n => Number(n)); - return { start, end }; - }); - - // Iterate through ranges and add key places for each range - for ( const range of ranges ) { - key_places.push({ - anchor: range.start, - lines_above: 0, - lines_below: range.end - range.start, - comment: `Requested range by AI agent: ${range.start}-${range.end}` - }); - } - - limited_view = create_limited_view(lines, key_places); - console.log('--- updated view ---'); - console.log(limited_view); - } - */ - - const prompt = - `${dedent(` - Please write a comment to be added above line ${comment.position}. - Do not write any surrounding text; just the comment itself. - Please include comment markers. If the comment is on a class, function, or method, please use jsdoc style. - The code is written in JavaScript. - `).trim() + - (refs ? `\n\n${ dedent(refs)}` : '') + - (comment.instruction ? `\n\n${ dedent(comment.instruction)}` : '') - }\n\n${ limited_view}` - ; - - // console.log('prompt:', prompt); - - const message = await context.ai.complete({ - messages: [ - { - role: 'user', - content: prompt, - }, - ], - driver_params, - }); - console.log('message:', message); - comment.lines = ai_message_to_lines(message.content); - - // Remove leading and trailing blank lines - // Remove leading and trailing blank lines from comment lines array - while ( comment.lines.length && !comment.lines[0].trim() ) { - comment.lines.shift(); - } - // Remove trailing blank lines from comment lines array - while ( comment.lines.length && !comment.lines[comment.lines.length - 1].trim() ) { - comment.lines.pop(); - } - - // Remove leading "```" or "```" lines - // Remove leading "```" or "```" lines - if ( comment.lines[0].startsWith('```') ) { - comment.lines.shift(); - } - - // Remove trailing "```" lines - // Remove trailing "```" lines if present - if ( comment.lines[comment.lines.length - 1].startsWith('```') ) { - comment.lines.pop(); - } - - comment.lines = dedent(comment.lines.join('\n')).split('\n'); - } - - inject_comments(lines, comments); - - console.log('--- lines ---'); - console.log(lines); - - // Check if file has metadata line and remove it before adding new metadata - if ( has_metadata_line ) { - lines.shift(); - } - - lines.unshift(`// METADATA // ${ JSON.stringify({ - ...metadata, - 'ai-commented': driver_params, - })}`); - - // Write the modified file - fs.writeFileSync(value.path, lines.join('\n')); - } - -}; - -main(); diff --git a/tools/comment-writer/package.json b/tools/comment-writer/package.json deleted file mode 100644 index 8b3eb793..00000000 --- a/tools/comment-writer/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "comment-writer", - "version": "1.0.0", - "main": "main.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "AGPL-3.0-only", - "description": "", - "dependencies": { - "axios": "^1.7.8", - "console-table-printer": "^2.12.1", - "dedent": "^1.5.3", - "diff-match-patch": "^1.0.5", - "enquirer": "^2.4.1", - "js-levenshtein": "^1.1.6", - "word-wrap": "^1.2.5", - "yaml": "^2.4.5" - } -} diff --git a/tools/gen-release-notes.js b/tools/gen-release-notes.js index ab438a99..71095f7a 100644 --- a/tools/gen-release-notes.js +++ b/tools/gen-release-notes.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/tools/license-headers/main.js b/tools/license-headers/main.js index 48589be0..7879624d 100644 --- a/tools/license-headers/main.js +++ b/tools/license-headers/main.js @@ -1,4 +1,3 @@ -// METADATA // {"ai-commented":{"service":"claude"}} /* * Copyright (C) 2024-present Puter Technologies Inc. * diff --git a/tools/module-docgen/defs.js b/tools/module-docgen/defs.js index 7b7b99c7..90e2c881 100644 --- a/tools/module-docgen/defs.js +++ b/tools/module-docgen/defs.js @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -// METADATA // {"ai-commented":{"service":"claude"}} const dedent = require('dedent'); const doctrine = require('doctrine');