WARNING: proceeding, even though we could not create PATH aliases: Refusing to create helper binaries under temporary dir "/tmp" (codex_home: AbsolutePathBuf("/tmp/codex-home"))
Reading additional input from stdin...
{"type":"thread.started","thread_id":"01a0c67c-8d4c-7f02-a9e4-a8d07e93b1d9"}
{"type":"turn.started"}
2026-09-22T00:20:46.823037Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
2026-09-22T00:20:46.991559Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
2026-09-22T00:20:47.315898Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
{"type":"error","message":"Reconnecting... 2/5 (unexpected status 404 Not Found: d9\r\n{\"error\":{\"message\":\"LlmProxy::Error: Unknown request URL: GET /api/llm_proxy/openai/v1/responses.\",\"type\":\"invalid_request_error\",\"code\":\"unknown_url\",\"context\":{\"request_id\":\"4f58e4dc-38c2-4780-8d10-824add625df0\"}}}, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses, cf-ray: a3ed2548a931aa06-BOS, request id: 4f58e4dc-38c2-4780-8d10-824add625df0)"}
2026-09-22T00:20:47.930840Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
{"type":"error","message":"Reconnecting... 3/5 (unexpected status 404 Not Found: d9\r\n{\"error\":{\"message\":\"LlmProxy::Error: Unknown request URL: GET /api/llm_proxy/openai/v1/responses.\",\"type\":\"invalid_request_error\",\"code\":\"unknown_url\",\"context\":{\"request_id\":\"57939239-02ac-4ac1-8517-3e9c764869c0\"}}}, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses, cf-ray: a3ed254c7bce8f76-BOS, request id: 57939239-02ac-4ac1-8517-3e9c764869c0)"}
2026-09-22T00:20:48.838645Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
{"type":"error","message":"Reconnecting... 4/5 (unexpected status 404 Not Found: d9\r\n{\"error\":{\"message\":\"LlmProxy::Error: Unknown request URL: GET /api/llm_proxy/openai/v1/responses.\",\"type\":\"invalid_request_error\",\"code\":\"unknown_url\",\"context\":{\"request_id\":\"72c48ef4-4ae0-43d9-93ed-73037e8ecd95\"}}}, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses, cf-ray: a3ed25521d3cbff7-BOS, request id: 72c48ef4-4ae0-43d9-93ed-73037e8ecd95)"}
2026-09-22T00:20:50.703672Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
{"type":"error","message":"Reconnecting... 5/5 (unexpected status 404 Not Found: d9\r\n{\"error\":{\"message\":\"LlmProxy::Error: Unknown request URL: GET /api/llm_proxy/openai/v1/responses.\",\"type\":\"invalid_request_error\",\"code\":\"unknown_url\",\"context\":{\"request_id\":\"be680c84-2141-4691-aaa2-d69ca77f7306\"}}}, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses, cf-ray: a3ed255d9d764306-BOS, request id: be680c84-2141-4691-aaa2-d69ca77f7306)"}
2026-09-22T00:20:53.819717Z ERROR codex_api::endpoint::responses_websocket: failed to connect to websocket: HTTP error: 404 Not Found, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses
{"type":"item.completed","item":{"id":"item_0","type":"error","message":"Falling back from WebSockets to HTTPS transport. unexpected status 404 Not Found: d9\r\n{\"error\":{\"message\":\"LlmProxy::Error: Unknown request URL: GET /api/llm_proxy/openai/v1/responses.\",\"type\":\"invalid_request_error\",\"code\":\"unknown_url\",\"context\":{\"request_id\":\"43c287b6-1ec3-4f24-9bc5-a81ecef32035\"}}}, url: wss://app-llmproxy.dataannotation.tech/api/llm_proxy/openai/v1/responses, cf-ray: a3ed25713bb33459-BOS, request id: 43c287b6-1ec3-4f24-9bc5-a81ecef32035"}}
{"type":"item.completed","item":{"id":"item_1","type":"agent_message","text":"I’ll trace how `pro_v2` clone jobs are validated, queued, and processed, then patch the failure point and run focused tests."}}
{"type":"item.started","item":{"id":"item_2","type":"command_execution","command":"/bin/bash -lc \"pwd && rg --files -g '\"'!node_modules'\"' -g '\"'!vendor'\"' | sed -n '1,240p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_2","type":"command_execution","command":"/bin/bash -lc \"pwd && rg --files -g '\"'!node_modules'\"' -g '\"'!vendor'\"' | sed -n '1,240p'\"","aggregated_output":"/workspace\nvoice-synthsizer-job-handler/salutation/salutation_service.js\nvoice-synthsizer-job-handler/salutation/salutation_model.js\nvoice-synthsizer-job-handler/salutation/index.js\nvoice-synthsizer-job-handler/pm2-development.yml\nvoice-synthsizer-job-handler/recording/recording_model.js\nvoice-synthsizer-job-handler/recording/index.js\nvoice-synthsizer-job-handler/index.js\nvoice-synthsizer-job-handler/package.json\nvoice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\nvoice-synthsizer-job-handler/recording_salutation/index.js\nvoice-synthsizer-job-handler/pm2-production.yml\npackage.json\nvoice-synthsizer-job-handler/job/job_service.js\nvoice-synthsizer-job-handler/job/index.js\nvoice-synthsizer-job-handler/job/job_model.js\nvoice-synthsizer-job-handler/user_audio_profile/index.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\nrequirements.dev.local.txt\napp/services/s3/index.js\napp/services/s3/s3_service.js\nvoice-cloning/train_config.py\nvoice-cloning/score_models.py\nvoice-cloning/minimize_cloned_voice_model.py\nvoice-cloning/synthesize_speech.py\nvoice-cloning/utils/transcription_utils.py\nvoice-cloning/utils/matching_utils.py\nvoice-cloning/utils/synthesize_utils.py\nvoice-cloning/utils/scoring_utils.py\nvoice-cloning/train_multispeaker_baseline_model.py\napp/services/utils/index.js\napp/services/utils/deleteFile.js\napp/services/utils/logService.js\napp/services/utils/bugsnag.js\nvoice-cloning/assets/speaker_encoder_model/model_se.pth.tar\napp/services/voice_cloning/voice_cloning_model.js\nvoice-cloning/assets/speaker_encoder_model/config_se.json\nvoice-cloning/assets/wgnd_2_0_unique_names_only.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\nvoice-cloning/assets/wgnd_2_0_sources.csv.gz\nvoice-cloning/prepare_datasets.py\nvoice-cloning/score_salutation.py\napp/services/voice_cloning/index.js\napp/services/voice_cloning/voice_cloning_service.js\nvoice-cloning/docs/potion-voice-cloning_Installation_Guide.md\nvoice-cloning/score_cloned_voice.py\nvoice-cloning/clone_voice.py\napp/services/sqs/index.js\napp/services/sqs/sqs_service.js\nrequirements.prod.cpu.txt\nrequirements.prod.gpu.txt\nrequirements.txt\nREADME.md\nrequirements.dev.txt\nvoice-cloning-job-handler/pm2-development.yml\nvoice-cloning-job-handler/index.js\nvoice-cloning-job-handler/package.json\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nvoice-cloning-job-handler/voice_cloning/index.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nvoice-cloning-job-handler/pm2-production.yml\nvoice-cloning-job-handler/user_audio_profile/index.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_3","type":"command_execution","command":"/bin/bash -lc \"git status --short && rg -n \\\"pro_v2|pro-v2|tier|clone\\\" . -g '\"'!voice-cloning/assets/**'\"' -g '\"'!*.csv'\"' -g '\"'!*.gz'\"'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_3","type":"command_execution","command":"/bin/bash -lc \"git status --short && rg -n \\\"pro_v2|pro-v2|tier|clone\\\" . -g '\"'!voice-cloning/assets/**'\"' -g '\"'!*.csv'\"' -g '\"'!*.gz'\"'\"","aggregated_output":"./voice-cloning/score_models.py:69:        print(\"Computing similarity score for a given voice model (cloned voice) wrt. a given set of voice recordings (original voice):\")\n./voice-cloning/score_models.py:109:    # score the cloned voice (wrt. similarity to recorded voice)\n./voice-cloning/score_models.py:174:                # speaker embeddings provided, use it together with the given model (cloned or baseline model) to synthesize speech\n./voice-cloning/minimize_cloned_voice_model.py:21:        description = \"Code to minimise (i.e., remove optimiser & discriminator) a cloned voice model\")\n./voice-cloning/minimize_cloned_voice_model.py:23:        help = \"Path to directory storing cloned voice model and the corresponding configuration and speaker files\")\n./voice-cloning/minimize_cloned_voice_model.py:25:        help = \"Name of the (best) cloned voice model\")\n./voice-cloning/minimize_cloned_voice_model.py:27:        help = \"Name of the config file for the cloned voice model\")\n./voice-cloning/minimize_cloned_voice_model.py:48:# save a lightweight (i.e., without optimiser and discriminator) model of the given cloned voice and corresponding config assets\n./voice-cloning/minimize_cloned_voice_model.py:103:        print(\"Completed minimising cloned voice model. The resulting (modified) assets can be found at:\")\n./voice-cloning/synthesize_speech.py:22:        help = \"Path to cloned voice model\")\n./voice-cloning/synthesize_speech.py:24:        help = \"Path to config file for the cloned voice model\")\n./voice-cloning/utils/synthesize_utils.py:31:    # load cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:254:1. Create a virtual potion-voice-cloner working environment\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:269:    (potion-voice_venv) $ git clone https://github.com/potion/potion-voice.git\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:292:    (potion-voice_venv) $ git clone --depth 1 --branch v0.10.2 https://github.com/coqui-ai/TTS\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:389:1. To clone a new voice, you need at least 10 voice samples (ideally 30). Those voice recordings (and their corresponding transcription files) have to be arranged as follows (and compressed into a `.tgz`, `.tbz` or `.zip` archive):\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:442:    (potion-voice_venv) $ python3 clone_voice.py [-h] --baseline_model_path BASELINE_MODEL_PATH --speaker_dataset_path SPEAKER_DATASET_PATH --speaker_embeddings_path SPEAKER_EMBEDDINGS_PATH [--output_path OUTPUT_PATH] [--batch_size BATCH_SIZE] [--max_epochs MAX_EPOCHS] [--use_cpu] [--output_format {txt,json}]\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:444:    Code to clone a voice from a given set of voice samples and a multi-speaker baseline model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:470:    results/cloned-voices/vits_potion_clone-December-28-2022_10+52AM-1327031/\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:474:    |-- clone_voice.py ......................... copy of the clone_voice script used in this run\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:514:    (potion-voice_venv) $ python3 minimize_cloned_voice_model.py [-h] --voice_model_asset_path VOICE_MODEL_ASSET_PATH [--voice_model_name VOICE_MODEL_NAME] [--voice_model_config_name VOICE_MODEL_CONFIG_NAME] [--minimise_suffix MINIMISE_SUFFIX] [--overwrite_assets] [--output_format {txt,json}]\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:516:    Code to minimise (i.e., remove optimiser & discriminator) a cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:521:                            Path to directory storing cloned voice model and the corresponding configuration and speaker files\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:523:                            Name of the (best) cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:525:                            Name of the config file for the cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:536:    $ python3 minimize_cloned_voice_model.py --voice_model_asset_path results/cloned-voices/vits_potion_clone-December-28-2022_10+52AM-1327031/\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:539:      + Cloned voice model file path       : results/cloned-voices/vits_potion_clone-December-28-2022_10+52AM-1327031/best_model.pth\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:540:      + Cloned voice model config file     : results/cloned-voices/vits_potion_clone-December-28-2022_10+52AM-1327031/config.json\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:545:    Completed minimising cloned voice model. The resulting (modified) assets can be found at:\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:546:      --> Minimised voice model path       : results/cloned-voices/vits_potion_clone-December-28-2022_10+52AM-1327031/best_model_light.pth\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:547:      --> Minimised voice model config path: results/cloned-voices/vits_potion_clone-December-28-2022_10+52AM-1327031/config_light.json\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:554:1. To score a cloned voice, run the following command:\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:557:    (potion-voice_venv) $ python3 score_cloned_voice.py [-h] --voice_dataset_path VOICE_DATASET_PATH --voice_model_path VOICE_MODEL_PATH --voice_model_config_path VOICE_MODEL_CONFIG_PATH --speaker_embeddings_path SPEAKER_EMBEDDINGS_PATH [--temp_path TEMP_PATH] [--keep_temp] [--use_cpu] [--output_format {txt,json}]\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:559:    Compute quality score for a given voice model (cloned voice) wrt. a given set of voice recordings (original voice))\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:566:                            Path to cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:568:                            Path to config file for the cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:582:    $ python3 score_cloned_voice.py --voice_dataset_path results/datasets/sr22050/michael/wav48/1/ --voice_model_path results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/best_model.pth --voice_model_config_path results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/config.json --speaker_embeddings_path results/datasets/sr22050/michael/speakers.pth\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:583:    Computing similarity score for a given voice model (cloned voice) wrt. a given set of voice recordings (original voice):\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:586:      + Cloned voice model file path  : results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/best_model.pth\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:587:      + Cloned voice model config file: results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/config.json\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:611:    (potion-voice_venv)$ python3 score_cloned_voice.py --voice_dataset_path results/datasets/sr22050/michael/wav48/1/ --voice_model_path results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/best_model.pth --voice_model_config_path results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/config.json --speaker_embeddings_path results/datasets/sr22050/michael/speakers.pth --output_format json\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:616:    {\"success\": true, \"in\": {\"voice_dataset_path\": \"results/datasets/sr22050/michael/wav48/1/\", \"voice_model_path\": \"results/cloned-voices/vits_potion_clone-December-28-2022_01+09AM-1327031/best_model.pth\"}, \"out\": {\"score\": 0.91}}\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:621:1. To generate speech for a given cloned voice, run the following command:\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:631:                            Path to cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:633:                            Path to config file for the cloned voice model\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:654:    (potion-voice_venv) $ python3 synthesize_speech.py --voice_model_path results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/best_model.pth --voice_model_config_path results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/config.json --speaker_embeddings_path results/datasets/sr22050/[REDACTED_HOMEDIR_USERNAME_2]/speakers.pth --txt \"Hi person_82, it works!\"\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:657:      + Voice model file path  : results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/best_model.pth\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:658:      + Voice model config file: results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/config.json\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:681:    (potion-voice_venv) $ python3 synthesize_speech.py --voice_model_path results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/best_model_light.pth --voice_model_config_path results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/config_light.json --speaker_embeddings_path results/datasets/sr22050/[REDACTED_HOMEDIR_USERNAME_2]/speakers.pth --txt \"Hi person_82, it works!\" --output_format json\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:685:    {\"success\": true, \"in\": {\"voice_model_path\": \"results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/best_model_light.pth\", \"voice_model_config_path\": \"results/cloned-voices/vits_potion_clone-December-28-2022_08+30AM-1327031/config_light.json\", \"speaker_embeddings_path\": \"results/datasets/sr22050/[REDACTED_HOMEDIR_USERNAME_2]/speakers.pth\"}, \"out\": {\"speech_original_path\": \"results/speech/c99e494c-e1f9-4c12-9095-255cf7db792b.wav\", \"speech_resampled_path\": \"results/speech/c99e494c-e1f9-4c12-9095-255cf7db792b_sr48000.wav\"}}\n./voice-cloning/clone_voice.py:25:        description = \"Code to clone a voice from a given set of voice samples and a multi-speaker baseline model\")\n./voice-cloning/clone_voice.py:32:    parser.add_argument(\"--output_path\",                type = str, default = \"results/cloned-voices\",\n./voice-cloning/clone_voice.py:103:        run_name                = \"vits_potion_clone\",\n./voice-cloning/clone_voice.py:226:    ### $ python3 clone_voice.py [with argument]\n./voice-cloning/score_cloned_voice.py:22:        description = \"Compute quality score for a given voice model (cloned voice) wrt. a given set of voice recordings (original voice))\")\n./voice-cloning/score_cloned_voice.py:26:        help = \"Path to cloned voice model\")\n./voice-cloning/score_cloned_voice.py:28:        help = \"Path to config file for the cloned voice model\")\n./voice-cloning/score_cloned_voice.py:56:        print(\"Computing similarity score for a given voice model (cloned voice) wrt. a given set of voice recordings (original voice):\")\n./voice-cloning/score_cloned_voice.py:93:    # score the cloned voice (wrt. similarity to recorded voice)\n./voice-cloning/score_cloned_voice.py:141:        # speaker embeddings provided, use it together with the given model (cloned or baseline model) to synthesize speech\n./voice-cloning-job-handler/pm2-development.yml:11:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-staging.fifo'\n./voice-cloning-job-handler/index.js:203:          // clone the voice\n./voice-cloning-job-handler/index.js:206:          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n./voice-cloning-job-handler/index.js:220:            if (file.includes('vits_potion_clone'))\n./voice-cloning-job-handler/index.js:228:          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n./voice-cloning-job-handler/index.js:301:      console.error('Error while training voice clone', { error })\n./voice-cloning-job-handler/pm2-production.yml:11:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-production.fifo'\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_4","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,380p' voice-cloning-job-handler/index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_4","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,380p' voice-cloning-job-handler/index.js\"","aggregated_output":"const fs = require('fs')\nconst https = require('https')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\n\nconst Bugsnag = require('@bugsnag/js')\nconst mongoose = require('mongoose')\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst voiceCloningService = require('./voice_cloning')\nconst userAudioProfileService = require('./user_audio_profile')\n\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nlet throttleMessageFetching = true\nconst APP_ENV = process.env.POTION_APP_ENV\n\nconst cloudFrontUrlProd = process.env.CLOUDFRONT_URL_PROD\nconst cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\nconst cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n\nconst updateUrl = (str, cloudFrontUrl) => {\n  const host = new URL(str).host\n  return str.replace(`https://${host}`, cloudFrontUrl)\n}\n\nfunction connectDB(dbUri, retryCount = 0) {\n  return new Promise((resolve, reject) => {\n    console.log('Connection Attempt : ', retryCount)\n    mongoose.set('strictQuery', true)\n    mongoose\n      .connect(dbUri)\n      .then((msg) => {\n        console.log('Connected to Mongo DB !')\n        resolve()\n      })\n      .catch((err) => {\n        console.log('Failed to connect dns mongo: ', err)\n        if (retryCount < 6) {\n          retryCount++\n          connectDB(dbUri, retryCount)\n        }\n      })\n  })\n}\n\nfunction execShellCommand(cmd, logPath) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while proccessing python command', error)\n        reject(error)\n      }\n      // console.log('Stdout --- ', stdout)\n      // console.log('Stderror --- ', stderr)\n      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n\n      resolve()\n    })\n  })\n}\n\nasync function getFile(waveUrl, path) {\n  return new Promise((resolve) => {\n    https.get(waveUrl, (res) => {\n      const writeStream = fs.createWriteStream(path)\n\n      res.pipe(writeStream)\n\n      writeStream.on('finish', () => {\n        writeStream.close()\n        resolve()\n      })\n    })\n  })\n}\n\nfunction pad(s) {\n  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n  return s\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        console.log('job===', job)\n\n        const { metadata, input, _id, userAudioProfileId } = job._doc\n        console.log('userAudioProfileId', userAudioProfileId)\n        console.log('_id', _id)\n        const { env } = job\n        console.log('env', env)\n\n        console.log('metadata------', metadata)\n        console.log('input', input)\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        const cloudFrontUrl =\n          env === 'production'\n            ? cloudFrontUrlProd\n            : env === 'staging'\n            ? cloudFrontUrlStaging\n            : cloudFrontUrlDev\n\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const { directoryName } = metadata\n          console.log('directoryName', directoryName)\n          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n          if (!fs.existsSync(logPath)) {\n            fs.mkdirSync(logPath, { recursive: true })\n          }\n          // update the db model to processing\n          await voiceCloningService.update({ _id, status: 'processing' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'processing',\n          })\n\n          // create directory for userid-useraudioprofileid if not exist\n          const rootPath = `/tmp/${directoryName}`\n          const wavePath = `${rootPath}/wav48/1`\n          if (!fs.existsSync(wavePath)) {\n            fs.mkdirSync(wavePath, { recursive: true })\n          }\n\n          const txtPath = `${rootPath}/txt/1`\n          if (!fs.existsSync(txtPath)) {\n            fs.mkdirSync(txtPath, { recursive: true })\n          }\n          // download the training data files and put it in respective directories\n          for (let index = 0; index < input.length; index++) {\n            const item = input[index]\n\n            const { waveUrl, originalText } = item\n            // download wave file\n            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n\n            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n\n            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n            await fs.promises.writeFile(txtFilePath, originalText)\n          }\n\n          const zipFileName = directoryName + '.tgz'\n\n          // /tmp/directoryName.tgz\n\n          await execShellCommand(\n            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n            logPath\n          )\n          console.log('ZIP created ', zipFileName)\n\n          // re-sample audio\n          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n          console.time(SAMPLING_LABEL)\n\n          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n\n          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n          console.log('samplingCommand ', samplingCommand)\n          const samplingResponse = await execShellCommand(\n            samplingCommand,\n            logPath\n          )\n          console.timeEnd(SAMPLING_LABEL)\n\n          // /mnt/efs/potion-voice/${env}/speakrs.pth\n          // /mnt/efs/potion-voice/${env}/txt\n          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n\n          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n\n          const resultsPath = outPath + '/results'\n\n          //update pth file for cloning\n          // clone the voice\n          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n          console.time(VOICE_CLONING_LABEL)\n          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n            outPath + '/speakers.pth'\n          } --output_path ${resultsPath}`\n\n          console.log('Training Model Command', trainingModelCommand)\n          const trainingResponse = await execShellCommand(\n            trainingModelCommand,\n            logPath\n          )\n\n          console.timeEnd(VOICE_CLONING_LABEL)\n\n          let generatedDirectoryName = ''\n          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n            if (file.includes('vits_potion_clone'))\n              // use output from above to get right path and directory name\n              generatedDirectoryName = file\n          })\n\n          // minimize cloning model\n          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n          console.time(VOICE_MINIMIZE_LABEL)\n          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n            resultsPath + '/' + generatedDirectoryName + '/'\n          } --voice_model_name checkpoint_365200.pth`\n\n          console.log(\n            'Minimize Cloning Model Command',\n            minimizeCloningModelCommand\n          )\n          const minimizeCloning = await execShellCommand(\n            minimizeCloningModelCommand,\n            logPath\n          )\n          console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n          // Add the  code to update location of generated model and status into DB\n          await voiceCloningService.update({ _id, status: 'completed' })\n\n          const training_model_path = {\n            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n          }\n\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'completed',\n            training_model_path,\n          })\n\n          // add code to put that model into S3\n          let keys = Object.keys(training_model_path)\n\n          const training_model_s3_path = {}\n\n          for (let index = 0; index < keys.length; index++) {\n            const path = training_model_path[keys[index]]\n            const s3Path = await s3.upload({\n              filePath: path,\n              fileName: `${directoryName}/${path.split('/').pop()}`,\n              bucket: `potion-voice-users-training-model/${env}`,\n            })\n            training_model_s3_path[keys[index]] = s3Path\n          }\n          //  add S3 path to user audio profile model\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            training_model_s3_path,\n          })\n        } catch (error) {\n          console.log('error********************', error)\n          Bugsnag.notify(\n            new Error(\n              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n            )\n          )\n          Bugsnag.notify(error)\n\n          // update the db to set status as error\n          await voiceCloningService.update({ _id, status: 'error' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'error',\n          })\n\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while training voice clone', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  console.log('potion Voice Clone Process Started')\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_5","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,280p' app/services/voice_cloning/voice_cloning_service.js && sed -n '1,240p' app/services/voice_cloning/voice_cloning_model.js && sed -n '1,220p' app/services/sqs/sqs_service.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_5","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,280p' app/services/voice_cloning/voice_cloning_service.js && sed -n '1,240p' app/services/voice_cloning/voice_cloning_model.js && sed -n '1,220p' app/services/sqs/sqs_service.js\"","aggregated_output":"const StringifyUtils = require('../utils/logService')\n\nconst create = (VoiceCloningModel) => async (data) => {\n  try {\n    const newModel = new VoiceCloningModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (VoiceCloningModel) => async (data) => {\n  try {\n    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (VoiceCloningModel) => {\n  return {\n    create: create(VoiceCloningModel),\n    insertMany: insertMany(VoiceCloningModel),\n    read: read(VoiceCloningModel),\n    remove: remove(VoiceCloningModel),\n    removeMany: removeMany(VoiceCloningModel),\n    update: update(VoiceCloningModel),\n    find: find(VoiceCloningModel),\n  }\n}\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst VoiceCloningSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    userAudioProfileId: {\n      type: Schema.Types.ObjectId,\n      ref: 'UserAudioProfile',\n      required: true,\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    input: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\nconst AWS = require('aws-sdk')\n\nconst sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n\nconst StringifyUtils = require('../utils/logService')\n\nconst fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      WaitTimeSeconds: waitTimeInSeconds,\n      QueueUrl: sqsQueueUrl /* required */,\n    }\n    sqs.receiveMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in fetchJobFromSQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        resolve(data)\n      }\n    })\n  })\n}\n\nconst deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      ReceiptHandle: receiptHandle,\n      QueueUrl: sqsQueueUrl /* required */,\n    }\n    sqs.deleteMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in sending delete request to AWS.SQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        console.log(\n          'Successfully sent delete request to AWS.SQS',\n          StringifyUtils.stringifyError(data)\n        )\n        resolve(data)\n      }\n    })\n  })\n}\n\nconst sendMessageToSQS = (sqsQueueUrl, message) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      MessageBody: message,\n      QueueUrl: sqsQueueUrl /* required */,\n      // MessageGroupId:\n      //   process.env.POTION_APP_ENV ||\n      //   '' + `_` + uuidV4() + '_' + new Date().toISOString(),\n      // MessageDeduplicationId: uuidV4() + `_` + new Date().toISOString()\n    }\n    sqs.sendMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in seding request to AWS.SQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        console.log(\n          'Successfully sent request to AWS.SQS',\n          StringifyUtils.stringifyError(data)\n        )\n        resolve(data.Location)\n      }\n    })\n  })\n}\n\nmodule.exports = {\n  fetchMessageFromSQS,\n  deleteMessageFromSQS,\n  sendMessageToSQS,\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_6","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,320p' voice-cloning-job-handler/voice_cloning/voice_cloning_service.js && sed -n '1,240p' voice-cloning-job-handler/voice_cloning/voice_cloning_model.js && sed -n '1,240p' voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_6","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,320p' voice-cloning-job-handler/voice_cloning/voice_cloning_service.js && sed -n '1,240p' voice-cloning-job-handler/voice_cloning/voice_cloning_model.js && sed -n '1,240p' voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\"","aggregated_output":"const StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (VoiceCloningModel) => async (data) => {\n  try {\n    const newModel = new VoiceCloningModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (VoiceCloningModel) => async (data) => {\n  try {\n    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (VoiceCloningModel) => {\n  return {\n    create: create(VoiceCloningModel),\n    insertMany: insertMany(VoiceCloningModel),\n    read: read(VoiceCloningModel),\n    remove: remove(VoiceCloningModel),\n    removeMany: removeMany(VoiceCloningModel),\n    update: update(VoiceCloningModel),\n    find: find(VoiceCloningModel),\n  }\n}\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst VoiceCloningSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    userAudioProfileId: {\n      type: Schema.Types.ObjectId,\n      ref: 'UserAudioProfile',\n      required: true,\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    input: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (UserAudioProfileModel) => async (data) => {\n  try {\n    const newModel = new UserAudioProfileModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (UserAudioProfileModel) => async (data) => {\n  try {\n    const inserted = await UserAudioProfileModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModel = await UserAudioProfileModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModels = await UserAudioProfileModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (UserAudioProfileModel) => async (data) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (UserAudioProfileModel) => {\n  return {\n    create: create(UserAudioProfileModel),\n    insertMany: insertMany(UserAudioProfileModel),\n    read: read(UserAudioProfileModel),\n    remove: remove(UserAudioProfileModel),\n    removeMany: removeMany(UserAudioProfileModel),\n    update: update(UserAudioProfileModel),\n    find: find(UserAudioProfileModel),\n  }\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_7","type":"command_execution","command":"/bin/bash -lc \"git branch -a && git log --oneline --decorate -20 && find . -maxdepth 3 -type f \\\\( -name '*test*' -o -name '*spec*' \\\\) -print && sed -n '1,240p' package.json && sed -n '1,240p' voice-cloning-job-handler/package.json\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_7","type":"command_execution","command":"/bin/bash -lc \"git branch -a && git log --oneline --decorate -20 && find . -maxdepth 3 -type f \\\\( -name '*test*' -o -name '*spec*' \\\\) -print && sed -n '1,240p' package.json && sed -n '1,240p' voice-cloning-job-handler/package.json\"","aggregated_output":"* master\n15b3565 (HEAD -> master) initial\n./node_modules/proxy-from-env/test.js\n./node_modules/isarray/test.js\n./node_modules/iserror/test.js\n./node_modules/memory-pager/test.js\n./node_modules/sparse-bitfield/test.js\n./node_modules/module-details-from-path/test.js\n./node_modules/git-node-fs/test.js\n./node_modules/safer-buffer/tests.js\n./node_modules/pump/test-browser.js\n./node_modules/pump/test-node.js\n./node_modules/stackframe/stackframe-tests.ts\n./node_modules/aws-sdk/buildspec.yml\n./node_modules/url/test.js\n./voice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\n{\n  \"name\": \"potion-voice\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice cloning jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {},\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"pm2\": \"^5.2.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}\n{\n  \"name\": \"voice-cloning-job-handler\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice cloning jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n    \"deploy-staging\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.staging.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-staging.js\"\n  },\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"pm2\": \"^5.2.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_8","type":"agent_message","text":"The worker currently assumes one legacy job shape and has no `pro_v2` handling at all. I’m checking the producer/model contracts next, especially where a tiered request could be dropped or turned into a null database result."}}
{"type":"item.started","item":{"id":"item_9","type":"command_execution","command":"/bin/bash -lc \"rg -ni \\\"pro|premium|version|model[_ -]?tier|voice[_ -]?clon|audio[_ -]?profile|status\\\" --glob '*.js' --glob '*.json' --glob '*.yml' --glob '*.yaml' . -g '\"'!node_modules/**'\"'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_9","type":"command_execution","command":"/bin/bash -lc \"rg -ni \\\"pro|premium|version|model[_ -]?tier|voice[_ -]?clon|audio[_ -]?profile|status\\\" --glob '*.js' --glob '*.json' --glob '*.yml' --glob '*.yaml' . -g '\"'!node_modules/**'\"'\"","aggregated_output":"./voice-synthsizer-job-handler/salutation/salutation_service.js:47:  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\r\n./voice-synthsizer-job-handler/salutation/salutation_service.js:50:      userAudioProfileId,\r\n./voice-synthsizer-job-handler/salutation/salutation_service.js:58:        { firstName, salutationVideo, userAudioProfileId },\r\n./voice-synthsizer-job-handler/salutation/salutation_model.js:24:    userAudioProfileId: {\r\n./voice-synthsizer-job-handler/pm2-development.yml:9:      NODE_ENV: 'production'\n./voice-synthsizer-job-handler/recording/recording_model.js:95:    previewGifsVersion: {\n./voice-synthsizer-job-handler/recording/recording_model.js:185:    dynamicVideoProcessing: {\n./voice-synthsizer-job-handler/recording/recording_model.js:190:    dynamicVideoProcessingError: {\n./voice-synthsizer-job-handler/recording/recording_model.js:203:    dynamicVideoTemplateGenerationStatus: {\n./voice-synthsizer-job-handler/recording/recording_model.js:241:          salutationVideoProcessed: {\n./voice-synthsizer-job-handler/recording/recording_model.js:245:          screenRecordingProcessed: {\n./voice-synthsizer-job-handler/recording/recording_model.js:251:          processed: {\n./voice-synthsizer-job-handler/recording/recording_model.js:255:          inProgress: {\n./voice-synthsizer-job-handler/recording/recording_model.js:272:          status: {\n./voice-synthsizer-job-handler/recording/recording_model.js:333:    backgroundChangeStatus: {\n./voice-synthsizer-job-handler/recording/recording_model.js:357:    isProcessingAssets: {\n./voice-synthsizer-job-handler/recording/recording_model.js:397:    lastDynamicProcessCompletedAt: {\n./voice-synthsizer-job-handler/index.js:2:const exec = require('child_process').exec\n./voice-synthsizer-job-handler/index.js:6:const version = require('./package.json').version\n./voice-synthsizer-job-handler/index.js:9:const userAudioProfileService = require('./user_audio_profile')\n./voice-synthsizer-job-handler/index.js:16:const sqsQueueUrl = process.env.SQS_URL\n./voice-synthsizer-job-handler/index.js:17:const mongoUriDev = process.env.MONGODB_URI_DEV\n./voice-synthsizer-job-handler/index.js:18:const mongoUriStaging = process.env.MONGODB_URI_STAGING\n./voice-synthsizer-job-handler/index.js:19:const mongoUriProd = process.env.MONGODB_URI_PROD\n./voice-synthsizer-job-handler/index.js:20:const APP_ENV = process.env.POTION_APP_ENV\n./voice-synthsizer-job-handler/index.js:24:  // const exec = require(\"child_process\").exec;\n./voice-synthsizer-job-handler/index.js:25:  return new Promise((resolve, reject) => {\n./voice-synthsizer-job-handler/index.js:28:        console.log('Error while processing python command', error)\n./voice-synthsizer-job-handler/index.js:39:  return new Promise((resolve, reject) => {\n./voice-synthsizer-job-handler/index.js:58:const processQueue = () => {\n./voice-synthsizer-job-handler/index.js:59:  /* eslint-disable no-async-promise-executor */\n./voice-synthsizer-job-handler/index.js:60:  return new Promise(async (resolve, reject) => {\n./voice-synthsizer-job-handler/index.js:75:            userAudioProfileId,\n./voice-synthsizer-job-handler/index.js:85:            env === 'production'\n./voice-synthsizer-job-handler/index.js:86:              ? mongoUriProd\n./voice-synthsizer-job-handler/index.js:94:          // read the path for the training model for the this users audio profile\n./voice-synthsizer-job-handler/index.js:96:          const userAudioProfile = await userAudioProfileService.find({\n./voice-synthsizer-job-handler/index.js:97:            _id: userAudioProfileId,\n./voice-synthsizer-job-handler/index.js:98:            status: 'completed',\n./voice-synthsizer-job-handler/index.js:100:          if (userAudioProfile) {\n./voice-synthsizer-job-handler/index.js:101:            const { training_model_path, userId } = userAudioProfile[0]\n./voice-synthsizer-job-handler/index.js:113:            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n./voice-synthsizer-job-handler/index.js:141:            // Create new entry with the s3 path to salutation collection for the user and its profile id\n./voice-synthsizer-job-handler/index.js:147:                userAudioProfileId,\n./voice-synthsizer-job-handler/index.js:208:              // create the job for the ai to create processing\n./voice-synthsizer-job-handler/index.js:219:                `audio profile training model not found ` + JSON.stringify(job)\n./voice-synthsizer-job-handler/index.js:248:  return new Promise((resolve) => {\n./voice-synthsizer-job-handler/index.js:254:    appVersion: APP_ENV + version,\n./voice-synthsizer-job-handler/index.js:255:    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n./voice-synthsizer-job-handler/index.js:256:    releaseStage: process.env.NODE_ENV,\n./voice-synthsizer-job-handler/index.js:260:      await processQueue()\n./voice-synthsizer-job-handler/package.json:3:  \"version\": \"1.0.0\",\n./voice-synthsizer-job-handler/package.json:7:    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n./voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js:30:    salutationVideoProcessed: {\r\n./voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js:34:    screenRecordingProcessed: {\r\n./voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js:40:    processed: {\r\n./voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js:44:    inProgress: {\r\n./voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js:61:    status: {\r\n./voice-synthsizer-job-handler/pm2-production.yml:9:      NODE_ENV: 'production'\n./voice-synthsizer-job-handler/pm2-production.yml:10:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-synthesizer-ai-production.fifo'\n./voice-synthsizer-job-handler/pm2-production.yml:11:      APP_ENV: 'production'\n./voice-synthsizer-job-handler/pm2-production.yml:14:      MONGODB_URI_PROD: 'mongodb+srv://[REDACTED_MONGO_USER_prod]:scrubbed_2@example.com.net/potion_production?retryWrites=true&w=majority'\n./voice-synthsizer-job-handler/job/job_model.js:34:    status: {\n./app/services/s3/index.js:11:    const downloadResult = await s3.getObject(params).promise()\r\n./app/services/s3/index.js:30:  return new Promise((resolve, reject) => {\r\n./app/services/utils/deleteFile.js:2:  return new Promise((resolve) => {\n./voice-synthsizer-job-handler/package-lock.json:3:  \"version\": \"1.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:4:  \"lockfileVersion\": 1,\n./voice-synthsizer-job-handler/package-lock.json:8:      \"version\": \"7.16.2\",\n./voice-synthsizer-job-handler/package-lock.json:16:      \"version\": \"7.16.1\",\n./voice-synthsizer-job-handler/package-lock.json:28:      \"version\": \"3.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:33:      \"version\": \"7.16.2\",\n./voice-synthsizer-job-handler/package-lock.json:42:      \"version\": \"7.16.2\",\n./voice-synthsizer-job-handler/package-lock.json:55:      \"version\": \"6.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:60:      \"version\": \"17.0.29\",\n./voice-synthsizer-job-handler/package-lock.json:64:    \"@types/webidl-conversions\": {\n./voice-synthsizer-job-handler/package-lock.json:65:      \"version\": \"6.1.1\",\n./voice-synthsizer-job-handler/package-lock.json:66:      \"resolved\": \"https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz\",\n./voice-synthsizer-job-handler/package-lock.json:70:      \"version\": \"8.2.1\",\n./voice-synthsizer-job-handler/package-lock.json:75:        \"@types/webidl-conversions\": \"*\"\n./voice-synthsizer-job-handler/package-lock.json:79:      \"version\": \"1.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:84:      \"version\": \"1.0.11\",\n./voice-synthsizer-job-handler/package-lock.json:90:      \"version\": \"2.1122.0\",\n./voice-synthsizer-job-handler/package-lock.json:106:          \"version\": \"3.3.2\",\n./voice-synthsizer-job-handler/package-lock.json:113:      \"version\": \"1.0.2\",\n./voice-synthsizer-job-handler/package-lock.json:118:      \"version\": \"1.5.1\",\n./voice-synthsizer-job-handler/package-lock.json:123:      \"version\": \"1.1.11\",\n./voice-synthsizer-job-handler/package-lock.json:132:      \"version\": \"4.6.3\",\n./voice-synthsizer-job-handler/package-lock.json:140:          \"version\": \"5.7.1\",\n./voice-synthsizer-job-handler/package-lock.json:151:      \"version\": \"4.9.2\",\n./voice-synthsizer-job-handler/package-lock.json:161:      \"version\": \"5.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:166:      \"version\": \"0.0.1\",\n./voice-synthsizer-job-handler/package-lock.json:171:      \"version\": \"4.3.4\",\n./voice-synthsizer-job-handler/package-lock.json:179:          \"version\": \"2.1.2\",\n./voice-synthsizer-job-handler/package-lock.json:186:      \"version\": \"2.0.1\",\n./voice-synthsizer-job-handler/package-lock.json:191:      \"version\": \"1.4.4\",\n./voice-synthsizer-job-handler/package-lock.json:199:      \"version\": \"2.0.7\",\n./voice-synthsizer-job-handler/package-lock.json:207:      \"version\": \"1.1.1\",\n./voice-synthsizer-job-handler/package-lock.json:212:      \"version\": \"9.1.0\",\n./voice-synthsizer-job-handler/package-lock.json:223:      \"version\": \"1.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:228:      \"version\": \"7.2.0\",\n./voice-synthsizer-job-handler/package-lock.json:241:      \"version\": \"4.2.10\",\n./voice-synthsizer-job-handler/package-lock.json:246:      \"version\": \"1.1.13\",\n./voice-synthsizer-job-handler/package-lock.json:251:      \"version\": \"1.0.6\",\n./voice-synthsizer-job-handler/package-lock.json:260:      \"version\": \"2.0.4\",\n./voice-synthsizer-job-handler/package-lock.json:265:      \"version\": \"1.1.5\",\n./voice-synthsizer-job-handler/package-lock.json:270:      \"version\": \"1.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:275:      \"version\": \"0.0.2\",\n./voice-synthsizer-job-handler/package-lock.json:280:      \"version\": \"0.16.0\",\n./voice-synthsizer-job-handler/package-lock.json:285:      \"version\": \"6.1.0\",\n./voice-synthsizer-job-handler/package-lock.json:294:      \"version\": \"2.3.5\",\n./voice-synthsizer-job-handler/package-lock.json:299:      \"version\": \"1.5.0\",\n./voice-synthsizer-job-handler/package-lock.json:305:      \"version\": \"3.1.2\",\n./voice-synthsizer-job-handler/package-lock.json:313:      \"version\": \"4.5.0\",\n./voice-synthsizer-job-handler/package-lock.json:325:      \"version\": \"2.5.2\",\n./voice-synthsizer-job-handler/package-lock.json:334:      \"version\": \"6.3.1\",\n./voice-synthsizer-job-handler/package-lock.json:348:      \"version\": \"0.8.4\",\n./voice-synthsizer-job-handler/package-lock.json:353:      \"version\": \"4.0.2\",\n./voice-synthsizer-job-handler/package-lock.json:361:      \"version\": \"2.1.3\",\n./voice-synthsizer-job-handler/package-lock.json:366:      \"version\": \"1.4.0\",\n./voice-synthsizer-job-handler/package-lock.json:374:      \"version\": \"1.0.1\",\n./voice-synthsizer-job-handler/package-lock.json:379:      \"version\": \"3.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:388:      \"version\": \"1.3.2\",\n./voice-synthsizer-job-handler/package-lock.json:393:      \"version\": \"0.2.0\",\n./voice-synthsizer-job-handler/package-lock.json:398:      \"version\": \"3.0.2\",\n./voice-synthsizer-job-handler/package-lock.json:406:      \"version\": \"1.0.3\",\n./voice-synthsizer-job-handler/package-lock.json:415:      \"version\": \"1.2.1\",\n./voice-synthsizer-job-handler/package-lock.json:420:      \"version\": \"16.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:425:      \"version\": \"4.2.0\",\n./voice-synthsizer-job-handler/package-lock.json:430:      \"version\": \"2.6.2\",\n./voice-synthsizer-job-handler/package-lock.json:439:      \"version\": \"3.0.3\",\n./voice-synthsizer-job-handler/package-lock.json:448:      \"version\": \"2.0.5\",\n./voice-synthsizer-job-handler/package-lock.json:456:      \"version\": \"1.2.1\",\n./voice-synthsizer-job-handler/package-lock.json:461:      \"version\": \"3.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:469:          \"version\": \"2.1.1\",\n./voice-synthsizer-job-handler/package-lock.json:476:      \"version\": \"2.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:481:      \"version\": \"0.10.3\",\n./voice-synthsizer-job-handler/package-lock.json:490:      \"version\": \"8.3.2\",\n./voice-synthsizer-job-handler/package-lock.json:494:    \"webidl-conversions\": {\n./voice-synthsizer-job-handler/package-lock.json:495:      \"version\": \"7.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:496:      \"resolved\": \"https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz\",\n./voice-synthsizer-job-handler/package-lock.json:500:      \"version\": \"11.0.0\",\n./voice-synthsizer-job-handler/package-lock.json:505:        \"webidl-conversions\": \"^7.0.0\"\n./voice-synthsizer-job-handler/package-lock.json:509:      \"version\": \"1.0.2\",\n./voice-synthsizer-job-handler/package-lock.json:514:      \"version\": \"0.4.19\",\n./voice-synthsizer-job-handler/package-lock.json:523:      \"version\": \"9.0.7\",\n./app/services/utils/logService.js:2:  return JSON.stringify(error, Object.getOwnPropertyNames(error))\n./app/services/utils/bugsnag.js:6:  const isDevEnv = DEV_APP_ENVS.includes(process.env.POTION_APP_ENV)\n./voice-synthsizer-job-handler/user_audio_profile/index.js:1:const UserAudioProfile = require('./user_audio_profile_model')\n./voice-synthsizer-job-handler/user_audio_profile/index.js:2:const UserAudioProfileService = require('./user_audio_profile_service')\n./voice-synthsizer-job-handler/user_audio_profile/index.js:4:module.exports = UserAudioProfileService(UserAudioProfile)\n./app/services/voice_cloning/voice_cloning_model.js:4:const VoiceCloningSchema = Schema(\n./app/services/voice_cloning/voice_cloning_model.js:11:    userAudioProfileId: {\n./app/services/voice_cloning/voice_cloning_model.js:13:      ref: 'UserAudioProfile',\n./app/services/voice_cloning/voice_cloning_model.js:16:    status: {\n./app/services/voice_cloning/voice_cloning_model.js:44:module.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js:4:const UserAudioProfileSchema = Schema(\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js:16:    status: {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js:40:module.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\n./app/services/voice_cloning/index.js:1:const VoiceCloning = require('./voice_cloning_model')\n./app/services/voice_cloning/index.js:2:const VoiceCloningService = require('./voice_cloning_service')\n./app/services/voice_cloning/index.js:4:module.exports = VoiceCloningService(VoiceCloning)\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:3:const create = (UserAudioProfileModel) => async (data) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:5:    const newModel = new UserAudioProfileModel({ ...data })\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:11:      'ERROR - USER AUDIO PROFILE SERVICE > create',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:18:const insertMany = (UserAudioProfileModel) => async (data) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:20:    const inserted = await UserAudioProfileModel.insertMany(data)\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:25:      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:32:const read = (UserAudioProfileModel) => async (filter) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:34:    const foundModel = await UserAudioProfileModel.findOne({\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:42:      'ERROR - USER AUDIO PROFILE SERVICE > read',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:49:const find = (UserAudioProfileModel) => async (filter) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:51:    const foundModels = await UserAudioProfileModel.find({\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:59:      'ERROR - USER AUDIO PROFILE SERVICE > find',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:66:const update = (UserAudioProfileModel) => async (data) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:69:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:81:      'ERROR - USER AUDIO PROFILE SERVICE > update',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:88:const remove = (UserAudioProfileModel) => async (filter) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:90:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:103:      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:110:const removeMany = (UserAudioProfileModel) => async (filter) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:112:    const updatedModel = await UserAudioProfileModel.updateMany(\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:125:      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:132:module.exports = (UserAudioProfileModel) => {\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:134:    create: create(UserAudioProfileModel),\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:135:    insertMany: insertMany(UserAudioProfileModel),\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:136:    read: read(UserAudioProfileModel),\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:137:    remove: remove(UserAudioProfileModel),\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:138:    removeMany: removeMany(UserAudioProfileModel),\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:139:    update: update(UserAudioProfileModel),\n./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:140:    find: find(UserAudioProfileModel)\n./app/services/voice_cloning/voice_cloning_service.js:3:const create = (VoiceCloningModel) => async (data) => {\n./app/services/voice_cloning/voice_cloning_service.js:5:    const newModel = new VoiceCloningModel({ ...data })\n./app/services/voice_cloning/voice_cloning_service.js:11:      'ERROR - VOICE CLONING SERVICE > create',\n./app/services/voice_cloning/voice_cloning_service.js:18:const insertMany = (VoiceCloningModel) => async (data) => {\n./app/services/voice_cloning/voice_cloning_service.js:20:    const inserted = await VoiceCloningModel.insertMany(data)\n./app/services/voice_cloning/voice_cloning_service.js:25:      'ERROR - VOICE CLONING SERVICE > insertMany',\n./app/services/voice_cloning/voice_cloning_service.js:32:const read = (VoiceCloningModel) => async (filter) => {\n./app/services/voice_cloning/voice_cloning_service.js:34:    const foundModel = await VoiceCloningModel.findOne({\n./app/services/voice_cloning/voice_cloning_service.js:42:      'ERROR - VOICE CLONING SERVICE > read',\n./app/services/voice_cloning/voice_cloning_service.js:49:const find = (VoiceCloningModel) => async (filter) => {\n./app/services/voice_cloning/voice_cloning_service.js:51:    const foundModels = await VoiceCloningModel.find({\n./app/services/voice_cloning/voice_cloning_service.js:59:      'ERROR - VOICE CLONING SERVICE > find',\n./app/services/voice_cloning/voice_cloning_service.js:66:const update = (VoiceCloningModel) => async (data) => {\n./app/services/voice_cloning/voice_cloning_service.js:68:    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./app/services/voice_cloning/voice_cloning_service.js:79:      'ERROR - VOICE CLONING SERVICE > update',\n./app/services/voice_cloning/voice_cloning_service.js:86:const remove = (VoiceCloningModel) => async (filter) => {\n./app/services/voice_cloning/voice_cloning_service.js:88:    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./app/services/voice_cloning/voice_cloning_service.js:101:      'ERROR - VOICE CLONING SERVICE > remove',\n./app/services/voice_cloning/voice_cloning_service.js:108:const removeMany = (VoiceCloningModel) => async (filter) => {\n./app/services/voice_cloning/voice_cloning_service.js:110:    const updatedModel = await VoiceCloningModel.updateMany(\n./app/services/voice_cloning/voice_cloning_service.js:123:      'ERROR - VOICE CLONING SERVICE > removeMany',\n./app/services/voice_cloning/voice_cloning_service.js:130:module.exports = (VoiceCloningModel) => {\n./app/services/voice_cloning/voice_cloning_service.js:132:    create: create(VoiceCloningModel),\n./app/services/voice_cloning/voice_cloning_service.js:133:    insertMany: insertMany(VoiceCloningModel),\n./app/services/voice_cloning/voice_cloning_service.js:134:    read: read(VoiceCloningModel),\n./app/services/voice_cloning/voice_cloning_service.js:135:    remove: remove(VoiceCloningModel),\n./app/services/voice_cloning/voice_cloning_service.js:136:    removeMany: removeMany(VoiceCloningModel),\n./app/services/voice_cloning/voice_cloning_service.js:137:    update: update(VoiceCloningModel),\n./app/services/voice_cloning/voice_cloning_service.js:138:    find: find(VoiceCloningModel),\n./app/services/sqs/index.js:4:const sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n./app/services/sqs/sqs_service.js:3:const sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n./app/services/sqs/sqs_service.js:8:  return new Promise((resolve, reject) => {\n./app/services/sqs/sqs_service.js:28:  return new Promise((resolve, reject) => {\n./app/services/sqs/sqs_service.js:52:  return new Promise((resolve, reject) => {\n./app/services/sqs/sqs_service.js:57:      //   process.env.POTION_APP_ENV ||\n./voice-cloning/assets/speaker_encoder_model/config_se.json:22:    \"output_path\": \"../checkpoints/speaker_encoder/language_balanced/normalized/angleproto-4-samples-by-speakers/\",\n./voice-cloning/assets/speaker_encoder_model/config_se.json:70:        \"proj_dim\": 512\n./voice-cloning/assets/speaker_encoder_model/config_se.json:110:    \"loss\": \"angleproto\",\n./package.json:3:  \"version\": \"1.0.0\",\n./package.json:4:  \"description\": \"This will handle the voice cloning jobs\",\n./voice-cloning-job-handler/pm2-development.yml:11:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-staging.fifo'\n./voice-cloning-job-handler/pm2-development.yml:15:      MONGODB_URI_PROD: ''\n./voice-cloning-job-handler/pm2-development.yml:16:      CLOUDFRONT_URL_PROD: 'https://videoassets.sendpotion.com'\n./voice-cloning-job-handler/index.js:3:const exec = require('child_process').exec\n./voice-cloning-job-handler/index.js:8:const version = require('./package.json').version\n./voice-cloning-job-handler/index.js:11:const voiceCloningService = require('./voice_cloning')\n./voice-cloning-job-handler/index.js:12:const userAudioProfileService = require('./user_audio_profile')\n./voice-cloning-job-handler/index.js:15:const sqsQueueUrl = process.env.SQS_URL\n./voice-cloning-job-handler/index.js:16:const mongoUriDev = process.env.MONGODB_URI_DEV\n./voice-cloning-job-handler/index.js:17:const mongoUriStaging = process.env.MONGODB_URI_STAGING\n./voice-cloning-job-handler/index.js:18:const mongoUriProd = process.env.MONGODB_URI_PROD\n./voice-cloning-job-handler/index.js:20:const APP_ENV = process.env.POTION_APP_ENV\n./voice-cloning-job-handler/index.js:22:const cloudFrontUrlProd = process.env.CLOUDFRONT_URL_PROD\n./voice-cloning-job-handler/index.js:23:const cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\n./voice-cloning-job-handler/index.js:24:const cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n./voice-cloning-job-handler/index.js:32:  return new Promise((resolve, reject) => {\n./voice-cloning-job-handler/index.js:52:  // const exec = require(\"child_process\").exec;\n./voice-cloning-job-handler/index.js:53:  return new Promise((resolve, reject) => {\n./voice-cloning-job-handler/index.js:56:        console.log('Error while proccessing python command', error)\n./voice-cloning-job-handler/index.js:61:      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n./voice-cloning-job-handler/index.js:62:      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n./voice-cloning-job-handler/index.js:70:  return new Promise((resolve) => {\n./voice-cloning-job-handler/index.js:89:const processQueue = () => {\n./voice-cloning-job-handler/index.js:90:  /* eslint-disable no-async-promise-executor */\n./voice-cloning-job-handler/index.js:91:  return new Promise(async (resolve, reject) => {\n./voice-cloning-job-handler/index.js:104:        const { metadata, input, _id, userAudioProfileId } = job._doc\n./voice-cloning-job-handler/index.js:105:        console.log('userAudioProfileId', userAudioProfileId)\n./voice-cloning-job-handler/index.js:113:          env === 'production'\n./voice-cloning-job-handler/index.js:114:            ? mongoUriProd\n./voice-cloning-job-handler/index.js:123:          env === 'production'\n./voice-cloning-job-handler/index.js:124:            ? cloudFrontUrlProd\n./voice-cloning-job-handler/index.js:138:          // update the db model to processing\n./voice-cloning-job-handler/index.js:139:          await voiceCloningService.update({ _id, status: 'processing' })\n./voice-cloning-job-handler/index.js:140:          await userAudioProfileService.update({\n./voice-cloning-job-handler/index.js:141:            _id: userAudioProfileId,\n./voice-cloning-job-handler/index.js:142:            status: 'processing',\n./voice-cloning-job-handler/index.js:145:          // create directory for userid-useraudioprofileid if not exist\n./voice-cloning-job-handler/index.js:167:            await fs.promises.writeFile(txtFilePath, originalText)\n./voice-cloning-job-handler/index.js:186:          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n./voice-cloning-job-handler/index.js:204:          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n./voice-cloning-job-handler/index.js:205:          console.time(VOICE_CLONING_LABEL)\n./voice-cloning-job-handler/index.js:206:          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n./voice-cloning-job-handler/index.js:216:          console.timeEnd(VOICE_CLONING_LABEL)\n./voice-cloning-job-handler/index.js:228:          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n./voice-cloning-job-handler/index.js:242:          // Add the  code to update location of generated model and status into DB\n./voice-cloning-job-handler/index.js:243:          await voiceCloningService.update({ _id, status: 'completed' })\n./voice-cloning-job-handler/index.js:253:          await userAudioProfileService.update({\n./voice-cloning-job-handler/index.js:254:            _id: userAudioProfileId,\n./voice-cloning-job-handler/index.js:255:            status: 'completed',\n./voice-cloning-job-handler/index.js:273:          //  add S3 path to user audio profile model\n./voice-cloning-job-handler/index.js:274:          await userAudioProfileService.update({\n./voice-cloning-job-handler/index.js:275:            _id: userAudioProfileId,\n./voice-cloning-job-handler/index.js:282:              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n./voice-cloning-job-handler/index.js:287:          // update the db to set status as error\n./voice-cloning-job-handler/index.js:288:          await voiceCloningService.update({ _id, status: 'error' })\n./voice-cloning-job-handler/index.js:289:          await userAudioProfileService.update({\n./voice-cloning-job-handler/index.js:290:            _id: userAudioProfileId,\n./voice-cloning-job-handler/index.js:291:            status: 'error',\n./voice-cloning-job-handler/index.js:301:      console.error('Error while training voice clone', { error })\n./voice-cloning-job-handler/index.js:311:  return new Promise((resolve) => {\n./voice-cloning-job-handler/index.js:316:  console.log('potion Voice Clone Process Started')\n./voice-cloning-job-handler/index.js:318:    appVersion: APP_ENV + version,\n./voice-cloning-job-handler/index.js:319:    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n./voice-cloning-job-handler/index.js:320:    releaseStage: process.env.NODE_ENV,\n./voice-cloning-job-handler/index.js:325:      await processQueue()\n./voice-cloning-job-handler/package.json:2:  \"name\": \"voice-cloning-job-handler\",\n./voice-cloning-job-handler/package.json:3:  \"version\": \"1.0.0\",\n./voice-cloning-job-handler/package.json:4:  \"description\": \"This will handle the voice cloning jobs\",\n./voice-cloning-job-handler/package.json:7:    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n./package-lock.json:3:  \"version\": \"1.0.0\",\n./package-lock.json:4:  \"lockfileVersion\": 1,\n./package-lock.json:8:      \"version\": \"3.978.0\",\n./package-lock.json:24:          \"version\": \"2.8.1\",\n./package-lock.json:31:    \"@aws-sdk/credential-provider-cognito-identity\": {\n./package-lock.json:32:      \"version\": \"3.972.70\",\n./package-lock.json:33:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.972.70.tgz\",\n./package-lock.json:45:          \"version\": \"2.8.1\",\n./package-lock.json:52:    \"@aws-sdk/credential-provider-env\": {\n./package-lock.json:53:      \"version\": \"3.972.71\",\n./package-lock.json:54:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.972.71.tgz\",\n./package-lock.json:66:          \"version\": \"2.8.1\",\n./package-lock.json:73:    \"@aws-sdk/credential-provider-http\": {\n./package-lock.json:74:      \"version\": \"3.972.73\",\n./package-lock.json:75:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.972.73.tgz\",\n./package-lock.json:89:          \"version\": \"2.8.1\",\n./package-lock.json:96:    \"@aws-sdk/credential-provider-ini\": {\n./package-lock.json:97:      \"version\": \"3.973.16\",\n./package-lock.json:98:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.973.16.tgz\",\n./package-lock.json:103:        \"@aws-sdk/credential-provider-env\": \"^3.972.71\",\n./package-lock.json:104:        \"@aws-sdk/credential-provider-http\": \"^3.972.73\",\n./package-lock.json:105:        \"@aws-sdk/credential-provider-login\": \"^3.972.78\",\n./package-lock.json:106:        \"@aws-sdk/credential-provider-process\": \"^3.972.71\",\n./package-lock.json:107:        \"@aws-sdk/credential-provider-sso\": \"^3.973.15\",\n./package-lock.json:108:        \"@aws-sdk/credential-provider-web-identity\": \"^3.972.77\",\n./package-lock.json:112:        \"@smithy/credential-provider-imds\": \"^4.4.16\",\n./package-lock.json:118:          \"version\": \"2.8.1\",\n./package-lock.json:125:    \"@aws-sdk/credential-provider-login\": {\n./package-lock.json:126:      \"version\": \"3.972.78\",\n./package-lock.json:127:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.972.78.tgz\",\n./package-lock.json:140:          \"version\": \"2.8.1\",\n./package-lock.json:147:    \"@aws-sdk/credential-provider-node\": {\n./package-lock.json:148:      \"version\": \"3.972.83\",\n./package-lock.json:149:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.972.83.tgz\",\n./package-lock.json:153:        \"@aws-sdk/credential-provider-env\": \"^3.972.71\",\n./package-lock.json:154:        \"@aws-sdk/credential-provider-http\": \"^3.972.73\",\n./package-lock.json:155:        \"@aws-sdk/credential-provider-ini\": \"^3.973.16\",\n./package-lock.json:156:        \"@aws-sdk/credential-provider-process\": \"^3.972.71\",\n./package-lock.json:157:        \"@aws-sdk/credential-provider-sso\": \"^3.973.15\",\n./package-lock.json:158:        \"@aws-sdk/credential-provider-web-identity\": \"^3.972.77\",\n./package-lock.json:161:        \"@smithy/credential-provider-imds\": \"^4.4.16\",\n./package-lock.json:167:          \"version\": \"2.8.1\",\n./package-lock.json:174:    \"@aws-sdk/credential-provider-process\": {\n./package-lock.json:175:      \"version\": \"3.972.71\",\n./package-lock.json:176:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.972.71.tgz\",\n./package-lock.json:188:          \"version\": \"2.8.1\",\n./package-lock.json:195:    \"@aws-sdk/credential-provider-sso\": {\n./package-lock.json:196:      \"version\": \"3.973.15\",\n./package-lock.json:197:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.973.15.tgz\",\n./package-lock.json:203:        \"@aws-sdk/token-providers\": \"3.1129.0\",\n./package-lock.json:211:          \"version\": \"2.8.1\",\n./package-lock.json:218:    \"@aws-sdk/credential-provider-web-identity\": {\n./package-lock.json:219:      \"version\": \"3.972.77\",\n./package-lock.json:220:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.972.77.tgz\",\n./package-lock.json:233:          \"version\": \"2.8.1\",\n./package-lock.json:240:    \"@aws-sdk/credential-providers\": {\n./package-lock.json:241:      \"version\": \"3.1137.0\",\n./package-lock.json:242:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.1137.0.tgz\",\n./package-lock.json:247:        \"@aws-sdk/credential-provider-cognito-identity\": \"^3.972.70\",\n./package-lock.json:248:        \"@aws-sdk/credential-provider-env\": \"^3.972.71\",\n./package-lock.json:249:        \"@aws-sdk/credential-provider-http\": \"^3.972.73\",\n./package-lock.json:250:        \"@aws-sdk/credential-provider-ini\": \"^3.973.16\",\n./package-lock.json:251:        \"@aws-sdk/credential-provider-login\": \"^3.972.78\",\n./package-lock.json:252:        \"@aws-sdk/credential-provider-node\": \"^3.972.83\",\n./package-lock.json:253:        \"@aws-sdk/credential-provider-process\": \"^3.972.71\",\n./package-lock.json:254:        \"@aws-sdk/credential-provider-sso\": \"^3.973.15\",\n./package-lock.json:255:        \"@aws-sdk/credential-provider-web-identity\": \"^3.972.77\",\n./package-lock.json:259:        \"@smithy/credential-provider-imds\": \"^4.4.16\",\n./package-lock.json:265:          \"version\": \"2.8.1\",\n./package-lock.json:273:      \"version\": \"3.997.45\",\n./package-lock.json:289:          \"version\": \"2.8.1\",\n./package-lock.json:297:      \"version\": \"3.996.46\",\n./package-lock.json:309:          \"version\": \"2.8.1\",\n./package-lock.json:316:    \"@aws-sdk/token-providers\": {\n./package-lock.json:317:      \"version\": \"3.1129.0\",\n./package-lock.json:318:      \"resolved\": \"https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.1129.0.tgz\",\n./package-lock.json:331:          \"version\": \"2.8.1\",\n./package-lock.json:339:      \"version\": \"3.974.5\",\n./package-lock.json:349:          \"version\": \"2.8.1\",\n./package-lock.json:357:      \"version\": \"3.972.40\",\n./package-lock.json:367:          \"version\": \"2.8.1\",\n./package-lock.json:375:      \"version\": \"0.3.0\",\n./package-lock.json:381:      \"version\": \"7.16.2\",\n./package-lock.json:389:      \"version\": \"7.16.1\",\n./package-lock.json:401:      \"version\": \"3.0.0\",\n./package-lock.json:406:      \"version\": \"7.16.2\",\n./package-lock.json:415:      \"version\": \"7.16.2\",\n./package-lock.json:428:      \"version\": \"6.0.0\",\n./package-lock.json:433:      \"version\": \"1.5.4\",\n./package-lock.json:442:      \"version\": \"0.0.9\",\n./package-lock.json:454:          \"version\": \"5.7.1\",\n./package-lock.json:459:          \"version\": \"3.4.0\",\n./package-lock.json:465:    \"@opencensus/propagation-b3\": {\n./package-lock.json:466:      \"version\": \"0.0.8\",\n./package-lock.json:467:      \"resolved\": \"https://registry.npmjs.org/@opencensus/propagation-b3/-/propagation-b3-0.0.8.tgz\",\n./package-lock.json:475:          \"version\": \"0.0.8\",\n./package-lock.json:487:          \"version\": \"5.7.1\",\n./package-lock.json:492:          \"version\": \"3.4.0\",\n./package-lock.json:499:      \"version\": \"2.0.1\",\n./package-lock.json:513:        \"proxy-agent\": \"~5.0.0\",\n./package-lock.json:519:          \"version\": \"7.2.3\",\n./package-lock.json:526:      \"version\": \"5.0.0\",\n./package-lock.json:531:        \"@opencensus/propagation-b3\": \"0.0.8\",\n./package-lock.json:543:          \"version\": \"2.6.4\",\n./package-lock.json:551:          \"version\": \"6.4.5\",\n./package-lock.json:556:          \"version\": \"6.3.0\",\n./package-lock.json:561:          \"version\": \"1.9.3\",\n./package-lock.json:568:      \"version\": \"0.6.7\",\n./package-lock.json:580:          \"version\": \"2.6.4\",\n./package-lock.json:588:          \"version\": \"6.4.5\",\n./package-lock.json:594:    \"@pm2/pm2-version-check\": {\n./package-lock.json:595:      \"version\": \"1.0.4\",\n./package-lock.json:596:      \"resolved\": \"https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz\",\n./package-lock.json:603:      \"version\": \"3.34.1\",\n./package-lock.json:613:          \"version\": \"2.8.1\",\n./package-lock.json:620:    \"@smithy/credential-provider-imds\": {\n./package-lock.json:621:      \"version\": \"4.5.2\",\n./package-lock.json:622:      \"resolved\": \"https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.5.2.tgz\",\n./package-lock.json:632:          \"version\": \"2.8.1\",\n./package-lock.json:640:      \"version\": \"5.8.0\",\n./package-lock.json:651:          \"version\": \"2.8.1\",\n./package-lock.json:659:      \"version\": \"4.12.1\",\n./package-lock.json:670:          \"version\": \"2.8.1\",\n./package-lock.json:678:      \"version\": \"5.7.3\",\n./package-lock.json:689:          \"version\": \"2.8.1\",\n./package-lock.json:697:      \"version\": \"4.18.0\",\n./package-lock.json:706:          \"version\": \"2.8.1\",\n./package-lock.json:714:      \"version\": \"1.1.2\",\n./package-lock.json:719:      \"version\": \"26.6.2\",\n./package-lock.json:726:    \"@types/webidl-conversions\": {\n./package-lock.json:727:      \"version\": \"7.0.3\",\n./package-lock.json:728:      \"resolved\": \"https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz\",\n./package-lock.json:732:      \"version\": \"8.2.2\",\n./package-lock.json:737:        \"@types/webidl-conversions\": \"*\"\n./package-lock.json:741:      \"version\": \"8.7.1\",\n./package-lock.json:746:      \"version\": \"8.2.0\",\n./package-lock.json:751:      \"version\": \"6.0.2\",\n./package-lock.json:759:      \"version\": \"0.3.1\",\n./package-lock.json:764:      \"version\": \"0.1.2\",\n./package-lock.json:772:      \"version\": \"4.1.1\",\n./package-lock.json:777:      \"version\": \"4.3.0\",\n./package-lock.json:785:      \"version\": \"3.1.2\",\n./package-lock.json:794:      \"version\": \"1.0.10\",\n./package-lock.json:802:          \"version\": \"1.0.3\",\n./package-lock.json:809:      \"version\": \"0.13.4\",\n./package-lock.json:817:      \"version\": \"3.2.3\",\n./package-lock.json:822:      \"version\": \"0.6.10\",\n./package-lock.json:831:          \"version\": \"5.7.1\",\n./package-lock.json:838:      \"version\": \"1.0.0\",\n./package-lock.json:843:      \"version\": \"1.0.11\",\n./package-lock.json:849:      \"version\": \"2.1134.0\",\n./package-lock.json:865:          \"version\": \"3.3.2\",\n./package-lock.json:872:      \"version\": \"0.21.4\",\n./package-lock.json:880:      \"version\": \"1.0.2\",\n./package-lock.json:885:      \"version\": \"1.5.1\",\n./package-lock.json:890:      \"version\": \"2.2.0\",\n./package-lock.json:895:      \"version\": \"0.1.81\",\n./package-lock.json:900:      \"version\": \"0.1.0\",\n./package-lock.json:905:      \"version\": \"2.14.1\",\n./package-lock.json:911:      \"version\": \"1.1.11\",\n./package-lock.json:920:      \"version\": \"3.0.2\",\n./package-lock.json:928:      \"version\": \"4.7.2\",\n./package-lock.json:936:          \"version\": \"5.7.1\",\n./package-lock.json:947:      \"version\": \"4.9.2\",\n./package-lock.json:957:      \"version\": \"1.1.2\",\n./package-lock.json:962:      \"version\": \"5.0.0\",\n./package-lock.json:967:      \"version\": \"3.1.2\",\n./package-lock.json:972:      \"version\": \"3.0.0\",\n./package-lock.json:981:      \"version\": \"0.1.2\",\n./package-lock.json:986:      \"version\": \"3.5.3\",\n./package-lock.json:1001:      \"version\": \"2.0.1\",\n./package-lock.json:1009:      \"version\": \"2.0.1\",\n./package-lock.json:1017:      \"version\": \"1.1.4\",\n./package-lock.json:1022:      \"version\": \"2.15.1\",\n./package-lock.json:1027:      \"version\": \"0.0.1\",\n./package-lock.json:1032:      \"version\": \"3.2.1\",\n./package-lock.json:1041:      \"version\": \"1.0.3\",\n./package-lock.json:1046:      \"version\": \"4.1.97\",\n./package-lock.json:1051:      \"version\": \"0.1.2\",\n./package-lock.json:1056:      \"version\": \"3.0.1\",\n./package-lock.json:1061:      \"version\": \"1.8.36\",\n./package-lock.json:1066:      \"version\": \"4.3.4\",\n./package-lock.json:1074:          \"version\": \"2.1.2\",\n./package-lock.json:1081:      \"version\": \"0.1.4\",\n./package-lock.json:1086:      \"version\": \"3.0.2\",\n./package-lock.json:1097:      \"version\": \"2.0.0\",\n./package-lock.json:1102:      \"version\": \"1.1.2\",\n./package-lock.json:1110:      \"version\": \"1.4.4\",\n./package-lock.json:1118:      \"version\": \"2.3.6\",\n./package-lock.json:1126:      \"version\": \"2.0.7\",\n./package-lock.json:1134:      \"version\": \"4.0.0\",\n./package-lock.json:1139:      \"version\": \"1.14.3\",\n./package-lock.json:1151:      \"version\": \"4.0.1\",\n./package-lock.json:1156:      \"version\": \"4.3.0\",\n./package-lock.json:1161:      \"version\": \"2.0.3\",\n./package-lock.json:1166:      \"version\": \"5.0.1\",\n./package-lock.json:1171:      \"version\": \"1.1.1\",\n./package-lock.json:1176:      \"version\": \"3.1.1\",\n./package-lock.json:1181:      \"version\": \"2.0.6\",\n./package-lock.json:1186:      \"version\": \"1.0.11\",\n./package-lock.json:1191:      \"version\": \"2.0.0\",\n./package-lock.json:1196:      \"version\": \"7.0.1\",\n./package-lock.json:1204:      \"version\": \"1.15.0\",\n./package-lock.json:1209:      \"version\": \"9.1.0\",\n./package-lock.json:1220:      \"version\": \"1.0.0\",\n./package-lock.json:1225:      \"version\": \"2.3.2\",\n./package-lock.json:1231:      \"version\": \"0.3.10\",\n./package-lock.json:1240:      \"version\": \"1.1.1\",\n./package-lock.json:1245:      \"version\": \"3.0.2\",\n./package-lock.json:1258:          \"version\": \"8.1.0\",\n./package-lock.json:1268:          \"version\": \"4.0.0\",\n./package-lock.json:1276:          \"version\": \"0.1.2\",\n./package-lock.json:1283:      \"version\": \"1.0.0\",\n./package-lock.json:1288:      \"version\": \"0.1.2\",\n./package-lock.json:1293:      \"version\": \"7.2.0\",\n./package-lock.json:1306:      \"version\": \"5.1.2\",\n./package-lock.json:1314:      \"version\": \"4.2.10\",\n./package-lock.json:1319:      \"version\": \"1.0.3\",\n./package-lock.json:1327:      \"version\": \"4.0.0\",\n./package-lock.json:1332:      \"version\": \"2.0.0\",\n./package-lock.json:1338:        \"setprototypeof\": \"1.2.0\",\n./package-lock.json:1339:        \"statuses\": \"2.0.1\",\n./package-lock.json:1343:    \"http-proxy-agent\": {\n./package-lock.json:1344:      \"version\": \"4.0.1\",\n./package-lock.json:1345:      \"resolved\": \"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz\",\n./package-lock.json:1353:    \"https-proxy-agent\": {\n./package-lock.json:1354:      \"version\": \"5.0.1\",\n./package-lock.json:1355:      \"resolved\": \"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz\",\n./package-lock.json:1363:      \"version\": \"0.4.24\",\n./package-lock.json:1371:      \"version\": \"1.1.13\",\n./package-lock.json:1376:      \"version\": \"1.0.6\",\n./package-lock.json:1385:      \"version\": \"2.0.4\",\n./package-lock.json:1390:      \"version\": \"1.3.8\",\n./package-lock.json:1395:      \"version\": \"1.1.8\",\n./package-lock.json:1400:      \"version\": \"10.7.2\",\n./package-lock.json:1405:      \"version\": \"2.1.0\",\n./package-lock.json:1413:      \"version\": \"2.9.0\",\n./package-lock.json:1421:      \"version\": \"2.1.1\",\n./package-lock.json:1426:      \"version\": \"4.0.3\",\n./package-lock.json:1434:      \"version\": \"7.0.0\",\n./package-lock.json:1439:      \"version\": \"1.0.0\",\n./package-lock.json:1444:      \"version\": \"0.0.2\",\n./package-lock.json:1449:      \"version\": \"0.16.0\",\n./package-lock.json:1454:      \"version\": \"0.7.8\",\n./package-lock.json:1465:      \"version\": \"5.0.1\",\n./package-lock.json:1471:      \"version\": \"6.1.0\",\n./package-lock.json:1480:      \"version\": \"2.5.1\",\n./package-lock.json:1485:      \"version\": \"1.0.11\",\n./package-lock.json:1490:      \"version\": \"0.3.0\",\n./package-lock.json:1499:      \"version\": \"4.17.21\",\n./package-lock.json:1504:      \"version\": \"1.2.7\",\n./package-lock.json:1509:      \"version\": \"5.1.1\",\n./package-lock.json:1517:      \"version\": \"1.5.0\",\n./package-lock.json:1523:      \"version\": \"3.1.2\",\n./package-lock.json:1531:      \"version\": \"1.0.4\",\n./package-lock.json:1536:      \"version\": \"1.0.3\",\n./package-lock.json:1541:      \"version\": \"4.17.2\",\n./package-lock.json:1545:        \"@aws-sdk/credential-providers\": \"^3.186.0\",\n./package-lock.json:1553:          \"version\": \"2.8.10\",\n./package-lock.json:1564:      \"version\": \"2.6.0\",\n./package-lock.json:1573:      \"version\": \"6.13.11\",\n./package-lock.json:1587:      \"version\": \"0.9.0\",\n./package-lock.json:1592:      \"version\": \"4.0.3\",\n./package-lock.json:1600:      \"version\": \"2.1.3\",\n./package-lock.json:1605:      \"version\": \"0.0.8\",\n./package-lock.json:1610:      \"version\": \"2.4.0\",\n./package-lock.json:1620:          \"version\": \"3.2.7\",\n./package-lock.json:1628:          \"version\": \"1.2.4\",\n./package-lock.json:1635:      \"version\": \"2.0.2\",\n./package-lock.json:1640:      \"version\": \"3.0.0\",\n./package-lock.json:1645:      \"version\": \"0.6.0\",\n./package-lock.json:1654:          \"version\": \"0.4.14\",\n./package-lock.json:1661:      \"version\": \"1.4.0\",\n./package-lock.json:1669:      \"version\": \"0.8.3\",\n./package-lock.json:1681:    \"pac-proxy-agent\": {\n./package-lock.json:1682:      \"version\": \"5.0.0\",\n./package-lock.json:1683:      \"resolved\": \"https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-5.0.0.tgz\",\n./package-lock.json:1690:        \"http-proxy-agent\": \"^4.0.1\",\n./package-lock.json:1691:        \"https-proxy-agent\": \"5\",\n./package-lock.json:1694:        \"socks-proxy-agent\": \"5\"\n./package-lock.json:1698:      \"version\": \"5.0.0\",\n./package-lock.json:1708:      \"version\": \"0.2.9\",\n./package-lock.json:1713:      \"version\": \"1.0.1\",\n./package-lock.json:1718:      \"version\": \"1.0.7\",\n./package-lock.json:1723:      \"version\": \"2.3.1\",\n./package-lock.json:1728:      \"version\": \"3.0.0\",\n./package-lock.json:1736:      \"version\": \"5.2.0\",\n./package-lock.json:1743:        \"@pm2/pm2-version-check\": \"^1.0.4\",\n./package-lock.json:1764:        \"promptly\": \"^2\",\n./package-lock.json:1773:      \"version\": \"4.0.1\",\n./package-lock.json:1784:      \"version\": \"0.7.1\",\n./package-lock.json:1792:      \"version\": \"1.0.2\",\n./package-lock.json:1801:      \"version\": \"0.1.2\",\n./package-lock.json:1809:      \"version\": \"1.2.8\",\n./package-lock.json:1822:          \"version\": \"2.0.21\",\n./package-lock.json:1833:      \"version\": \"1.1.2\",\n./package-lock.json:1837:    \"promptly\": {\n./package-lock.json:1838:      \"version\": \"2.2.0\",\n./package-lock.json:1839:      \"resolved\": \"https://registry.npmjs.org/promptly/-/promptly-2.2.0.tgz\",\n./package-lock.json:1845:    \"proxy-agent\": {\n./package-lock.json:1846:      \"version\": \"5.0.0\",\n./package-lock.json:1847:      \"resolved\": \"https://registry.npmjs.org/proxy-agent/-/proxy-agent-5.0.0.tgz\",\n./package-lock.json:1852:        \"http-proxy-agent\": \"^4.0.0\",\n./package-lock.json:1853:        \"https-proxy-agent\": \"^5.0.0\",\n./package-lock.json:1855:        \"pac-proxy-agent\": \"^5.0.0\",\n./package-lock.json:1856:        \"proxy-from-env\": \"^1.0.0\",\n./package-lock.json:1857:        \"socks-proxy-agent\": \"^5.0.0\"\n./package-lock.json:1860:    \"proxy-from-env\": {\n./package-lock.json:1861:      \"version\": \"1.1.0\",\n./package-lock.json:1862:      \"resolved\": \"https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz\",\n./package-lock.json:1866:      \"version\": \"3.0.0\",\n./package-lock.json:1875:      \"version\": \"1.3.2\",\n./package-lock.json:1880:      \"version\": \"0.2.0\",\n./package-lock.json:1885:      \"version\": \"2.5.1\",\n./package-lock.json:1896:      \"version\": \"1.0.7\",\n./package-lock.json:1904:      \"version\": \"1.1.14\",\n./package-lock.json:1915:          \"version\": \"0.0.1\",\n./package-lock.json:1922:      \"version\": \"3.6.0\",\n./package-lock.json:1930:      \"version\": \"5.1.0\",\n./package-lock.json:1940:      \"version\": \"1.22.0\",\n./package-lock.json:1950:      \"version\": \"3.0.2\",\n./package-lock.json:1958:      \"version\": \"1.1.9\",\n./package-lock.json:1963:      \"version\": \"5.2.1\",\n./package-lock.json:1968:      \"version\": \"2.1.2\",\n./package-lock.json:1973:      \"version\": \"1.2.1\",\n./package-lock.json:1978:      \"version\": \"7.3.7\",\n./package-lock.json:1986:          \"version\": \"6.0.0\",\n./package-lock.json:1994:          \"version\": \"4.0.0\",\n./package-lock.json:2000:    \"setprototypeof\": {\n./package-lock.json:2001:      \"version\": \"1.2.0\",\n./package-lock.json:2002:      \"resolved\": \"https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz\",\n./package-lock.json:2006:      \"version\": \"1.2.1\",\n./package-lock.json:2011:      \"version\": \"16.0.1\",\n./package-lock.json:2016:      \"version\": \"3.0.7\",\n./package-lock.json:2021:      \"version\": \"4.2.0\",\n./package-lock.json:2026:      \"version\": \"2.6.2\",\n./package-lock.json:2034:    \"socks-proxy-agent\": {\n./package-lock.json:2035:      \"version\": \"5.0.1\",\n./package-lock.json:2036:      \"resolved\": \"https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz\",\n./package-lock.json:2045:      \"version\": \"0.6.1\",\n./package-lock.json:2050:      \"version\": \"0.5.19\",\n./package-lock.json:2059:      \"version\": \"3.0.3\",\n./package-lock.json:2068:      \"version\": \"1.1.2\",\n./package-lock.json:2073:      \"version\": \"2.0.5\",\n./package-lock.json:2081:      \"version\": \"1.2.1\",\n./package-lock.json:2085:    \"statuses\": {\n./package-lock.json:2086:      \"version\": \"2.0.1\",\n./package-lock.json:2087:      \"resolved\": \"https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz\",\n./package-lock.json:2091:      \"version\": \"0.10.31\",\n./package-lock.json:2096:      \"version\": \"7.2.0\",\n./package-lock.json:2104:      \"version\": \"1.0.0\",\n./package-lock.json:2109:      \"version\": \"5.11.15\",\n./package-lock.json:2115:      \"version\": \"5.0.1\",\n./package-lock.json:2123:      \"version\": \"1.0.1\",\n./package-lock.json:2128:      \"version\": \"3.0.0\",\n./package-lock.json:2136:          \"version\": \"2.3.1\",\n./package-lock.json:2143:      \"version\": \"2.4.0\",\n./package-lock.json:2148:      \"version\": \"1.3.0\",\n./package-lock.json:2153:      \"version\": \"1.0.5\",\n./package-lock.json:2162:      \"version\": \"0.3.2\",\n./package-lock.json:2170:      \"version\": \"8.9.0\",\n./package-lock.json:2175:      \"version\": \"2.0.0\",\n./package-lock.json:2180:      \"version\": \"1.0.0\",\n./package-lock.json:2185:      \"version\": \"0.10.3\",\n./package-lock.json:2194:      \"version\": \"8.3.2\",\n./package-lock.json:2199:      \"version\": \"2.2.1\",\n./package-lock.json:2210:          \"version\": \"2.6.4\",\n./package-lock.json:2220:      \"version\": \"3.9.9\",\n./package-lock.json:2228:    \"webidl-conversions\": {\n./package-lock.json:2229:      \"version\": \"7.0.0\",\n./package-lock.json:2230:      \"resolved\": \"https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz\",\n./package-lock.json:2234:      \"version\": \"11.0.0\",\n./package-lock.json:2239:        \"webidl-conversions\": \"^7.0.0\"\n./package-lock.json:2243:      \"version\": \"1.2.3\",\n./package-lock.json:2248:      \"version\": \"1.0.2\",\n./package-lock.json:2253:      \"version\": \"7.4.6\",\n./package-lock.json:2258:      \"version\": \"0.4.19\",\n./package-lock.json:2267:      \"version\": \"9.0.7\",\n./package-lock.json:2272:      \"version\": \"2.0.0\",\n./package-lock.json:2277:      \"version\": \"3.1.1\",\n./package-lock.json:2282:      \"version\": \"0.3.0\",\n./voice-cloning-job-handler/voice_cloning/voice_cloning_model.js:4:const VoiceCloningSchema = Schema(\n./voice-cloning-job-handler/voice_cloning/voice_cloning_model.js:11:    userAudioProfileId: {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_model.js:13:      ref: 'UserAudioProfile',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_model.js:16:    status: {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_model.js:44:module.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\n./voice-cloning-job-handler/pm2-production.yml:9:      NODE_ENV: 'production'\n./voice-cloning-job-handler/pm2-production.yml:10:      POTION_APP_ENV: 'production'\n./voice-cloning-job-handler/pm2-production.yml:11:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-production.fifo'\n./voice-cloning-job-handler/pm2-production.yml:15:      MONGODB_URI_PROD: 'mongodb+srv://[REDACTED_MONGO_USER_prod]:scrubbed_3@example.com.net/potion_production?retryWrites=true&w=majority'\n./voice-cloning-job-handler/pm2-production.yml:16:      CLOUDFRONT_URL_PROD: 'https://videoassets.sendpotion.com'\n./voice-cloning-job-handler/voice_cloning/index.js:1:const VoiceCloning = require('./voice_cloning_model')\n./voice-cloning-job-handler/voice_cloning/index.js:2:const VoiceCloningService = require('./voice_cloning_service')\n./voice-cloning-job-handler/voice_cloning/index.js:4:module.exports = VoiceCloningService(VoiceCloning)\n./voice-cloning-job-handler/user_audio_profile/index.js:1:const UserAudioProfile = require('./user_audio_profile_model')\n./voice-cloning-job-handler/user_audio_profile/index.js:2:const UserAudioProfileService = require('./user_audio_profile_service')\n./voice-cloning-job-handler/user_audio_profile/index.js:4:module.exports = UserAudioProfileService(UserAudioProfile)\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:3:const create = (VoiceCloningModel) => async (data) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:5:    const newModel = new VoiceCloningModel({ ...data })\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:11:      'ERROR - VOICE CLONING SERVICE > create',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:18:const insertMany = (VoiceCloningModel) => async (data) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:20:    const inserted = await VoiceCloningModel.insertMany(data)\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:25:      'ERROR - VOICE CLONING SERVICE > insertMany',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:32:const read = (VoiceCloningModel) => async (filter) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:34:    const foundModel = await VoiceCloningModel.findOne({\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:42:      'ERROR - VOICE CLONING SERVICE > read',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:49:const find = (VoiceCloningModel) => async (filter) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:51:    const foundModels = await VoiceCloningModel.find({\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:59:      'ERROR - VOICE CLONING SERVICE > find',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:66:const update = (VoiceCloningModel) => async (data) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:68:    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:80:      'ERROR - VOICE CLONING SERVICE > update',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:87:const remove = (VoiceCloningModel) => async (filter) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:89:    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:102:      'ERROR - VOICE CLONING SERVICE > remove',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:109:const removeMany = (VoiceCloningModel) => async (filter) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:111:    const updatedModel = await VoiceCloningModel.updateMany(\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:124:      'ERROR - VOICE CLONING SERVICE > removeMany',\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:131:module.exports = (VoiceCloningModel) => {\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:133:    create: create(VoiceCloningModel),\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:134:    insertMany: insertMany(VoiceCloningModel),\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:135:    read: read(VoiceCloningModel),\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:136:    remove: remove(VoiceCloningModel),\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:137:    removeMany: removeMany(VoiceCloningModel),\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:138:    update: update(VoiceCloningModel),\n./voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:139:    find: find(VoiceCloningModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js:4:const UserAudioProfileSchema = Schema(\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js:16:    status: {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js:40:module.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:3:const create = (UserAudioProfileModel) => async (data) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:5:    const newModel = new UserAudioProfileModel({ ...data })\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:11:      'ERROR - USER AUDIO PROFILE SERVICE > create',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:18:const insertMany = (UserAudioProfileModel) => async (data) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:20:    const inserted = await UserAudioProfileModel.insertMany(data)\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:25:      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:32:const read = (UserAudioProfileModel) => async (filter) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:34:    const foundModel = await UserAudioProfileModel.findOne({\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:42:      'ERROR - USER AUDIO PROFILE SERVICE > read',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:49:const find = (UserAudioProfileModel) => async (filter) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:51:    const foundModels = await UserAudioProfileModel.find({\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:59:      'ERROR - USER AUDIO PROFILE SERVICE > find',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:66:const update = (UserAudioProfileModel) => async (data) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:68:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:79:      'ERROR - USER AUDIO PROFILE SERVICE > update',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:86:const remove = (UserAudioProfileModel) => async (filter) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:88:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:101:      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:108:const removeMany = (UserAudioProfileModel) => async (filter) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:110:    const updatedModel = await UserAudioProfileModel.updateMany(\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:123:      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:130:module.exports = (UserAudioProfileModel) => {\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:132:    create: create(UserAudioProfileModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:133:    insertMany: insertMany(UserAudioProfileModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:134:    read: read(UserAudioProfileModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:135:    remove: remove(UserAudioProfileModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:136:    removeMany: removeMany(UserAudioProfileModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:137:    update: update(UserAudioProfileModel),\n./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:138:    find: find(UserAudioProfileModel),\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_10","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,280p' README.md && sed -n '1,220p' voice-cloning-job-handler/pm2-development.yml && sed -n '1,220p' voice-cloning-job-handler/pm2-production.yml && git show --stat --oneline HEAD && git ls-tree -r --name-only HEAD\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_11","type":"command_execution","command":"/bin/bash -lc \"find app voice-cloning-job-handler voice-synthsizer-job-handler -type f -maxdepth 5 -print | sort | xargs -r -n1 sh -c 'echo FILE:\"'$0; sed -n \"1,260p\" \"$0\"'\"'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_11","type":"command_execution","command":"/bin/bash -lc \"find app voice-cloning-job-handler voice-synthsizer-job-handler -type f -maxdepth 5 -print | sort | xargs -r -n1 sh -c 'echo FILE:\"'$0; sed -n \"1,260p\" \"$0\"'\"'\"","aggregated_output":"FILE:app/services/s3/index.js\nconst AWS = require('aws-sdk')\r\nconst fs = require('fs')\r\nconst { stringifyError } = require('../utils/logService')\r\nvar s3 = new AWS.S3()\r\n\r\nconst fetchS3Object = async ({ fileName, bucket, filePath }) => {\r\n  filePath = filePath || '/tmp/' + fileName\r\n  console.log('Fetching', stringifyObj({ fileName, filePath }))\r\n  try {\r\n    var params = { Bucket: bucket, Key: fileName }\r\n    const downloadResult = await s3.getObject(params).promise()\r\n    fs.writeFileSync(filePath, downloadResult.Body, function (err) {\r\n      if (err) console.log(err.code, '-', err.message)\r\n    })\r\n    return filePath\r\n  } catch (error) {\r\n    console.log('Download from S3 Error:', stringifyError(error))\r\n    throw error\r\n  }\r\n}\r\n\r\nconst upload = ({\r\n  filePath,\r\n  fileName,\r\n  bucket,\r\n  contentType,\r\n  fileType,\r\n  // accessControl,\r\n}) => {\r\n  return new Promise((resolve, reject) => {\r\n    // accessControl = accessControl || 'public-read'\r\n    fs.readFile(filePath, function (err, data) {\r\n      if (err) reject(err)\r\n      const params = {\r\n        Bucket: bucket, // pass your bucket name\r\n        Key: fileName,\r\n        Body: data,\r\n        // ContentType: contentType,\r\n        // ContentDisposition: `inline; fileName=${fileName}.${fileType}`,\r\n        // ACL: accessControl,\r\n      }\r\n      s3.upload(params, function (err, data) {\r\n        if (err) {\r\n          reject(err)\r\n          console.log(`${fileName} Upload to s3`, stringifyError(err))\r\n        } else {\r\n          console.log(\r\n            `Successfully uploaded data ${fileName}`,\r\n            stringifyError(data)\r\n          )\r\n          resolve(data.Location)\r\n        }\r\n      })\r\n    })\r\n  })\r\n}\r\n\r\nmodule.exports = {\r\n  upload,\r\n  fetchS3Object,\r\n}\r\nFILE:app/services/s3/s3_service.js\nFILE:app/services/sqs/index.js\nconst AWS = require('aws-sdk')\nAWS.config.update({ region: 'us-west-2' })\nconst sqsService = require('./sqs_service')\nconst sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n\nmodule.exports = sqsService\nFILE:app/services/sqs/sqs_service.js\nconst AWS = require('aws-sdk')\n\nconst sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n\nconst StringifyUtils = require('../utils/logService')\n\nconst fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      WaitTimeSeconds: waitTimeInSeconds,\n      QueueUrl: sqsQueueUrl /* required */,\n    }\n    sqs.receiveMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in fetchJobFromSQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        resolve(data)\n      }\n    })\n  })\n}\n\nconst deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      ReceiptHandle: receiptHandle,\n      QueueUrl: sqsQueueUrl /* required */,\n    }\n    sqs.deleteMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in sending delete request to AWS.SQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        console.log(\n          'Successfully sent delete request to AWS.SQS',\n          StringifyUtils.stringifyError(data)\n        )\n        resolve(data)\n      }\n    })\n  })\n}\n\nconst sendMessageToSQS = (sqsQueueUrl, message) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      MessageBody: message,\n      QueueUrl: sqsQueueUrl /* required */,\n      // MessageGroupId:\n      //   process.env.POTION_APP_ENV ||\n      //   '' + `_` + uuidV4() + '_' + new Date().toISOString(),\n      // MessageDeduplicationId: uuidV4() + `_` + new Date().toISOString()\n    }\n    sqs.sendMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in seding request to AWS.SQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        console.log(\n          'Successfully sent request to AWS.SQS',\n          StringifyUtils.stringifyError(data)\n        )\n        resolve(data.Location)\n      }\n    })\n  })\n}\n\nmodule.exports = {\n  fetchMessageFromSQS,\n  deleteMessageFromSQS,\n  sendMessageToSQS,\n}\nFILE:app/services/utils/bugsnag.js\nconst Bugsnag = require('@bugsnag/js')\n\nconst DEV_APP_ENVS = ['local-dev', 'development']\n\nconst handleError = (err, user) => {\n  const isDevEnv = DEV_APP_ENVS.includes(process.env.POTION_APP_ENV)\n  if (isDevEnv) {\n    return\n  }\n\n  if (user)\n    Bugsnag.notify(err, function (event) {\n      event.setUser(user._id, user.email, user.name)\n    })\n  else Bugsnag.notify(err)\n}\n\nmodule.exports = handleError\nFILE:app/services/utils/deleteFile.js\nconst deleteFile = (filePath) => {\n  return new Promise((resolve) => {\n    require('fs').unlinkSync(filePath)\n    console.log(`[deleted] ${filePath}`)\n    resolve()\n  })\n}\n\nexports.deleteFile = deleteFile\nFILE:app/services/utils/index.js\nconst fs = require('fs')\r\n\r\nconst importedModules = {}\r\nconst files = fs.readdirSync(__dirname)\r\n\r\nfor (const file of files) {\r\n  const fileNameWithoutExtension = file.replace(/\\.[^.]*$/, '')\r\n  const fileExtension = file.split('.').pop()\r\n\r\n  if (\r\n    fileNameWithoutExtension !== 'index' &&\r\n    (fileExtension === 'js' || fileExtension === 'ts')\r\n  )\r\n    importedModules[fileNameWithoutExtension] = require(`./${file}`)[\r\n      fileNameWithoutExtension\r\n    ]\r\n}\r\n\r\nmodule.exports = importedModules\r\nFILE:app/services/utils/logService.js\nconst stringifyError = (error = {}) => {\n  return JSON.stringify(error, Object.getOwnPropertyNames(error))\n}\n\nconst potionErrorObj = (error = {}, details = {}) => {\n  const stringifiedError = stringifyError(error)\n  const stringifiedObject = JSON.stringify({\n    error: stringifiedError,\n    details,\n  })\n  return stringifiedObject\n}\n\nmodule.exports = { potionErrorObj, stringifyError }\nFILE:app/services/voice_cloning/index.js\nconst VoiceCloning = require('./voice_cloning_model')\nconst VoiceCloningService = require('./voice_cloning_service')\n\nmodule.exports = VoiceCloningService(VoiceCloning)\nFILE:app/services/voice_cloning/voice_cloning_model.js\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst VoiceCloningSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    userAudioProfileId: {\n      type: Schema.Types.ObjectId,\n      ref: 'UserAudioProfile',\n      required: true,\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    input: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\nFILE:app/services/voice_cloning/voice_cloning_service.js\nconst StringifyUtils = require('../utils/logService')\n\nconst create = (VoiceCloningModel) => async (data) => {\n  try {\n    const newModel = new VoiceCloningModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (VoiceCloningModel) => async (data) => {\n  try {\n    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (VoiceCloningModel) => {\n  return {\n    create: create(VoiceCloningModel),\n    insertMany: insertMany(VoiceCloningModel),\n    read: read(VoiceCloningModel),\n    remove: remove(VoiceCloningModel),\n    removeMany: removeMany(VoiceCloningModel),\n    update: update(VoiceCloningModel),\n    find: find(VoiceCloningModel),\n  }\n}\nFILE:voice-cloning-job-handler/index.js\nconst fs = require('fs')\nconst https = require('https')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\n\nconst Bugsnag = require('@bugsnag/js')\nconst mongoose = require('mongoose')\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst voiceCloningService = require('./voice_cloning')\nconst userAudioProfileService = require('./user_audio_profile')\n\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nlet throttleMessageFetching = true\nconst APP_ENV = process.env.POTION_APP_ENV\n\nconst cloudFrontUrlProd = process.env.CLOUDFRONT_URL_PROD\nconst cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\nconst cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n\nconst updateUrl = (str, cloudFrontUrl) => {\n  const host = new URL(str).host\n  return str.replace(`https://${host}`, cloudFrontUrl)\n}\n\nfunction connectDB(dbUri, retryCount = 0) {\n  return new Promise((resolve, reject) => {\n    console.log('Connection Attempt : ', retryCount)\n    mongoose.set('strictQuery', true)\n    mongoose\n      .connect(dbUri)\n      .then((msg) => {\n        console.log('Connected to Mongo DB !')\n        resolve()\n      })\n      .catch((err) => {\n        console.log('Failed to connect dns mongo: ', err)\n        if (retryCount < 6) {\n          retryCount++\n          connectDB(dbUri, retryCount)\n        }\n      })\n  })\n}\n\nfunction execShellCommand(cmd, logPath) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while proccessing python command', error)\n        reject(error)\n      }\n      // console.log('Stdout --- ', stdout)\n      // console.log('Stderror --- ', stderr)\n      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n\n      resolve()\n    })\n  })\n}\n\nasync function getFile(waveUrl, path) {\n  return new Promise((resolve) => {\n    https.get(waveUrl, (res) => {\n      const writeStream = fs.createWriteStream(path)\n\n      res.pipe(writeStream)\n\n      writeStream.on('finish', () => {\n        writeStream.close()\n        resolve()\n      })\n    })\n  })\n}\n\nfunction pad(s) {\n  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n  return s\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        console.log('job===', job)\n\n        const { metadata, input, _id, userAudioProfileId } = job._doc\n        console.log('userAudioProfileId', userAudioProfileId)\n        console.log('_id', _id)\n        const { env } = job\n        console.log('env', env)\n\n        console.log('metadata------', metadata)\n        console.log('input', input)\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        const cloudFrontUrl =\n          env === 'production'\n            ? cloudFrontUrlProd\n            : env === 'staging'\n            ? cloudFrontUrlStaging\n            : cloudFrontUrlDev\n\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const { directoryName } = metadata\n          console.log('directoryName', directoryName)\n          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n          if (!fs.existsSync(logPath)) {\n            fs.mkdirSync(logPath, { recursive: true })\n          }\n          // update the db model to processing\n          await voiceCloningService.update({ _id, status: 'processing' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'processing',\n          })\n\n          // create directory for userid-useraudioprofileid if not exist\n          const rootPath = `/tmp/${directoryName}`\n          const wavePath = `${rootPath}/wav48/1`\n          if (!fs.existsSync(wavePath)) {\n            fs.mkdirSync(wavePath, { recursive: true })\n          }\n\n          const txtPath = `${rootPath}/txt/1`\n          if (!fs.existsSync(txtPath)) {\n            fs.mkdirSync(txtPath, { recursive: true })\n          }\n          // download the training data files and put it in respective directories\n          for (let index = 0; index < input.length; index++) {\n            const item = input[index]\n\n            const { waveUrl, originalText } = item\n            // download wave file\n            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n\n            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n\n            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n            await fs.promises.writeFile(txtFilePath, originalText)\n          }\n\n          const zipFileName = directoryName + '.tgz'\n\n          // /tmp/directoryName.tgz\n\n          await execShellCommand(\n            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n            logPath\n          )\n          console.log('ZIP created ', zipFileName)\n\n          // re-sample audio\n          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n          console.time(SAMPLING_LABEL)\n\n          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n\n          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n          console.log('samplingCommand ', samplingCommand)\n          const samplingResponse = await execShellCommand(\n            samplingCommand,\n            logPath\n          )\n          console.timeEnd(SAMPLING_LABEL)\n\n          // /mnt/efs/potion-voice/${env}/speakrs.pth\n          // /mnt/efs/potion-voice/${env}/txt\n          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n\n          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n\n          const resultsPath = outPath + '/results'\n\n          //update pth file for cloning\n          // clone the voice\n          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n          console.time(VOICE_CLONING_LABEL)\n          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n            outPath + '/speakers.pth'\n          } --output_path ${resultsPath}`\n\n          console.log('Training Model Command', trainingModelCommand)\n          const trainingResponse = await execShellCommand(\n            trainingModelCommand,\n            logPath\n          )\n\n          console.timeEnd(VOICE_CLONING_LABEL)\n\n          let generatedDirectoryName = ''\n          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n            if (file.includes('vits_potion_clone'))\n              // use output from above to get right path and directory name\n              generatedDirectoryName = file\n          })\n\n          // minimize cloning model\n          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n          console.time(VOICE_MINIMIZE_LABEL)\n          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n            resultsPath + '/' + generatedDirectoryName + '/'\n          } --voice_model_name checkpoint_365200.pth`\n\n          console.log(\n            'Minimize Cloning Model Command',\n            minimizeCloningModelCommand\n          )\n          const minimizeCloning = await execShellCommand(\n            minimizeCloningModelCommand,\n            logPath\n          )\n          console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n          // Add the  code to update location of generated model and status into DB\n          await voiceCloningService.update({ _id, status: 'completed' })\n\n          const training_model_path = {\n            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n          }\n\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'completed',\n            training_model_path,\n          })\n\n          // add code to put that model into S3\n          let keys = Object.keys(training_model_path)\nFILE:voice-cloning-job-handler/package.json\n{\n  \"name\": \"voice-cloning-job-handler\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice cloning jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n    \"deploy-staging\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.staging.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-staging.js\"\n  },\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"pm2\": \"^5.2.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}FILE:voice-cloning-job-handler/pm2-development.yml\napps:\n  - name: training-model\n    script: index.js\n    watch: false\n    autorestart: true\n    instances: 1\n    time: true\n    env:\n      NODE_ENV: 'staging'\n      POTION_APP_ENV: 'staging'\n      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-staging.fifo'\n      BUGSNAG_BACKEND_KEY: '[REDACTED_generic-api-key]'\n      MONGODB_URI_DEV: 'mongodb+srv://[REDACTED_MONGO_USER_deve]:scrubbed_1@example.com7.mongodb.net/potion_development?retryWrites=true&w=majority'\n      MONGODB_URI_STAGING: 'mongodb+srv://[REDACTED_MONGO_USER_stag]:scrubbed_2@example.com7.mongodb.net/potion_staging?retryWrites=true&w=majority'\n      MONGODB_URI_PROD: ''\n      CLOUDFRONT_URL_PROD: 'https://videoassets.sendpotion.com'\n      CLOUDFRONT_URL_STAGING: ''\n      CLOUDFRONT_URL_DEV: 'https://d2rmbzmoml90gd.cloudfront.net'\nFILE:voice-cloning-job-handler/pm2-production.yml\napps:\n  - name: training-model\n    script: index.js\n    watch: false\n    autorestart: true\n    instances: 1\n    time: true\n    env:\n      NODE_ENV: 'production'\n      POTION_APP_ENV: 'production'\n      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-production.fifo'\n      BUGSNAG_BACKEND_KEY: '[REDACTED_generic-api-key]'\n      MONGODB_URI_DEV: 'mongodb+srv://[REDACTED_MONGO_USER_deve]:scrubbed_1@example.com7.mongodb.net/potion_development?retryWrites=true&w=majority'\n      MONGODB_URI_STAGING: 'mongodb+srv://[REDACTED_MONGO_USER_stag]:scrubbed_2@example.com7.mongodb.net/potion_staging?retryWrites=true&w=majority'\n      MONGODB_URI_PROD: 'mongodb+srv://[REDACTED_MONGO_USER_prod]:scrubbed_3@example.com.net/potion_production?retryWrites=true&w=majority'\n      CLOUDFRONT_URL_PROD: 'https://videoassets.sendpotion.com'\n      CLOUDFRONT_URL_STAGING: ''\n      CLOUDFRONT_URL_DEV: 'https://d2rmbzmoml90gd.cloudfront.net'\nFILE:voice-cloning-job-handler/user_audio_profile/index.js\nconst UserAudioProfile = require('./user_audio_profile_model')\nconst UserAudioProfileService = require('./user_audio_profile_service')\n\nmodule.exports = UserAudioProfileService(UserAudioProfile)\nFILE:voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst UserAudioProfileSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    name: {\n      type: String,\n      required: true,\n      default: '',\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    training_model_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model_s3_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\nFILE:voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (UserAudioProfileModel) => async (data) => {\n  try {\n    const newModel = new UserAudioProfileModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (UserAudioProfileModel) => async (data) => {\n  try {\n    const inserted = await UserAudioProfileModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModel = await UserAudioProfileModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModels = await UserAudioProfileModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (UserAudioProfileModel) => async (data) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (UserAudioProfileModel) => {\n  return {\n    create: create(UserAudioProfileModel),\n    insertMany: insertMany(UserAudioProfileModel),\n    read: read(UserAudioProfileModel),\n    remove: remove(UserAudioProfileModel),\n    removeMany: removeMany(UserAudioProfileModel),\n    update: update(UserAudioProfileModel),\n    find: find(UserAudioProfileModel),\n  }\n}\nFILE:voice-cloning-job-handler/voice_cloning/index.js\nconst VoiceCloning = require('./voice_cloning_model')\nconst VoiceCloningService = require('./voice_cloning_service')\n\nmodule.exports = VoiceCloningService(VoiceCloning)\nFILE:voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst VoiceCloningSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    userAudioProfileId: {\n      type: Schema.Types.ObjectId,\n      ref: 'UserAudioProfile',\n      required: true,\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    input: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\nFILE:voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (VoiceCloningModel) => async (data) => {\n  try {\n    const newModel = new VoiceCloningModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (VoiceCloningModel) => async (data) => {\n  try {\n    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (VoiceCloningModel) => {\n  return {\n    create: create(VoiceCloningModel),\n    insertMany: insertMany(VoiceCloningModel),\n    read: read(VoiceCloningModel),\n    remove: remove(VoiceCloningModel),\n    removeMany: removeMany(VoiceCloningModel),\n    update: update(VoiceCloningModel),\n    find: find(VoiceCloningModel),\n  }\n}\nFILE:voice-synthsizer-job-handler/index.js\nconst fs = require('fs')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\nconst Bugsnag = require('@bugsnag/js')\nconst uuid = require('uuid').v4\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst userAudioProfileService = require('./user_audio_profile')\nconst recordingModel = require('./recording')\nconst recordingSalutationModel = require('./recording_salutation')\nconst jobService = require('./job')\nconst salutationService = require('./salutation')\nlet throttleMessageFetching = true\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nconst APP_ENV = process.env.POTION_APP_ENV\nconst mongoose = require('mongoose')\n\nfunction execShellCommand(cmd) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while processing python command', error)\n        reject(error)\n      }\n      console.log('Stdout --- ', stdout)\n      console.log('Std error --- ', stderr)\n      resolve(stdout || stderr)\n    })\n  })\n}\n\nfunction connectDB(dbUri, retryCount = 0) {\n  return new Promise((resolve, reject) => {\n    console.log('Connection Attempt : ', retryCount)\n    mongoose.set('strictQuery', true)\n    mongoose\n      .connect(dbUri)\n      .then((msg) => {\n        console.log('Connected to Mongo DB !')\n        resolve()\n      })\n      .catch((err) => {\n        console.log('Failed to connect dns mongo: ', err)\n        if (retryCount < 6) {\n          retryCount++\n          connectDB(dbUri, retryCount)\n        }\n      })\n  })\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const {\n            userAudioProfileId,\n            text,\n            firstName,\n            salutationId,\n            recordingId,\n            baseUrlForPotionAi,\n            env,\n          } = job\n\n          const DB_URI =\n            env === 'production'\n              ? mongoUriProd\n              : env === 'staging'\n              ? mongoUriStaging\n              : mongoUriDev\n\n          console.log('DB_URI ', DB_URI)\n          await connectDB(DB_URI)\n\n          // read the path for the training model for the this users audio profile\n\n          const userAudioProfile = await userAudioProfileService.find({\n            _id: userAudioProfileId,\n            status: 'completed',\n          })\n          if (userAudioProfile) {\n            const { training_model_path, userId } = userAudioProfile[0]\n            const {\n              voice_model_light_path,\n              voice_model_config_light_path,\n              voice_model_speakers_file_path, // name for speakers embeddings file path\n            } = training_model_path\n\n            const outputPath = `/tmp/${uuid()}/`\n            if (!fs.existsSync(outputPath)) {\n              fs.mkdirSync(outputPath, { recursive: true })\n            }\n\n            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n            console.log('AI_COMMAND ', AI_COMMAND)\n\n            const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n            console.time(SYNTHESIZE_AI_LABEL)\n            const aiResponse = await execShellCommand(AI_COMMAND)\n            console.timeEnd(SYNTHESIZE_AI_LABEL)\n\n            let generatedFileName = ''\n            fs.readdirSync(`${outputPath}`).forEach((file) => {\n              if (file.includes('sr48000.wav')) generatedFileName = file\n            })\n\n            // upload the file to s3\n            const uploadParams = {\n              filePath: `${outputPath}${generatedFileName}`,\n              bucket: `recordings-${env}`,\n              fileName: `${uuid()}_salutation_${firstName.replace(\n                '-',\n                '_'\n              )}.wav`,\n              contentType: 'audio/x-wav',\n              fileType: 'wav',\n            }\n            console.time('Time to Upload video on S3')\n            const greetingUploadResponse = await s3.upload(uploadParams)\n            console.timeEnd('Time to Upload video on S3')\n\n            // Create new entry with the s3 path to salutation collection for the user and its profile id\n            // upsert the salutation\n            await salutationService.updateOrCreate(\n              {\n                firstName: firstName,\n                salutationVideo: greetingUploadResponse,\n                userAudioProfileId,\n              },\n              userId\n            )\n            // update the dynamic recordings for the current dynamic video with salutation url\n            const salutationToUpdate = await recordingSalutationModel.findOne({\n              _id: salutationId,\n              deleted: false,\n            })\n\n            const recordingToUpdate = await recordingModel.findOne({\n              _id: recordingId,\n              deleted: false,\n            })\n\n            if (\n              salutationToUpdate &&\n              salutationToUpdate.deleted === false &&\n              recordingToUpdate\n            ) {\n              const jobsToInsert = []\n\n              await recordingSalutationModel.findOneAndUpdate(\n                {\n                  _id: salutationId,\n                },\n                {\n                  $set: {\n                    salutationVideo: greetingUploadResponse,\n                  },\n                }\n              )\n\n              const jobData = {\n                originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n                originalVideo:\n                  recordingToUpdate.originalVideoUrl ||\n                  recordingToUpdate.urls[0].url,\n                cropTimestamp: recordingToUpdate.cropTimestamp,\n                greetingClips: [greetingUploadResponse],\n                greetingObjects: [\n                  {\n                    greetingId: salutationToUpdate._id,\n                    firstName: firstName,\n                    videoUrl: greetingUploadResponse,\n                  },\n                ],\n                requestOrigin: baseUrlForPotionAi,\n                environment: env,\n                recordingId: recordingToUpdate._id,\n                salutation: salutationToUpdate._id,\n                dynamicVideoType: recordingToUpdate.dynamicVideoType,\n              }\n              jobsToInsert.push({\n                firstName,\n                recordingId: recordingToUpdate._id,\n                userId: recordingToUpdate.userId,\n                salutationId: salutationToUpdate._id,\n                metadata: jobData,\n              })\n\n              // create the job for the ai to create processing\n              if (jobsToInsert.length) {\n                await jobService.insertMany(jobsToInsert)\n              }\n            }\n\n            fs.unlinkSync(`${outputPath}${generatedFileName}`)\n            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n          } else {\n            Bugsnag.notify(\n              new Error(\n                `audio profile training model not found ` + JSON.stringify(job)\n              )\n            )\n\n            resolve() // to continue working on new jobs\n          }\n        } catch (error) {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while synthesizing audio', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n  try {\n    while (true) {\n      await processQueue()\nFILE:voice-synthsizer-job-handler/job/index.js\nconst Job = require('./job_model')\nconst JobService = require('./job_service')\n\nmodule.exports = JobService(Job)\nFILE:voice-synthsizer-job-handler/job/job_model.js\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\nconst JobSchema = Schema(\n  {\n    recordingId: {\n      type: Schema.Types.ObjectId,\n      required: false\n    },\n    userId: {\n      type: Schema.Types.ObjectId,\n      required: false\n    },\n    salutationId: {\n      type: Schema.Types.ObjectId,\n      required: false\n    },\n    type: {\n      type: String,\n      required: false,\n      default: 'ai-job'\n    },\n    firstName: {\n      type: String,\n      default: ''\n    },\n    weight: {\n      type: Number,\n      default: 0\n    },\n    email: {\n      type: String,\n      default: ''\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created'\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false\n    }\n  },\n  {\n    timestamps: true\n  }\n)\n\nmodule.exports = mongoose.model('Job', JobSchema)\nFILE:voice-synthsizer-job-handler/job/job_service.js\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (Job) => async (jobData) => {\n  try {\n    const newJob = new Job({ ...jobData })\n    const savedJob = await newJob.save()\n    return savedJob\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (Job) => async (jobData) => {\n  try {\n    const inserted = await Job.insertMany(jobData)\n    return inserted\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (Job) => async (filter) => {\n  try {\n    const foundJob = await Job.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (Job) => async (filter) => {\n  try {\n    const foundJobs = await Job.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundJobs\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (Job) => async (job) => {\n  try {\n    const updatedJob = await Job.findOneAndUpdate({ _id: job._id }, job, {\n      new: true,\n    })\n    return updatedJob\n  } catch (error) {\n    const details = { job }\n    console.log(\n      'ERROR - JOB SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (Job) => async (filter) => {\n  try {\n    const updatedJob = await Job.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (Job) => async (filter) => {\n  try {\n    const updatedJob = await Job.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (Job) => {\n  return {\n    create: create(Job),\n    insertMany: insertMany(Job),\n    read: read(Job),\n    remove: remove(Job),\n    removeMany: removeMany(Job),\n    update: update(Job),\n    find: find(Job),\n  }\n}\nFILE:voice-synthsizer-job-handler/package-lock.json\n{\n  \"name\": \"voice-synthesizer-job-handler\",\n  \"version\": \"1.0.0\",\n  \"lockfileVersion\": 1,\n  \"requires\": true,\n  \"dependencies\": {\n    \"@bugsnag/browser\": {\n      \"version\": \"7.16.2\",\n      \"resolved\": \"https://registry.npmjs.org/@bugsnag/browser/-/browser-7.16.2.tgz\",\n      \"integrity\": \"sha512-iBbAmjTDe0I6WPTHi3wIcmKu3ykydtT6fc8atJA65rzgDLMlTM1Wnwz4Ny1cn0bVouLGa48BRiOJ27Rwy7QRYA==\",\n      \"requires\": {\n        \"@bugsnag/core\": \"^7.16.1\"\n      }\n    },\n    \"@bugsnag/core\": {\n      \"version\": \"7.16.1\",\n      \"resolved\": \"https://registry.npmjs.org/@bugsnag/core/-/core-7.16.1.tgz\",\n      \"integrity\": \"sha512-zuBnL7B329VldItRqhXYrp1hjmjZnltJwNXMysi9WtY4t29WKk5LVwgWb1mPM9clJ0FoObZ7kvvQMUTKh3ezFQ==\",\n      \"requires\": {\n        \"@bugsnag/cuid\": \"^3.0.0\",\n        \"@bugsnag/safe-json-stringify\": \"^6.0.0\",\n        \"error-stack-parser\": \"^2.0.3\",\n        \"iserror\": \"0.0.2\",\n        \"stack-generator\": \"^2.0.3\"\n      }\n    },\n    \"@bugsnag/cuid\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/@bugsnag/cuid/-/cuid-3.0.0.tgz\",\n      \"integrity\": \"sha512-LOt8aaBI+KvOQGneBtpuCz3YqzyEAehd1f3nC5yr9TIYW1+IzYKa2xWS4EiMz5pPOnRPHkyyS5t/wmSmN51Gjg==\"\n    },\n    \"@bugsnag/js\": {\n      \"version\": \"7.16.2\",\n      \"resolved\": \"https://registry.npmjs.org/@bugsnag/js/-/js-7.16.2.tgz\",\n      \"integrity\": \"sha512-AzV0PtG3SZt+HnA2JmRJeI60aDNZsIJbEEAZIWZeATvWBt5RdVdsWKllM1SkTvURfxfdAVd4Xry3BgVrh8nEbg==\",\n      \"requires\": {\n        \"@bugsnag/browser\": \"^7.16.2\",\n        \"@bugsnag/node\": \"^7.16.2\"\n      }\n    },\n    \"@bugsnag/node\": {\n      \"version\": \"7.16.2\",\n      \"resolved\": \"https://registry.npmjs.org/@bugsnag/node/-/node-7.16.2.tgz\",\n      \"integrity\": \"sha512-V5pND701cIYGzjjTwt0tuvAU1YyPB9h7vo5F/DzrDHRPmCINA/oVbc0Twco87knc2VPe8ntGFqTicTY65iOWzg==\",\n      \"requires\": {\n        \"@bugsnag/core\": \"^7.16.1\",\n        \"byline\": \"^5.0.0\",\n        \"error-stack-parser\": \"^2.0.2\",\n        \"iserror\": \"^0.0.2\",\n        \"pump\": \"^3.0.0\",\n        \"stack-generator\": \"^2.0.3\"\n      }\n    },\n    \"@bugsnag/safe-json-stringify\": {\n      \"version\": \"6.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/@bugsnag/safe-json-stringify/-/safe-json-stringify-6.0.0.tgz\",\n      \"integrity\": \"sha512-htzFO1Zc57S8kgdRK9mLcPVTW1BY2ijfH7Dk2CeZmspTWKdKqSo1iwmqrq2WtRjFlo8aRZYgLX0wFrDXF/9DLA==\"\n    },\n    \"@types/node\": {\n      \"version\": \"17.0.29\",\n      \"resolved\": \"https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz\",\n      \"integrity\": \"sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==\"\n    },\n    \"@types/webidl-conversions\": {\n      \"version\": \"6.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-6.1.1.tgz\",\n      \"integrity\": \"sha512-XAahCdThVuCFDQLT7R7Pk/vqeObFNL3YqRyFZg+AqAP/W1/w3xHaIxuW7WszQqTbIBOPRcItYJIou3i/mppu3Q==\"\n    },\n    \"@types/whatwg-url\": {\n      \"version\": \"8.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.1.tgz\",\n      \"integrity\": \"sha512-2YubE1sjj5ifxievI5Ge1sckb9k/Er66HyR2c+3+I6VDUUg1TLPdYYTEbQ+DjRkS4nTxMJhgWfSfMRD2sl2EYQ==\",\n      \"requires\": {\n        \"@types/node\": \"*\",\n        \"@types/webidl-conversions\": \"*\"\n      }\n    },\n    \"at-least-node\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz\",\n      \"integrity\": \"sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==\"\n    },\n    \"aws-code-deploy\": {\n      \"version\": \"1.0.11\",\n      \"resolved\": \"https://registry.npmjs.org/aws-code-deploy/-/aws-code-deploy-1.0.11.tgz\",\n      \"integrity\": \"sha512-e/TKVqYO1jcqDwsQoOxq2UjdWncjlTjJoNzOEhY2NhOXqvwvm8ClizxZGPH6H/J6hyusi/LLP0Afp/ynXgLfRQ==\",\n      \"dev\": true\n    },\n    \"aws-sdk\": {\n      \"version\": \"2.1122.0\",\n      \"resolved\": \"https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1122.0.tgz\",\n      \"integrity\": \"sha512-545VawhsCQ7yEx9jZKV0hTTW3FS/waycISWMvnNwqRfpU9o4FQ4DSu3je7ekn5yFKM+91dxJC+IfJgtIV8WaUw==\",\n      \"requires\": {\n        \"buffer\": \"4.9.2\",\n        \"events\": \"1.1.1\",\n        \"ieee754\": \"1.1.13\",\n        \"jmespath\": \"0.16.0\",\n        \"querystring\": \"0.2.0\",\n        \"sax\": \"1.2.1\",\n        \"url\": \"0.10.3\",\n        \"uuid\": \"3.3.2\",\n        \"xml2js\": \"0.4.19\"\n      },\n      \"dependencies\": {\n        \"uuid\": {\n          \"version\": \"3.3.2\",\n          \"resolved\": \"https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz\",\n          \"integrity\": \"sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==\"\n        }\n      }\n    },\n    \"balanced-match\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz\",\n      \"integrity\": \"sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==\"\n    },\n    \"base64-js\": {\n      \"version\": \"1.5.1\",\n      \"resolved\": \"https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz\",\n      \"integrity\": \"sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==\"\n    },\n    \"brace-expansion\": {\n      \"version\": \"1.1.11\",\n      \"resolved\": \"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz\",\n      \"integrity\": \"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==\",\n      \"requires\": {\n        \"balanced-match\": \"^1.0.0\",\n        \"concat-map\": \"0.0.1\"\n      }\n    },\n    \"bson\": {\n      \"version\": \"4.6.3\",\n      \"resolved\": \"https://registry.npmjs.org/bson/-/bson-4.6.3.tgz\",\n      \"integrity\": \"sha512-rAqP5hcUVJhXP2MCSNVsf0oM2OGU1So6A9pVRDYayvJ5+hygXHQApf87wd5NlhPM1J9RJnbqxIG/f8QTzRoQ4A==\",\n      \"requires\": {\n        \"buffer\": \"^5.6.0\"\n      },\n      \"dependencies\": {\n        \"buffer\": {\n          \"version\": \"5.7.1\",\n          \"resolved\": \"https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz\",\n          \"integrity\": \"sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==\",\n          \"requires\": {\n            \"base64-js\": \"^1.3.1\",\n            \"ieee754\": \"^1.1.13\"\n          }\n        }\n      }\n    },\n    \"buffer\": {\n      \"version\": \"4.9.2\",\n      \"resolved\": \"https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz\",\n      \"integrity\": \"sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==\",\n      \"requires\": {\n        \"base64-js\": \"^1.0.2\",\n        \"ieee754\": \"^1.1.4\",\n        \"isarray\": \"^1.0.0\"\n      }\n    },\n    \"byline\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/byline/-/byline-5.0.0.tgz\",\n      \"integrity\": \"sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=\"\n    },\n    \"concat-map\": {\n      \"version\": \"0.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz\",\n      \"integrity\": \"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=\"\n    },\n    \"debug\": {\n      \"version\": \"4.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/debug/-/debug-4.3.4.tgz\",\n      \"integrity\": \"sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==\",\n      \"requires\": {\n        \"ms\": \"2.1.2\"\n      },\n      \"dependencies\": {\n        \"ms\": {\n          \"version\": \"2.1.2\",\n          \"resolved\": \"https://registry.npmjs.org/ms/-/ms-2.1.2.tgz\",\n          \"integrity\": \"sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==\"\n        }\n      }\n    },\n    \"denque\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/denque/-/denque-2.0.1.tgz\",\n      \"integrity\": \"sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==\"\n    },\n    \"end-of-stream\": {\n      \"version\": \"1.4.4\",\n      \"resolved\": \"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz\",\n      \"integrity\": \"sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==\",\n      \"requires\": {\n        \"once\": \"^1.4.0\"\n      }\n    },\n    \"error-stack-parser\": {\n      \"version\": \"2.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.7.tgz\",\n      \"integrity\": \"sha512-chLOW0ZGRf4s8raLrDxa5sdkvPec5YdvwbFnqJme4rk0rFajP8mPtrDL1+I+CwrQDCjswDA5sREX7jYQDQs9vA==\",\n      \"requires\": {\n        \"stackframe\": \"^1.1.1\"\n      }\n    },\n    \"events\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/events/-/events-1.1.1.tgz\",\n      \"integrity\": \"sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=\"\n    },\n    \"fs-extra\": {\n      \"version\": \"9.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz\",\n      \"integrity\": \"sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==\",\n      \"requires\": {\n        \"at-least-node\": \"^1.0.0\",\n        \"graceful-fs\": \"^4.2.0\",\n        \"jsonfile\": \"^6.0.1\",\n        \"universalify\": \"^2.0.0\"\n      }\n    },\n    \"fs.realpath\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz\",\n      \"integrity\": \"sha1-FQStJSMVjKpA20onh8sBQRmU6k8=\"\n    },\n    \"glob\": {\n      \"version\": \"7.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/glob/-/glob-7.2.0.tgz\",\n      \"integrity\": \"sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==\",\n      \"requires\": {\n        \"fs.realpath\": \"^1.0.0\",\n        \"inflight\": \"^1.0.4\",\n        \"inherits\": \"2\",\n        \"minimatch\": \"^3.0.4\",\n        \"once\": \"^1.3.0\",\n        \"path-is-absolute\": \"^1.0.0\"\n      }\n    },\n    \"graceful-fs\": {\n      \"version\": \"4.2.10\",\n      \"resolved\": \"https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz\",\n      \"integrity\": \"sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==\"\n    },\n    \"ieee754\": {\n      \"version\": \"1.1.13\",\n      \"resolved\": \"https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz\",\n      \"integrity\": \"sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==\"\n    },\n    \"inflight\": {\n      \"version\": \"1.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz\",\n      \"integrity\": \"sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=\",\n      \"requires\": {\n        \"once\": \"^1.3.0\",\n        \"wrappy\": \"1\"\n      }\n    },\n    \"inherits\": {\n      \"version\": \"2.0.4\",\nFILE:voice-synthsizer-job-handler/package.json\n{\n  \"name\": \"voice-synthesizer-job-handler\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice synthesizer jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n    \"deploy-staging\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.staging.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-staging.js\"\n  },\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}\nFILE:voice-synthsizer-job-handler/pm2-development.yml\napps:\n  - name: synthsizer-job\n    script: index.js\n    watch: false\n    autorestart: true\n    instances: 1\n    time: true\n    env:\n      NODE_ENV: 'production'\n      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-synthesizer-ai-staging.fifo'\n      APP_ENV: 'development'\n      BUGSNAG_BACKEND_KEY: '[REDACTED_generic-api-key]'\n      MONGODB_URI_DEV: 'mongodb+srv://[REDACTED_MONGO_USER_deve]:scrubbed_1@example.com7.mongodb.net/potion_development?retryWrites=true&w=majority'\nFILE:voice-synthsizer-job-handler/pm2-production.yml\napps:\n  - name: synthsizer-job\n    script: index.js\n    watch: false\n    autorestart: true\n    instances: 1\n    time: true\n    env:\n      NODE_ENV: 'production'\n      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-synthesizer-ai-production.fifo'\n      APP_ENV: 'production'\n      BUGSNAG_BACKEND_KEY: '[REDACTED_generic-api-key]'\n      MONGODB_URI_DEV: 'mongodb+srv://[REDACTED_MONGO_USER_deve]:scrubbed_1@example.com7.mongodb.net/potion_development?retryWrites=true&w=majority'\n      MONGODB_URI_PROD: 'mongodb+srv://[REDACTED_MONGO_USER_prod]:scrubbed_2@example.com.net/potion_production?retryWrites=true&w=majority'\nFILE:voice-synthsizer-job-handler/recording/index.js\nconst Recording = require('./recording_model')\n\n\nmodule.exports = Recording\nFILE:voice-synthsizer-job-handler/recording/recording_model.js\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\nconst RecordingSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    urls: [\n      new mongoose.Schema(\n        {\n          quality: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          url: {\n            type: String,\n            required: false,\n            default: '',\n          },\n        },\n        { _id: false }\n      ),\n    ],\n    faceVideoUrl: {\n      type: String,\n      required: false,\n      default: '',\n    },\n    title: {\n      type: String,\n      required: false,\n      default: '',\n    },\n    type: {\n      type: String,\n      required: false,\n      default: 'video/webm',\n    },\n    duration: {\n      type: String,\n      required: false,\n      default: '',\n    },\n    screenRecording: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n    uploadedRecording: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n    ctaClickCount: {\n      type: Number,\n      default: 0,\n    },\n    previewThumbnails: [\n      new mongoose.Schema(\n        {\n          size: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          url: {\n            type: String,\n            required: false,\n            default: '',\n          },\n        },\n        { _id: false }\n      ),\n    ],\n    previewGifs: [\n      new mongoose.Schema(\n        {\n          size: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          url: {\n            type: String,\n            required: false,\n            default: '',\n          },\n        },\n        { _id: false }\n      ),\n    ],\n    previewGifsVersion: {\n      type: Number,\n      required: false,\n      default: 0,\n    },\n    videoInitialGifUrl: {\n      type: String,\n      require: false,\n    },\n    unfirlGifUrl: {\n      type: String,\n      require: false,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: '0',\n    },\n    subtitles: [\n      new mongoose.Schema({\n        kind: {\n          type: String,\n          required: true,\n          default: 'subtitles',\n        },\n        label: {\n          type: String,\n          required: true,\n          default: 'English',\n        },\n        srclang: {\n          type: String,\n          required: true,\n          default: 'en',\n        },\n        url: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        transcriptId: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        transcriptionPending: {\n          type: Boolean,\n          required: true,\n          default: true,\n        },\n        isDefault: {\n          type: Boolean,\n          required: true,\n          default: true,\n        },\n      }),\n    ],\n    views: [\n      new mongoose.Schema({\n        deviceId: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        startedAt: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        viewedDuration: {\n          type: String,\n          required: false,\n          default: '',\n        },\n      }),\n    ],\n    draft: {\n      type: Boolean,\n      require: true,\n      default: true,\n    },\n    notified: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamic: {\n      type: Boolean,\n      require: false,\n    },\n    dynamicVideoProcessing: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamicVideoProcessingError: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamicVideoTemplate: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamicVideoTemplateBackgroundUrl: {\n      type: String,\n    },\n    dynamicVideoTemplateGenerationStatus: {\n      type: String,\n      require: false,\n      default: '',\n    },\n    dynamicVideoType: {\n      type: String,\n      default: 'video',\n    },\n    templateRecordingId: {\n      type: Schema.Types.ObjectId,\n      default: null,\n    },\n    autoGenerated: {\n      type: Boolean,\n      require: false,\n    },\n    masterRecordingId: {\n      type: Schema.Types.ObjectId,\n      require: false,\n      ref: 'Recordings',\n      default: null,\n    },\n    dynamicRecordings: [\n      new mongoose.Schema(\n        {\n          recordingId: {\n            type: Schema.Types.ObjectId,\n          },\n          firstName: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          salutationVideo: {\n            type: String,\n            default: null,\n          },\n          salutationVideoProcessed: {\n            type: String,\n            default: null,\n          },\n          screenRecordingProcessed: {\n            type: String,\n          },\n          transcriptId: {\n            type: String,\n          },\n          processed: {\n            type: Boolean,\n            default: false,\n          },\n          inProgress: {\n            type: Boolean,\n            default: false,\n          },\n          deleted: {\n            type: Boolean,\nFILE:voice-synthsizer-job-handler/recording_salutation/index.js\nconst RecordingSalutationModel = require('./recording_salutation_model')\r\n\r\nmodule.exports = RecordingSalutationModel\r\nFILE:voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\nconst mongoose = require('mongoose')\r\nconst Schema = mongoose.Schema\r\n\r\nconst RecordingSalutationSchema = Schema(\r\n  {\r\n    userId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'User',\r\n      required: true\r\n    },\r\n    masterRecordingId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'Recordings',\r\n      required: true\r\n    },\r\n    recordingId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'Recordings',\r\n      required: false\r\n    },\r\n    firstName: {\r\n      type: String,\r\n      required: false,\r\n      default: ''\r\n    },\r\n    salutationVideo: {\r\n      type: String,\r\n      default: null\r\n    },\r\n    salutationVideoProcessed: {\r\n      type: String,\r\n      default: null\r\n    },\r\n    screenRecordingProcessed: {\r\n      type: String\r\n    },\r\n    transcriptId: {\r\n      type: String\r\n    },\r\n    processed: {\r\n      type: Boolean,\r\n      default: false\r\n    },\r\n    inProgress: {\r\n      type: Boolean,\r\n      default: false\r\n    },\r\n    deleted: {\r\n      type: Boolean,\r\n      default: false\r\n    },\r\n    backgroundScreenUrl: {\r\n      type: String\r\n    },\r\n    backgroundScreenFileUrl: {\r\n      type: String\r\n    },\r\n    slug: {\r\n      type: String\r\n    },\r\n    status: {\r\n      type: String,\r\n      default: null\r\n    }\r\n  },\r\n  {\r\n    timestamps: true\r\n  }\r\n)\r\n\r\nconst RecordingSalutationModel = mongoose.model(\r\n  'recording_salutations',\r\n  RecordingSalutationSchema\r\n)\r\n\r\nmodule.exports = RecordingSalutationModel\r\nFILE:voice-synthsizer-job-handler/salutation/index.js\nconst SalutationModel = require('./salutation_model')\r\nconst SalutationService = require('./salutation_service')\r\n\r\nmodule.exports = SalutationService(SalutationModel)\r\nFILE:voice-synthsizer-job-handler/salutation/salutation_model.js\nconst mongoose = require('mongoose')\r\nconst Schema = mongoose.Schema\r\nconst SalutationSchema = Schema(\r\n  {\r\n    userId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'User',\r\n      required: true\r\n    },\r\n    firstName: {\r\n      type: String,\r\n      required: false,\r\n      default: ''\r\n    },\r\n    salutationVideo: {\r\n      type: String,\r\n      default: null\r\n    },\r\n    transcriptId: {\r\n      type: String,\r\n      default: null,\r\n      required: false\r\n    },\r\n    userAudioProfileId: {\r\n      type: Schema.Types.ObjectId,\r\n      default: null,\r\n      required: false\r\n    },\r\n    transcriptObj: {\r\n      type: Object,\r\n      default: null,\r\n      required: false\r\n    },\r\n    deleted: {\r\n      type: Boolean,\r\n      default: false\r\n    }\r\n  },\r\n  {\r\n    timestamps: true\r\n  }\r\n)\r\n\r\nmodule.exports = mongoose.model('Salutations', SalutationSchema)\r\nFILE:voice-synthsizer-job-handler/salutation/salutation_service.js\nconst create = (Salutation) => async (salutationData, userId) => {\r\n  const newSalutation = new Salutation({ ...salutationData, userId })\r\n  const savedSalutation = await newSalutation.save()\r\n  return savedSalutation\r\n}\r\n\r\nconst read = (Salutation) => async (filter) => {\r\n  const foundSalutation = await Salutation.findOne({\r\n    ...filter,\r\n    deleted: false,\r\n  })\r\n  return foundSalutation\r\n}\r\n\r\nconst find = (Salutation) => async (filter) => {\r\n  const foundSalutations = await Salutation.find({\r\n    ...filter,\r\n    deleted: false,\r\n  })\r\n  return foundSalutations\r\n}\r\n\r\nconst update = (Salutation) => async (salutation, userId) => {\r\n  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n    { _id: salutation._id, userId },\r\n    salutation,\r\n    { new: true }\r\n  )\r\n  return updatedSalutation\r\n}\r\n\r\nconst modify = (Salutation) => async (salutation) => {\r\n  const findQuery = salutation._id\r\n    ? { _id: salutation._id }\r\n    : { transcriptId: salutation.transcriptId }\r\n\r\n  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n    findQuery,\r\n    salutation,\r\n    { new: true }\r\n  )\r\n  return updatedSalutation\r\n}\r\n\r\nconst updateOrCreate =\r\n  (Salutation) =>\r\n  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\r\n    const salutation = await read(Salutation)({\r\n      firstName,\r\n      userAudioProfileId,\r\n      userId,\r\n    })\r\n    if (salutation) {\r\n      salutation.salutationVideo = salutationVideo\r\n      return await update(Salutation)(salutation, userId)\r\n    } else {\r\n      return await create(Salutation)(\r\n        { firstName, salutationVideo, userAudioProfileId },\r\n        userId\r\n      )\r\n    }\r\n  }\r\n\r\nconst remove = (Salutation) => async (filter, userId) => {\r\n  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n    { ...filter, userId },\r\n    {\r\n      $set: {\r\n        deleted: true,\r\n      },\r\n    },\r\n    { new: true }\r\n  )\r\n  return updatedSalutation\r\n}\r\n\r\nmodule.exports = (Salutation) => {\r\n  return {\r\n    create: create(Salutation),\r\n    read: read(Salutation),\r\n    remove: remove(Salutation),\r\n    update: update(Salutation),\r\n    updateOrCreate: updateOrCreate(Salutation),\r\n    find: find(Salutation),\r\n    modify: modify(Salutation),\r\n  }\r\n}\r\nFILE:voice-synthsizer-job-handler/user_audio_profile/index.js\nconst UserAudioProfile = require('./user_audio_profile_model')\nconst UserAudioProfileService = require('./user_audio_profile_service')\n\nmodule.exports = UserAudioProfileService(UserAudioProfile)\nFILE:voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst UserAudioProfileSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    name: {\n      type: String,\n      required: true,\n      default: '',\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    training_model_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model_s3_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\nFILE:voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (UserAudioProfileModel) => async (data) => {\n  try {\n    const newModel = new UserAudioProfileModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (UserAudioProfileModel) => async (data) => {\n  try {\n    const inserted = await UserAudioProfileModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModel = await UserAudioProfileModel.findOne({\n      ...filter,\n      deleted: false\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModels = await UserAudioProfileModel.find({\n      ...filter,\n      deleted: false\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (UserAudioProfileModel) => async (data) => {\n  console.log('ua data', data)\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true\n      }\n    )\n    console.log('ua updatedModel', updatedModel)\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true\n        }\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true\n        }\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (UserAudioProfileModel) => {\n  return {\n    create: create(UserAudioProfileModel),\n    insertMany: insertMany(UserAudioProfileModel),\n    read: read(UserAudioProfileModel),\n    remove: remove(UserAudioProfileModel),\n    removeMany: removeMany(UserAudioProfileModel),\n    update: update(UserAudioProfileModel),\n    find: find(UserAudioProfileModel)\n  }\n}\nFILE:voice-synthsizer-job-handler/yarn.lock\n# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n# yarn lockfile v1\n\n\n\"@aws-crypto/ie11-detection@^2.0.0\":\n  version \"2.0.2\"\n  resolved \"https://registry.yarnpkg.com/@aws-crypto/ie11-detection/-/ie11-detection-2.0.2.tgz#9c39f4a5558196636031a933ec1b4792de959d6a\"\n  integrity sha512-5XDMQY98gMAf/WRTic5G++jfmS/VLM0rwpiOpaainKi4L0nqWMSB1SzsrEG5rjFZGYN6ZAefO+/Yta2dFM0kMw==\n  dependencies:\n    tslib \"^1.11.1\"\n\n\"@aws-crypto/sha256-browser@2.0.0\":\n  version \"2.0.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-crypto/sha256-browser/-/sha256-browser-2.0.0.tgz#741c9024df55ec59b51e5b1f5d806a4852699fb5\"\n  integrity sha512-rYXOQ8BFOaqMEHJrLHul/25ckWH6GTJtdLSajhlqGMx0PmSueAuvboCuZCTqEKlxR8CQOwRarxYMZZSYlhRA1A==\n  dependencies:\n    \"@aws-crypto/ie11-detection\" \"^2.0.0\"\n    \"@aws-crypto/sha256-js\" \"^2.0.0\"\n    \"@aws-crypto/supports-web-crypto\" \"^2.0.0\"\n    \"@aws-crypto/util\" \"^2.0.0\"\n    \"@aws-sdk/types\" \"^3.1.0\"\n    \"@aws-sdk/util-locate-window\" \"^3.0.0\"\n    \"@aws-sdk/util-utf8-browser\" \"^3.0.0\"\n    tslib \"^1.11.1\"\n\n\"@aws-crypto/sha256-js@2.0.0\":\n  version \"2.0.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-crypto/sha256-js/-/sha256-js-2.0.0.tgz#f1f936039bdebd0b9e2dd834d65afdc2aac4efcb\"\n  integrity sha512-VZY+mCY4Nmrs5WGfitmNqXzaE873fcIZDu54cbaDaaamsaTOP1DBImV9F4pICc3EHjQXujyE8jig+PFCaew9ig==\n  dependencies:\n    \"@aws-crypto/util\" \"^2.0.0\"\n    \"@aws-sdk/types\" \"^3.1.0\"\n    tslib \"^1.11.1\"\n\n\"@aws-crypto/sha256-js@^2.0.0\":\n  version \"2.0.2\"\n  resolved \"https://registry.yarnpkg.com/@aws-crypto/sha256-js/-/sha256-js-2.0.2.tgz#c81e5d378b8a74ff1671b58632779986e50f4c99\"\n  integrity sha512-iXLdKH19qPmIC73fVCrHWCSYjN/sxaAvZ3jNNyw6FclmHyjLKg0f69WlC9KTnyElxCR5MO9SKaG00VwlJwyAkQ==\n  dependencies:\n    \"@aws-crypto/util\" \"^2.0.2\"\n    \"@aws-sdk/types\" \"^3.110.0\"\n    tslib \"^1.11.1\"\n\n\"@aws-crypto/supports-web-crypto@^2.0.0\":\n  version \"2.0.2\"\n  resolved \"https://registry.yarnpkg.com/@aws-crypto/supports-web-crypto/-/supports-web-crypto-2.0.2.tgz#9f02aafad8789cac9c0ab5faaebb1ab8aa841338\"\n  integrity sha512-6mbSsLHwZ99CTOOswvCRP3C+VCWnzBf+1SnbWxzzJ9lR0mA0JnY2JEAhp8rqmTE0GPFy88rrM27ffgp62oErMQ==\n  dependencies:\n    tslib \"^1.11.1\"\n\n\"@aws-crypto/util@^2.0.0\", \"@aws-crypto/util@^2.0.2\":\n  version \"2.0.2\"\n  resolved \"https://registry.yarnpkg.com/@aws-crypto/util/-/util-2.0.2.tgz#adf5ff5dfbc7713082f897f1d01e551ce0edb9c0\"\n  integrity sha512-Lgu5v/0e/BcrZ5m/IWqzPUf3UYFTy/PpeED+uc9SWUR1iZQL8XXbGQg10UfllwwBryO3hFF5dizK+78aoXC1eA==\n  dependencies:\n    \"@aws-sdk/types\" \"^3.110.0\"\n    \"@aws-sdk/util-utf8-browser\" \"^3.0.0\"\n    tslib \"^1.11.1\"\n\n\"@aws-sdk/abort-controller@3.226.0\":\n  version \"3.226.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/abort-controller/-/abort-controller-3.226.0.tgz#3adffb8ee5af57ddb154e8544a8eeec76ad32271\"\n  integrity sha512-cJVzr1xxPBd08voknXvR0RLgtZKGKt6WyDpH/BaPCu3rfSqWCDZKzwqe940eqosjmKrxC6pUZNKASIqHOQ8xxQ==\n  dependencies:\n    \"@aws-sdk/types\" \"3.226.0\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/client-cognito-identity@3.231.0\":\n  version \"3.231.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.231.0.tgz#8c55118820a646cad3c09cdde7bec8fda550a433\"\n  integrity sha512-68/sVzGkjU+/weMKpiSRjFmqvX6pTzMUyaholXUFXm5NzU51sWGc9w4+4PL4qwjCDPEHwDlCID5Pp5Ttgei+0Q==\n  dependencies:\n    \"@aws-crypto/sha256-browser\" \"2.0.0\"\n    \"@aws-crypto/sha256-js\" \"2.0.0\"\n    \"@aws-sdk/client-sts\" \"3.231.0\"\n    \"@aws-sdk/config-resolver\" \"3.231.0\"\n    \"@aws-sdk/credential-provider-node\" \"3.231.0\"\n    \"@aws-sdk/fetch-http-handler\" \"3.226.0\"\n    \"@aws-sdk/hash-node\" \"3.226.0\"\n    \"@aws-sdk/invalid-dependency\" \"3.226.0\"\n    \"@aws-sdk/middleware-content-length\" \"3.226.0\"\n    \"@aws-sdk/middleware-endpoint\" \"3.226.0\"\n    \"@aws-sdk/middleware-host-header\" \"3.226.0\"\n    \"@aws-sdk/middleware-logger\" \"3.226.0\"\n    \"@aws-sdk/middleware-recursion-detection\" \"3.226.0\"\n    \"@aws-sdk/middleware-retry\" \"3.229.0\"\n    \"@aws-sdk/middleware-serde\" \"3.226.0\"\n    \"@aws-sdk/middleware-signing\" \"3.226.0\"\n    \"@aws-sdk/middleware-stack\" \"3.226.0\"\n    \"@aws-sdk/middleware-user-agent\" \"3.226.0\"\n    \"@aws-sdk/node-config-provider\" \"3.226.0\"\n    \"@aws-sdk/node-http-handler\" \"3.226.0\"\n    \"@aws-sdk/protocol-http\" \"3.226.0\"\n    \"@aws-sdk/smithy-client\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    \"@aws-sdk/url-parser\" \"3.226.0\"\n    \"@aws-sdk/util-base64\" \"3.208.0\"\n    \"@aws-sdk/util-body-length-browser\" \"3.188.0\"\n    \"@aws-sdk/util-body-length-node\" \"3.208.0\"\n    \"@aws-sdk/util-defaults-mode-browser\" \"3.226.0\"\n    \"@aws-sdk/util-defaults-mode-node\" \"3.231.0\"\n    \"@aws-sdk/util-endpoints\" \"3.226.0\"\n    \"@aws-sdk/util-retry\" \"3.229.0\"\n    \"@aws-sdk/util-user-agent-browser\" \"3.226.0\"\n    \"@aws-sdk/util-user-agent-node\" \"3.226.0\"\n    \"@aws-sdk/util-utf8-browser\" \"3.188.0\"\n    \"@aws-sdk/util-utf8-node\" \"3.208.0\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/client-sso-oidc@3.231.0\":\n  version \"3.231.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.231.0.tgz#de8783b608faf4b829b52e12a088f88326f9b851\"\n  integrity sha512-yqEZW9/Q6VvMDMcQoE52oa/oa6F8z8cqyax7m29VpuVrncYcfELpkZKWPoaJVfierR5ysKfKiAU0acPgMpvllQ==\n  dependencies:\n    \"@aws-crypto/sha256-browser\" \"2.0.0\"\n    \"@aws-crypto/sha256-js\" \"2.0.0\"\n    \"@aws-sdk/config-resolver\" \"3.231.0\"\n    \"@aws-sdk/fetch-http-handler\" \"3.226.0\"\n    \"@aws-sdk/hash-node\" \"3.226.0\"\n    \"@aws-sdk/invalid-dependency\" \"3.226.0\"\n    \"@aws-sdk/middleware-content-length\" \"3.226.0\"\n    \"@aws-sdk/middleware-endpoint\" \"3.226.0\"\n    \"@aws-sdk/middleware-host-header\" \"3.226.0\"\n    \"@aws-sdk/middleware-logger\" \"3.226.0\"\n    \"@aws-sdk/middleware-recursion-detection\" \"3.226.0\"\n    \"@aws-sdk/middleware-retry\" \"3.229.0\"\n    \"@aws-sdk/middleware-serde\" \"3.226.0\"\n    \"@aws-sdk/middleware-stack\" \"3.226.0\"\n    \"@aws-sdk/middleware-user-agent\" \"3.226.0\"\n    \"@aws-sdk/node-config-provider\" \"3.226.0\"\n    \"@aws-sdk/node-http-handler\" \"3.226.0\"\n    \"@aws-sdk/protocol-http\" \"3.226.0\"\n    \"@aws-sdk/smithy-client\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    \"@aws-sdk/url-parser\" \"3.226.0\"\n    \"@aws-sdk/util-base64\" \"3.208.0\"\n    \"@aws-sdk/util-body-length-browser\" \"3.188.0\"\n    \"@aws-sdk/util-body-length-node\" \"3.208.0\"\n    \"@aws-sdk/util-defaults-mode-browser\" \"3.226.0\"\n    \"@aws-sdk/util-defaults-mode-node\" \"3.231.0\"\n    \"@aws-sdk/util-endpoints\" \"3.226.0\"\n    \"@aws-sdk/util-retry\" \"3.229.0\"\n    \"@aws-sdk/util-user-agent-browser\" \"3.226.0\"\n    \"@aws-sdk/util-user-agent-node\" \"3.226.0\"\n    \"@aws-sdk/util-utf8-browser\" \"3.188.0\"\n    \"@aws-sdk/util-utf8-node\" \"3.208.0\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/client-sso@3.231.0\":\n  version \"3.231.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.231.0.tgz#783322cb936da353bb047dd2fb762eab09c19c50\"\n  integrity sha512-/q7BptaMiT6/wxW9vE/gcQuApMXio5vdTuqt77A6+mjqhNzYFfCn7RRS4BU8KEOpZObnYBKP3mYe3NDccEbMzQ==\n  dependencies:\n    \"@aws-crypto/sha256-browser\" \"2.0.0\"\n    \"@aws-crypto/sha256-js\" \"2.0.0\"\n    \"@aws-sdk/config-resolver\" \"3.231.0\"\n    \"@aws-sdk/fetch-http-handler\" \"3.226.0\"\n    \"@aws-sdk/hash-node\" \"3.226.0\"\n    \"@aws-sdk/invalid-dependency\" \"3.226.0\"\n    \"@aws-sdk/middleware-content-length\" \"3.226.0\"\n    \"@aws-sdk/middleware-endpoint\" \"3.226.0\"\n    \"@aws-sdk/middleware-host-header\" \"3.226.0\"\n    \"@aws-sdk/middleware-logger\" \"3.226.0\"\n    \"@aws-sdk/middleware-recursion-detection\" \"3.226.0\"\n    \"@aws-sdk/middleware-retry\" \"3.229.0\"\n    \"@aws-sdk/middleware-serde\" \"3.226.0\"\n    \"@aws-sdk/middleware-stack\" \"3.226.0\"\n    \"@aws-sdk/middleware-user-agent\" \"3.226.0\"\n    \"@aws-sdk/node-config-provider\" \"3.226.0\"\n    \"@aws-sdk/node-http-handler\" \"3.226.0\"\n    \"@aws-sdk/protocol-http\" \"3.226.0\"\n    \"@aws-sdk/smithy-client\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    \"@aws-sdk/url-parser\" \"3.226.0\"\n    \"@aws-sdk/util-base64\" \"3.208.0\"\n    \"@aws-sdk/util-body-length-browser\" \"3.188.0\"\n    \"@aws-sdk/util-body-length-node\" \"3.208.0\"\n    \"@aws-sdk/util-defaults-mode-browser\" \"3.226.0\"\n    \"@aws-sdk/util-defaults-mode-node\" \"3.231.0\"\n    \"@aws-sdk/util-endpoints\" \"3.226.0\"\n    \"@aws-sdk/util-retry\" \"3.229.0\"\n    \"@aws-sdk/util-user-agent-browser\" \"3.226.0\"\n    \"@aws-sdk/util-user-agent-node\" \"3.226.0\"\n    \"@aws-sdk/util-utf8-browser\" \"3.188.0\"\n    \"@aws-sdk/util-utf8-node\" \"3.208.0\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/client-sts@3.231.0\":\n  version \"3.231.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.231.0.tgz#ec4689dc8d4d81d4bd1a13f3508bf3c9d5a1e7fb\"\n  integrity sha512-5WYqlcbM49ofOFBsu28QBt3t26M5D9XynhSaswSrCzawwdNkIMYQrKOCplF5mqOy+GywVIRrFeCVVrAKPMZJxQ==\n  dependencies:\n    \"@aws-crypto/sha256-browser\" \"2.0.0\"\n    \"@aws-crypto/sha256-js\" \"2.0.0\"\n    \"@aws-sdk/config-resolver\" \"3.231.0\"\n    \"@aws-sdk/credential-provider-node\" \"3.231.0\"\n    \"@aws-sdk/fetch-http-handler\" \"3.226.0\"\n    \"@aws-sdk/hash-node\" \"3.226.0\"\n    \"@aws-sdk/invalid-dependency\" \"3.226.0\"\n    \"@aws-sdk/middleware-content-length\" \"3.226.0\"\n    \"@aws-sdk/middleware-endpoint\" \"3.226.0\"\n    \"@aws-sdk/middleware-host-header\" \"3.226.0\"\n    \"@aws-sdk/middleware-logger\" \"3.226.0\"\n    \"@aws-sdk/middleware-recursion-detection\" \"3.226.0\"\n    \"@aws-sdk/middleware-retry\" \"3.229.0\"\n    \"@aws-sdk/middleware-sdk-sts\" \"3.226.0\"\n    \"@aws-sdk/middleware-serde\" \"3.226.0\"\n    \"@aws-sdk/middleware-signing\" \"3.226.0\"\n    \"@aws-sdk/middleware-stack\" \"3.226.0\"\n    \"@aws-sdk/middleware-user-agent\" \"3.226.0\"\n    \"@aws-sdk/node-config-provider\" \"3.226.0\"\n    \"@aws-sdk/node-http-handler\" \"3.226.0\"\n    \"@aws-sdk/protocol-http\" \"3.226.0\"\n    \"@aws-sdk/smithy-client\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    \"@aws-sdk/url-parser\" \"3.226.0\"\n    \"@aws-sdk/util-base64\" \"3.208.0\"\n    \"@aws-sdk/util-body-length-browser\" \"3.188.0\"\n    \"@aws-sdk/util-body-length-node\" \"3.208.0\"\n    \"@aws-sdk/util-defaults-mode-browser\" \"3.226.0\"\n    \"@aws-sdk/util-defaults-mode-node\" \"3.231.0\"\n    \"@aws-sdk/util-endpoints\" \"3.226.0\"\n    \"@aws-sdk/util-retry\" \"3.229.0\"\n    \"@aws-sdk/util-user-agent-browser\" \"3.226.0\"\n    \"@aws-sdk/util-user-agent-node\" \"3.226.0\"\n    \"@aws-sdk/util-utf8-browser\" \"3.188.0\"\n    \"@aws-sdk/util-utf8-node\" \"3.208.0\"\n    fast-xml-parser \"4.0.11\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/config-resolver@3.231.0\":\n  version \"3.231.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/config-resolver/-/config-resolver-3.231.0.tgz#3254a73d10c5d1eeaa2ee8d500676ca7e2ec4339\"\n  integrity sha512-qpjV4Fw/NQ4a0p5/qwzqaShflYRlY/SPcgA7N5GTJjIjZjg3NV+5BKJSF3VeZcNKfbXq68kkn207OSCpyheYxQ==\n  dependencies:\n    \"@aws-sdk/signature-v4\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    \"@aws-sdk/util-config-provider\" \"3.208.0\"\n    \"@aws-sdk/util-middleware\" \"3.226.0\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/credential-provider-cognito-identity@3.231.0\":\n  version \"3.231.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.231.0.tgz#a9e4d96717acdabb86bbd30e3ccefeb3854f7a3a\"\n  integrity sha512-T3NkElmlSMWKKMzu46C4ZcneuYWvnUQT2XTQlaJG28b2IPnpzjPn1m8DumBsSNgZhqwFJI9VPD4+Pt2AB/YysQ==\n  dependencies:\n    \"@aws-sdk/client-cognito-identity\" \"3.231.0\"\n    \"@aws-sdk/property-provider\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    tslib \"^2.3.1\"\n\n\"@aws-sdk/credential-provider-env@3.226.0\":\n  version \"3.226.0\"\n  resolved \"https://registry.yarnpkg.com/@aws-sdk/credential-provider-env/-/credential-provider-env-3.226.0.tgz#0bcb89a9abc166b3a48f5c255b9fcabc4cb80daf\"\n  integrity sha512-sd8uK1ojbXxaZXlthzw/VXZwCPUtU3PjObOfr3Evj7MPIM2IH8h29foOlggx939MdLQGboJf9gKvLlvKDWtJRA==\n  dependencies:\n    \"@aws-sdk/property-provider\" \"3.226.0\"\n    \"@aws-sdk/types\" \"3.226.0\"\n    tslib \"^2.3.1\"\n\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_10","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,280p' README.md && sed -n '1,220p' voice-cloning-job-handler/pm2-development.yml && sed -n '1,220p' voice-cloning-job-handler/pm2-production.yml && git show --stat --oneline HEAD && git ls-tree -r --name-only HEAD\"","aggregated_output":"15b3565 initial\n .claude/settings.json                              |       1 +\n .gitignore                                         |     165 +\n .styx_prs/pr_1.json                                |     150 +\n .styx_prs/pr_10.json                               |     101 +\n .styx_prs/pr_11.json                               |     583 +\n .styx_prs/pr_12.json                               |     129 +\n .styx_prs/pr_13.json                               |      76 +\n .styx_prs/pr_14.json                               |     107 +\n .styx_prs/pr_15.json                               |     417 +\n .styx_prs/pr_16.json                               |     751 +\n .styx_prs/pr_17.json                               |     263 +\n .styx_prs/pr_18.json                               |     661 +\n .styx_prs/pr_19.json                               |     234 +\n .styx_prs/pr_2.json                                |     100 +\n .styx_prs/pr_20.json                               |    2052 +\n .styx_prs/pr_21.json                               |      94 +\n .styx_prs/pr_22.json                               |     130 +\n .styx_prs/pr_23.json                               |     948 +\n .styx_prs/pr_24.json                               |     298 +\n .styx_prs/pr_25.json                               |      72 +\n .styx_prs/pr_26.json                               |      72 +\n .styx_prs/pr_27.json                               |      76 +\n .styx_prs/pr_28.json                               |     508 +\n .styx_prs/pr_3.json                                |      78 +\n .styx_prs/pr_4.json                                |     930 +\n .styx_prs/pr_5.json                                |      85 +\n .styx_prs/pr_6.json                                |      97 +\n .styx_prs/pr_7.json                                |      91 +\n .styx_prs/pr_8.json                                |     193 +\n .styx_prs/pr_9.json                                |     119 +\n README.md                                          |       2 +\n app/services/s3/index.js                           |      61 +\n app/services/s3/s3_service.js                      |       0\n app/services/sqs/index.js                          |       6 +\n app/services/sqs/sqs_service.js                    |      83 +\n app/services/utils/bugsnag.js                      |      18 +\n app/services/utils/deleteFile.js                   |       9 +\n app/services/utils/index.js                        |      19 +\n app/services/utils/logService.js                   |      14 +\n app/services/voice_cloning/index.js                |       4 +\n app/services/voice_cloning/voice_cloning_model.js  |      44 +\n .../voice_cloning/voice_cloning_service.js         |     140 +\n package.json                                       |      21 +\n requirements.dev.local.txt                         |      12 +\n requirements.dev.txt                               |      12 +\n requirements.prod.cpu.txt                          |      10 +\n requirements.prod.gpu.txt                          |      10 +\n requirements.txt                                   |      11 +\n voice-cloning-job-handler/index.js                 |     332 +\n voice-cloning-job-handler/package.json             |      24 +\n voice-cloning-job-handler/pm2-development.yml      |      18 +\n voice-cloning-job-handler/pm2-production.yml       |      18 +\n .../user_audio_profile/index.js                    |       4 +\n .../user_audio_profile/user_audio_profile_model.js |      40 +\n .../user_audio_profile_service.js                  |     140 +\n voice-cloning-job-handler/voice_cloning/index.js   |       4 +\n .../voice_cloning/voice_cloning_model.js           |      44 +\n .../voice_cloning/voice_cloning_service.js         |     141 +\n .../assets/speaker_encoder_model/config_se.json    |     121 +\n .../assets/speaker_encoder_model/model_se.pth.tar  |     Bin 0 -> 44610930 bytes\n voice-cloning/assets/wgnd_2_0_sources.csv.gz       |     Bin 0 -> 21825148 bytes\n .../assets/wgnd_2_0_unique_names_only.csv.gz       |     Bin 0 -> 11967143 bytes\n ...2_0_unique_names_only_limited_special_chars.csv | 3270538 +++++++++++++++++\n voice-cloning/clone_voice.py                       |     226 +\n .../potion-voice-cloning_Installation_Guide.md     |     764 +\n voice-cloning/minimize_cloned_voice_model.py       |     120 +\n voice-cloning/prepare_datasets.py                  |     191 +\n voice-cloning/score_cloned_voice.py                |     179 +\n voice-cloning/score_models.py                      |     219 +\n voice-cloning/score_salutation.py                  |     161 +\n voice-cloning/synthesize_speech.py                 |     144 +\n voice-cloning/train_config.py                      |      48 +\n voice-cloning/train_multispeaker_baseline_model.py |     238 +\n voice-cloning/utils/matching_utils.py              |      22 +\n voice-cloning/utils/scoring_utils.py               |      37 +\n voice-cloning/utils/synthesize_utils.py            |      77 +\n voice-cloning/utils/transcription_utils.py         |      94 +\n voice-synthsizer-job-handler/index.js              |     267 +\n voice-synthsizer-job-handler/job/index.js          |       4 +\n voice-synthsizer-job-handler/job/job_model.js      |      54 +\n voice-synthsizer-job-handler/job/job_service.js    |     136 +\n voice-synthsizer-job-handler/package.json          |      23 +\n voice-synthsizer-job-handler/pm2-development.yml   |      13 +\n voice-synthsizer-job-handler/pm2-production.yml    |      14 +\n voice-synthsizer-job-handler/recording/index.js    |       4 +\n .../recording/recording_model.js                   |     406 +\n .../recording_salutation/index.js                  |       3 +\n .../recording_salutation_model.js                  |      76 +\n voice-synthsizer-job-handler/salutation/index.js   |       4 +\n .../salutation/salutation_model.js                 |      44 +\n .../salutation/salutation_service.js               |      87 +\n .../user_audio_profile/index.js                    |       4 +\n .../user_audio_profile/user_audio_profile_model.js |      40 +\n .../user_audio_profile_service.js                  |     142 +\n 94 files changed, 3285322 insertions(+)\n.claude/settings.json\n.gitignore\n.styx_prs/pr_1.json\n.styx_prs/pr_10.json\n.styx_prs/pr_11.json\n.styx_prs/pr_12.json\n.styx_prs/pr_13.json\n.styx_prs/pr_14.json\n.styx_prs/pr_15.json\n.styx_prs/pr_16.json\n.styx_prs/pr_17.json\n.styx_prs/pr_18.json\n.styx_prs/pr_19.json\n.styx_prs/pr_2.json\n.styx_prs/pr_20.json\n.styx_prs/pr_21.json\n.styx_prs/pr_22.json\n.styx_prs/pr_23.json\n.styx_prs/pr_24.json\n.styx_prs/pr_25.json\n.styx_prs/pr_26.json\n.styx_prs/pr_27.json\n.styx_prs/pr_28.json\n.styx_prs/pr_3.json\n.styx_prs/pr_4.json\n.styx_prs/pr_5.json\n.styx_prs/pr_6.json\n.styx_prs/pr_7.json\n.styx_prs/pr_8.json\n.styx_prs/pr_9.json\nREADME.md\napp/services/s3/index.js\napp/services/s3/s3_service.js\napp/services/sqs/index.js\napp/services/sqs/sqs_service.js\napp/services/utils/bugsnag.js\napp/services/utils/deleteFile.js\napp/services/utils/index.js\napp/services/utils/logService.js\napp/services/voice_cloning/index.js\napp/services/voice_cloning/voice_cloning_model.js\napp/services/voice_cloning/voice_cloning_service.js\npackage.json\nrequirements.dev.local.txt\nrequirements.dev.txt\nrequirements.prod.cpu.txt\nrequirements.prod.gpu.txt\nrequirements.txt\nvoice-cloning-job-handler/index.js\nvoice-cloning-job-handler/package.json\nvoice-cloning-job-handler/pm2-development.yml\nvoice-cloning-job-handler/pm2-production.yml\nvoice-cloning-job-handler/user_audio_profile/index.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\nvoice-cloning-job-handler/voice_cloning/index.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nvoice-cloning/assets/speaker_encoder_model/config_se.json\nvoice-cloning/assets/speaker_encoder_model/model_se.pth.tar\nvoice-cloning/assets/wgnd_2_0_sources.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\nvoice-cloning/clone_voice.py\nvoice-cloning/docs/potion-voice-cloning_Installation_Guide.md\nvoice-cloning/minimize_cloned_voice_model.py\nvoice-cloning/prepare_datasets.py\nvoice-cloning/score_cloned_voice.py\nvoice-cloning/score_models.py\nvoice-cloning/score_salutation.py\nvoice-cloning/synthesize_speech.py\nvoice-cloning/train_config.py\nvoice-cloning/train_multispeaker_baseline_model.py\nvoice-cloning/utils/matching_utils.py\nvoice-cloning/utils/scoring_utils.py\nvoice-cloning/utils/synthesize_utils.py\nvoice-cloning/utils/transcription_utils.py\nvoice-synthsizer-job-handler/index.js\nvoice-synthsizer-job-handler/job/index.js\nvoice-synthsizer-job-handler/job/job_model.js\nvoice-synthsizer-job-handler/job/job_service.js\nvoice-synthsizer-job-handler/package.json\nvoice-synthsizer-job-handler/pm2-development.yml\nvoice-synthsizer-job-handler/pm2-production.yml\nvoice-synthsizer-job-handler/recording/index.js\nvoice-synthsizer-job-handler/recording/recording_model.js\nvoice-synthsizer-job-handler/recording_salutation/index.js\nvoice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\nvoice-synthsizer-job-handler/salutation/index.js\nvoice-synthsizer-job-handler/salutation/salutation_model.js\nvoice-synthsizer-job-handler/salutation/salutation_service.js\nvoice-synthsizer-job-handler/user_audio_profile/index.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_12","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,180p' voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js; sed -n '1,180p' voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js; sed -n '1,420p' voice-synthsizer-job-handler/index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_12","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,180p' voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js; sed -n '1,180p' voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js; sed -n '1,420p' voice-synthsizer-job-handler/index.js\"","aggregated_output":"const mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst UserAudioProfileSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    name: {\n      type: String,\n      required: true,\n      default: '',\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    training_model_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model_s3_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst UserAudioProfileSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    name: {\n      type: String,\n      required: true,\n      default: '',\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    training_model_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model_s3_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\nconst fs = require('fs')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\nconst Bugsnag = require('@bugsnag/js')\nconst uuid = require('uuid').v4\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst userAudioProfileService = require('./user_audio_profile')\nconst recordingModel = require('./recording')\nconst recordingSalutationModel = require('./recording_salutation')\nconst jobService = require('./job')\nconst salutationService = require('./salutation')\nlet throttleMessageFetching = true\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nconst APP_ENV = process.env.POTION_APP_ENV\nconst mongoose = require('mongoose')\n\nfunction execShellCommand(cmd) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while processing python command', error)\n        reject(error)\n      }\n      console.log('Stdout --- ', stdout)\n      console.log('Std error --- ', stderr)\n      resolve(stdout || stderr)\n    })\n  })\n}\n\nfunction connectDB(dbUri, retryCount = 0) {\n  return new Promise((resolve, reject) => {\n    console.log('Connection Attempt : ', retryCount)\n    mongoose.set('strictQuery', true)\n    mongoose\n      .connect(dbUri)\n      .then((msg) => {\n        console.log('Connected to Mongo DB !')\n        resolve()\n      })\n      .catch((err) => {\n        console.log('Failed to connect dns mongo: ', err)\n        if (retryCount < 6) {\n          retryCount++\n          connectDB(dbUri, retryCount)\n        }\n      })\n  })\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const {\n            userAudioProfileId,\n            text,\n            firstName,\n            salutationId,\n            recordingId,\n            baseUrlForPotionAi,\n            env,\n          } = job\n\n          const DB_URI =\n            env === 'production'\n              ? mongoUriProd\n              : env === 'staging'\n              ? mongoUriStaging\n              : mongoUriDev\n\n          console.log('DB_URI ', DB_URI)\n          await connectDB(DB_URI)\n\n          // read the path for the training model for the this users audio profile\n\n          const userAudioProfile = await userAudioProfileService.find({\n            _id: userAudioProfileId,\n            status: 'completed',\n          })\n          if (userAudioProfile) {\n            const { training_model_path, userId } = userAudioProfile[0]\n            const {\n              voice_model_light_path,\n              voice_model_config_light_path,\n              voice_model_speakers_file_path, // name for speakers embeddings file path\n            } = training_model_path\n\n            const outputPath = `/tmp/${uuid()}/`\n            if (!fs.existsSync(outputPath)) {\n              fs.mkdirSync(outputPath, { recursive: true })\n            }\n\n            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n            console.log('AI_COMMAND ', AI_COMMAND)\n\n            const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n            console.time(SYNTHESIZE_AI_LABEL)\n            const aiResponse = await execShellCommand(AI_COMMAND)\n            console.timeEnd(SYNTHESIZE_AI_LABEL)\n\n            let generatedFileName = ''\n            fs.readdirSync(`${outputPath}`).forEach((file) => {\n              if (file.includes('sr48000.wav')) generatedFileName = file\n            })\n\n            // upload the file to s3\n            const uploadParams = {\n              filePath: `${outputPath}${generatedFileName}`,\n              bucket: `recordings-${env}`,\n              fileName: `${uuid()}_salutation_${firstName.replace(\n                '-',\n                '_'\n              )}.wav`,\n              contentType: 'audio/x-wav',\n              fileType: 'wav',\n            }\n            console.time('Time to Upload video on S3')\n            const greetingUploadResponse = await s3.upload(uploadParams)\n            console.timeEnd('Time to Upload video on S3')\n\n            // Create new entry with the s3 path to salutation collection for the user and its profile id\n            // upsert the salutation\n            await salutationService.updateOrCreate(\n              {\n                firstName: firstName,\n                salutationVideo: greetingUploadResponse,\n                userAudioProfileId,\n              },\n              userId\n            )\n            // update the dynamic recordings for the current dynamic video with salutation url\n            const salutationToUpdate = await recordingSalutationModel.findOne({\n              _id: salutationId,\n              deleted: false,\n            })\n\n            const recordingToUpdate = await recordingModel.findOne({\n              _id: recordingId,\n              deleted: false,\n            })\n\n            if (\n              salutationToUpdate &&\n              salutationToUpdate.deleted === false &&\n              recordingToUpdate\n            ) {\n              const jobsToInsert = []\n\n              await recordingSalutationModel.findOneAndUpdate(\n                {\n                  _id: salutationId,\n                },\n                {\n                  $set: {\n                    salutationVideo: greetingUploadResponse,\n                  },\n                }\n              )\n\n              const jobData = {\n                originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n                originalVideo:\n                  recordingToUpdate.originalVideoUrl ||\n                  recordingToUpdate.urls[0].url,\n                cropTimestamp: recordingToUpdate.cropTimestamp,\n                greetingClips: [greetingUploadResponse],\n                greetingObjects: [\n                  {\n                    greetingId: salutationToUpdate._id,\n                    firstName: firstName,\n                    videoUrl: greetingUploadResponse,\n                  },\n                ],\n                requestOrigin: baseUrlForPotionAi,\n                environment: env,\n                recordingId: recordingToUpdate._id,\n                salutation: salutationToUpdate._id,\n                dynamicVideoType: recordingToUpdate.dynamicVideoType,\n              }\n              jobsToInsert.push({\n                firstName,\n                recordingId: recordingToUpdate._id,\n                userId: recordingToUpdate.userId,\n                salutationId: salutationToUpdate._id,\n                metadata: jobData,\n              })\n\n              // create the job for the ai to create processing\n              if (jobsToInsert.length) {\n                await jobService.insertMany(jobsToInsert)\n              }\n            }\n\n            fs.unlinkSync(`${outputPath}${generatedFileName}`)\n            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n          } else {\n            Bugsnag.notify(\n              new Error(\n                `audio profile training model not found ` + JSON.stringify(job)\n              )\n            )\n\n            resolve() // to continue working on new jobs\n          }\n        } catch (error) {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while synthesizing audio', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc \"git remote -v; git status --porcelain=v1; git log --all --format='%H %s' --name-only\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc \"git remote -v; git status --porcelain=v1; git log --all --format='%H %s' --name-only\"","aggregated_output":"15b35658fa4bc1d416aa14c44d8003cf101b93e9 initial\n\n.claude/settings.json\n.gitignore\n.styx_prs/pr_1.json\n.styx_prs/pr_10.json\n.styx_prs/pr_11.json\n.styx_prs/pr_12.json\n.styx_prs/pr_13.json\n.styx_prs/pr_14.json\n.styx_prs/pr_15.json\n.styx_prs/pr_16.json\n.styx_prs/pr_17.json\n.styx_prs/pr_18.json\n.styx_prs/pr_19.json\n.styx_prs/pr_2.json\n.styx_prs/pr_20.json\n.styx_prs/pr_21.json\n.styx_prs/pr_22.json\n.styx_prs/pr_23.json\n.styx_prs/pr_24.json\n.styx_prs/pr_25.json\n.styx_prs/pr_26.json\n.styx_prs/pr_27.json\n.styx_prs/pr_28.json\n.styx_prs/pr_3.json\n.styx_prs/pr_4.json\n.styx_prs/pr_5.json\n.styx_prs/pr_6.json\n.styx_prs/pr_7.json\n.styx_prs/pr_8.json\n.styx_prs/pr_9.json\nREADME.md\napp/services/s3/index.js\napp/services/s3/s3_service.js\napp/services/sqs/index.js\napp/services/sqs/sqs_service.js\napp/services/utils/bugsnag.js\napp/services/utils/deleteFile.js\napp/services/utils/index.js\napp/services/utils/logService.js\napp/services/voice_cloning/index.js\napp/services/voice_cloning/voice_cloning_model.js\napp/services/voice_cloning/voice_cloning_service.js\npackage.json\nrequirements.dev.local.txt\nrequirements.dev.txt\nrequirements.prod.cpu.txt\nrequirements.prod.gpu.txt\nrequirements.txt\nvoice-cloning-job-handler/index.js\nvoice-cloning-job-handler/package.json\nvoice-cloning-job-handler/pm2-development.yml\nvoice-cloning-job-handler/pm2-production.yml\nvoice-cloning-job-handler/user_audio_profile/index.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\nvoice-cloning-job-handler/voice_cloning/index.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nvoice-cloning/assets/speaker_encoder_model/config_se.json\nvoice-cloning/assets/speaker_encoder_model/model_se.pth.tar\nvoice-cloning/assets/wgnd_2_0_sources.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\nvoice-cloning/clone_voice.py\nvoice-cloning/docs/potion-voice-cloning_Installation_Guide.md\nvoice-cloning/minimize_cloned_voice_model.py\nvoice-cloning/prepare_datasets.py\nvoice-cloning/score_cloned_voice.py\nvoice-cloning/score_models.py\nvoice-cloning/score_salutation.py\nvoice-cloning/synthesize_speech.py\nvoice-cloning/train_config.py\nvoice-cloning/train_multispeaker_baseline_model.py\nvoice-cloning/utils/matching_utils.py\nvoice-cloning/utils/scoring_utils.py\nvoice-cloning/utils/synthesize_utils.py\nvoice-cloning/utils/transcription_utils.py\nvoice-synthsizer-job-handler/index.js\nvoice-synthsizer-job-handler/job/index.js\nvoice-synthsizer-job-handler/job/job_model.js\nvoice-synthsizer-job-handler/job/job_service.js\nvoice-synthsizer-job-handler/package.json\nvoice-synthsizer-job-handler/pm2-development.yml\nvoice-synthsizer-job-handler/pm2-production.yml\nvoice-synthsizer-job-handler/recording/index.js\nvoice-synthsizer-job-handler/recording/recording_model.js\nvoice-synthsizer-job-handler/recording_salutation/index.js\nvoice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\nvoice-synthsizer-job-handler/salutation/index.js\nvoice-synthsizer-job-handler/salutation/salutation_model.js\nvoice-synthsizer-job-handler/salutation/salutation_service.js\nvoice-synthsizer-job-handler/user_audio_profile/index.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_14","type":"command_execution","command":"/bin/bash -lc \"find /workspace -maxdepth 3 -type f -not -path '*/node_modules/*' -printf '%p %s bytes\\\\n' | sort\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_14","type":"command_execution","command":"/bin/bash -lc \"find /workspace -maxdepth 3 -type f -not -path '*/node_modules/*' -printf '%p %s bytes\\\\n' | sort\"","aggregated_output":"/workspace/.claude/settings.json 50 bytes\n/workspace/.git/COMMIT_EDITMSG 8 bytes\n/workspace/.git/HEAD 23 bytes\n/workspace/.git/config 130 bytes\n/workspace/.git/description 73 bytes\n/workspace/.git/hooks/applypatch-msg.sample 478 bytes\n/workspace/.git/hooks/commit-msg.sample 896 bytes\n/workspace/.git/hooks/fsmonitor-watchman.sample 4655 bytes\n/workspace/.git/hooks/post-update.sample 189 bytes\n/workspace/.git/hooks/pre-applypatch.sample 424 bytes\n/workspace/.git/hooks/pre-commit.sample 1643 bytes\n/workspace/.git/hooks/pre-merge-commit.sample 416 bytes\n/workspace/.git/hooks/pre-push.sample 1374 bytes\n/workspace/.git/hooks/pre-rebase.sample 4898 bytes\n/workspace/.git/hooks/pre-receive.sample 544 bytes\n/workspace/.git/hooks/prepare-commit-msg.sample 1492 bytes\n/workspace/.git/hooks/push-to-checkout.sample 2783 bytes\n/workspace/.git/hooks/update.sample 3650 bytes\n/workspace/.git/index 10505 bytes\n/workspace/.git/info/exclude 240 bytes\n/workspace/.git/logs/HEAD 141 bytes\n/workspace/.gitignore 2308 bytes\n/workspace/.styx_prs/pr_1.json 3716 bytes\n/workspace/.styx_prs/pr_10.json 2363 bytes\n/workspace/.styx_prs/pr_11.json 16180 bytes\n/workspace/.styx_prs/pr_12.json 3367 bytes\n/workspace/.styx_prs/pr_13.json 1558 bytes\n/workspace/.styx_prs/pr_14.json 2735 bytes\n/workspace/.styx_prs/pr_15.json 11752 bytes\n/workspace/.styx_prs/pr_16.json 21559 bytes\n/workspace/.styx_prs/pr_17.json 7028 bytes\n/workspace/.styx_prs/pr_18.json 19909 bytes\n/workspace/.styx_prs/pr_19.json 6289 bytes\n/workspace/.styx_prs/pr_2.json 2500 bytes\n/workspace/.styx_prs/pr_20.json 62503 bytes\n/workspace/.styx_prs/pr_21.json 2345 bytes\n/workspace/.styx_prs/pr_22.json 3190 bytes\n/workspace/.styx_prs/pr_23.json 28590 bytes\n/workspace/.styx_prs/pr_24.json 8305 bytes\n/workspace/.styx_prs/pr_25.json 1523 bytes\n/workspace/.styx_prs/pr_26.json 1517 bytes\n/workspace/.styx_prs/pr_27.json 1536 bytes\n/workspace/.styx_prs/pr_28.json 15230 bytes\n/workspace/.styx_prs/pr_3.json 1722 bytes\n/workspace/.styx_prs/pr_4.json 26358 bytes\n/workspace/.styx_prs/pr_5.json 1830 bytes\n/workspace/.styx_prs/pr_6.json 2199 bytes\n/workspace/.styx_prs/pr_7.json 2016 bytes\n/workspace/.styx_prs/pr_8.json 4671 bytes\n/workspace/.styx_prs/pr_9.json 2765 bytes\n/workspace/README.md 126 bytes\n/workspace/package-lock.json 92513 bytes\n/workspace/package.json 457 bytes\n/workspace/requirements.dev.local.txt 180 bytes\n/workspace/requirements.dev.txt 439 bytes\n/workspace/requirements.prod.cpu.txt 177 bytes\n/workspace/requirements.prod.gpu.txt 155 bytes\n/workspace/requirements.txt 447 bytes\n/workspace/voice-cloning-job-handler/index.js 11531 bytes\n/workspace/voice-cloning-job-handler/package.json 796 bytes\n/workspace/voice-cloning-job-handler/pm2-development.yml 850 bytes\n/workspace/voice-cloning-job-handler/pm2-production.yml 972 bytes\n/workspace/voice-cloning-job-handler/user_audio_profile/index.js 195 bytes\n/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js 757 bytes\n/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js 3402 bytes\n/workspace/voice-cloning-job-handler/voice_cloning/index.js 169 bytes\n/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js 840 bytes\n/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js 3280 bytes\n/workspace/voice-cloning/assets/wgnd_2_0_sources.csv.gz 21825148 bytes\n/workspace/voice-cloning/assets/wgnd_2_0_unique_names_only.csv.gz 11967143 bytes\n/workspace/voice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv 35464313 bytes\n/workspace/voice-cloning/clone_voice.py 10021 bytes\n/workspace/voice-cloning/docs/potion-voice-cloning_Installation_Guide.md 39802 bytes\n/workspace/voice-cloning/minimize_cloned_voice_model.py 4796 bytes\n/workspace/voice-cloning/prepare_datasets.py 8527 bytes\n/workspace/voice-cloning/score_cloned_voice.py 8339 bytes\n/workspace/voice-cloning/score_models.py 10628 bytes\n/workspace/voice-cloning/score_salutation.py 5990 bytes\n/workspace/voice-cloning/synthesize_speech.py 6726 bytes\n/workspace/voice-cloning/train_config.py 1906 bytes\n/workspace/voice-cloning/train_multispeaker_baseline_model.py 11810 bytes\n/workspace/voice-cloning/utils/matching_utils.py 671 bytes\n/workspace/voice-cloning/utils/scoring_utils.py 1492 bytes\n/workspace/voice-cloning/utils/synthesize_utils.py 2649 bytes\n/workspace/voice-cloning/utils/transcription_utils.py 3519 bytes\n/workspace/voice-synthsizer-job-handler/index.js 9079 bytes\n/workspace/voice-synthsizer-job-handler/job/index.js 113 bytes\n/workspace/voice-synthsizer-job-handler/job/job_model.js 943 bytes\n/workspace/voice-synthsizer-job-handler/job/job_service.js 2859 bytes\n/workspace/voice-synthsizer-job-handler/package-lock.json 20844 bytes\n/workspace/voice-synthsizer-job-handler/package.json 784 bytes\n/workspace/voice-synthsizer-job-handler/pm2-development.yml 517 bytes\n/workspace/voice-synthsizer-job-handler/pm2-production.yml 659 bytes\n/workspace/voice-synthsizer-job-handler/recording/index.js 76 bytes\n/workspace/voice-synthsizer-job-handler/recording/recording_model.js 7947 bytes\n/workspace/voice-synthsizer-job-handler/recording_salutation/index.js 119 bytes\n/workspace/voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js 1437 bytes\n/workspace/voice-synthsizer-job-handler/salutation/index.js 169 bytes\n/workspace/voice-synthsizer-job-handler/salutation/salutation_model.js 857 bytes\n/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js 2238 bytes\n/workspace/voice-synthsizer-job-handler/user_audio_profile/index.js 195 bytes\n/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js 757 bytes\n/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js 3474 bytes\n/workspace/voice-synthsizer-job-handler/yarn.lock 62784 bytes\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_15","type":"command_execution","command":"/bin/bash -lc \"rg -n 'pro_v2' /workspace/node_modules 2>/dev/null | head -50\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_15","type":"command_execution","command":"/bin/bash -lc \"rg -n 'pro_v2' /workspace/node_modules 2>/dev/null | head -50\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_16","type":"command_execution","command":"/bin/bash -lc 'rg -n -i \"pro_v2|pro v2|pro-v2|tier|clon.*request|null state|voice clon\" .styx_prs'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_16","type":"command_execution","command":"/bin/bash -lc 'rg -n -i \"pro_v2|pro v2|pro-v2|tier|clon.*request|null state|voice clon\" .styx_prs'","aggregated_output":".styx_prs/pr_24.json:137:          \"message\": \"Merge pull request #18 from potion/develop\\n\\nRefined voice cloning settings\",\n.styx_prs/pr_24.json:217:          \"message\": \"Merge pull request #19 from potion/update-voice-clone-23-05\\n\\nUpdate voice clone 23 05\",\n.styx_prs/pr_23.json:839:        \"path\": \"voice-cloning/docs/Voice Cloning @ 48k Hz Sampling Rate - Step-by-Step.txt\",\n.styx_prs/pr_4.json:3:  \"title\": \"Feature 4023 voice clone handler\",\n.styx_prs/pr_4.json:57:          \"message\": \"Added base code for voice cloning\",\n.styx_prs/pr_15.json:48:          \"message\": \"Refined voice cloning to support new capabilities to determine best model; updated recently adde capability to determine best multi-speaker model.\",\n.styx_prs/pr_11.json:516:        \"path\": \".prettierrc\",\n.styx_prs/pr_18.json:3:  \"title\": \"Refined voice cloning settings\",\n.styx_prs/pr_18.json:4:  \"body\": \"Update settings for voice cloning.\",\n.styx_prs/pr_18.json:281:          \"message\": \"Added new voice cloning approach (using fine-tuning via continue_path).\",\n.styx_prs/pr_28.json:297:          \"message\": \"48k Voice cloning documentation now based on clone_voice_via_continue_n_natqa.py; adjusted default cloning parameters.\",\n.styx_prs/pr_28.json:429:        \"path\": \"voice-cloning/docs/Voice Cloning @ 48k Hz Sampling Rate - Step-by-Step.txt\",\n.styx_prs/pr_16.json:660:        \"path\": \".prettierrc\",\n.styx_prs/pr_20.json:89:          \"message\": \"Refined voice cloning to support new capabilities to determine best model; updated recently adde capability to determine best multi-speaker model.\",\n.styx_prs/pr_20.json:585:          \"message\": \"Added new voice cloning approach (using fine-tuning via continue_path).\",\n.styx_prs/pr_20.json:953:          \"message\": \"Merge pull request #18 from potion/develop\\n\\nRefined voice cloning settings\",\n.styx_prs/pr_20.json:1033:          \"message\": \"Merge pull request #19 from potion/update-voice-clone-23-05\\n\\nUpdate voice clone 23 05\",\n.styx_prs/pr_20.json:1913:        \"path\": \"voice-cloning/docs/Voice Cloning @ 48k Hz Sampling Rate - Step-by-Step.txt\",\n.styx_prs/pr_8.json:114:        \"path\": \".prettierrc\",\n.styx_prs/pr_19.json:3:  \"title\": \"Update voice clone 23 05\",\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_17","type":"command_execution","command":"/bin/bash -lc \"for f in .styx_prs/*.json; do jq -r '[input_filename, .title, (.body // \\\"\\\")] | @tsv' \\\"\"'$f\"; done | sort -V'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_17","type":"command_execution","command":"/bin/bash -lc \"for f in .styx_prs/*.json; do jq -r '[input_filename, .title, (.body // \\\"\\\")] | @tsv' \\\"\"'$f\"; done | sort -V'","aggregated_output":".styx_prs/pr_1.json\tInitial commit\t\n.styx_prs/pr_2.json\tInitial commit\tAdditional improvements for initial commit (coqiau/TTS v0.6.2 compatibility)\n.styx_prs/pr_3.json\tFurther coquai/TTS v0.6.2 compatibiliuty changes\t\n.styx_prs/pr_4.json\tFeature 4023 voice clone handler\t\n.styx_prs/pr_5.json\tAdded the filename fix\t\n.styx_prs/pr_6.json\tUpdated the cloud front access and code\t\n.styx_prs/pr_7.json\tAdded change in yml file\t\n.styx_prs/pr_8.json\tupdated mongoose version 6.x\t\n.styx_prs/pr_9.json\tupdate DB uri\t\n.styx_prs/pr_10.json\tupdated code for using original text\t\n.styx_prs/pr_11.json\tVoice ai v2 changes\t\n.styx_prs/pr_12.json\tAi 490 adv synth\tAdded:\\r\\n+ optional speech sample waveform and text parameter support for style transfer\\r\\n+ upsampling of synthetic speech output to target sampling rate (48kHz by default)\\r\\n\\r\\nUpdated:\\r\\n+ usage documentation\n.styx_prs/pr_13.json\tAdded sr48000 for wave\t\n.styx_prs/pr_14.json\tNew feature score model\tNo impact on staging / prod ... just for dev / training.\n.styx_prs/pr_15.json\tNew feature score model\tImproved and documented the new find_best_* model scripts.\n.styx_prs/pr_16.json\tStaging > Main\t\n.styx_prs/pr_17.json\tNew feature updates\t\n.styx_prs/pr_18.json\tRefined voice cloning settings\tUpdate settings for voice cloning.\n.styx_prs/pr_19.json\tUpdate voice clone 23 05\t\n.styx_prs/pr_20.json\tStaging > Main\t\n.styx_prs/pr_21.json\tDev find best fixup\tfind_best_* improvements (suppress TTS-based command line output; track progress instead)\n.styx_prs/pr_22.json\tDev cpu only\tCPU-only processing support (tested)\n.styx_prs/pr_23.json\tDevelop\tSupport of 48k Hz sampling rate as default; GPU and CPU-based usage for all scripts but baseline training run.\\r\\n\\r\\nSee voice-cloning/docs/Voice\\\\ Cloning\\\\ @\\\\ 48k\\\\ Hz\\\\ Sampling\\\\ Rate\\\\ -\\\\ Step-by-Step.txt for example usage.\\r\\n\\r\\nModel assets can be found at s3://potion-ai-models/potion-voice-2023-08/\n.styx_prs/pr_24.json\tDevelop 07 08 code updates\t\n.styx_prs/pr_25.json\tAdded code for cloning script\t\n.styx_prs/pr_26.json\tAdded changes for sr 48000\t\n.styx_prs/pr_27.json\tupdated model name\t\n.styx_prs/pr_28.json\tGCP support, upgraded TTS, new model with cleaner data\t\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_18","type":"command_execution","command":"/bin/bash -lc \"jq 'keys' .styx_prs/pr_11.json && jq '.files[] | {path,status,additions,deletions,patch}' .styx_prs/pr_11.json\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_18","type":"command_execution","command":"/bin/bash -lc \"jq 'keys' .styx_prs/pr_11.json && jq '.files[] | {path,status,additions,deletions,patch}' .styx_prs/pr_11.json\"","aggregated_output":"[\n  \"additions\",\n  \"assignees\",\n  \"author\",\n  \"baseRefName\",\n  \"body\",\n  \"changedFiles\",\n  \"closedAt\",\n  \"comments\",\n  \"commits\",\n  \"createdAt\",\n  \"deletions\",\n  \"files\",\n  \"headRefName\",\n  \"isDraft\",\n  \"labels\",\n  \"mergeCommit\",\n  \"mergedAt\",\n  \"mergedBy\",\n  \"milestone\",\n  \"number\",\n  \"requestedReviewers\",\n  \"reviews\",\n  \"state\",\n  \"title\",\n  \"url\"\n]\njq: error (at .styx_prs/pr_11.json:582): Cannot index array with string \"path\"\n","exit_code":5,"status":"failed"}}
{"type":"item.started","item":{"id":"item_19","type":"command_execution","command":"/bin/bash -lc \"jq '.files | type, keys, .[0:2]' .styx_prs/pr_11.json\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_19","type":"command_execution","command":"/bin/bash -lc \"jq '.files | type, keys, .[0:2]' .styx_prs/pr_11.json\"","aggregated_output":"jq: error (at .styx_prs/pr_11.json:582): Cannot index object with object\n\"object\"\n[\n  \"nodes\"\n]\n","exit_code":5,"status":"failed"}}
{"type":"item.started","item":{"id":"item_20","type":"command_execution","command":"/bin/bash -lc \"jq '.files.nodes[] | {path,additions,deletions,changeType,patch}' .styx_prs/pr_11.json\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_20","type":"command_execution","command":"/bin/bash -lc \"jq '.files.nodes[] | {path,additions,deletions,changeType,patch}' .styx_prs/pr_11.json\"","aggregated_output":"{\n  \"path\": \".gitignore\",\n  \"additions\": 3,\n  \"deletions\": 0,\n  \"changeType\": \"MODIFIED\",\n  \"patch\": null\n}\n{\n  \"path\": \".prettierrc\",\n  \"additions\": 0,\n  \"deletions\": 7,\n  \"changeType\": \"REMOVED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-cloning-job-handler/index.js\",\n  \"additions\": 56,\n  \"deletions\": 11,\n  \"changeType\": \"MODIFIED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-cloning-job-handler/package-lock.json\",\n  \"additions\": 0,\n  \"deletions\": 1782,\n  \"changeType\": \"REMOVED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-cloning-job-handler/package.json\",\n  \"additions\": 1,\n  \"deletions\": 1,\n  \"changeType\": \"MODIFIED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\",\n  \"additions\": 8,\n  \"deletions\": 10,\n  \"changeType\": \"MODIFIED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\",\n  \"additions\": 0,\n  \"deletions\": 2,\n  \"changeType\": \"MODIFIED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-cloning-job-handler/yarn.lock\",\n  \"additions\": 0,\n  \"deletions\": 2475,\n  \"changeType\": \"REMOVED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-synthsizer-job-handler/index.js\",\n  \"additions\": 53,\n  \"deletions\": 56,\n  \"changeType\": \"MODIFIED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-synthsizer-job-handler/recording_salutation/index.js\",\n  \"additions\": 3,\n  \"deletions\": 0,\n  \"changeType\": \"ADDED\",\n  \"patch\": null\n}\n{\n  \"path\": \"voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\",\n  \"additions\": 76,\n  \"deletions\": 0,\n  \"changeType\": \"ADDED\",\n  \"patch\": null\n}\n{\n  \"path\": \"yarn.lock\",\n  \"additions\": 0,\n  \"deletions\": 2475,\n  \"changeType\": \"REMOVED\",\n  \"patch\": null\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_21","type":"command_execution","command":"/bin/bash -lc \"jq -r '.url, .headRefName, .baseRefName, .commits.nodes[].commit.oid // .commits.nodes[].oid // empty' .styx_prs/pr_11.json; jq '.commits' .styx_prs/pr_11.json | sed -n '1,180p'; git config --get remote.origin.url || true\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_21","type":"command_execution","command":"/bin/bash -lc \"jq -r '.url, .headRefName, .baseRefName, .commits.nodes[].commit.oid // .commits.nodes[].oid // empty' .styx_prs/pr_11.json; jq '.commits' .styx_prs/pr_11.json | sed -n '1,180p'; git config --get remote.origin.url || true\"","aggregated_output":"https://github.com/potion/potion-voice/pull/11\nvoice-ai-v2-changes\nstaging\n09895be273030cf75781b88a43581db15e2b537f\n477c39922d6f1f8bf474d6aa215dbf7f745629af\n81a3e340d28c15313cf363697ea35e401bd48c30\n920ab8ac6ba9b428d30b655a12533e7491c17ad2\n18e04e2e4e9ae7eef5d77d86cb83bf1efea7fbd4\n31996261302205e07e9135750c71ba6c227e81ee\nd6a4ca9809bd3e61bce09d81534c85582a6648c4\n5dbe54bf0674a0323fb237d2549b3bccab8b1bae\n103d47f263421ab090097825883fe33f9cbd1830\nde9256d575777382caee28192d6e7321d4f6cf37\n4054eaeabf53f7a1477134496e26d1b323a89211\n676ae4419c2c00340a6e0ddbc2ebedaf547b984b\na1d7a29e837f4c508245ed6158c07accfe1ab550\n9eac7f855681a903b6372d74a0252ffa3f4f6ceb\n6f33b7b4c8d3b14e323a5e87852216e35da8806d\na4a22adba17913568643f56a7803b743055dde97\nb1222eea17760fbf5c9cf6007637a6f01e7deab7\n60193204e3783f20e156000ef48a2b9386002d88\n7960ed5dfa9afce6281350870977aa48f4f903d2\n633ecbafcda44c57d24ab4280aec53e9453c93ba\n6a0fdc17bb6c19d20338c1a6cae2bbea8f87dcb4\nfd70943a1ca541e00852e7384f91c7b09c42d9d3\n0617f15153fdffd52f009bb0429d6878743649dc\n0e83ea6cd962df73dccf012582fcd31277e9398e\nf996adf6c1277fd78253badeb77d487c5ad1d328\n2aea05da7bfa3c057f3a31ed16639e461a395f53\n6a234309474cbc1e420fd092fefed97ec2c75aae\na616fd33178b70105d5cb40694e74e2c1df124da\n{\n  \"totalCount\": 28,\n  \"nodes\": [\n    {\n      \"commit\": {\n        \"oid\": \"09895be273030cf75781b88a43581db15e2b537f\",\n        \"message\": \"Some cleanup\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-12T15:39:34Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-12T15:39:34Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"477c39922d6f1f8bf474d6aa215dbf7f745629af\",\n        \"message\": \"Some cleanup\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-12T15:41:46Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-12T15:41:46Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"81a3e340d28c15313cf363697ea35e401bd48c30\",\n        \"message\": \"Some cleanup\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-12T15:41:59Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-12T15:41:59Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"920ab8ac6ba9b428d30b655a12533e7491c17ad2\",\n        \"message\": \"Added todos\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-13T07:54:31Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-13T07:54:31Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"18e04e2e4e9ae7eef5d77d86cb83bf1efea7fbd4\",\n        \"message\": \"Added code for v2 changes\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-16T17:46:46Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-16T17:46:46Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"31996261302205e07e9135750c71ba6c227e81ee\",\n        \"message\": \"update the python command\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-16T18:36:48Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-16T18:36:48Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"d6a4ca9809bd3e61bce09d81534c85582a6648c4\",\n        \"message\": \"Added code for v2 changes\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-17T07:42:04Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-17T07:42:04Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"5dbe54bf0674a0323fb237d2549b3bccab8b1bae\",\n        \"message\": \"Added code for v2 changes\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-17T07:50:16Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-17T07:50:16Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"103d47f263421ab090097825883fe33f9cbd1830\",\n        \"message\": \"Added code for v2 changes\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-17T07:51:23Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-17T07:51:23Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"de9256d575777382caee28192d6e7321d4f6cf37\",\n        \"message\": \"Merge branch 'main' into voice-ai-v2-changes\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-18T15:30:59Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-18T15:30:59Z\"\n        }\n      }\n    },\n    {\n      \"commit\": {\n        \"oid\": \"4054eaeabf53f7a1477134496e26d1b323a89211\",\n        \"message\": \"Removed unwanted package\",\n        \"author\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-18T19:24:29Z\"\n        },\n        \"committer\": {\n          \"name\": \"author_unknown\",\n          \"email\": \"author_unknown\",\n          \"date\": \"2023-01-18T19:24:29Z\"\n        }\n      }\n    },\n    {\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_22","type":"command_execution","command":"/bin/bash -lc \"curl -L --fail --silent --show-error https://raw.githubusercontent.com/potion/potion-voice/a616fd33178b70105d5cb40694e74e2c1df124da/voice-cloning-job-handler/index.js | sed -n '1,380p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_22","type":"command_execution","command":"/bin/bash -lc \"curl -L --fail --silent --show-error https://raw.githubusercontent.com/potion/potion-voice/a616fd33178b70105d5cb40694e74e2c1df124da/voice-cloning-job-handler/index.js | sed -n '1,380p'\"","aggregated_output":"curl: (22) The requested URL returned error: 404 \n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_23","type":"command_execution","command":"/bin/bash -lc 'for oid in 18e04e2e4e9ae7eef5d77d86cb83bf1efea7fbd4 a616fd33178b70105d5cb40694e74e2c1df124da; do git cat-file -t \"$oid\" 2>&1 || true; done; find .git/objects -type f | wc -l; git count-objects -v'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_23","type":"command_execution","command":"/bin/bash -lc 'for oid in 18e04e2e4e9ae7eef5d77d86cb83bf1efea7fbd4 a616fd33178b70105d5cb40694e74e2c1df124da; do git cat-file -t \"$oid\" 2>&1 || true; done; find .git/objects -type f | wc -l; git count-objects -v'","aggregated_output":"fatal: git cat-file: could not get object info\nfatal: git cat-file: could not get object info\n114\ncount: 114\nsize: 85508\nin-pack: 0\npacks: 0\nsize-pack: 0\nprune-packable: 0\ngarbage: 0\nsize-garbage: 0\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_24","type":"command_execution","command":"/bin/bash -lc \"jq -r '.commits.nodes[].commit | [.oid[0:8], .message] | @tsv' .styx_prs/pr_11.json; jq -r '.comments.nodes[]? | [.author.login, .body] | @tsv' .styx_prs/pr_11.json; jq -r '.reviews.nodes[]? | [.author.login, .state, .body] | @tsv' .styx_prs/pr_11.json\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_24","type":"command_execution","command":"/bin/bash -lc \"jq -r '.commits.nodes[].commit | [.oid[0:8], .message] | @tsv' .styx_prs/pr_11.json; jq -r '.comments.nodes[]? | [.author.login, .body] | @tsv' .styx_prs/pr_11.json; jq -r '.reviews.nodes[]? | [.author.login, .state, .body] | @tsv' .styx_prs/pr_11.json\"","aggregated_output":"09895be2\tSome cleanup\n477c3992\tSome cleanup\n81a3e340\tSome cleanup\n920ab8ac\tAdded todos\n18e04e2e\tAdded code for v2 changes\n31996261\tupdate the python command\nd6a4ca98\tAdded code for v2 changes\n5dbe54bf\tAdded code for v2 changes\n103d47f2\tAdded code for v2 changes\nde9256d5\tMerge branch 'main' into voice-ai-v2-changes\n4054eaea\tRemoved unwanted package\n676ae441\tupdated zip command\na1d7a29e\tUpdated path\n9eac7f85\tUpdated zippath\n6f33b7b4\tUpdated zippath\na4a22adb\tUpdated zippath\nb1222eea\tUpdated path for result\n60193204\tupdated command\n7960ed5d\tupdated command\n633ecbaf\tAdded changes for the synthesize command\n6a0fdc17\tupdated voice-ai-changes\nfd70943a\tUpdated speaker path\n0617f151\tUpdated speaker path\n0e83ea6c\tUpdated code for synthesis\nf996adf6\tUpdated code for synthesis\n2aea05da\tUpdated job code\n6a234309\tUpdated job code\na616fd33\tAdded condition for delete check\nauthor_7\tAPPROVED\t\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_25","type":"command_execution","command":"/bin/bash -lc \"xxd -g1 README.md; jq -r '[.number,.title,.createdAt,.mergedAt,.headRefName,.baseRefName] | @tsv' .styx_prs/*.json | sort -n\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_25","type":"command_execution","command":"/bin/bash -lc \"xxd -g1 README.md; jq -r '[.number,.title,.createdAt,.mergedAt,.headRefName,.baseRefName] | @tsv' .styx_prs/*.json | sort -n\"","aggregated_output":"/bin/bash: line 1: xxd: command not found\n1\tInitial commit\t2022-04-21T13:53:32Z\t2022-04-21T13:53:54Z\tinitialCommit\tmain\n2\tInitial commit\t2022-04-21T14:49:50Z\t2022-04-21T14:50:00Z\tinitialCommit\tmain\n3\tFurther coquai/TTS v0.6.2 compatibiliuty changes\t2022-04-21T14:56:26Z\t2022-04-21T14:56:32Z\tinitialCommit\tmain\n4\tFeature 4023 voice clone handler\t2022-06-06T15:36:08Z\t2022-07-19T07:21:41Z\tfeature-4023-voice-clone-handler\tmain\n5\tAdded the filename fix\t2022-07-25T08:52:45Z\t2022-08-02T05:49:56Z\thotfix-update-filename\tmain\n6\tUpdated the cloud front access and code\t2022-11-29T13:22:59Z\t2022-11-29T13:35:23Z\tfix-bucket-access-for-sentences\tmain\n7\tAdded change in yml file\t2022-11-29T14:51:46Z\t2022-11-29T14:52:47Z\tfix-bucket-access-for-sentences\tmain\n8\tupdated mongoose version 6.x\t2022-12-16T15:03:54Z\t2022-12-16T15:31:52Z\tPR-update-mongoose-version-to-6.x\tmain\n9\tupdate DB uri\t2022-12-19T11:00:51Z\t2023-01-10T12:12:57Z\tupdate-db-uri\tmain\n10\tupdated code for using original text\t2023-01-10T09:39:58Z\t2023-01-10T12:13:20Z\tupdate-voice-cloning-to-use-original-text\tmain\n11\tVoice ai v2 changes\t2023-02-01T09:10:44Z\t2023-02-02T05:32:22Z\tvoice-ai-v2-changes\tstaging\n12\tAi 490 adv synth\t2023-02-01T17:09:41Z\t2023-02-02T05:52:09Z\tai-490-adv-synth\tstaging\n13\tAdded sr48000 for wave\t2023-02-02T05:50:19Z\t2023-02-02T05:53:02Z\tfix-output-for-wav\tstaging\n14\tNew feature score model\t2023-02-03T04:11:03Z\t2023-02-03T10:51:48Z\tnew-feature-score-model\tstaging\n15\tNew feature score model\t2023-02-07T15:46:36Z\t2023-04-21T04:50:02Z\tnew-feature-score-model\tstaging\n16\tStaging > Main\t2023-02-13T04:47:47Z\t2023-02-13T09:49:07Z\tstaging\tmain\n17\tNew feature updates\t2023-03-03T05:14:09Z\t2023-03-08T19:59:08Z\tnew-feature-updates\tnew-feature-score-model\n18\tRefined voice cloning settings\t2023-04-21T05:10:41Z\t2023-06-21T10:58:16Z\tdevelop\tstaging\n19\tUpdate voice clone 23 05\t2023-06-21T10:59:07Z\t2023-06-27T04:50:28Z\tupdate-voice-clone-23-05\tstaging\n20\tStaging > Main\t2023-06-27T05:14:57Z\t\tstaging\tmain\n21\tDev find best fixup\t2023-07-21T05:14:32Z\t2023-07-21T05:14:54Z\tdev-find-best-fixup\tdevelop\n22\tDev cpu only\t2023-07-25T09:44:12Z\t2023-07-25T09:44:26Z\tdev-cpu-only\tdevelop\n23\tDevelop\t2023-08-07T06:58:31Z\t2023-09-25T07:15:56Z\tdevelop\tstaging\n24\tDevelop 07 08 code updates\t2023-08-07T08:05:54Z\t2023-08-07T08:08:05Z\tdevelop-07-08\tdevelop\n25\tAdded code for cloning script\t2023-08-07T08:21:11Z\t2023-08-07T08:21:18Z\tdevelop-07-08-updates\tdevelop\n26\tAdded changes for sr 48000\t2023-08-07T10:19:45Z\t2023-08-07T10:19:55Z\tdevelop-07-08-updates\tdevelop\n27\tupdated model name\t2023-10-11T20:46:31Z\t2023-10-11T20:47:05Z\tdevelop\tstaging\n28\tGCP support, upgraded TTS, new model with cleaner data\t2023-11-29T07:42:08Z\t\tdevelop\tstaging\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_26","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 20 -H 'Accept: application/vnd.github+json' -H 'User-Agent: codex' 'https://api.github.com/search/code?q=%22pro_v2%22+%22voice+cloning%22' | head -c 20000\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_26","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 20 -H 'Accept: application/vnd.github+json' -H 'User-Agent: codex' 'https://api.github.com/search/code?q=%22pro_v2%22+%22voice+cloning%22' | head -c 20000\"","aggregated_output":"{\r\n  \"message\": \"Requires authentication\",\r\n  \"documentation_url\": \"https://docs.github.com/rest\",\r\n  \"status\": \"401\"\r\n}","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_27","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 20 -H 'Accept: application/vnd.github+json' -H 'User-Agent: codex' 'https://github.com/search?q=%22pro_v2%22+%22voice+cloning%22&type=code' | head -c 20000\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_27","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 20 -H 'Accept: application/vnd.github+json' -H 'User-Agent: codex' 'https://github.com/search?q=%22pro_v2%22+%22voice+cloning%22&type=code' | head -c 20000\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_28","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 20 -H 'Accept: application/vnd.github+json' -H 'User-Agent: codex' 'https://grep.app/api/search?q=pro_v2%20voice%20cloning' | head -c 20000\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_28","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 20 -H 'Accept: application/vnd.github+json' -H 'User-Agent: codex' 'https://grep.app/api/search?q=pro_v2%20voice%20cloning' | head -c 20000\"","aggregated_output":"<!DOCTYPE html><html lang=\"en\" data-astro-cid-4wdtffzm><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><meta name=\"theme-color\" content=\"#000\"><title>Vercel Security Checkpoint</title><style>.spinner[data-astro-cid-ijmsm3te]{flex-direction:column;justify-content:center;align-items:center;display:flex}.spinner-circle[data-astro-cid-ijmsm3te]{transform-origin:50%;animation:1s step-start infinite spinner-circle-animate}rect[data-astro-cid-ijmsm3te]{fill:var(--ds-gray-900)}@keyframes spinner-circle-animate{0%{transform:rotate(0)}10%{transform:rotate(36deg)}20%{transform:rotate(72deg)}30%{transform:rotate(108deg)}40%{transform:rotate(144deg)}50%{transform:rotate(180deg)}60%{transform:rotate(216deg)}70%{transform:rotate(252deg)}80%{transform:rotate(288deg)}90%{transform:rotate(324deg)}to{transform:rotate(360deg)}}:root{--ds-gray-900:#666;--ds-gray-alpha-1000:#000000e8;--background-color:#fff;--link-color:#0070f3}@media (prefers-color-scheme:dark){:root{--ds-gray-900:#a1a1a1;--ds-gray-alpha-1000:#ffffffeb;--background-color:#0a0a0a;--link-color:#3291ff}}html{box-sizing:border-box}[data-astro-cid-4wdtffzm],[data-astro-cid-4wdtffzm]:after,[data-astro-cid-4wdtffzm]:before{box-sizing:inherit}body{word-break:break-word;font-kerning:auto;font-variant:normal;text-rendering:optimizelegibility;hyphens:auto;background-color:var(--background-color);height:100vh;max-height:100vh;color:var(--ds-gray-900);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;font-size:1.2rem;line-height:1.65}.container[data-astro-cid-4wdtffzm]{flex-direction:column;justify-content:center;min-height:100%;display:flex}#root[data-astro-cid-4wdtffzm]{display:none}main[data-astro-cid-4wdtffzm]{text-align:center;max-width:80rem;margin:auto;padding:4rem 6rem}p[data-astro-cid-4wdtffzm]#header-text,p[data-astro-cid-4wdtffzm]#header-noscript-text{color:var(--ds-gray-alpha-1000);text-align:center;font-size:1.2rem;font-weight:500;line-height:32px}#fix-container[data-astro-cid-4wdtffzm]{flex-direction:column;align-items:center;display:flex}.fix-text[data-astro-cid-4wdtffzm]{color:var(--link-color);cursor:pointer;margin-top:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.75rem;font-weight:200;line-height:1rem;text-decoration:underline}.metadata-text[data-astro-cid-4wdtffzm]{opacity:.7;margin-top:4px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.75rem;font-weight:200}footer[data-astro-cid-4wdtffzm]{color:var(--ds-gray-900);flex-direction:row;justify-content:center;align-items:center;padding-bottom:24px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.75rem;font-weight:200;line-height:1rem;display:flex}footer[data-astro-cid-4wdtffzm] div[data-astro-cid-4wdtffzm]{flex-direction:row;gap:3px;display:flex}@media (width<=600px){body{height:100dvh;max-height:100dvh}main[data-astro-cid-4wdtffzm]{padding:1rem 2rem}body{text-align:center;font-size:1.4rem;line-height:1.55}footer[data-astro-cid-4wdtffzm]{text-align:center;flex-direction:column;padding:24px 12px;display:flex;& .hide-mobile{display:none}}footer[data-astro-cid-4wdtffzm] p[data-astro-cid-4wdtffzm]{margin:6px auto}footer[data-astro-cid-4wdtffzm] div[data-astro-cid-4wdtffzm]{flex-direction:column;gap:0;display:flex}}\n</style></head><body data-astro-cid-4wdtffzm><div id=\"root\" class=\"container\" data-astro-cid-4wdtffzm><main data-astro-cid-4wdtffzm><div class=\"spinner\" data-astro-cid-ijmsm3te><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" data-astro-cid-ijmsm3te><g class=\"spinner-circle\" data-astro-cid-ijmsm3te><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" opacity=\"1\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(36 12 12)\" opacity=\".1\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(72 12 12)\" opacity=\".2\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(108 12 12)\" opacity=\".3\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(144 12 12)\" opacity=\".4\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(180 12 12)\" opacity=\".5\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(216 12 12)\" opacity=\".6\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(252 12 12)\" opacity=\".7\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(288 12 12)\" opacity=\".8\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(324 12 12)\" opacity=\".9\" data-astro-cid-ijmsm3te></rect></g></svg></div><p id=\"header-text\" data-astro-cid-4wdtffzm>We're verifying your browser</p><div id=\"fix-container\" style=\"display: none;\" data-astro-cid-4wdtffzm><a id=\"fix-text\" class=\"fix-text\" href=\"https://vercel.link/security-checkpoint\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-astro-cid-4wdtffzm>Website owner? Click here to fix</a><p id=\"metadata-text\" class=\"metadata-text\" data-astro-cid-4wdtffzm></p></div><p id=\"failure-text\" class=\"metadata-text\" data-astro-cid-4wdtffzm></p></main><footer data-astro-cid-4wdtffzm><div data-astro-cid-4wdtffzm><p id=\"footer-text\" data-astro-cid-4wdtffzm>Vercel Security Checkpoint</p><p class=\"hide-mobile\" data-astro-cid-4wdtffzm>|</p><p data-astro-cid-4wdtffzm>iad1::1790036537-fD4CC6gMFMJEwpWJLv9N5Zv9bjWlTreD</p></div></footer></div><noscript><div class=\"container\" data-astro-cid-4wdtffzm><main data-astro-cid-4wdtffzm><div class=\"spinner\" data-astro-cid-ijmsm3te><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" data-astro-cid-ijmsm3te><g class=\"spinner-circle\" data-astro-cid-ijmsm3te><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" opacity=\"1\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(36 12 12)\" opacity=\".1\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(72 12 12)\" opacity=\".2\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(108 12 12)\" opacity=\".3\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(144 12 12)\" opacity=\".4\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(180 12 12)\" opacity=\".5\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(216 12 12)\" opacity=\".6\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(252 12 12)\" opacity=\".7\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(288 12 12)\" opacity=\".8\" data-astro-cid-ijmsm3te></rect><rect x=\"11\" y=\"1\" width=\"2\" height=\"6\" transform=\"rotate(324 12 12)\" opacity=\".9\" data-astro-cid-ijmsm3te></rect></g></svg></div><p id=\"header-noscript-text\" data-astro-cid-4wdtffzm>Enable JavaScript to continue</p></main><footer data-astro-cid-4wdtffzm><div data-astro-cid-4wdtffzm><p data-astro-cid-4wdtffzm>Vercel Security Checkpoint</p><p class=\"hide-mobile\" data-astro-cid-4wdtffzm>|</p><p data-astro-cid-4wdtffzm>iad1::1790036537-fD4CC6gMFMJEwpWJLv9N5Zv9bjWlTreD</p></div></footer></div></noscript></body></html><script type=\"module\">(function(e,t){let r=n,i=e();for(;;)try{if(parseInt(r(132))/1*(-parseInt(r(124))/2)+parseInt(r(135))/3*(-parseInt(r(152))/4)+parseInt(r(150))/5+parseInt(r(153))/6+parseInt(r(140))/7*(-parseInt(r(149))/8)+-parseInt(r(125))/9*(parseInt(r(131))/10)+parseInt(r(144))/11===t)break;i.push(i.shift())}catch{i.push(i.shift())}})(r,622708);var e=function(){let e=!0;return function(t,r){let i=e?function(){let e=n;if(r){let n=r[e(137)+`ly`](t,arguments);return r=null,n}}:function(){};return e=!1,i}}()(void 0,function(){let t=n;return e[t(134)+t(143)+`ng`]()[t(158)+`rch`](t(154)+t(145)+`+)+`+t(123))[t(134)+`tring`]()[t(155)+t(146)+t(128)+`or`](e)[`sea`+t(127)](t(154)+t(145)+t(130)+t(123))});e();function t(e,t){let r=n,i=document[r(142)+r(138)+`men`+r(129)+`Id`](e);i&&(i[`inn`+r(136)+r(148)]=t)}function n(e,t){let i=r();return n=function(e,t){return e-=123,i[e]},n(e,t)}function r(){let e=`36BAIAMg,828126XOROjT,(((,con,ove,que,sea,)+$,46538RyzLHx,22437aWvAny,rem,rch,uct,tBy,+)+,1730HAHqGd,49vsEmix,men,toS,203169CojooG,erT,app,Ele,per,1386eZjNhH,Pro,get,tri,17847720EkMaGL,.+),str,sty,ext,6464Zhxkvz,6015640qrdlTT,ele`.split(`,`);return r=function(){return e},r()}function i(e,t,r){let i=n;document[`get`+i(138)+i(133)+i(129)+`Id`](e)?.[i(147)+`le`][`set`+i(141)+i(139)+`ty`](t,r)}function a(e){let t=n;document[t(142)+t(138)+`men`+t(129)+`Id`](e)?.remove(),document[t(157)+`ryS`+t(151)+`ctor`](e)?.[t(126)+t(156)]()}var o=s;function s(e,t){let n=c();return s=function(e,t){return e-=278,n[e]},s(e,t)}(function(e,t){let n=s,r=e();for(;;)try{if(parseInt(n(579))/1+parseInt(n(524))/2+-parseInt(n(866))/3+-parseInt(n(668))/4+-parseInt(n(376))/5*(parseInt(n(1027))/6)+parseInt(n(551))/7*(-parseInt(n(493))/8)+parseInt(n(691))/9===t)break;r.push(r.shift())}catch{r.push(r.shift())}})(c,770773);function c(){let e=[`par`,`处修复`,`া আ`,`quí`,` tı`,`4086159CgcbjO`,`si `,`فشل`,`tôi`,`の所有`,`зде`,`elt`,`hir`,` ధృ`,`r v`,`సరి`,`zu `,`li `,` 검문`,`tor`,`aj,`,`లిక`,`nh `,`ron`,`ؤزر`,`기를 `,`c m`,`कोड`,`ser`,`有者？`,`ालक`,`্রা`,`قر `,`रोध`,`e b`,` கி`,`ੱਥੇ`,`ंदू`,`Kit`,` ال`,`েছে`,`Poi`,`d p`,`வி `,`pud`,`hie`,`਼ਰ `,`ar `,` క్`,`ک پ`,` Gü`,`பு `,`kac`,`ери`,` ਤੀ`,` ਪੁ`,`ంది`,`her`,`Düz`,` ਦੀ`,`ca `,`dor`,`er `,`ваш`,`ade`,`g p`,`cca`,`ারা`,`ने `,`います`,` tr`,`rpr`,`ापि`,`te?`,`ình`,` ud`,`рау`,`ana`,`cac`,` మూ`,`ਦੀ `,`आहो`,` üb`,`бра`,`هنا`,`ibi`,`ாவட`,`ود `,`నిఖ`,`We'`,`rtl`,`o v`,`్‌న`,`Pon`,`یں `,`le `,`end`,`লিক`,`정하세`,`зер`,`bên`,`льн`,`l d`,`vot`,`্যর`,`лос`,` da`,`ntL`,`cią`,`led`,`ப்ப`,`лок`,`ave`,`ة ط`,`हैं`,`ть `,`сти`,`pri`,`vér`,`আমর`,`ে ব`,` ఇక`,`dir`,`ion`,`्लि`,`cur`,`kow`,`کری`,` சர`,`ene`,`ing`,`z? `,`ja `,`ung`,`त्य`,`ाउझ`,`ਰਨ `,`éri`,`en `,`ంచడ`,`wer`,`ౌజర`,`ے ک`,`eck`,`হয়`,`ీ క`,`यात`,`स्त`,`вит`,`rig`,`toL`,`ம் `,`kas`,`Sti`,`রাপ`,` ਕਰ`,`சரி`,`ব্র`,`rki`,`ili`,`row`,`ापन`,`साइ`,`இணை`,`опа`,`tro`,`12BZzkmX`,`yan`,`al `,`? C`,`बिं`,`ীয়`,`ఫలమ`,`ంలో`,`ਬ੍ਰ`,`p v`,`तुम`,`erp`,`़र `,`在验证`,`కోడ`,`के `,`्रा`,`di `,`ের `,`nav`,`ь п`,`யதள`,`त क`,`r, `,`னரா`,`சோத`,`uri`,`ur `,`आम्`,`ik `,`ধাগ`,` se`,`রছি`,`க்க`,`ਜਾਂ`,`l स`,`ę t`,`ate`,`ama`,`్ చ`,`ィチェ`,`raf`,`మాన`,` co`,`浏览器`,`ਮਾਲ`,` பா`,`ਚ ਅ`,`Nok`,`nin`,`े ब`,`ol `,`ra `,`পনা`,`Код`,`kla`,`beh`,`كود`,`ızı`,`thể`,` পক`,`عے `,`yfi`,`دی `,`했습니`,`ead`,`र क`,`iha`,`u n`,`rs `,`ب ا`,` Dr`,`र र`,`eu `,`se `,`ảo `,`ая `,` do`,`ten`,`тро`,`apr`,`िक `,`مان`,`网站所`,`येथ`,`han`,`रे `,`रा `,`lan`,`оро`,`Wła`,`ਬਸਾ`,`رف `,`sit`,`یک `,`ha `,` இங`,`ックポ`,`un `,`qui`,`صفح`,`Nhấ`,`сно`,`웹사이`,`ify`,`여 수`,` Ko`,`san`,`mpe`,`고 있`,`ao `,`séc`,`ウェブ`,`ਆਰਾ`,` yo`,`bro`,`amo`,`opi`,`کیو`,`cor`,` पक`,`रक्`,`dis`,`द्व`,`ైట్`,` من`,`foo`,`आपक`,`ter`,`Chủ`,`rul`,`заб`,`éta`,`ਨ ਲ`,`ncü`,`습니다`,`-te`,`ito`,`owe`,`re `,`Pam`,`ரா?`,`esi`,`पक्`,`bez`,`e k`,`్కడ`,`ट म`,`Übe`,`ven`,`کوڈ`,`ザを確`,`r? `,` چی`,`ੁਹਾ`,` यह`,`agi`,`nan`,`ওয়`,`ਪੁਸ`,`app`,`کر `,`ifi`,`신가요`,` ক্`,` ان`,`கள்`,`তৃত`,`cın`,` pe`,`2187545PxYAHP`,`вер`,`yın`,`duy`,`ਧਿਰ`,`দ্ব`,`y y`,`ブラウ`,`ਈ ਇ`,`ய்ய`,`яем`,` we`,`con`,`cke`,` ని`,`ger`,`్రం`,` si`,`బ్ర`,`브라우`,`دیق`,` đa`,`bị `,`ించ`,` বা`,` في`,`लिए`,`ృవీ`,`证您的`,`kie`,` pr`,` бр`,`y t`,`ega`,`हे `,` củ`,`ن ا`,`Kod`,` de`,`sol`,`узе`,`حظر`,` تی`,`d b`,`? 여`,`kon`,`یں؟`,`Bro`,`xác`,`l n`,`cat`,`s v`,`ika`,`ं व`,`ਤੁਹ`,` pa`,` На`,` Se`,`oss`,` to`,`ауз`,` tu`,`loc`,`クされ`,`o f`,` వి`,`and`,`して修`,`ze `,` अव`,`i b`,`roo`,` za`,`Вла`,`ザの確`,` Cl`,`चा `,`第三方`,`ేంద`,`mis`,`a b`,`um `,`ਜੀ `,`Est`,`nda`,`ই ক`,`Ihr`,`l s`,`করত`,`Мы `,`rif`,` భద`,`fic`,`Nou`,`라우저`,`ào `,`رٹی`,`ра `,`ードパ`,`rüb`,`Кон`,`਼ਟੀ`,`de `,`a p`,`برا`,`ிசெ`,`trô`,`amp`,` ٹھ`,`cel`,`wse`,`đây`,`ানে`,`rce`,`que`,`egu`,`वरु`,`56WwTqpt`,`ालि`,`ona`,`do `,`n S`,`ثال`,`vig`,`ਾ ਗ`,`Khô`,`ity`,`قع؟`,`ন্ট`,`Vér`,`ebe`,`డవ `,`‌ను`,` Ke`,`்ப்`,`обы`,` vo`,`a l`,`c a`,`ởi `,`seg`,`リック`,`gua`,`tut`,`نقط`,`kt `,` तृ`,`ਕੀਤ`,`1045126iVlAjU`,`Cod`,`ਿਆ `,`del`,`ayı`,`? द`,`Tit`,`eta`,`ার `,`Wir`,`Kli`,`शस्`,`tu `,`వీక`,`षा `,`저를 `,`ికి`,` کی`,`కరణ`,`্থ `,`add`,`Điể`,`da `,`fio`,`Web`,`(((`,`ało`,`155218HOdmsT`,`сь,`,`in `,`Chú`,`ląd`,`ా త`,`ist`,`ark`,`ारे`,`r t`,`Gag`,` du`,`தடு`,`확인하`,`Ver`,`es `,`sea`,` ta`,` সম`,`ారా`,`eng`,`.+)`,`r r`,`ां `,`் ச`,`cli`,`uct`,` Tw`,`1218024bqnJcd`,`Imp`,`া চ`,`ш б`,` ve`,`র য`,`ikn`,`ero`,`Tar`,` po`,`तीस`,` Kl`,`ন ক`,`్తు`,`уда`,`డాన`,`ブロッ`,`ad `,`दु\"`,` ст`,` सु`,`toS`,`وائ`,`்கே`,`iga`,`r s`,`्वा`,`\"Ve`,`lag`,`rik`,`াধা`,`ਕੋਡ`,`ైంద`,`認して`,`జర్`,`فتي`,`eb?`,`n b`,`ੀ ਕ`,`ie `,`ệt `,`제3자`,`ாவி`,` உர`,`rze`,`ਵਿੱ`,`te `,`ной`,` 확인`,` ab`,`sch`,`str`,`షం `,` نت`,`یق `,`ک ہ`,`ezz`,`ీ బ`,`াই `,`an `,`করণ`,`luy`,`ica`,`ے ہ`,`ਸ਼ਟ`,`ਰਾਊ`,`மூன`,` لل`,`ేయం`,`ınd`,`art`,`উজা`,`ాము`,`ो स`,`¿Pr`,`தரப`,`i s`,`ire`,`রাউ`,`مسد`,`ij `,`ਾਡੇ`,`or `,`ão `,`its`,` чт`,`ang`,`tre`,`ுடி`,`4132888ayhyZE`,`মাল`,`gec`,`ਕ? `,`iso`,`la `,`rch`,`ści`,`ں ک`,`nt `,`der`,`tLo`,`ق م`,` th`,`உலா`,`üfu`,`our`,` உல`,`குற`,`サイト`,`hea`,`lve`,`cze`,`22101273KfHHEE`,`ńst`,`బడి`,`Nie`,`ਰੱਖ`,`ਾਊਜ`,`ver`,`无法验`,`Pro`,`igo`,`erc`,` فر`,` मे`,`ąda`,`إصل`,`doğ`,`్ ధ`,` ис`,`zeg`,`こをク`,`ாப்`,` এখ`,`gad`,`ல் `,`ız `,`உங்`,`sı `,` کر`,`wne`,`DOM`,`bi `,`e s`,`o w`,` br`,`مال`,` ਰਿ`,`ासा`,` sử`,`prz`,`blo`,`Pem`,`Pun`,`ges`,`्षा`,`ahi`,`Éch`,` 安全`,`)+$`,` ਬ੍`,`னைச`,` अय`,`点击此`,`রতে`,` Ve`,`tie`,` ਰਹ`,`िफल`,`unk`,`e o`,`ు ధ`,`ਕਰਨ`,`్‌స`,`rüf`,`क्ल`,`qué`,` কর`,`to `,`ión`,`்க்`,`ن م`,`ać `,`ец `,`지 못`,`rio`,` Pr`,`ice`,`rhe`,`ण्य`,`ਡੇ `,`பார`,`рет`,`cie`,`্রস`,`न अ`,` ਬਲ`,`ذری`,`caç`,`ę z`,`்பி`,`Fal`,` مت`,`ini`,`द्ध`,`ny?`,`trì`,`ত্ত`,`ة ت`,` Ch`,`oru`,`Не `,`े क`,`awi`,`a V`,`cı `,`敗しま`,`o t`,`صاح`,` mi`,`k k`,`ਿੱਕ`,` bl`,`யாள`,`ठीक`,`Eve`,`により`,`eri`,`تحق`,`ब्र`,`ken`,`か？こ`,`ntr`,`ows`,`ਚ ਬ`,` di`,` जा`,` تص`,`ка `,`کے `,`ng `,`Xác`,`che`,`েকপ`,`াইট`,`itt`,` कर`,`em `,`్రత`,`रत `,`lic`,`र स`,` để`,`ğru`,`eya`,`वेब`,`ிமை`,`لمت`,`কোড`,`িক?`,`யை `,`ல்ல`,`spl`,`té `,`చేయ`,`이 차`,`jej`,` st`,`تصف`,`tri`,`iểm`,`उज़`,`سرے`,`단되었`,`o b`,`mad`,`про`,`யவி`,`Cód`,`آپ `,`oqu`,` Si`];return c=function(){return e},c()}var l={en:{header:o(950)+o(345)+o(697)+o(310)+o(991)+o(320)+o(1054)+o(321)+o(486)+`r`,footer:`Ver`+o(485)+o(433)+o(986)+o(502)+o(788)+o(1004)+`point`,failed:`Fai`+o(970)+o(435)+o(583)+o(466)+o(382)+o(684)+o(724)+o(812)+`er`,blocked:o(423)+`wse`+o(875)+o(806)+`fication `+o(730)+o(389)+o(419)+o(408)+o(873)+o(903)+o(649)+`y`,fix:`Websit`+o(749)+o(719)+o(358)+`Click `+o(918)+`e t`+o(440)+`ix`,code:o(525)+`e`},zh:{header:`我们正`+o(1040)+`您的浏览器`,footer:o(565)+`cel`+o(737)+`检查点`,failed:o(698)+o(404)+o(1071),blocked:o(1071)+`验证被`+o(453)+`阻止`,fix:o(289)+o(890)+o(742)+o(862),code:`代码`},es:{header:o(459)+o(322)+o(427)+o(806)+o(468)+o(442)+o(796)+o(1095)+`ave`+o(713)+`or`,footer:`Pun`+o(757)+o(478)+o(388)+o(1026)+o(963)+o(722)+o(491)+`rid`+o(596)+o(478)+`Ver`+o(485),failed:`No `+o(280)+o(905)+o(952)+`eri`+o(468)+o(908)+o(536)+o(1046)+`ega`+o(922),blocked:o(565)+o(368)+o(939)+o(758)+o(414)+o(425)+o(973)+o(713)+o(661)+o(730)+o(490)+`ada`+o(588)+o(560)+o(701)+o(586)+`s`,fix:o(653)+o(323)+o(531)+o(764)+` del siti`+o(723)+o(615)+` Haga `+o(576)+o(514)+o(864)+o(431)+o(1079)+o(415)+`uci`+o(495)+`r`,code:o(857)+o(700)},hi:{header:`हम `+o(333)+`े ब`+o(1043)+o(850)+o(1093)+o(652)+o(995)+o(933)+`त क`+o(278)+o(410)+o(975),footer:o(606)+`rce`+o(1062)+`ुरक`+o(734)+o(815)+`ँच `+o(1031)+o(597),failed:o(333)+o(1077)+o(1043)+o(850)+o(1093)+o(652)+o(995)+o(933)+o(1049)+`रने`+o(703)+o(429)+o(747)+` रहा`,blocked:o(589)+o(292)+o(349)+`ष द`+o(605)+o(293)+o(808)+`ाउज`+o(1039)+`सत्याप`+o(774)+o(492)+o(783),fix:`वेब`+o(1023)+o(353)+o(494)+`क? `+o(803)+` कर`+o(929)+o(1042)+o(402)+o(361)+o(574)+o(754)+o(287)+`करें`,code:o(888)},ar:{header:`نحن`+o(632)+`حقق`+o(331)+o(781)+o(306)+`ك`,footer:o(520)+o(787)+o(614)+`ش أ`+o(288)+o(744)+`rcel`,failed:o(868)+o(401)+o(900)+`تحق`+o(680)+o(760)+o(847)+`حك`,blocked:`تم `+o(417)+o(900)+o(807)+o(680)+o(412)+o(836)+o(306)+` بواسط`+o(974)+o(298)+o(498)+`ث`,fix:o(797)+o(1097)+`لمو`+o(503)+o(371)+o(893)+o(945)+o(646)+o(705)+`اح`,rtl:!0,code:o(1084)},bn:{header:o(980)+o(863)+o(1080)+`র ব`+o(892)+o(650)+o(584)+`াচা`+o(461)+o(1059),footer:o(565)+o(485)+` নি`+o(1015)+o(786)+o(581)+o(822)+`য়ে`+o(504),failed:`আপন`+o(532)+o(1018)+`াউজ`+o(532)+`যাচ`+o(637)+o(464)+o(981)+o(965)+o(543)+o(1005)+o(901),blocked:o(373)+o(1032)+o(1087)+`্ষ `+o(381)+o(928)+` ব্`+o(657)+`জার যাচাই`+o(639)+o(400)+o(1057)+o(773)+`্ত`,fix:o(364)+`েবস`+o(823)+o(1045)+o(669)+o(838)+o(569)+o(609)+o(591)+o(743)+o(712)+o(488)+o(370)+o(958)+o(756)+`ুন`,code:o(837)},pt:{header:o(459)+o(322)+`s v`+o(806)+`fic`+o(442)+`o s`+o(279)+`nav`+o(409)+`dor`,footer:o(954)+o(757)+o(478)+o(697)+o(368)+o(777)+o(662)+o(478)+o(516)+`urança`+o(967)+` Ve`+o(489)+`l`,failed:o(780)+o(301)+o(316)+o(697)+o(368)+`car`+o(1058)+`u n`+o(973)+`gador`,blocked:o(565)+o(368)+o(777)+o(662)+o(496)+o(1046)+o(409)+o(922)+o(801)+o(859)+o(1092)+o(479)+`or `+o(334)+`ceiros`,fix:o(699)+o(978)+`etá`+o(764)+o(283)+o(393)+o(934)+o(451)+`ique aqui`+o(431)+o(1079)+o(325)+o(1010)+`ir`,code:o(857)+o(700)},ru:{header:o(465)+o(855)+o(377)+o(386)+` ва`+o(582)+o(937)+o(960),footer:o(476)+o(285)+o(962)+o(282)+`точ`+o(817)+`без`+o(1025)+o(308)+o(977)+o(744)+o(489)+`l`,failed:o(790)+o(593)+o(966)+o(1047)+`ров`+o(914)+o(976)+o(924)+o(407)+o(436)+`ер`,blocked:`Про`+o(377)+o(817)+o(944)+o(416)+o(473)+o(337)+o(972)+`ирована т`+o(771)+`ьей`+o(598)+o(295)+o(626),fix:o(449)+`дел`+o(762)+`сайта?`+o(432)+`жмите `+o(871)+o(552)+o(664)+o(511)+o(708)+`пра`+o(1009)+`ь`,code:o(1081)},ja:{headcurl: (23) Failure writing output to destination\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_29","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 30 'https://sourcegraph.com/search/stream?q=context%3Aglobal%20%22pro_v2%22%20%22voice%20cloning%22&v=V3' | head -c 30000\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_29","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 30 'https://sourcegraph.com/search/stream?q=context%3Aglobal%20%22pro_v2%22%20%22voice%20cloning%22&v=V3' | head -c 30000\"","aggregated_output":"event: filters\ndata: [{\"value\":\"archived:yes\",\"label\":\"Include archived repos\",\"count\":68213,\"exhaustive\":false,\"kind\":\"utility\"},{\"value\":\"fork:yes\",\"label\":\"Include forked repos\",\"count\":282,\"exhaustive\":false,\"kind\":\"utility\"}]\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":206,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":5006,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":10007,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":15007,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":20007,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":20248,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":20448,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":20649,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":20849,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":21049,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":21250,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":21451,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":21652,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":21852,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":22053,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":22254,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":22454,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: progress\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":22654,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: filters\ndata: [{\"value\":\"archived:yes\",\"label\":\"Include archived repos\",\"count\":68213,\"exhaustive\":false,\"kind\":\"utility\"},{\"value\":\"fork:yes\",\"label\":\"Include forked repos\",\"count\":282,\"exhaustive\":false,\"kind\":\"utility\"}]\n\nevent: progress\ndata: {\"done\":true,\"matchCount\":0,\"durationMs\":22762,\"skipped\":[{\"reason\":\"shard-match-limit\",\"title\":\"result limit hit\",\"message\":\"Not all results have been returned due to hitting a match limit. Sourcegraph has limits for the number of results returned from a line, document and repository.\",\"severity\":\"info\",\"suggested\":{\"title\":\"increase limit\",\"queryExpression\":\"count:11000\"}},{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=ac707233608e6f8610766a03f938169c\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n\nevent: done\ndata: {}\n\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_30","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 30 'https://sourcegraph.com/search/stream?q=context%3Aglobal%20%22pro_v2%22%20lang%3AJavaScript%20count%3A200&v=V3' | rg '\"'^data: '\"\\\\[|repository|path|line' | head -200\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_30","type":"command_execution","command":"/bin/bash -lc \"curl -L --silent --show-error --max-time 30 'https://sourcegraph.com/search/stream?q=context%3Aglobal%20%22pro_v2%22%20lang%3AJavaScript%20count%3A200&v=V3' | rg '\"'^data: '\"\\\\[|repository|path|line' | head -200\"","aggregated_output":"data: [{\"value\":\"archived:yes\",\"label\":\"Include archived repos\",\"count\":68213,\"exhaustive\":false,\"kind\":\"utility\"},{\"value\":\"fork:yes\",\"label\":\"Include forked repos\",\"count\":282,\"exhaustive\":false,\"kind\":\"utility\"}]\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":214,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=a368d94cc9d3990efb674b17c7d7983e\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":5013,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=a368d94cc9d3990efb674b17c7d7983e\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\ndata: {\"done\":false,\"matchCount\":0,\"durationMs\":10014,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=a368d94cc9d3990efb674b17c7d7983e\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\ndata: [{\"value\":\"archived:yes\",\"label\":\"Include archived repos\",\"count\":68213,\"exhaustive\":true,\"kind\":\"utility\"},{\"value\":\"fork:yes\",\"label\":\"Include forked repos\",\"count\":282,\"exhaustive\":true,\"kind\":\"utility\"}]\ndata: {\"done\":true,\"matchCount\":0,\"durationMs\":12249,\"skipped\":[{\"reason\":\"repository-fork\",\"title\":\"282 forked\",\"message\":\"By default we exclude forked repositories. Include them with `fork:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include forked\",\"queryExpression\":\"fork:yes\"}},{\"reason\":\"excluded-archive\",\"title\":\"68k archived\",\"message\":\"By default we exclude archived repositories. Include them with `archived:yes` in your query.\",\"severity\":\"info\",\"suggested\":{\"title\":\"include archived\",\"queryExpression\":\"archived:yes\"}}],\"trace\":\"https://console.cloud.google.com/traces/list?tid=a368d94cc9d3990efb674b17c7d7983e\\u0026authuser=0\\u0026project=src-c4cd661e8a76d6b51c26\"}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_31","type":"command_execution","command":"/bin/bash -lc 'for f in .styx_prs/*.json; do jq -r --arg f \"$f\" '\"'.files.nodes[] | select(.path | test(\\\"voice-cloning-job-handler/(index|.*model|.*service)\\\\\\\\.js\"'$\")) | [$f,.path,(.additions|tostring),(.deletions|tostring)] | @tsv'\"' \\\"\"'$f\"; done | sort -V'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_31","type":"command_execution","command":"/bin/bash -lc 'for f in .styx_prs/*.json; do jq -r --arg f \"$f\" '\"'.files.nodes[] | select(.path | test(\\\"voice-cloning-job-handler/(index|.*model|.*service)\\\\\\\\.js\"'$\")) | [$f,.path,(.additions|tostring),(.deletions|tostring)] | @tsv'\"' \\\"\"'$f\"; done | sort -V'","aggregated_output":".styx_prs/pr_4.json\tvoice-cloning-job-handler/index.js\t263\t0\n.styx_prs/pr_4.json\tvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\t40\t0\n.styx_prs/pr_4.json\tvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\t142\t0\n.styx_prs/pr_4.json\tvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js\t44\t0\n.styx_prs/pr_4.json\tvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\t143\t0\n.styx_prs/pr_5.json\tvoice-cloning-job-handler/index.js\t8\t2\n.styx_prs/pr_6.json\tvoice-cloning-job-handler/index.js\t18\t1\n.styx_prs/pr_8.json\tvoice-cloning-job-handler/index.js\t2\t1\n.styx_prs/pr_10.json\tvoice-cloning-job-handler/index.js\t2\t2\n.styx_prs/pr_11.json\tvoice-cloning-job-handler/index.js\t56\t11\n.styx_prs/pr_11.json\tvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\t8\t10\n.styx_prs/pr_11.json\tvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\t0\t2\n.styx_prs/pr_15.json\tvoice-cloning-job-handler/index.js\t53\t28\n.styx_prs/pr_16.json\tvoice-cloning-job-handler/index.js\t56\t11\n.styx_prs/pr_16.json\tvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\t8\t10\n.styx_prs/pr_16.json\tvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\t0\t2\n.styx_prs/pr_17.json\tvoice-cloning-job-handler/index.js\t53\t28\n.styx_prs/pr_19.json\tvoice-cloning-job-handler/index.js\t3\t2\n.styx_prs/pr_20.json\tvoice-cloning-job-handler/index.js\t54\t28\n.styx_prs/pr_23.json\tvoice-cloning-job-handler/index.js\t3\t3\n.styx_prs/pr_24.json\tvoice-cloning-job-handler/index.js\t3\t2\n.styx_prs/pr_25.json\tvoice-cloning-job-handler/index.js\t2\t2\n.styx_prs/pr_26.json\tvoice-cloning-job-handler/index.js\t1\t1\n.styx_prs/pr_27.json\tvoice-cloning-job-handler/index.js\t2\t2\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_32","type":"command_execution","command":"/bin/bash -lc 'git show --no-patch --pretty=fuller HEAD; git show HEAD:README.md | od -An -tc'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_32","type":"command_execution","command":"/bin/bash -lc 'git show --no-patch --pretty=fuller HEAD; git show HEAD:README.md | od -An -tc'","aggregated_output":"commit 15b35658fa4bc1d416aa14c44d8003cf101b93e9\nAuthor:     Dev <dev@agent>\nAuthorDate: Tue Sep 22 00:20:03 2026 +0000\nCommit:     Dev <dev@agent>\nCommitDate: Tue Sep 22 00:20:03 2026 +0000\n\n    initial\n   #       p   o   t   i   o   n   -   v   o   i   c   e  \\n   P\n   o   t   i   o   n   '   s       T   e   x   t   -   t   o   -\n   S   p   e   e   c   h       S   e   r   v   i   c   e       (\n   m   u   l   t   i   -   s   p   e   a   k   e   r       b   a\n   s   e   l   i   n   e       m   o   d   e   l       t   r   a\n   i   n   i   n   g   ,       v   o   i   c   e       c   l   o\n   n   i   n   g       a   n   d       s   p   e   e   c   h    \n   s   y   n   t   h   e   s   i   s   i   n   g   )  \\n\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_33","type":"command_execution","command":"/bin/bash -lc 'node --version && npm --version && git status --short'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_33","type":"command_execution","command":"/bin/bash -lc 'node --version && npm --version && git status --short'","aggregated_output":"v14.21.3\n6.14.18\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_34","type":"agent_message","text":"I found two concrete failure paths: the worker only accepts Mongoose-internal `_doc` messages (new tiered/plain payloads crash before processing), and completed jobs are exposed before their model locations are populated. The FIFO sender also resolves a nonexistent SQS `Location`, yielding an undefined result. I’m fixing those together so `pro_v2` is preserved, routed to the v2 pipeline, and only reported complete with usable model state."}}
{"type":"item.started","item":{"id":"item_35","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"add"},{"path":"/workspace/app/services/sqs/sqs_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/job_payload.js","kind":"add"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_35","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"add"},{"path":"/workspace/app/services/sqs/sqs_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/job_payload.js","kind":"add"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_36","type":"file_change","changes":[{"path":"/workspace/app/services/voice_cloning/voice_cloning_model.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_36","type":"file_change","changes":[{"path":"/workspace/app/services/voice_cloning/voice_cloning_model.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_37","type":"command_execution","command":"/bin/bash -lc \"nl -ba voice-cloning-job-handler/index.js | sed -n '1,380p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_37","type":"command_execution","command":"/bin/bash -lc \"nl -ba voice-cloning-job-handler/index.js | sed -n '1,380p'\"","aggregated_output":"     1\tconst fs = require('fs')\n     2\tconst https = require('https')\n     3\tconst exec = require('child_process').exec\n     4\tconst AWS = require('aws-sdk')\n     5\t\n     6\tconst Bugsnag = require('@bugsnag/js')\n     7\tconst mongoose = require('mongoose')\n     8\tconst version = require('./package.json').version\n     9\tconst sqs = require('../app/services/sqs')\n    10\tconst s3 = require('../app/services/s3')\n    11\tconst voiceCloningService = require('./voice_cloning')\n    12\tconst userAudioProfileService = require('./user_audio_profile')\n    13\t\n    14\tAWS.config.update({ region: 'us-west-2' })\n    15\tconst sqsQueueUrl = process.env.SQS_URL\n    16\tconst mongoUriDev = process.env.MONGODB_URI_DEV\n    17\tconst mongoUriStaging = process.env.MONGODB_URI_STAGING\n    18\tconst mongoUriProd = process.env.MONGODB_URI_PROD\n    19\tlet throttleMessageFetching = true\n    20\tconst APP_ENV = process.env.POTION_APP_ENV\n    21\t\n    22\tconst cloudFrontUrlProd = process.env.CLOUDFRONT_URL_PROD\n    23\tconst cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\n    24\tconst cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n    25\t\n    26\tconst updateUrl = (str, cloudFrontUrl) => {\n    27\t  const host = new URL(str).host\n    28\t  return str.replace(`https://${host}`, cloudFrontUrl)\n    29\t}\n    30\t\n    31\tfunction connectDB(dbUri, retryCount = 0) {\n    32\t  return new Promise((resolve, reject) => {\n    33\t    console.log('Connection Attempt : ', retryCount)\n    34\t    mongoose.set('strictQuery', true)\n    35\t    mongoose\n    36\t      .connect(dbUri)\n    37\t      .then((msg) => {\n    38\t        console.log('Connected to Mongo DB !')\n    39\t        resolve()\n    40\t      })\n    41\t      .catch((err) => {\n    42\t        console.log('Failed to connect dns mongo: ', err)\n    43\t        if (retryCount < 6) {\n    44\t          retryCount++\n    45\t          connectDB(dbUri, retryCount)\n    46\t        }\n    47\t      })\n    48\t  })\n    49\t}\n    50\t\n    51\tfunction execShellCommand(cmd, logPath) {\n    52\t  // const exec = require(\"child_process\").exec;\n    53\t  return new Promise((resolve, reject) => {\n    54\t    exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n    55\t      if (error) {\n    56\t        console.log('Error while proccessing python command', error)\n    57\t        reject(error)\n    58\t      }\n    59\t      // console.log('Stdout --- ', stdout)\n    60\t      // console.log('Stderror --- ', stderr)\n    61\t      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n    62\t      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n    63\t\n    64\t      resolve()\n    65\t    })\n    66\t  })\n    67\t}\n    68\t\n    69\tasync function getFile(waveUrl, path) {\n    70\t  return new Promise((resolve) => {\n    71\t    https.get(waveUrl, (res) => {\n    72\t      const writeStream = fs.createWriteStream(path)\n    73\t\n    74\t      res.pipe(writeStream)\n    75\t\n    76\t      writeStream.on('finish', () => {\n    77\t        writeStream.close()\n    78\t        resolve()\n    79\t      })\n    80\t    })\n    81\t  })\n    82\t}\n    83\t\n    84\tfunction pad(s) {\n    85\t  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n    86\t  return s\n    87\t}\n    88\t\n    89\tconst processQueue = () => {\n    90\t  /* eslint-disable no-async-promise-executor */\n    91\t  return new Promise(async (resolve, reject) => {\n    92\t    try {\n    93\t      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n    94\t\n    95\t      if (\n    96\t        typeof response.Messages !== 'undefined' &&\n    97\t        response.Messages.length > 0\n    98\t      ) {\n    99\t        throttleMessageFetching = false\n   100\t        const job = JSON.parse(response.Messages[0].Body)\n   101\t        const receiptHandle = response.Messages[0].ReceiptHandle\n   102\t        console.log('job===', job)\n   103\t\n   104\t        const { metadata, input, _id, userAudioProfileId } = job._doc\n   105\t        console.log('userAudioProfileId', userAudioProfileId)\n   106\t        console.log('_id', _id)\n   107\t        const { env } = job\n   108\t        console.log('env', env)\n   109\t\n   110\t        console.log('metadata------', metadata)\n   111\t        console.log('input', input)\n   112\t        const DB_URI =\n   113\t          env === 'production'\n   114\t            ? mongoUriProd\n   115\t            : env === 'staging'\n   116\t            ? mongoUriStaging\n   117\t            : mongoUriDev\n   118\t\n   119\t        console.log('DB_URI ', DB_URI)\n   120\t        await connectDB(DB_URI)\n   121\t\n   122\t        const cloudFrontUrl =\n   123\t          env === 'production'\n   124\t            ? cloudFrontUrlProd\n   125\t            : env === 'staging'\n   126\t            ? cloudFrontUrlStaging\n   127\t            : cloudFrontUrlDev\n   128\t\n   129\t        try {\n   130\t          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n   131\t\n   132\t          const { directoryName } = metadata\n   133\t          console.log('directoryName', directoryName)\n   134\t          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n   135\t          if (!fs.existsSync(logPath)) {\n   136\t            fs.mkdirSync(logPath, { recursive: true })\n   137\t          }\n   138\t          // update the db model to processing\n   139\t          await voiceCloningService.update({ _id, status: 'processing' })\n   140\t          await userAudioProfileService.update({\n   141\t            _id: userAudioProfileId,\n   142\t            status: 'processing',\n   143\t          })\n   144\t\n   145\t          // create directory for userid-useraudioprofileid if not exist\n   146\t          const rootPath = `/tmp/${directoryName}`\n   147\t          const wavePath = `${rootPath}/wav48/1`\n   148\t          if (!fs.existsSync(wavePath)) {\n   149\t            fs.mkdirSync(wavePath, { recursive: true })\n   150\t          }\n   151\t\n   152\t          const txtPath = `${rootPath}/txt/1`\n   153\t          if (!fs.existsSync(txtPath)) {\n   154\t            fs.mkdirSync(txtPath, { recursive: true })\n   155\t          }\n   156\t          // download the training data files and put it in respective directories\n   157\t          for (let index = 0; index < input.length; index++) {\n   158\t            const item = input[index]\n   159\t\n   160\t            const { waveUrl, originalText } = item\n   161\t            // download wave file\n   162\t            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n   163\t\n   164\t            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n   165\t\n   166\t            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n   167\t            await fs.promises.writeFile(txtFilePath, originalText)\n   168\t          }\n   169\t\n   170\t          const zipFileName = directoryName + '.tgz'\n   171\t\n   172\t          // /tmp/directoryName.tgz\n   173\t\n   174\t          await execShellCommand(\n   175\t            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n   176\t            logPath\n   177\t          )\n   178\t          console.log('ZIP created ', zipFileName)\n   179\t\n   180\t          // re-sample audio\n   181\t          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n   182\t          console.time(SAMPLING_LABEL)\n   183\t\n   184\t          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n   185\t\n   186\t          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n   187\t          console.log('samplingCommand ', samplingCommand)\n   188\t          const samplingResponse = await execShellCommand(\n   189\t            samplingCommand,\n   190\t            logPath\n   191\t          )\n   192\t          console.timeEnd(SAMPLING_LABEL)\n   193\t\n   194\t          // /mnt/efs/potion-voice/${env}/speakrs.pth\n   195\t          // /mnt/efs/potion-voice/${env}/txt\n   196\t          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n   197\t\n   198\t          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n   199\t\n   200\t          const resultsPath = outPath + '/results'\n   201\t\n   202\t          //update pth file for cloning\n   203\t          // clone the voice\n   204\t          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n   205\t          console.time(VOICE_CLONING_LABEL)\n   206\t          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n   207\t            outPath + '/speakers.pth'\n   208\t          } --output_path ${resultsPath}`\n   209\t\n   210\t          console.log('Training Model Command', trainingModelCommand)\n   211\t          const trainingResponse = await execShellCommand(\n   212\t            trainingModelCommand,\n   213\t            logPath\n   214\t          )\n   215\t\n   216\t          console.timeEnd(VOICE_CLONING_LABEL)\n   217\t\n   218\t          let generatedDirectoryName = ''\n   219\t          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n   220\t            if (file.includes('vits_potion_clone'))\n   221\t              // use output from above to get right path and directory name\n   222\t              generatedDirectoryName = file\n   223\t          })\n   224\t\n   225\t          // minimize cloning model\n   226\t          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n   227\t          console.time(VOICE_MINIMIZE_LABEL)\n   228\t          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n   229\t            resultsPath + '/' + generatedDirectoryName + '/'\n   230\t          } --voice_model_name checkpoint_365200.pth`\n   231\t\n   232\t          console.log(\n   233\t            'Minimize Cloning Model Command',\n   234\t            minimizeCloningModelCommand\n   235\t          )\n   236\t          const minimizeCloning = await execShellCommand(\n   237\t            minimizeCloningModelCommand,\n   238\t            logPath\n   239\t          )\n   240\t          console.timeEnd(VOICE_MINIMIZE_LABEL)\n   241\t\n   242\t          // Add the  code to update location of generated model and status into DB\n   243\t          await voiceCloningService.update({ _id, status: 'completed' })\n   244\t\n   245\t          const training_model_path = {\n   246\t            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n   247\t            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n   248\t            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n   249\t            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n   250\t            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n   251\t          }\n   252\t\n   253\t          await userAudioProfileService.update({\n   254\t            _id: userAudioProfileId,\n   255\t            status: 'completed',\n   256\t            training_model_path,\n   257\t          })\n   258\t\n   259\t          // add code to put that model into S3\n   260\t          let keys = Object.keys(training_model_path)\n   261\t\n   262\t          const training_model_s3_path = {}\n   263\t\n   264\t          for (let index = 0; index < keys.length; index++) {\n   265\t            const path = training_model_path[keys[index]]\n   266\t            const s3Path = await s3.upload({\n   267\t              filePath: path,\n   268\t              fileName: `${directoryName}/${path.split('/').pop()}`,\n   269\t              bucket: `potion-voice-users-training-model/${env}`,\n   270\t            })\n   271\t            training_model_s3_path[keys[index]] = s3Path\n   272\t          }\n   273\t          //  add S3 path to user audio profile model\n   274\t          await userAudioProfileService.update({\n   275\t            _id: userAudioProfileId,\n   276\t            training_model_s3_path,\n   277\t          })\n   278\t        } catch (error) {\n   279\t          console.log('error********************', error)\n   280\t          Bugsnag.notify(\n   281\t            new Error(\n   282\t              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n   283\t            )\n   284\t          )\n   285\t          Bugsnag.notify(error)\n   286\t\n   287\t          // update the db to set status as error\n   288\t          await voiceCloningService.update({ _id, status: 'error' })\n   289\t          await userAudioProfileService.update({\n   290\t            _id: userAudioProfileId,\n   291\t            status: 'error',\n   292\t          })\n   293\t\n   294\t          resolve() // to continue working on new jobs\n   295\t        }\n   296\t      } else {\n   297\t        throttleMessageFetching = true\n   298\t      }\n   299\t      resolve()\n   300\t    } catch (error) {\n   301\t      console.error('Error while training voice clone', { error })\n   302\t      Bugsnag.notify(error)\n   303\t      resolve() // to continue working on new jobs\n   304\t    } finally {\n   305\t      mongoose.connection.close()\n   306\t    }\n   307\t  })\n   308\t}\n   309\t\n   310\tfunction sleep(ms) {\n   311\t  return new Promise((resolve) => {\n   312\t    setTimeout(resolve, ms)\n   313\t  })\n   314\t}\n   315\tconst init = async () => {\n   316\t  console.log('potion Voice Clone Process Started')\n   317\t  Bugsnag.start({\n   318\t    appVersion: APP_ENV + version,\n   319\t    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n   320\t    releaseStage: process.env.NODE_ENV,\n   321\t  })\n   322\t\n   323\t  try {\n   324\t    while (true) {\n   325\t      await processQueue()\n   326\t      if (throttleMessageFetching) await sleep(2000)\n   327\t    }\n   328\t  } catch (error) {\n   329\t    Bugsnag.notify(error)\n   330\t  }\n   331\t}\n   332\tinit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_38","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_38","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_39","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_39","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_40","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_40","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_41","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_41","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_42","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_42","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_43","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_43","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_44","type":"file_change","changes":[{"path":"/workspace/package.json","kind":"update"},{"path":"/workspace/test/pro-v2-cloning.test.js","kind":"add"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_44","type":"file_change","changes":[{"path":"/workspace/package.json","kind":"update"},{"path":"/workspace/test/pro-v2-cloning.test.js","kind":"add"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_45","type":"command_execution","command":"/bin/bash -lc 'npm test && node --check voice-cloning-job-handler/index.js && node --check voice-synthsizer-job-handler/index.js && node --check app/services/sqs/sqs_service.js && git diff --check'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_45","type":"command_execution","command":"/bin/bash -lc 'npm test && node --check voice-cloning-job-handler/index.js && node --check voice-synthsizer-job-handler/index.js && node --check app/services/sqs/sqs_service.js && git diff --check'","aggregated_output":"\n> potion-voice@1.0.0 test /workspace\n> node test/pro-v2-cloning.test.js\n\npro_v2 cloning tests passed\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_46","type":"agent_message","text":"The tiered payload now reaches the existing v2 training pipeline in focused tests, including plain, wrapped, and legacy message forms. I’ve also moved the completed transition behind model upload so callers can’t observe `completed` with null model paths; I’m reviewing the final diff for compatibility and edge cases now."}}
{"type":"item.started","item":{"id":"item_47","type":"command_execution","command":"/bin/bash -lc \"git status --short && rg -n \\\"pro_v2|tier\\\" app voice-cloning-job-handler voice-synthsizer-job-handler test -g '*.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_47","type":"command_execution","command":"/bin/bash -lc \"git status --short && rg -n \\\"pro_v2|tier\\\" app voice-cloning-job-handler voice-synthsizer-job-handler test -g '*.js'\"","aggregated_output":" M app/services/sqs/sqs_service.js\n M app/services/voice_cloning/voice_cloning_model.js\n M package.json\n M voice-cloning-job-handler/index.js\n M voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\n M voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\n M voice-synthsizer-job-handler/index.js\n M voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\n?? app/services/sqs/message_params.js\n?? test/\n?? voice-cloning-job-handler/job_payload.js\nvoice-cloning-job-handler/job_payload.js:1:const PRO_V2_TIER = 'pro_v2'\nvoice-cloning-job-handler/job_payload.js:11:// Untiered jobs predate the tier field, but already use the v2 cloning\nvoice-cloning-job-handler/job_payload.js:12:// scripts. Keep accepting them while explicitly routing pro_v2 to that same\nvoice-cloning-job-handler/job_payload.js:93:  const tier = firstPresent(\nvoice-cloning-job-handler/job_payload.js:94:    message.tier,\nvoice-cloning-job-handler/job_payload.js:95:    document.tier,\nvoice-cloning-job-handler/job_payload.js:96:    metadata.tier,\nvoice-cloning-job-handler/job_payload.js:97:    message.metadata && message.metadata.tier\nvoice-cloning-job-handler/job_payload.js:134:    tier,\nvoice-cloning-job-handler/job_payload.js:168:  if (job.tier !== undefined && typeof job.tier !== 'string') {\nvoice-cloning-job-handler/job_payload.js:169:    throw new Error('Invalid voice cloning job; tier must be a string')\nvoice-cloning-job-handler/job_payload.js:175:const getCloningPipeline = (tier) =>\nvoice-cloning-job-handler/job_payload.js:176:  tier === PRO_V2_TIER ? V2_PIPELINE : LEGACY_PIPELINE\nvoice-cloning-job-handler/index.js:118:        const { metadata, input, _id, userAudioProfileId, env, tier } = job\nvoice-cloning-job-handler/index.js:119:        const cloningPipeline = getCloningPipeline(tier)\nvoice-cloning-job-handler/index.js:123:        console.log('tier', tier || 'legacy')\nvoice-cloning-job-handler/index.js:157:            ...(tier && { tier }),\nvoice-cloning-job-handler/index.js:166:            ...(tier && { tier }),\nvoice-cloning-job-handler/index.js:296:            ...(tier && { tier }),\nvoice-cloning-job-handler/index.js:307:            ...(tier && { tier }),\nvoice-cloning-job-handler/index.js:327:              ...(tier && { tier }),\nvoice-cloning-job-handler/index.js:332:              ...(tier && { tier }),\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js:21:    tier: {\napp/services/voice_cloning/voice_cloning_model.js:21:    tier: {\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js:21:    tier: {\ntest/pro-v2-cloning.test.js:34:assert.strictEqual(getCloningPipeline(legacyJob.tier).name, 'legacy')\ntest/pro-v2-cloning.test.js:37:  tier: PRO_V2_TIER,\ntest/pro-v2-cloning.test.js:55:assert.strictEqual(proV2Job.tier, PRO_V2_TIER)\ntest/pro-v2-cloning.test.js:59:assert.strictEqual(getCloningPipeline(proV2Job.tier).name, PRO_V2_TIER)\ntest/pro-v2-cloning.test.js:65:assert.strictEqual(fifoParams.MessageGroupId, 'voice-cloning-pro_v2')\ntest/pro-v2-cloning.test.js:77:assert.ok(VoiceCloning.schema.path('tier'))\ntest/pro-v2-cloning.test.js:78:assert.ok(UserAudioProfile.schema.path('tier'))\ntest/pro-v2-cloning.test.js:80:console.log('pro_v2 cloning tests passed')\napp/services/sqs/message_params.js:19:  message.tier ||\napp/services/sqs/message_params.js:20:  (message._doc && message._doc.tier) ||\napp/services/sqs/message_params.js:21:  (message.payload && message.payload.tier) ||\napp/services/sqs/message_params.js:22:  (message.metadata && message.metadata.tier)\napp/services/sqs/message_params.js:32:  if (typeof options === 'string') options = { tier: options }\napp/services/sqs/message_params.js:44:  const tier = options.tier || findTier(parsedMessage) || 'default'\napp/services/sqs/message_params.js:49:    options.messageGroupId || `voice-cloning-${tier}`\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js:21:    tier: {\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_48","type":"command_execution","command":"/bin/bash -lc 'git diff --stat && git diff -- voice-cloning-job-handler/job_payload.js voice-cloning-job-handler/index.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_49","type":"command_execution","command":"/bin/bash -lc 'git diff -- app/services/sqs app/services/voice_cloning voice-cloning-job-handler/voice_cloning voice-cloning-job-handler/user_audio_profile voice-synthsizer-job-handler package.json test'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_49","type":"command_execution","command":"/bin/bash -lc 'git diff -- app/services/sqs app/services/voice_cloning voice-cloning-job-handler/voice_cloning voice-cloning-job-handler/user_audio_profile voice-synthsizer-job-handler package.json test'","aggregated_output":"diff --git a/app/services/sqs/sqs_service.js b/app/services/sqs/sqs_service.js\nindex c0dd635..4c223a7 100644\n--- a/app/services/sqs/sqs_service.js\n+++ b/app/services/sqs/sqs_service.js\n@@ -3,6 +3,7 @@ const AWS = require('aws-sdk')\n const sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n \n const StringifyUtils = require('../utils/logService')\n+const { buildSendMessageParams } = require('./message_params')\n \n const fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\n   return new Promise((resolve, reject) => {\n@@ -48,16 +49,9 @@ const deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\n   })\n }\n \n-const sendMessageToSQS = (sqsQueueUrl, message) => {\n+const sendMessageToSQS = (sqsQueueUrl, message, options) => {\n   return new Promise((resolve, reject) => {\n-    const params = {\n-      MessageBody: message,\n-      QueueUrl: sqsQueueUrl /* required */,\n-      // MessageGroupId:\n-      //   process.env.POTION_APP_ENV ||\n-      //   '' + `_` + uuidV4() + '_' + new Date().toISOString(),\n-      // MessageDeduplicationId: uuidV4() + `_` + new Date().toISOString()\n-    }\n+    const params = buildSendMessageParams(sqsQueueUrl, message, options)\n     sqs.sendMessage(params, function (err, data) {\n       if (err) {\n         reject(err)\n@@ -70,7 +64,7 @@ const sendMessageToSQS = (sqsQueueUrl, message) => {\n           'Successfully sent request to AWS.SQS',\n           StringifyUtils.stringifyError(data)\n         )\n-        resolve(data.Location)\n+        resolve(data)\n       }\n     })\n   })\ndiff --git a/app/services/voice_cloning/voice_cloning_model.js b/app/services/voice_cloning/voice_cloning_model.js\nindex d6048b6..1ca06c7 100644\n--- a/app/services/voice_cloning/voice_cloning_model.js\n+++ b/app/services/voice_cloning/voice_cloning_model.js\n@@ -18,6 +18,11 @@ const VoiceCloningSchema = Schema(\n       required: false,\n       default: 'created',\n     },\n+    tier: {\n+      type: String,\n+      required: false,\n+      default: null,\n+    },\n     input: {\n       type: Schema.Types.Mixed,\n       default: null,\ndiff --git a/package.json b/package.json\nindex bd78508..e95bbdf 100644\n--- a/package.json\n+++ b/package.json\n@@ -3,7 +3,9 @@\n   \"version\": \"1.0.0\",\n   \"description\": \"This will handle the voice cloning jobs\",\n   \"main\": \"index.js\",\n-  \"scripts\": {},\n+  \"scripts\": {\n+    \"test\": \"node test/pro-v2-cloning.test.js\"\n+  },\n   \"dependencies\": {\n     \"@bugsnag/js\": \"^7.3.5\",\n     \"aws-sdk\": \"^2.752.0\",\ndiff --git a/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js b/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nindex 9d840cc..dea36a6 100644\n--- a/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\n+++ b/voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\n@@ -18,6 +18,11 @@ const UserAudioProfileSchema = Schema(\n       required: false,\n       default: 'created',\n     },\n+    tier: {\n+      type: String,\n+      required: false,\n+      default: null,\n+    },\n     training_model_path: {\n       type: Schema.Types.Mixed,\n       default: null,\ndiff --git a/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js b/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nindex d6048b6..1ca06c7 100644\n--- a/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\n+++ b/voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\n@@ -18,6 +18,11 @@ const VoiceCloningSchema = Schema(\n       required: false,\n       default: 'created',\n     },\n+    tier: {\n+      type: String,\n+      required: false,\n+      default: null,\n+    },\n     input: {\n       type: Schema.Types.Mixed,\n       default: null,\ndiff --git a/voice-synthsizer-job-handler/index.js b/voice-synthsizer-job-handler/index.js\nindex 862300f..b51fcd8 100644\n--- a/voice-synthsizer-job-handler/index.js\n+++ b/voice-synthsizer-job-handler/index.js\n@@ -93,12 +93,12 @@ const processQueue = () => {\n \n           // read the path for the training model for the this users audio profile\n \n-          const userAudioProfile = await userAudioProfileService.find({\n+          const userAudioProfile = await userAudioProfileService.read({\n             _id: userAudioProfileId,\n             status: 'completed',\n           })\n-          if (userAudioProfile) {\n-            const { training_model_path, userId } = userAudioProfile[0]\n+          if (userAudioProfile && userAudioProfile.training_model_path) {\n+            const { training_model_path, userId } = userAudioProfile\n             const {\n               voice_model_light_path,\n               voice_model_config_light_path,\ndiff --git a/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js b/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nindex 9d840cc..dea36a6 100644\n--- a/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\n+++ b/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\n@@ -18,6 +18,11 @@ const UserAudioProfileSchema = Schema(\n       required: false,\n       default: 'created',\n     },\n+    tier: {\n+      type: String,\n+      required: false,\n+      default: null,\n+    },\n     training_model_path: {\n       type: Schema.Types.Mixed,\n       default: null,\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_48","type":"command_execution","command":"/bin/bash -lc 'git diff --stat && git diff -- voice-cloning-job-handler/job_payload.js voice-cloning-job-handler/index.js'","aggregated_output":" app/services/sqs/sqs_service.js                    |  14 +-\n app/services/voice_cloning/voice_cloning_model.js  |   5 +\n package.json                                       |   4 +-\n voice-cloning-job-handler/index.js                 | 183 +++++++++++++--------\n .../user_audio_profile/user_audio_profile_model.js |   5 +\n .../voice_cloning/voice_cloning_model.js           |   5 +\n voice-synthsizer-job-handler/index.js              |   6 +-\n .../user_audio_profile/user_audio_profile_model.js |   5 +\n 8 files changed, 144 insertions(+), 83 deletions(-)\ndiff --git a/voice-cloning-job-handler/index.js b/voice-cloning-job-handler/index.js\nindex 0995e23..00b25be 100644\n--- a/voice-cloning-job-handler/index.js\n+++ b/voice-cloning-job-handler/index.js\n@@ -10,6 +10,12 @@ const sqs = require('../app/services/sqs')\n const s3 = require('../app/services/s3')\n const voiceCloningService = require('./voice_cloning')\n const userAudioProfileService = require('./user_audio_profile')\n+const {\n+  getCloningPipeline,\n+  normalizeVoiceCloningJob,\n+  parseQueueMessage,\n+  validateVoiceCloningJob,\n+} = require('./job_payload')\n \n AWS.config.update({ region: 'us-west-2' })\n const sqsQueueUrl = process.env.SQS_URL\n@@ -24,60 +30,67 @@ const cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\n const cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n \n const updateUrl = (str, cloudFrontUrl) => {\n+  if (!cloudFrontUrl) return str\n   const host = new URL(str).host\n   return str.replace(`https://${host}`, cloudFrontUrl)\n }\n \n-function connectDB(dbUri, retryCount = 0) {\n-  return new Promise((resolve, reject) => {\n-    console.log('Connection Attempt : ', retryCount)\n-    mongoose.set('strictQuery', true)\n-    mongoose\n-      .connect(dbUri)\n-      .then((msg) => {\n-        console.log('Connected to Mongo DB !')\n-        resolve()\n-      })\n-      .catch((err) => {\n-        console.log('Failed to connect dns mongo: ', err)\n-        if (retryCount < 6) {\n-          retryCount++\n-          connectDB(dbUri, retryCount)\n-        }\n-      })\n-  })\n+async function connectDB(dbUri, retryCount = 0) {\n+  console.log('Connection Attempt : ', retryCount)\n+  mongoose.set('strictQuery', true)\n+\n+  try {\n+    await mongoose.connect(dbUri)\n+    console.log('Connected to Mongo DB !')\n+  } catch (error) {\n+    console.log('Failed to connect dns mongo: ', error)\n+    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n+    throw error\n+  }\n }\n \n function execShellCommand(cmd, logPath) {\n   // const exec = require(\"child_process\").exec;\n   return new Promise((resolve, reject) => {\n     exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n+      try {\n+        await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n+        await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n+      } catch (logError) {\n+        return reject(logError)\n+      }\n+\n       if (error) {\n-        console.log('Error while proccessing python command', error)\n-        reject(error)\n+        console.log('Error while processing python command', error)\n+        return reject(error)\n       }\n-      // console.log('Stdout --- ', stdout)\n-      // console.log('Stderror --- ', stderr)\n-      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n-      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n \n-      resolve()\n+      resolve({ stdout, stderr })\n     })\n   })\n }\n \n async function getFile(waveUrl, path) {\n-  return new Promise((resolve) => {\n-    https.get(waveUrl, (res) => {\n+  return new Promise((resolve, reject) => {\n+    const request = https.get(waveUrl, (res) => {\n+      if (res.statusCode < 200 || res.statusCode >= 300) {\n+        res.resume()\n+        return reject(\n+          new Error(`Unable to download ${waveUrl}: HTTP ${res.statusCode}`)\n+        )\n+      }\n+\n       const writeStream = fs.createWriteStream(path)\n \n       res.pipe(writeStream)\n \n       writeStream.on('finish', () => {\n-        writeStream.close()\n-        resolve()\n+        writeStream.close(resolve)\n       })\n+      writeStream.on('error', reject)\n     })\n+\n+    request.on('error', reject)\n   })\n }\n \n@@ -97,15 +110,17 @@ const processQueue = () => {\n         response.Messages.length > 0\n       ) {\n         throttleMessageFetching = false\n-        const job = JSON.parse(response.Messages[0].Body)\n+        const rawJob = parseQueueMessage(response.Messages[0].Body)\n+        const job = validateVoiceCloningJob(normalizeVoiceCloningJob(rawJob))\n         const receiptHandle = response.Messages[0].ReceiptHandle\n         console.log('job===', job)\n \n-        const { metadata, input, _id, userAudioProfileId } = job._doc\n+        const { metadata, input, _id, userAudioProfileId, env, tier } = job\n+        const cloningPipeline = getCloningPipeline(tier)\n         console.log('userAudioProfileId', userAudioProfileId)\n         console.log('_id', _id)\n-        const { env } = job\n         console.log('env', env)\n+        console.log('tier', tier || 'legacy')\n \n         console.log('metadata------', metadata)\n         console.log('input', input)\n@@ -136,11 +151,23 @@ const processQueue = () => {\n             fs.mkdirSync(logPath, { recursive: true })\n           }\n           // update the db model to processing\n-          await voiceCloningService.update({ _id, status: 'processing' })\n-          await userAudioProfileService.update({\n+          const voiceCloning = await voiceCloningService.update({\n+            _id,\n+            status: 'processing',\n+            ...(tier && { tier }),\n+          })\n+          if (!voiceCloning) {\n+            throw new Error(`Voice cloning job ${_id} was not found`)\n+          }\n+\n+          const userAudioProfile = await userAudioProfileService.update({\n             _id: userAudioProfileId,\n             status: 'processing',\n+            ...(tier && { tier }),\n           })\n+          if (!userAudioProfile) {\n+            throw new Error(`User audio profile ${userAudioProfileId} was not found`)\n+          }\n \n           // create directory for userid-useraudioprofileid if not exist\n           const rootPath = `/tmp/${directoryName}`\n@@ -185,10 +212,7 @@ const processQueue = () => {\n \n           const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n           console.log('samplingCommand ', samplingCommand)\n-          const samplingResponse = await execShellCommand(\n-            samplingCommand,\n-            logPath\n-          )\n+          await execShellCommand(samplingCommand, logPath)\n           console.timeEnd(SAMPLING_LABEL)\n \n           // /mnt/efs/potion-voice/${env}/speakrs.pth\n@@ -203,61 +227,54 @@ const processQueue = () => {\n           // clone the voice\n           const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n           console.time(VOICE_CLONING_LABEL)\n-          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n+          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ${cloningPipeline.baselineModelPath} --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n             outPath + '/speakers.pth'\n           } --output_path ${resultsPath}`\n \n           console.log('Training Model Command', trainingModelCommand)\n-          const trainingResponse = await execShellCommand(\n-            trainingModelCommand,\n-            logPath\n-          )\n+          await execShellCommand(trainingModelCommand, logPath)\n \n           console.timeEnd(VOICE_CLONING_LABEL)\n \n           let generatedDirectoryName = ''\n           fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n-            if (file.includes('vits_potion_clone'))\n+            if (file.includes(cloningPipeline.generatedDirectoryPrefix))\n               // use output from above to get right path and directory name\n               generatedDirectoryName = file\n           })\n+          if (!generatedDirectoryName) {\n+            throw new Error(\n+              `Cloning pipeline ${cloningPipeline.name} did not produce a model`\n+            )\n+          }\n \n           // minimize cloning model\n           const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n           console.time(VOICE_MINIMIZE_LABEL)\n           const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n             resultsPath + '/' + generatedDirectoryName + '/'\n-          } --voice_model_name checkpoint_365200.pth`\n+          } --voice_model_name ${cloningPipeline.checkpointName}`\n \n           console.log(\n             'Minimize Cloning Model Command',\n             minimizeCloningModelCommand\n           )\n-          const minimizeCloning = await execShellCommand(\n-            minimizeCloningModelCommand,\n-            logPath\n-          )\n+          await execShellCommand(minimizeCloningModelCommand, logPath)\n           console.timeEnd(VOICE_MINIMIZE_LABEL)\n \n-          // Add the  code to update location of generated model and status into DB\n-          await voiceCloningService.update({ _id, status: 'completed' })\n-\n           const training_model_path = {\n-            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n+            voice_model_path: `${resultsPath}/${generatedDirectoryName}/${cloningPipeline.checkpointName}`,\n             voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n             voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n-            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n+            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/${cloningPipeline.checkpointName.replace(\n+              /\\.pth$/,\n+              '_light.pth'\n+            )}`,\n             voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n           }\n \n-          await userAudioProfileService.update({\n-            _id: userAudioProfileId,\n-            status: 'completed',\n-            training_model_path,\n-          })\n-\n           // add code to put that model into S3\n-          let keys = Object.keys(training_model_path)\n+          const keys = Object.keys(training_model_path)\n \n           const training_model_s3_path = {}\n \n@@ -270,11 +287,29 @@ const processQueue = () => {\n             })\n             training_model_s3_path[keys[index]] = s3Path\n           }\n-          //  add S3 path to user audio profile model\n-          await userAudioProfileService.update({\n+          // Do not expose a completed profile until both local and durable\n+          // model locations are present. Consumers otherwise observe null\n+          // model state while uploads are still running.\n+          const completedUserAudioProfile = await userAudioProfileService.update({\n             _id: userAudioProfileId,\n+            status: 'completed',\n+            ...(tier && { tier }),\n+            training_model_path,\n             training_model_s3_path,\n           })\n+          if (!completedUserAudioProfile) {\n+            throw new Error(`User audio profile ${userAudioProfileId} was not found`)\n+          }\n+\n+          const completedVoiceCloning = await voiceCloningService.update({\n+            _id,\n+            status: 'completed',\n+            ...(tier && { tier }),\n+            training_model: training_model_s3_path,\n+          })\n+          if (!completedVoiceCloning) {\n+            throw new Error(`Voice cloning job ${_id} was not found`)\n+          }\n         } catch (error) {\n           console.log('error********************', error)\n           Bugsnag.notify(\n@@ -285,11 +320,18 @@ const processQueue = () => {\n           Bugsnag.notify(error)\n \n           // update the db to set status as error\n-          await voiceCloningService.update({ _id, status: 'error' })\n-          await userAudioProfileService.update({\n-            _id: userAudioProfileId,\n-            status: 'error',\n-          })\n+          await Promise.allSettled([\n+            voiceCloningService.update({\n+              _id,\n+              status: 'error',\n+              ...(tier && { tier }),\n+            }),\n+            userAudioProfileService.update({\n+              _id: userAudioProfileId,\n+              status: 'error',\n+              ...(tier && { tier }),\n+            }),\n+          ])\n \n           resolve() // to continue working on new jobs\n         }\n@@ -329,4 +371,7 @@ const init = async () => {\n     Bugsnag.notify(error)\n   }\n }\n-init()\n+\n+if (require.main === module) init()\n+\n+module.exports = { init, processQueue }\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_50","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,280p' voice-cloning/prepare_datasets.py; sed -n '1,280p' voice-cloning/clone_voice.py; sed -n '1,180p' voice-cloning/train_config.py\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_50","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,280p' voice-cloning/prepare_datasets.py; sed -n '1,280p' voice-cloning/clone_voice.py; sed -n '1,180p' voice-cloning/train_config.py\"","aggregated_output":"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport argparse\n\n# load coqui-ai/TTS libraries\nfrom TTS.bin.resample import resample_files\nfrom TTS.bin.compute_embeddings import compute_embeddings\n\nimport train_config as tc\n\n\n#\n# parse command line arguments\n#\ndef parse_cmdline_args():\n    parser = argparse.ArgumentParser(\n        description = \"Code to prepare voice dataset for multi-speaker baseline model training (i.e., adjust sampling rate and compute speaker embeddings).\")\n    parser.add_argument(\"--dataset_preset\",           type = str, choices = (\"VCTK\", \"LibriTTS_tc360\", \"DAPS\", \"POTION_Salut\", \"potion_voice_cloning\"), required = True,\n        help = \"Path the voice dataset archive (.zip, .tar.gz, .tgz, .tar.bz2, and .tbz are supported)\")\n    parser.add_argument(\"--dataset_archive_path\",     type = str, required = True,\n        help = \"Path the voice dataset archive (.zip, .tar.gz, .tgz, .tar.bz2, and .tbz are supported)\")\n    parser.add_argument(\"--output_path\",              type = str, default = \"results/datasets\",\n        help = \"Path to store augmented dataset\")\n    parser.add_argument(\"--sampling_rate\",            type = int, default = 22050, choices = (16000, 22050, 32000, 48000),   # 32k & 48k are untested\n        help = \"Sampling rate for training run\")\n\n    return parser.parse_args()\n\n\n#\n# utility functuion to extract archives (zip, tar, tgz, ...)\n#   - returns first entry in archive (typically the main directory name contained in the archive)\n#\ndef extract_archive(archive_path, dest_path):\n\n    from zipfile import ZipFile\n    import tarfile\n\n    if archive_path.endswith('.zip'):\n        opener, getnames, mode = ZipFile, ZipFile.namelist, 'r'\n\n    elif (archive_path.endswith('.tar.gz')) or (archive_path.endswith('.tgz')):\n        opener, getnames, mode = tarfile.open, tarfile.TarFile.getnames, 'r:gz'\n\n    elif (archive_path.endswith('.tar.bz2')) or (archive_path.endswith('.tbz')):\n        opener, getnames, mode = tarfile.open, tarfile.TarFile.getnames, 'r:bz2'\n\n    else:\n        print(\"Extracting archive \" + archive_path + \" is not supported.\")\n        return\n\n    # extract archive\n    with opener(archive_path, mode) as archive:\n        archive_dir = archive.getnames()[0]\n        archive.extractall(path = dest_path)\n\n    return archive_dir\n\n\n#\n# main training method (VITS multi-speaker model)\n#\ndef main(args):\n    print(\"Commencing preparation of dataset for multi-speaker baseline model training:\")\n    print(\"\")\n    print(\"  + Dataset preset: {}\" . format(args.dataset_preset))\n    print(\"  + Dataset       : {}\" . format(args.dataset_archive_path))\n    print(\"  + Output path   : {}\" . format(args.output_path))\n    print(\"  + Sampling rate : {}\" . format(args.sampling_rate))\n    print(\"\")\n\n    # set parameters according to dataset preset\n    if args.dataset_preset  == \"VCTK\":\n        DATASET_NAME = tc.VCTK_DATASET_NAME\n        DATASET_FORMATTER = tc.VCTK_DATASET_FORMATTER\n        DATASET_FILE_FORMAT = tc.VCTK_DATASET_FILE_FORMAT\n        NO_EVAL = False\n    elif args.dataset_preset == \"LibriTTS_tc360\":\n        DATASET_NAME = tc.LIBRITTS_TC360_DATASET_NAME\n        DATASET_FORMATTER = tc.LIBRITTS_TC360_DATASET_FORMATTER\n        DATASET_FILE_FORMAT = tc.LIBRITTS_TC360_DATASET_FILE_FORMAT\n        NO_EVAL = False\n    elif args.dataset_preset == \"POTION_Salut\":\n        DATASET_NAME = tc.POTION_SALUT_DATASET_NAME\n        DATASET_FORMATTER = tc.POTION_SALUT_DATASET_FORMATTER\n        DATASET_FILE_FORMAT = tc.POTION_SALUT_DATASET_FILE_FORMAT\n        NO_EVAL = False\n    elif args.dataset_preset == \"potion_voice_cloning\":\n        DATASET_NAME = tc.POTION_SALUT_DATASET_NAME\n        DATASET_FORMATTER = tc.POTION_SALUT_DATASET_FORMATTER\n        DATASET_FILE_FORMAT = tc.POTION_SALUT_DATASET_FILE_FORMAT\n        NO_EVAL = True\n\n    # define sampling rate for computing speaker embeddings\n    SPK_EMB_SAMPLING_RATE = 16000\n\n    # define the number of threads used during audio resampling\n    NUM_RESAMPLE_THREADS = 10\n\n    # extract dataset archive\n    print(f\">>> Extracting archive ...\")\n    dataset_root = extract_archive(args.dataset_archive_path, os.path.join(args.output_path, \"sr\" + str(args.sampling_rate)))\n\n    # set dataset path (there should only be ONE directory in the extracted archive location)\n    dataset_path = os.path.join(args.output_path, \"sr\" + str(args.sampling_rate), dataset_root)\n\n    # ensure the dataset_path exists\n    os.makedirs(dataset_path, exist_ok = True)\n\n    # resample dataset for speaker embeddings computation\n    print(f\">>> Resampling audio files to 16000Hz ...\")\n    resample_files(dataset_path, 16000, file_ext = DATASET_FILE_FORMAT, n_jobs = NUM_RESAMPLE_THREADS)\n\n    # compute speaker embeddings\n    SPEAKER_ENCODER_CHECKPOINT_PATH = \"assets/speaker_encoder_model/model_se.pth.tar\"\n    SPEAKER_ENCODER_CONFIG_PATH = \"assets/speaker_encoder_model/config_se.json\"\n\n    # init list speaker embeddings/d-vectors to be used during the training\n    d_vector_files = []\n\n    # check if the speakers embeddings are already computated, if not compute them\n    embeddings_file = os.path.join(dataset_path, \"speakers.pth\")\n\n    if not os.path.isfile(embeddings_file):\n        print(f\">>> Computing speaker embeddings ...\")\n        compute_embeddings(\n            SPEAKER_ENCODER_CHECKPOINT_PATH,\n            SPEAKER_ENCODER_CONFIG_PATH,\n            embeddings_file,\n            old_spakers_file    = None,\n            config_dataset_path = None,\n            formatter_name      = DATASET_FORMATTER,\n            dataset_name        = DATASET_NAME,\n            dataset_path        = dataset_path,\n            meta_file_train     = \"\",\n            meta_file_val       = \"\",\n            disable_cuda        = False,\n            no_eval             = NO_EVAL\n        )\n\n    d_vector_files.append(embeddings_file)\n\n    # if targetted sampling rate is not the same as that used for computing speaker embeddings, replace and resample audio files\n    if not args.sampling_rate == SPK_EMB_SAMPLING_RATE:\n        print(f\">>> Extracting original archive again (overwritting previously resampled files)...\")\n        extract_archive(args.dataset_archive_path, os.path.join(args.output_path, \"sr\" + str(args.sampling_rate)))\n        print(f\">>> Resampling audio files to {args.sampling_rate}Hz ...\")\n        resample_files(dataset_path, args.sampling_rate, file_ext = DATASET_FILE_FORMAT, n_jobs = NUM_RESAMPLE_THREADS)\n\n    # exit gracefully\n    print(\"\")\n    print(\"Completed preparing voice dataset for multi-speaker baseline model training; generated asset locations are as follows:\")\n    print(\"  --> {}\" . format(dataset_path))\n    print(\"  --> {}\" . format(embeddings_file))\n    print(\"\")\n    print(\"Done; bye.\")\n    print(\"\")\n\n\nif __name__ == \"__main__\":\n    # parse command line arguments\n    args = parse_cmdline_args()\n\n    # clear command line arguments to avoid triggering argparse features part of Trainer / coqpit imports\n    #    Traceback (most recent call last):\n    #      File \"train_multispeaker_baseline_model.py\", line 208, in <module>\n    #        main(args)\n    #      File \"train_multispeaker_baseline_model.py\", line 177, in main\n    #        trainer = Trainer(\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/trainer/trainer.py\", line 360, in __init__\n    #        config, new_fields = self.init_training(args, coqpit_overrides, config)\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/trainer/trainer.py\", line 594, in init_training\n    #        config.parse_known_args(coqpit_overrides, relaxed_parser=True)\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 843, in parse_known_args\n    #        parser = self.init_argparse(arg_prefix=arg_prefix, relaxed_parser=relaxed_parser)\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 881, in init_argparse\n    #        _init_argparse(\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 529, in _init_argparse\n    #        parser = _init_argparse(\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 550, in _init_argparse\n    #        return default.init_argparse(\n    #    AttributeError: 'str' object has no attribute 'init_argparse'\n    sys.argv = [sys.argv[0]]\n\n    # ensure the output path exists\n    os.makedirs(args.output_path, exist_ok = True)\n\n    main(args)\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport argparse\n\nimport torch\n\n# load coqui-ai/trainer libraries\nfrom trainer import Trainer, TrainerArgs\n\n# load coqui-ai/TTS libraries\nfrom TTS.tts.configs.shared_configs import BaseDatasetConfig\nfrom TTS.tts.configs.vits_config import VitsConfig\nfrom TTS.tts.datasets import load_tts_samples\nfrom TTS.tts.models.vits import Vits, VitsArgs, VitsAudioConfig\n\n\n#\n# parse command line arguments\n#\ndef parse_cmdline_args():\n    parser = argparse.ArgumentParser(\n        description = \"Code to clone a voice from a given set of voice samples and a multi-speaker baseline model\")\n    parser.add_argument(\"--baseline_model_path\",        type = str, required = True,\n        help = \"Path to multi-speaker baseline model (VITS model)\")\n    parser.add_argument(\"--speaker_dataset_path\",       type = str, required = True,\n        help = \"Path to voice cloning dataset\")\n    parser.add_argument(\"--speaker_embeddings_path\",    type = str, required = True,\n        help = \"Path to speaker's embeddings file\")\n    parser.add_argument(\"--output_path\",                type = str, default = \"results/cloned-voices\",\n        help = \"Path to store trained / generated assets\")\n    parser.add_argument(\"--batch_size\",                 type = int, default = 96,   # 96 is suitable for AWS g5 instances\n        help = \"Batch size for training run\")\n    parser.add_argument(\"--max_epochs\",                 type = int, default = 200,   # 200 for batch_size 96 (with the 22.050 sampling rate multi-speaker model\n        help = \"Maximum number of epochs for training run\")                          # 2000 for batch_size 64 and 1500 for batch_size 96 (with the initial 16k sampling rate VCTK 0.80 model)\n    parser.add_argument(\"--use_cpu\",                    default = False, action = \"store_true\",   # untested!!!\n        help = \"Signal that CPU should be used even if a CUDA-device is available\")\n    parser.add_argument(\"--output_format\",              type = str, choices = [\"txt\", \"json\"], default = \"txt\",\n        help = \"Output format; available choices include 'txt' for human readible text and 'json' for JSON formatting\")\n\n    return parser.parse_args()\n\n\n#\n# main training method (voice cloning)\n#\ndef main(args):\n    if args.output_format == \"txt\":\n        print(\"Commencing training of a new multi-speaker potion-voice baseline model:\")\n        print(\"\")\n        print(\"  + Baseline multi-speaker model path: {}\" . format(args.baseline_model_path))\n        print(\"  + Voice training dataset path      : {}\" . format(args.speaker_dataset_path))\n        print(\"  + Speaker embeddings path          : {}\" . format(args.speaker_embeddings_path))\n        print(\"  + Output path                      : {}\" . format(args.output_path))\n        print(\"  + Batch size                       : {}\" . format(args.batch_size))\n        print(\"  + Training runs (max epochs)       : {}\" . format(args.max_epochs))\n        print(\"\")\n\n    # determine whether CUDA support is available and set device parameters accordingly\n    use_cuda = torch.cuda.is_available()\n    if args.output_format == \"txt\":\n        print(\"  + CUDA availability                : {}\" . format(use_cuda))\n\n    if args.use_cpu:\n        device = \"cpu\"\n        device_torch = False\n    elif use_cuda:\n        device = \"cuda\"\n        device_torch = torch.device(\"cuda\")\n    else:\n        device = \"cpu\"\n        device_torch = False\n    if args.output_format == \"txt\":\n        print(\"  + Compute device used              : {}\" . format(device))\n        print(\"\")\n\n    # define training data set\n    dataset_config = BaseDatasetConfig(formatter = \"vctk_old\", language = \"en-us\", path = args.speaker_dataset_path)\n\n    # set VITS training parameters\n    audio_config = VitsAudioConfig(\n        sample_rate         = 22050,\n        win_length          = 1024,\n        hop_length          = 256,\n        num_mels            = 80,\n        mel_fmin            = 0,\n        mel_fmax            = None,\n    )\n\n    vitsArgs = VitsArgs(\n        use_speaker_embedding   = False,\n        use_d_vector_file       = True,\n        d_vector_file           = [args.speaker_embeddings_path],\n        d_vector_dim            = 512,\n        num_layers_text_encoder = 10\n    )\n\n    config = VitsConfig(\n        model_args              = vitsArgs,\n        audio                   = audio_config,\n        run_name                = \"vits_potion_clone\",\n        use_speaker_embedding   = False,\n        use_d_vector_file       = True,\n        d_vector_file           = [args.speaker_embeddings_path],\n        d_vector_dim            = 512,\n        batch_size              = args.batch_size,\n        eval_batch_size         = 8,\n        batch_group_size        = 0,   # changing this to 5 (VITS training default) slows training down, but doesn't have any positive training effects\n        num_loader_workers      = 4,\n        num_eval_loader_workers = 4,\n        run_eval                = True,\n        eval_split_size         = 2,   # fix size of eval dataset (default 1% approach requires at least 100 voice samples!)\n        test_delay_epochs       = -1,\n        epochs                  = args.max_epochs,\n        text_cleaner            = \"english_cleaners\",\n        use_phonemes            = False,\n        phoneme_language        = \"en-us\",\n        phoneme_cache_path      = os.path.join(args.output_path, \"phoneme_cache\"),\n        compute_input_seq_cache = True,\n        print_step              = 50,\n        print_eval              = True,\n        mixed_precision         = True,\n        max_text_len            = 325,\n        output_path             = args.output_path,\n\n        save_checkpoints        = True,\n        save_step               = 200,\n\n        datasets                = [dataset_config],\n        cudnn_benchmark         = False,\n        #characters              = {\n        #    \"pad\": \"_\",\n        #    \"eos\": \"&\",\n        #    \"bos\": \"*\",\n        #    \"characters\": \"!¡'(),-.:;¿?abcdefghijklmnopqrstuvwxyz «°±µ»$%&‘’‚“`”„\",\n        #    \"punctuations\": \"!¡'(),-.:;¿? \",\n        #    \"phonemes\": None,\n        #    \"unique\": True\n        #},\n        test_sentences = [\n            [\"It took me quite a long time to develop a voice, and now that I have it I'm not going to be silent.\"],\n            [\"Be a voice, not an echo.\"],\n            [\"I'm sorry Dave. I'm afraid I can't do that.\"],\n            [\"This cake is great. It's so delicious and moist.\"],\n            [\"Prior to November 22, 1963.\"],\n            [\"Hey! Sandra.\"],\n            [\"Hey! Andrew.\"],\n            [\"Hey, Michelle.\"],\n            [\"Hey! George.\"],\n            [\"Hey there, Rachel.\"]\n        ]\n    )\n\n    # load training samples\n    train_samples, eval_samples = load_tts_samples(config.datasets, eval_split = True, eval_split_max_size = config.eval_split_max_size, eval_split_size = config.eval_split_size)\n\n    # init VITS model\n    model = Vits.init_from_config(config)\n\n    # init voice cloning\n    trainer = Trainer(\n        TrainerArgs(restore_path = args.baseline_model_path, use_ddp = False),\n        config,\n        args.output_path,\n        model = model,\n        train_samples = train_samples,\n        eval_samples = eval_samples\n    )\n\n    # trigger voice cloning (aka single speaker training)\n    try:\n        trainer.fit()\n    except (KeyboardInterrupt, SystemExit):\n        print(\"Training stopped manually (via keyboard interrupt)! Bye.\")\n        exit(0)\n\n    # determine required adjustment for speech synthesizing (i.e., the scaling factor for the duration predictor)\n    # take the duration of the test sentence and calculate the difference to corresponding reference samples\n    # set config.model_args[\"length_scale\"] accordingly and save the updated config asset\n\n    # exit gracefully\n    if args.output_format == \"txt\":\n        print(\"\")\n        print(\"Completed voice cloning. The resulting model(s) can be found at:\")\n        print(\"  --> {}\" . format(args.output_path))\n        print(\"\")\n        print(\"Done; bye.\")\n        print(\"\")\n\n\nif __name__ == \"__main__\":\n    # parse command line arguments\n    args = parse_cmdline_args()\n\n    # clear command line arguments to avoid triggering argparse features part of Trainer / coqpit imports\n    #    Traceback (most recent call last):\n    #      File \"train_multispeaker_baseline_model.py\", line 208, in <module>\n    #        main(args)\n    #      File \"train_multispeaker_baseline_model.py\", line 177, in main\n    #        trainer = Trainer(\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/trainer/trainer.py\", line 360, in __init__\n    #        config, new_fields = self.init_training(args, coqpit_overrides, config)\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/trainer/trainer.py\", line 594, in init_training\n    #        config.parse_known_args(coqpit_overrides, relaxed_parser=True)\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 843, in parse_known_args\n    #        parser = self.init_argparse(arg_prefix=arg_prefix, relaxed_parser=relaxed_parser)\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 881, in init_argparse\n    #        _init_argparse(\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 529, in _init_argparse\n    #        parser = _init_argparse(\n    #      File \"/home/ubuntu/dev/potion-voice_venv/lib/python3.8/site-packages/coqpit/coqpit.py\", line 550, in _init_argparse\n    #        return default.init_argparse(\n    #    AttributeError: 'str' object has no attribute 'init_argparse'\n    sys.argv = [sys.argv[0]]\n\n    # ensure the output path exists\n    os.makedirs(args.output_path, exist_ok = True)\n\n    main(args)\n\n\n    ### USAGE:\n    ### $ python3 TTS/TTS/bin/resample.py --input_dir voice_dataset_path/person_82/wav48/1 --output_sr 16000\n    ### $ python3 clone_voice.py [with argument]\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n####################################################################################\n###                                                                              ###\n### Configuration File for Multi-Speaker Baseline Model Training & Voice Cloning ###\n###                                                                              ###\n####################################################################################\n\nimport os\n\n# Data Sets\n\n## VCTK (v0.92), sampling rate: 48000\n\nVCTK_PRESET              = \"VCTK\"\nVCTK_DATASET_NAME        = \"VCTK\"\nVCTK_DATASET_FORMATTER   = \"vctk\"\nVCTK_DATASET_FILE_FORMAT = \"flac\"\nVCTK_DATASET_PATH        = \"results/datasets/sr22050/VCTK-Corpus-0.92\"\nVCTK_SPK_EMB_PATH        = os.path.join(VCTK_DATASET_PATH, \"speakers.pth\")\n\n## LibriTTS TC360, sampling rate: 24000\n\nLIBRITTS_TC360_PRESET              = \"LibriTTS_tc360\"\nLIBRITTS_TC360_DATASET_NAME        = \"LibtriTTS-tc360\"\nLIBRITTS_TC360_DATASET_FORMATTER   = \"libri_tts\"\nLIBRITTS_TC360_DATASET_FILE_FORMAT = \"wav\"\nLIBRITTS_TC360_DATASET_PATH        = \"results/datasets/sr22050/LibriTTS/train-clean-360\"\nLIBRITTS_TC360_SPK_EMB_PATH        = os.path.join(LIBRITTS_TC360_DATASET_PATH, \"speakers.pth\")\n\n## DAPS\n\n## Potion salutation recordings\n\nPOTION_SALUT_PRESET              = \"POTION_Salut\"\nPOTION_SALUT_DATASET_NAME        = \"potion-Salut\"\nPOTION_SALUT_DATASET_FORMATTER   = \"vctk_old\"\nPOTION_SALUT_DATASET_FILE_FORMAT = \"wav\"\nPOTION_SALUT_DATASET_PATH        = \"results/datasets/sr22050/potion-salut-corpus-4ac24ce8-8405-4b70-8b48-018d4492f6e9\"\nPOTION_SALUT_SPK_EMB_PATH        = os.path.join(POTION_SALUT_DATASET_PATH, \"speakers.pth\")\n\n## Potion voice cloning recordings\n\nPOTION_SALUT_PRESET              = \"potion_voice_cloning\"\nPOTION_SALUT_DATASET_NAME        = \"\"\nPOTION_SALUT_DATASET_FORMATTER   = \"vctk_old\"\nPOTION_SALUT_DATASET_FILE_FORMAT = \"wav\"\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_51","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,220p' voice-cloning/minimize_cloned_voice_model.py; rg -n \\\"checkpoint_|save_step|epochs|max_epochs|sampling_rate\\\" voice-cloning/clone_voice.py voice-cloning/train_config.py voice-cloning/prepare_datasets.py\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_51","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,220p' voice-cloning/minimize_cloned_voice_model.py; rg -n \\\"checkpoint_|save_step|epochs|max_epochs|sampling_rate\\\" voice-cloning/clone_voice.py voice-cloning/train_config.py voice-cloning/prepare_datasets.py\"","aggregated_output":"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport argparse\nfrom pathlib import Path\n\nimport json\nimport torch\n\nfrom TTS.config import load_config\nfrom TTS.tts.models import setup_model as setup_tts_model\n\n\n#\n# parse command line arguments\n#\ndef parse_cmdline_args():\n    parser = argparse.ArgumentParser(\n        description = \"Code to minimise (i.e., remove optimiser & discriminator) a cloned voice model\")\n    parser.add_argument(\"--voice_model_asset_path\",         type = str, required = True,\n        help = \"Path to directory storing cloned voice model and the corresponding configuration and speaker files\")\n    parser.add_argument(\"--voice_model_name\",               type = str, default = \"best_model.pth\",\n        help = \"Name of the (best) cloned voice model\")\n    parser.add_argument(\"--voice_model_config_name\",        type = str, default = \"config.json\",\n        help = \"Name of the config file for the cloned voice model\")\n    parser.add_argument(\"--minimise_suffix\",                type = str, default = \"light\",\n        help = \"Suffix to be used for minimised model and its assets (i.e., new config file)\")\n    parser.add_argument(\"--overwrite_assets\",               default = False, action = \"store_true\",\n        help = \"Signal whether existing model assets should be overwritten or not (default: do not overwrite)\")\n    parser.add_argument(\"--output_format\",                  type = str, choices = [\"txt\", \"json\"], default = \"txt\",\n        help = \"Output format; available choices include 'txt' for human readible text and 'json' for JSON formatting\")\n\n    return parser.parse_args()\n\n\n#\n# utility function to expand the name of a given filename (infront of the extension)\n#\ndef append_suffix_to_filename(fname, fname_suffix):\n  fpath = Path(fname)\n\n  return \"{0}_{2}{1}\" . format(fpath.stem, fpath.suffix, fname_suffix)\n\n\n#\n# save a lightweight (i.e., without optimiser and discriminator) model of the given cloned voice and corresponding config assets\n#\ndef main(args):\n    # set variables\n    output_path = args.voice_model_asset_path\n    model_path = os.path.join(args.voice_model_asset_path, args.voice_model_name)\n    model_config_path = os.path.join(args.voice_model_asset_path, args.voice_model_config_name)\n    model_light_path = os.path.join(output_path, append_suffix_to_filename(args.voice_model_name, args.minimise_suffix))\n    model_light_config_path = os.path.join(output_path, append_suffix_to_filename(args.voice_model_config_name, args.minimise_suffix))\n\n    if not args.overwrite_assets:\n        # ensure target output files do not already exist\n        if (Path(model_light_path).exists()) or (Path(model_light_config_path).exists()):\n            sys.exit(\"Naming conflict: Model asset files ({} and/or {}) exist already!\" . format (model_light_path, model_light_config_path))\n\n    if args.output_format == \"txt\":\n        print(\"Minimising given voice model:\")\n        print(\"\")\n        print(\"  + Cloned voice model file path       : {}\" . format(model_path))\n        print(\"  + Cloned voice model config file     : {}\" . format(model_config_path))\n        print(\"\")\n    elif args.output_format == \"json\":\n        json_data = {\n            \"success\": False,\n            \"in\": {\n                \"voice_model_path\": format(model_path),\n                \"voice_model_config_path\": format(model_config_path)\n            },\n            \"out\": {\n                \"voice_model_light_path\": \"\",\n                \"voice_model_light_config_path\": \"\"\n            }\n        }\n\n    # load model\n    config = load_config(model_config_path)\n\n    # init model\n    model = setup_tts_model(config = config)\n\n    # load checkpoint / model\n    model.load_checkpoint(config, model_path, eval = True)\n    model.disc = None\n    model_state = model.state_dict()\n    state = {\n        \"model\": model_state\n    }\n\n    torch.save(state, model_light_path)\n\n    config.model_args[\"init_discriminator\"] = False\n    config.save_json(model_light_config_path)\n\n    # exit gracefully\n    if args.output_format == \"txt\":\n        print(\"Completed minimising cloned voice model. The resulting (modified) assets can be found at:\")\n        print(\"  --> Minimised voice model path       : {}\" . format(model_light_path))\n        print(\"  --> Minimised voice model config path: {}\" . format(model_light_config_path))\n        print(\"\")\n        print(\"Done; bye.\")\n        print(\"\")\n    elif args.output_format == \"json\":\n        json_data[\"out\"][\"voice_model_light_path\"] = format(model_light_path)\n        json_data[\"out\"][\"voice_model_light_config_path\"]: format(model_light_config_path)\n        json_data[\"success\"] = True\n        print(json.dumps(json_data))\n\n\nif __name__ == \"__main__\":\n    # parse command line arguments\n    args = parse_cmdline_args()\n\n    main(args)\nvoice-cloning/clone_voice.py:36:    parser.add_argument(\"--max_epochs\",                 type = int, default = 200,   # 200 for batch_size 96 (with the 22.050 sampling rate multi-speaker model\nvoice-cloning/clone_voice.py:37:        help = \"Maximum number of epochs for training run\")                          # 2000 for batch_size 64 and 1500 for batch_size 96 (with the initial 16k sampling rate VCTK 0.80 model)\nvoice-cloning/clone_voice.py:58:        print(\"  + Training runs (max epochs)       : {}\" . format(args.max_epochs))\nvoice-cloning/clone_voice.py:115:        test_delay_epochs       = -1,\nvoice-cloning/clone_voice.py:116:        epochs                  = args.max_epochs,\nvoice-cloning/clone_voice.py:129:        save_step               = 200,\nvoice-cloning/prepare_datasets.py:27:    parser.add_argument(\"--sampling_rate\",            type = int, default = 22050, choices = (16000, 22050, 32000, 48000),   # 32k & 48k are untested\nvoice-cloning/prepare_datasets.py:72:    print(\"  + Sampling rate : {}\" . format(args.sampling_rate))\nvoice-cloning/prepare_datasets.py:105:    dataset_root = extract_archive(args.dataset_archive_path, os.path.join(args.output_path, \"sr\" + str(args.sampling_rate)))\nvoice-cloning/prepare_datasets.py:108:    dataset_path = os.path.join(args.output_path, \"sr\" + str(args.sampling_rate), dataset_root)\nvoice-cloning/prepare_datasets.py:147:    if not args.sampling_rate == SPK_EMB_SAMPLING_RATE:\nvoice-cloning/prepare_datasets.py:149:        extract_archive(args.dataset_archive_path, os.path.join(args.output_path, \"sr\" + str(args.sampling_rate)))\nvoice-cloning/prepare_datasets.py:150:        print(f\">>> Resampling audio files to {args.sampling_rate}Hz ...\")\nvoice-cloning/prepare_datasets.py:151:        resample_files(dataset_path, args.sampling_rate, file_ext = DATASET_FILE_FORMAT, n_jobs = NUM_RESAMPLE_THREADS)\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_52","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"update"},{"path":"/workspace/app/services/sqs/sqs_service.js","kind":"update"},{"path":"/workspace/test/pro-v2-cloning.test.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_52","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"update"},{"path":"/workspace/app/services/sqs/sqs_service.js","kind":"update"},{"path":"/workspace/test/pro-v2-cloning.test.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_53","type":"command_execution","command":"/bin/bash -lc 'npm test && for file in voice-cloning-job-handler/index.js voice-cloning-job-handler/job_payload.js app/services/sqs/sqs_service.js app/services/sqs/message_params.js voice-synthsizer-job-handler/index.js test/pro-v2-cloning.test.js; do node --check \"$file\"; done && git diff --check'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_53","type":"command_execution","command":"/bin/bash -lc 'npm test && for file in voice-cloning-job-handler/index.js voice-cloning-job-handler/job_payload.js app/services/sqs/sqs_service.js app/services/sqs/message_params.js voice-synthsizer-job-handler/index.js test/pro-v2-cloning.test.js; do node --check \"$file\"; done && git diff --check'","aggregated_output":"pro_v2 cloning tests passed\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_54","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_54","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_55","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"sendMessageToSQS|fetchMessageFromSQS|deleteMessageFromSQS|s3\\\\.upload\\\\(\\\" . -g '\"'!node_modules/**'\"' -g '\"'!.styx_prs/**'\"'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_55","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"sendMessageToSQS|fetchMessageFromSQS|deleteMessageFromSQS|s3\\\\.upload\\\\(\\\" . -g '\"'!node_modules/**'\"' -g '\"'!.styx_prs/**'\"'\"","aggregated_output":"./voice-synthsizer-job-handler/index.js:62:      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n./voice-synthsizer-job-handler/index.js:72:          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n./voice-synthsizer-job-handler/index.js:138:            const greetingUploadResponse = await s3.upload(uploadParams)\n./app/services/s3/index.js:42:      s3.upload(params, function (err, data) {\r\n./app/services/sqs/sqs_service.js:8:const fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\n./app/services/sqs/sqs_service.js:29:const deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\n./app/services/sqs/sqs_service.js:53:const sendMessageToSQS = (sqsQueueUrl, message, options) => {\n./app/services/sqs/sqs_service.js:75:  fetchMessageFromSQS,\n./app/services/sqs/sqs_service.js:76:  deleteMessageFromSQS,\n./app/services/sqs/sqs_service.js:77:  sendMessageToSQS,\n./voice-cloning-job-handler/index.js:106:      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n./voice-cloning-job-handler/index.js:151:          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n./voice-cloning-job-handler/index.js:289:            const s3Path = await s3.upload({\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_56","type":"command_execution","command":"/bin/bash -lc \"tail -30 voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js && sed -n '1,120p' app/services/sqs/message_params.js && sed -n '1,230p' voice-cloning-job-handler/job_payload.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_56","type":"command_execution","command":"/bin/bash -lc \"tail -30 voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js && sed -n '1,120p' app/services/sqs/message_params.js && sed -n '1,230p' voice-cloning-job-handler/job_payload.js\"","aggregated_output":"      { ...filter },\n      {\n        $set: {\n          deleted: true\n        }\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (UserAudioProfileModel) => {\n  return {\n    create: create(UserAudioProfileModel),\n    insertMany: insertMany(UserAudioProfileModel),\n    read: read(UserAudioProfileModel),\n    remove: remove(UserAudioProfileModel),\n    removeMany: removeMany(UserAudioProfileModel),\n    update: update(UserAudioProfileModel),\n    find: find(UserAudioProfileModel)\n  }\n}\nconst crypto = require('crypto')\n\nconst isFifoQueue = (queueUrl) => /\\.fifo(?:$|\\?)/.test(queueUrl)\n\nconst parseMessage = (messageBody) => {\n  try {\n    return JSON.parse(messageBody)\n  } catch (error) {\n    return {}\n  }\n}\n\nconst sanitizeFifoId = (value) =>\n  String(value)\n    .replace(/[^a-zA-Z0-9_-]/g, '-')\n    .slice(0, 128)\n\nconst findTier = (message) =>\n  message.tier ||\n  (message._doc && message._doc.tier) ||\n  (message.payload && message.payload.tier) ||\n  (message.metadata && message.metadata.tier)\n\nconst findJobId = (message) =>\n  message._id ||\n  message.id ||\n  message.voiceCloningId ||\n  (message._doc && message._doc._id) ||\n  (message.payload && (message.payload._id || message.payload.id))\n\nconst buildSendMessageParams = (sqsQueueUrl, message, options = {}) => {\n  if (typeof options === 'string') options = { tier: options }\n\n  const messageBody =\n    typeof message === 'string' ? message : JSON.stringify(message)\n  const params = {\n    MessageBody: messageBody,\n    QueueUrl: sqsQueueUrl,\n  }\n  const parsedMessage = parseMessage(messageBody)\n  const tier = options.tier || findTier(parsedMessage)\n\n  if (tier) {\n    params.MessageAttributes = {\n      tier: {\n        DataType: 'String',\n        StringValue: String(tier),\n      },\n    }\n  }\n\n  if (!isFifoQueue(sqsQueueUrl)) return params\n\n  const jobId = findJobId(parsedMessage)\n  const bodyHash = crypto.createHash('sha256').update(messageBody).digest('hex')\n\n  params.MessageGroupId = sanitizeFifoId(\n    options.messageGroupId || `voice-cloning-${tier || 'default'}`\n  )\n  params.MessageDeduplicationId = sanitizeFifoId(\n    options.messageDeduplicationId || jobId || bodyHash\n  )\n\n  return params\n}\n\nmodule.exports = { buildSendMessageParams }\nconst PRO_V2_TIER = 'pro_v2'\n\nconst V2_PIPELINE = Object.freeze({\n  name: PRO_V2_TIER,\n  baselineModelPath:\n    '../voice-cloning/pretrained-models/checkpoint_365000.pth',\n  generatedDirectoryPrefix: 'vits_potion_clone',\n  checkpointName: 'checkpoint_365200.pth',\n})\n\n// Untiered jobs predate the tier field, but already use the v2 cloning\n// scripts. Keep accepting them while explicitly routing pro_v2 to that same\n// pipeline.\nconst LEGACY_PIPELINE = Object.freeze({\n  ...V2_PIPELINE,\n  name: 'legacy',\n})\n\nconst isObject = (value) =>\n  value !== null && typeof value === 'object' && !Array.isArray(value)\n\nconst firstPresent = (...values) =>\n  values.find((value) => value !== undefined && value !== null)\n\nconst parseJson = (value, description) => {\n  try {\n    return JSON.parse(value)\n  } catch (error) {\n    throw new Error(`Invalid ${description}: ${error.message}`)\n  }\n}\n\nconst parseQueueMessage = (body) => {\n  let message = typeof body === 'string' ? parseJson(body, 'SQS message') : body\n\n  // SQS subscriptions may receive the job through an SNS envelope.\n  if (isObject(message) && typeof message.Message === 'string') {\n    message = parseJson(message.Message, 'SNS message')\n  }\n\n  if (!isObject(message)) {\n    throw new Error('Voice cloning job must be a JSON object')\n  }\n\n  return message\n}\n\nconst findJobDocument = (message) => {\n  const candidates = [\n    message._doc,\n    message.job && message.job._doc,\n    message.job,\n    message.payload && message.payload._doc,\n    message.payload,\n    message.data && message.data._doc,\n    message.data,\n  ]\n\n  return candidates.find(isObject) || message\n}\n\nconst normalizeInput = (input) => {\n  if (!Array.isArray(input)) return input\n\n  return input.map((item) => {\n    if (!isObject(item)) return item\n\n    return {\n      ...item,\n      waveUrl: firstPresent(item.waveUrl, item.audioUrl, item.url),\n      originalText: firstPresent(\n        item.originalText,\n        item.text,\n        item.transcription,\n        item.transcript\n      ),\n    }\n  })\n}\n\nconst normalizeVoiceCloningJob = (message) => {\n  if (!isObject(message)) {\n    throw new Error('Voice cloning job must be an object')\n  }\n\n  const document = findJobDocument(message)\n  const metadata = firstPresent(document.metadata, message.metadata, {})\n  const directoryName = firstPresent(\n    metadata.directoryName,\n    document.directoryName,\n    message.directoryName\n  )\n  const tier = firstPresent(\n    message.tier,\n    document.tier,\n    metadata.tier,\n    message.metadata && message.metadata.tier\n  )\n  const input = firstPresent(\n    document.input,\n    message.input,\n    document.samples,\n    message.samples,\n    document.recordings,\n    message.recordings\n  )\n\n  return {\n    ...document,\n    _id: firstPresent(\n      document._id,\n      document.id,\n      message._id,\n      message.id,\n      message.voiceCloningId\n    ),\n    userAudioProfileId: firstPresent(\n      document.userAudioProfileId,\n      message.userAudioProfileId,\n      document.audioProfileId,\n      message.audioProfileId\n    ),\n    metadata: {\n      ...metadata,\n      directoryName,\n    },\n    input: normalizeInput(input),\n    env: firstPresent(\n      message.env,\n      document.env,\n      message.environment,\n      document.environment\n    ),\n    tier,\n  }\n}\n\nconst validateVoiceCloningJob = (job) => {\n  const missingFields = []\n\n  if (!job._id) missingFields.push('_id')\n  if (!job.userAudioProfileId) missingFields.push('userAudioProfileId')\n  if (!job.env) missingFields.push('env')\n  if (!job.metadata || !job.metadata.directoryName) {\n    missingFields.push('metadata.directoryName')\n  }\n  if (!Array.isArray(job.input) || job.input.length === 0) {\n    missingFields.push('input')\n  }\n\n  if (missingFields.length) {\n    throw new Error(\n      `Invalid voice cloning job; missing ${missingFields.join(', ')}`\n    )\n  }\n\n  job.input.forEach((item, index) => {\n    if (!isObject(item) || !item.waveUrl) {\n      throw new Error(`Invalid voice cloning job; input[${index}].waveUrl missing`)\n    }\n    if (typeof item.originalText !== 'string') {\n      throw new Error(\n        `Invalid voice cloning job; input[${index}].originalText missing`\n      )\n    }\n  })\n\n  if (job.tier !== undefined && typeof job.tier !== 'string') {\n    throw new Error('Invalid voice cloning job; tier must be a string')\n  }\n\n  return job\n}\n\nconst getCloningPipeline = (tier) =>\n  tier === PRO_V2_TIER ? V2_PIPELINE : LEGACY_PIPELINE\n\nmodule.exports = {\n  PRO_V2_TIER,\n  getCloningPipeline,\n  normalizeVoiceCloningJob,\n  parseQueueMessage,\n  validateVoiceCloningJob,\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_57","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_57","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_58","type":"command_execution","command":"/bin/bash -lc \"node <<'NODE'\nconst assert = require('assert')\nconst AWS = require('aws-sdk')\nconst original = AWS.SQS.prototype.sendMessage\nAWS.SQS.prototype.sendMessage = function (params, callback) {\n  assert.strictEqual(params.MessageGroupId, 'voice-cloning-pro_v2')\n  callback(null, { MessageId: 'message-123', SequenceNumber: '1' })\n}\nconst sqs = require('./app/services/sqs/sqs_service')\nsqs.sendMessageToSQS('https://sqs.us-west-2.amazonaws.com/123/jobs.fifo', {\n  _id: 'clone-123',\n  tier: 'pro_v2',\n}).then((result) => {\n  assert.strictEqual(result.MessageId, 'message-123')\n  AWS.SQS.prototype.sendMessage = original\n  console.log('mocked SQS submission passed')\n}).catch((error) => {\n  AWS.SQS.prototype.sendMessage = original\n  console.error(error)\n  process.exitCode = 1\n})\nNODE\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_58","type":"command_execution","command":"/bin/bash -lc \"node <<'NODE'\nconst assert = require('assert')\nconst AWS = require('aws-sdk')\nconst original = AWS.SQS.prototype.sendMessage\nAWS.SQS.prototype.sendMessage = function (params, callback) {\n  assert.strictEqual(params.MessageGroupId, 'voice-cloning-pro_v2')\n  callback(null, { MessageId: 'message-123', SequenceNumber: '1' })\n}\nconst sqs = require('./app/services/sqs/sqs_service')\nsqs.sendMessageToSQS('https://sqs.us-west-2.amazonaws.com/123/jobs.fifo', {\n  _id: 'clone-123',\n  tier: 'pro_v2',\n}).then((result) => {\n  assert.strictEqual(result.MessageId, 'message-123')\n  AWS.SQS.prototype.sendMessage = original\n  console.log('mocked SQS submission passed')\n}).catch((error) => {\n  AWS.SQS.prototype.sendMessage = original\n  console.error(error)\n  process.exitCode = 1\n})\nNODE\"","aggregated_output":"Successfully sent request to AWS.SQS {\"MessageId\":\"message-123\",\"SequenceNumber\":\"1\"}\nmocked SQS submission passed\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_59","type":"command_execution","command":"/bin/bash -lc \"npm test && node --check voice-cloning-job-handler/index.js && node --check app/services/sqs/sqs_service.js && node --check voice-synthsizer-job-handler/index.js && git diff --check && git status --short && nl -ba voice-cloning-job-handler/job_payload.js | sed -n '1,220p' && nl -ba voice-cloning-job-handler/index.js | sed -n '100,350p' && nl -ba app/services/sqs/sqs_service.js | sed -n '1,100p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_59","type":"command_execution","command":"/bin/bash -lc \"npm test && node --check voice-cloning-job-handler/index.js && node --check app/services/sqs/sqs_service.js && node --check voice-synthsizer-job-handler/index.js && git diff --check && git status --short && nl -ba voice-cloning-job-handler/job_payload.js | sed -n '1,220p' && nl -ba voice-cloning-job-handler/index.js | sed -n '100,350p' && nl -ba app/services/sqs/sqs_service.js | sed -n '1,100p'\"","aggregated_output":"\n> potion-voice@1.0.0 test /workspace\n> node test/pro-v2-cloning.test.js\n\npro_v2 cloning tests passed\n M app/services/sqs/sqs_service.js\n M app/services/voice_cloning/voice_cloning_model.js\n M package.json\n M voice-cloning-job-handler/index.js\n M voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\n M voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\n M voice-synthsizer-job-handler/index.js\n M voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\n?? app/services/sqs/message_params.js\n?? test/\n?? voice-cloning-job-handler/job_payload.js\n     1\tconst PRO_V2_TIER = 'pro_v2'\n     2\t\n     3\tconst V2_PIPELINE = Object.freeze({\n     4\t  name: PRO_V2_TIER,\n     5\t  baselineModelPath:\n     6\t    '../voice-cloning/pretrained-models/checkpoint_365000.pth',\n     7\t  generatedDirectoryPrefix: 'vits_potion_clone',\n     8\t  checkpointName: 'checkpoint_365200.pth',\n     9\t})\n    10\t\n    11\t// Untiered jobs predate the tier field, but already use the v2 cloning\n    12\t// scripts. Keep accepting them while explicitly routing pro_v2 to that same\n    13\t// pipeline.\n    14\tconst LEGACY_PIPELINE = Object.freeze({\n    15\t  ...V2_PIPELINE,\n    16\t  name: 'legacy',\n    17\t})\n    18\t\n    19\tconst isObject = (value) =>\n    20\t  value !== null && typeof value === 'object' && !Array.isArray(value)\n    21\t\n    22\tconst firstPresent = (...values) =>\n    23\t  values.find((value) => value !== undefined && value !== null)\n    24\t\n    25\tconst parseJson = (value, description) => {\n    26\t  try {\n    27\t    return JSON.parse(value)\n    28\t  } catch (error) {\n    29\t    throw new Error(`Invalid ${description}: ${error.message}`)\n    30\t  }\n    31\t}\n    32\t\n    33\tconst parseQueueMessage = (body) => {\n    34\t  let message = typeof body === 'string' ? parseJson(body, 'SQS message') : body\n    35\t\n    36\t  // SQS subscriptions may receive the job through an SNS envelope.\n    37\t  if (isObject(message) && typeof message.Message === 'string') {\n    38\t    message = parseJson(message.Message, 'SNS message')\n    39\t  }\n    40\t\n    41\t  if (!isObject(message)) {\n    42\t    throw new Error('Voice cloning job must be a JSON object')\n    43\t  }\n    44\t\n    45\t  return message\n    46\t}\n    47\t\n    48\tconst findJobDocument = (message) => {\n    49\t  const candidates = [\n    50\t    message._doc,\n    51\t    message.job && message.job._doc,\n    52\t    message.job,\n    53\t    message.payload && message.payload._doc,\n    54\t    message.payload,\n    55\t    message.data && message.data._doc,\n    56\t    message.data,\n    57\t  ]\n    58\t\n    59\t  return candidates.find(isObject) || message\n    60\t}\n    61\t\n    62\tconst normalizeInput = (input) => {\n    63\t  if (!Array.isArray(input)) return input\n    64\t\n    65\t  return input.map((item) => {\n    66\t    if (!isObject(item)) return item\n    67\t\n    68\t    return {\n    69\t      ...item,\n    70\t      waveUrl: firstPresent(item.waveUrl, item.audioUrl, item.url),\n    71\t      originalText: firstPresent(\n    72\t        item.originalText,\n    73\t        item.text,\n    74\t        item.transcription,\n    75\t        item.transcript\n    76\t      ),\n    77\t    }\n    78\t  })\n    79\t}\n    80\t\n    81\tconst normalizeVoiceCloningJob = (message) => {\n    82\t  if (!isObject(message)) {\n    83\t    throw new Error('Voice cloning job must be an object')\n    84\t  }\n    85\t\n    86\t  const document = findJobDocument(message)\n    87\t  const metadata = firstPresent(document.metadata, message.metadata, {})\n    88\t  const directoryName = firstPresent(\n    89\t    metadata.directoryName,\n    90\t    document.directoryName,\n    91\t    message.directoryName\n    92\t  )\n    93\t  const tier = firstPresent(\n    94\t    message.tier,\n    95\t    document.tier,\n    96\t    metadata.tier,\n    97\t    message.metadata && message.metadata.tier\n    98\t  )\n    99\t  const input = firstPresent(\n   100\t    document.input,\n   101\t    message.input,\n   102\t    document.samples,\n   103\t    message.samples,\n   104\t    document.recordings,\n   105\t    message.recordings\n   106\t  )\n   107\t\n   108\t  return {\n   109\t    ...document,\n   110\t    _id: firstPresent(\n   111\t      document._id,\n   112\t      document.id,\n   113\t      message._id,\n   114\t      message.id,\n   115\t      message.voiceCloningId\n   116\t    ),\n   117\t    userAudioProfileId: firstPresent(\n   118\t      document.userAudioProfileId,\n   119\t      message.userAudioProfileId,\n   120\t      document.audioProfileId,\n   121\t      message.audioProfileId\n   122\t    ),\n   123\t    metadata: {\n   124\t      ...metadata,\n   125\t      directoryName,\n   126\t    },\n   127\t    input: normalizeInput(input),\n   128\t    env: firstPresent(\n   129\t      message.env,\n   130\t      document.env,\n   131\t      message.environment,\n   132\t      document.environment\n   133\t    ),\n   134\t    tier,\n   135\t  }\n   136\t}\n   137\t\n   138\tconst validateVoiceCloningJob = (job) => {\n   139\t  const missingFields = []\n   140\t\n   141\t  if (!job._id) missingFields.push('_id')\n   142\t  if (!job.userAudioProfileId) missingFields.push('userAudioProfileId')\n   143\t  if (!job.env) missingFields.push('env')\n   144\t  if (!job.metadata || !job.metadata.directoryName) {\n   145\t    missingFields.push('metadata.directoryName')\n   146\t  }\n   147\t  if (!Array.isArray(job.input) || job.input.length === 0) {\n   148\t    missingFields.push('input')\n   149\t  }\n   150\t\n   151\t  if (missingFields.length) {\n   152\t    throw new Error(\n   153\t      `Invalid voice cloning job; missing ${missingFields.join(', ')}`\n   154\t    )\n   155\t  }\n   156\t\n   157\t  job.input.forEach((item, index) => {\n   158\t    if (!isObject(item) || !item.waveUrl) {\n   159\t      throw new Error(`Invalid voice cloning job; input[${index}].waveUrl missing`)\n   160\t    }\n   161\t    if (typeof item.originalText !== 'string') {\n   162\t      throw new Error(\n   163\t        `Invalid voice cloning job; input[${index}].originalText missing`\n   164\t      )\n   165\t    }\n   166\t  })\n   167\t\n   168\t  if (job.tier !== undefined && typeof job.tier !== 'string') {\n   169\t    throw new Error('Invalid voice cloning job; tier must be a string')\n   170\t  }\n   171\t\n   172\t  return job\n   173\t}\n   174\t\n   175\tconst getCloningPipeline = (tier) =>\n   176\t  tier === PRO_V2_TIER ? V2_PIPELINE : LEGACY_PIPELINE\n   177\t\n   178\tmodule.exports = {\n   179\t  PRO_V2_TIER,\n   180\t  getCloningPipeline,\n   181\t  normalizeVoiceCloningJob,\n   182\t  parseQueueMessage,\n   183\t  validateVoiceCloningJob,\n   184\t}\n   100\t}\n   101\t\n   102\tconst processQueue = () => {\n   103\t  /* eslint-disable no-async-promise-executor */\n   104\t  return new Promise(async (resolve, reject) => {\n   105\t    try {\n   106\t      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n   107\t\n   108\t      if (\n   109\t        typeof response.Messages !== 'undefined' &&\n   110\t        response.Messages.length > 0\n   111\t      ) {\n   112\t        throttleMessageFetching = false\n   113\t        const receivedMessage = response.Messages[0]\n   114\t        const rawJob = parseQueueMessage(receivedMessage.Body)\n   115\t        const tierAttribute =\n   116\t          receivedMessage.MessageAttributes &&\n   117\t          receivedMessage.MessageAttributes.tier &&\n   118\t          receivedMessage.MessageAttributes.tier.StringValue\n   119\t        if (!rawJob.tier && tierAttribute) rawJob.tier = tierAttribute\n   120\t        const job = validateVoiceCloningJob(normalizeVoiceCloningJob(rawJob))\n   121\t        const receiptHandle = receivedMessage.ReceiptHandle\n   122\t        console.log('job===', job)\n   123\t\n   124\t        const { metadata, input, _id, userAudioProfileId, env, tier } = job\n   125\t        const cloningPipeline = getCloningPipeline(tier)\n   126\t        console.log('userAudioProfileId', userAudioProfileId)\n   127\t        console.log('_id', _id)\n   128\t        console.log('env', env)\n   129\t        console.log('tier', tier || 'legacy')\n   130\t\n   131\t        console.log('metadata------', metadata)\n   132\t        console.log('input', input)\n   133\t        const DB_URI =\n   134\t          env === 'production'\n   135\t            ? mongoUriProd\n   136\t            : env === 'staging'\n   137\t            ? mongoUriStaging\n   138\t            : mongoUriDev\n   139\t\n   140\t        console.log('DB_URI ', DB_URI)\n   141\t        await connectDB(DB_URI)\n   142\t\n   143\t        const cloudFrontUrl =\n   144\t          env === 'production'\n   145\t            ? cloudFrontUrlProd\n   146\t            : env === 'staging'\n   147\t            ? cloudFrontUrlStaging\n   148\t            : cloudFrontUrlDev\n   149\t\n   150\t        try {\n   151\t          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n   152\t\n   153\t          const { directoryName } = metadata\n   154\t          console.log('directoryName', directoryName)\n   155\t          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n   156\t          if (!fs.existsSync(logPath)) {\n   157\t            fs.mkdirSync(logPath, { recursive: true })\n   158\t          }\n   159\t          // update the db model to processing\n   160\t          const voiceCloning = await voiceCloningService.update({\n   161\t            _id,\n   162\t            status: 'processing',\n   163\t            ...(tier && { tier }),\n   164\t          })\n   165\t          if (!voiceCloning) {\n   166\t            throw new Error(`Voice cloning job ${_id} was not found`)\n   167\t          }\n   168\t\n   169\t          const userAudioProfile = await userAudioProfileService.update({\n   170\t            _id: userAudioProfileId,\n   171\t            status: 'processing',\n   172\t            ...(tier && { tier }),\n   173\t          })\n   174\t          if (!userAudioProfile) {\n   175\t            throw new Error(`User audio profile ${userAudioProfileId} was not found`)\n   176\t          }\n   177\t\n   178\t          // create directory for userid-useraudioprofileid if not exist\n   179\t          const rootPath = `/tmp/${directoryName}`\n   180\t          const wavePath = `${rootPath}/wav48/1`\n   181\t          if (!fs.existsSync(wavePath)) {\n   182\t            fs.mkdirSync(wavePath, { recursive: true })\n   183\t          }\n   184\t\n   185\t          const txtPath = `${rootPath}/txt/1`\n   186\t          if (!fs.existsSync(txtPath)) {\n   187\t            fs.mkdirSync(txtPath, { recursive: true })\n   188\t          }\n   189\t          // download the training data files and put it in respective directories\n   190\t          for (let index = 0; index < input.length; index++) {\n   191\t            const item = input[index]\n   192\t\n   193\t            const { waveUrl, originalText } = item\n   194\t            // download wave file\n   195\t            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n   196\t\n   197\t            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n   198\t\n   199\t            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n   200\t            await fs.promises.writeFile(txtFilePath, originalText)\n   201\t          }\n   202\t\n   203\t          const zipFileName = directoryName + '.tgz'\n   204\t\n   205\t          // /tmp/directoryName.tgz\n   206\t\n   207\t          await execShellCommand(\n   208\t            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n   209\t            logPath\n   210\t          )\n   211\t          console.log('ZIP created ', zipFileName)\n   212\t\n   213\t          // re-sample audio\n   214\t          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n   215\t          console.time(SAMPLING_LABEL)\n   216\t\n   217\t          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n   218\t\n   219\t          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n   220\t          console.log('samplingCommand ', samplingCommand)\n   221\t          await execShellCommand(samplingCommand, logPath)\n   222\t          console.timeEnd(SAMPLING_LABEL)\n   223\t\n   224\t          // /mnt/efs/potion-voice/${env}/speakrs.pth\n   225\t          // /mnt/efs/potion-voice/${env}/txt\n   226\t          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n   227\t\n   228\t          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n   229\t\n   230\t          const resultsPath = outPath + '/results'\n   231\t\n   232\t          //update pth file for cloning\n   233\t          // clone the voice\n   234\t          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n   235\t          console.time(VOICE_CLONING_LABEL)\n   236\t          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ${cloningPipeline.baselineModelPath} --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n   237\t            outPath + '/speakers.pth'\n   238\t          } --output_path ${resultsPath}`\n   239\t\n   240\t          console.log('Training Model Command', trainingModelCommand)\n   241\t          await execShellCommand(trainingModelCommand, logPath)\n   242\t\n   243\t          console.timeEnd(VOICE_CLONING_LABEL)\n   244\t\n   245\t          let generatedDirectoryName = ''\n   246\t          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n   247\t            if (file.includes(cloningPipeline.generatedDirectoryPrefix))\n   248\t              // use output from above to get right path and directory name\n   249\t              generatedDirectoryName = file\n   250\t          })\n   251\t          if (!generatedDirectoryName) {\n   252\t            throw new Error(\n   253\t              `Cloning pipeline ${cloningPipeline.name} did not produce a model`\n   254\t            )\n   255\t          }\n   256\t\n   257\t          // minimize cloning model\n   258\t          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n   259\t          console.time(VOICE_MINIMIZE_LABEL)\n   260\t          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n   261\t            resultsPath + '/' + generatedDirectoryName + '/'\n   262\t          } --voice_model_name ${cloningPipeline.checkpointName}`\n   263\t\n   264\t          console.log(\n   265\t            'Minimize Cloning Model Command',\n   266\t            minimizeCloningModelCommand\n   267\t          )\n   268\t          await execShellCommand(minimizeCloningModelCommand, logPath)\n   269\t          console.timeEnd(VOICE_MINIMIZE_LABEL)\n   270\t\n   271\t          const training_model_path = {\n   272\t            voice_model_path: `${resultsPath}/${generatedDirectoryName}/${cloningPipeline.checkpointName}`,\n   273\t            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n   274\t            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n   275\t            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/${cloningPipeline.checkpointName.replace(\n   276\t              /\\.pth$/,\n   277\t              '_light.pth'\n   278\t            )}`,\n   279\t            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n   280\t          }\n   281\t\n   282\t          // add code to put that model into S3\n   283\t          const keys = Object.keys(training_model_path)\n   284\t\n   285\t          const training_model_s3_path = {}\n   286\t\n   287\t          for (let index = 0; index < keys.length; index++) {\n   288\t            const path = training_model_path[keys[index]]\n   289\t            const s3Path = await s3.upload({\n   290\t              filePath: path,\n   291\t              fileName: `${directoryName}/${path.split('/').pop()}`,\n   292\t              bucket: `potion-voice-users-training-model/${env}`,\n   293\t            })\n   294\t            if (!s3Path) {\n   295\t              throw new Error(`Model upload returned no location for ${path}`)\n   296\t            }\n   297\t            training_model_s3_path[keys[index]] = s3Path\n   298\t          }\n   299\t          // Do not expose a completed profile until both local and durable\n   300\t          // model locations are present. Consumers otherwise observe null\n   301\t          // model state while uploads are still running.\n   302\t          const completedUserAudioProfile = await userAudioProfileService.update({\n   303\t            _id: userAudioProfileId,\n   304\t            status: 'completed',\n   305\t            ...(tier && { tier }),\n   306\t            training_model_path,\n   307\t            training_model_s3_path,\n   308\t          })\n   309\t          if (!completedUserAudioProfile) {\n   310\t            throw new Error(`User audio profile ${userAudioProfileId} was not found`)\n   311\t          }\n   312\t\n   313\t          const completedVoiceCloning = await voiceCloningService.update({\n   314\t            _id,\n   315\t            status: 'completed',\n   316\t            ...(tier && { tier }),\n   317\t            training_model: training_model_s3_path,\n   318\t          })\n   319\t          if (!completedVoiceCloning) {\n   320\t            throw new Error(`Voice cloning job ${_id} was not found`)\n   321\t          }\n   322\t        } catch (error) {\n   323\t          console.log('error********************', error)\n   324\t          Bugsnag.notify(\n   325\t            new Error(\n   326\t              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n   327\t            )\n   328\t          )\n   329\t          Bugsnag.notify(error)\n   330\t\n   331\t          // update the db to set status as error\n   332\t          await Promise.allSettled([\n   333\t            voiceCloningService.update({\n   334\t              _id,\n   335\t              status: 'error',\n   336\t              ...(tier && { tier }),\n   337\t            }),\n   338\t            userAudioProfileService.update({\n   339\t              _id: userAudioProfileId,\n   340\t              status: 'error',\n   341\t              ...(tier && { tier }),\n   342\t            }),\n   343\t          ])\n   344\t\n   345\t          resolve() // to continue working on new jobs\n   346\t        }\n   347\t      } else {\n   348\t        throttleMessageFetching = true\n   349\t      }\n   350\t      resolve()\n     1\tconst AWS = require('aws-sdk')\n     2\t\n     3\tconst sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n     4\t\n     5\tconst StringifyUtils = require('../utils/logService')\n     6\tconst { buildSendMessageParams } = require('./message_params')\n     7\t\n     8\tconst fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\n     9\t  return new Promise((resolve, reject) => {\n    10\t    const params = {\n    11\t      WaitTimeSeconds: waitTimeInSeconds,\n    12\t      MessageAttributeNames: ['All'],\n    13\t      QueueUrl: sqsQueueUrl /* required */,\n    14\t    }\n    15\t    sqs.receiveMessage(params, function (err, data) {\n    16\t      if (err) {\n    17\t        reject(err)\n    18\t        console.log(\n    19\t          `ERROR in fetchJobFromSQS : `,\n    20\t          StringifyUtils.stringifyError(err)\n    21\t        )\n    22\t      } else {\n    23\t        resolve(data)\n    24\t      }\n    25\t    })\n    26\t  })\n    27\t}\n    28\t\n    29\tconst deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\n    30\t  return new Promise((resolve, reject) => {\n    31\t    const params = {\n    32\t      ReceiptHandle: receiptHandle,\n    33\t      QueueUrl: sqsQueueUrl /* required */,\n    34\t    }\n    35\t    sqs.deleteMessage(params, function (err, data) {\n    36\t      if (err) {\n    37\t        reject(err)\n    38\t        console.log(\n    39\t          `ERROR in sending delete request to AWS.SQS : `,\n    40\t          StringifyUtils.stringifyError(err)\n    41\t        )\n    42\t      } else {\n    43\t        console.log(\n    44\t          'Successfully sent delete request to AWS.SQS',\n    45\t          StringifyUtils.stringifyError(data)\n    46\t        )\n    47\t        resolve(data)\n    48\t      }\n    49\t    })\n    50\t  })\n    51\t}\n    52\t\n    53\tconst sendMessageToSQS = (sqsQueueUrl, message, options) => {\n    54\t  return new Promise((resolve, reject) => {\n    55\t    const params = buildSendMessageParams(sqsQueueUrl, message, options)\n    56\t    sqs.sendMessage(params, function (err, data) {\n    57\t      if (err) {\n    58\t        reject(err)\n    59\t        console.log(\n    60\t          `ERROR in seding request to AWS.SQS : `,\n    61\t          StringifyUtils.stringifyError(err)\n    62\t        )\n    63\t      } else {\n    64\t        console.log(\n    65\t          'Successfully sent request to AWS.SQS',\n    66\t          StringifyUtils.stringifyError(data)\n    67\t        )\n    68\t        resolve(data)\n    69\t      }\n    70\t    })\n    71\t  })\n    72\t}\n    73\t\n    74\tmodule.exports = {\n    75\t  fetchMessageFromSQS,\n    76\t  deleteMessageFromSQS,\n    77\t  sendMessageToSQS,\n    78\t}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_60","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_60","type":"file_change","changes":[{"path":"/workspace/app/services/sqs/message_params.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_61","type":"command_execution","command":"/bin/bash -lc 'npm test && git diff --check && node --check app/services/sqs/message_params.js && git status --short'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_61","type":"command_execution","command":"/bin/bash -lc 'npm test && git diff --check && node --check app/services/sqs/message_params.js && git status --short'","aggregated_output":"pro_v2 cloning tests passed\n M app/services/sqs/sqs_service.js\n M app/services/voice_cloning/voice_cloning_model.js\n M package.json\n M voice-cloning-job-handler/index.js\n M voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\n M voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\n M voice-synthsizer-job-handler/index.js\n M voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\n?? app/services/sqs/message_params.js\n?? test/\n?? voice-cloning-job-handler/job_payload.js\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_62","type":"agent_message","text":"Implemented `pro_v2` voice cloning support.\n\n- Normalizes legacy, plain, wrapped, SNS, and tier-attributed jobs.\n- Routes `pro_v2` through the v2 pipeline and persists its tier.\n- Fixes FIFO submission and undefined SQS responses.\n- Prevents `completed` jobs from exposing null model paths.\n- Adds focused regression tests.\n\nValidation: `npm test` passes."}}
{"type":"turn.completed","usage":{"input_tokens":2862088,"cached_input_tokens":2753559,"cache_write_input_tokens":108394,"output_tokens":30436,"reasoning_output_tokens":17646}}
