khoj 1.20.5.dev15__tar.gz → 1.20.5.dev18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/PKG-INFO +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/configure.py +5 -32
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/adapters/__init__.py +61 -20
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/admin.py +4 -2
- khoj-1.20.5.dev18/src/khoj/database/migrations/0057_remove_serverchatsettings_default_model_and_more.py +51 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/models/__init__.py +5 -4
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/404/index.html +1 -1
- khoj-1.20.5.dev15/src/khoj/interface/compiled/_next/static/chunks/9178-ef3257c08d8973c8.js → khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/chunks/9178-b9ab3fa2e9be8287.js +1 -1
- khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/chunks/app/chat/page-c2ebc47a09abc8ae.js +1 -0
- khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/chunks/app/settings/page-1a2acc46cdabaf4a.js +1 -0
- khoj-1.20.5.dev15/src/khoj/interface/compiled/_next/static/css/2bfe35fbe2c97a56.css → khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/css/9369a9dea99c97e8.css +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/agents/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/agents/index.txt +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/automations/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/automations/index.txt +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/chat/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/chat/index.txt +2 -2
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/factchecker/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/factchecker/index.txt +2 -2
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/index.txt +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/search/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/search/index.txt +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/settings/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/settings/index.txt +2 -2
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/share/chat/index.html +1 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/share/chat/index.txt +2 -2
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/tools/online_search.py +10 -5
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/api_chat.py +22 -9
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/helpers.py +28 -12
- khoj-1.20.5.dev15/src/khoj/interface/compiled/_next/static/chunks/app/chat/page-37ff98d93e65b5a4.js +0 -1
- khoj-1.20.5.dev15/src/khoj/interface/compiled/_next/static/chunks/app/settings/page-b0fae6e054ca311e.js +0 -1
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/.gitignore +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/LICENSE +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/README.md +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/pyproject.toml +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/app/README.md +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/app/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/app/asgi.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/app/settings.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/app/urls.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/apps.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/management/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/management/commands/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/management/commands/change_generated_images_url.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/management/commands/convert_images_png_to_webp.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0001_khojuser.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0002_googleuser.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0003_vector_extension.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0004_content_types_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0005_embeddings_corpus_id.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0006_embeddingsdates.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0007_add_conversation.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0008_alter_conversation_conversation_log.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0009_khojapiuser.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0010_chatmodeloptions_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0010_rename_embeddings_entry_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0011_merge_20231102_0138.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0012_entry_file_source.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0013_subscription.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0014_alter_googleuser_picture.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0015_alter_subscription_user.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0016_alter_subscription_renewal_date.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0017_searchmodel.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0018_searchmodelconfig_delete_searchmodel.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0019_alter_googleuser_family_name_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0020_reflectivequestion.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0021_speechtotextmodeloptions_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0022_texttoimagemodelconfig.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0023_usersearchmodelconfig.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0024_alter_entry_embeddings.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0025_clientapplication_khojuser_phone_number_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0025_searchmodelconfig_embeddings_inference_endpoint_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0026_searchmodelconfig_cross_encoder_inference_endpoint_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0027_merge_20240118_1324.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0028_khojuser_verified_phone_number.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0029_userrequests.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0030_conversation_slug_and_title.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0031_agent_conversation_agent.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0031_alter_googleuser_locale.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0032_merge_20240322_0427.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0033_rename_tuning_agent_personality.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0034_alter_chatmodeloptions_chat_model.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0035_processlock.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0036_alter_processlock_name.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0036_delete_offlinechatprocessorconversationconfig.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0036_publicconversation.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0037_chatmodeloptions_openai_config_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0037_searchmodelconfig_bi_encoder_docs_encode_config_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0038_merge_20240425_0857.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0038_merge_20240426_1640.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0039_merge_20240501_0301.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0040_alter_processlock_name.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0040_merge_20240504_1010.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0041_merge_20240505_1234.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0042_serverchatsettings.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0043_alter_chatmodeloptions_model_type.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0044_conversation_file_filters.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0045_fileobject.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0046_khojuser_email_verification_code_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0047_alter_entry_file_type.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0048_voicemodeloption_uservoicemodelconfig.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0049_datastore.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0049_texttoimagemodelconfig_api_key_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0050_alter_processlock_name.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0051_merge_20240702_1220.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0052_alter_searchmodelconfig_bi_encoder_docs_encode_config_and_more.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0053_agent_style_color_agent_style_icon.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0054_alter_agent_style_color.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0055_alter_agent_style_icon.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/0056_searchmodelconfig_cross_encoder_model_config.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/migrations/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/database/tests.py +0 -0
- {khoj-1.20.5.dev15/src/khoj/interface/compiled/_next/static/K0mF1QxJRVM2LVZZQ_Edc → khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/StJQhDfsnRaHEWnrxvjj3}/_buildManifest.js +0 -0
- {khoj-1.20.5.dev15/src/khoj/interface/compiled/_next/static/K0mF1QxJRVM2LVZZQ_Edc → khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/StJQhDfsnRaHEWnrxvjj3}/_ssgManifest.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/1603-fb2d80ae73990df3.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/2614-7cf01576d4457a75.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/3062-a42d847c919a9ea4.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/3678-8c0e55c3b5d83a22.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/4504-1629487c8bc82203.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/6297-d1c842ed3f714ab0.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/6648-ff677e51f1b2bcf1.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/7023-52c1be60135eb057.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/7071-b4711cecca6619a8.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/743-1a64254447cda71f.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/8423-898d821eaab634af.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/9001-acbca3e19b1a5ddf.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/9162-4a6d0d0dc5e27618.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/9417-5d14ac74aaab2c66.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/9693-91b03052c5cabded.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/_not-found/page-07ff4ab42b07845e.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/agents/layout-e71c8e913cccf792.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/agents/page-6ade083d5e27a023.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/automations/layout-27c28e923c9b1ff0.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/automations/page-559111e9b97f158d.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/chat/layout-8102549127db3067.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/factchecker/layout-7b30c541c05fb904.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/factchecker/page-6ca723a9ff0dfd70.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/layout-f3e40d346da53112.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/page-a7e6517e91dde51a.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/search/layout-3720f1362310bebb.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/search/page-fa15807b1ad7e30b.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/settings/layout-6f9314b0d7a26046.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-39f03f9e32399f0f.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/app/share/chat/page-0ae8f5b868af65c1.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/d3ac728e-a9e3522eef9b6b28.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/fd9d1056-2b978342deb60015.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/framework-8e0e0f4a6b83a956.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/main-175c164f5e0f026c.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/main-app-6d6ee3495efe03d4.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/pages/_app-f870474a17b7f2fd.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/chunks/webpack-072d1cbdec7e1782.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/1538cedb321e3a97.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/2272c73fc7a3b571.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/553f9cdcc7a2bcd6.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/9d5b867ec04494a6.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/a22d83f18a32957e.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/a3530ec58b0b660f.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/css/b81e909d403fb2df.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/0e790e04fd40ad16-s.p.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/4221e1667cd19c7d-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/6c276159aa0eb14b-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/6cc0b9500e4f9168-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/9d9319a7a2ac39c6-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.1608a09b.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.4aafdb68.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.a79f1c31.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.b6770918.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.9f256b85.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.7c187121.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.b74a1a8b.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.d181c465.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.47373d1e.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.8916142b.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.9024d815.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.0462f03b.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.7f51fe03.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.572d331f.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.5295ba48.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.939bc644.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.f28c23ac.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.bf59d231.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.74048478.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.03e9641d.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.07505710.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.e1e279cb.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.eae34984.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.fabc004a.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.57727022.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.5916a24f.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.d6b476ec.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.9acaf01c.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.a144ef58.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.b4230e7e.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.10d95fd3.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.7a996c9d.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.fbccdabe.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.6258592b.woff +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/a75c8ea86756d52d-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/abce7c400ca31a51-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/f759c939737fb668-s.woff2 +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/flags.3afdda2f.webp +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/flags@2x.5fbe9fc1.webp +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/globe.98e105ca.webp +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/_next/static/media/globe@2x.974df6f8.webp +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/agents.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/icons/khoj_lantern.ico +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/icons/khoj_lantern_128x128.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/icons/khoj_lantern_256x256.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/icons/khoj_lantern_logomarktype_1200x630.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/samples/desktop-browse-draw-sample.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/samples/desktop-plain-chat-sample.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/samples/desktop-remember-plan-sample.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/samples/phone-browse-draw-sample.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/samples/phone-plain-chat-sample.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/assets/samples/phone-remember-plan-sample.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/automation.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/chat.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/close.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/copy-button-success.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/copy-button.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/khoj.webmanifest +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/logo.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/send.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/share.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/thumbs-down.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/compiled/thumbs-up.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/email/feedback.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/email/magic_link.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/email/task.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/email/welcome.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/agents.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/automation.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/favicon-128x128.ico +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/github.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/khoj-logo-sideways-200.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/khoj-logo-sideways-500.png +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/khoj-logo-sideways.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/khoj.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/logotype.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/search.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/icons/sync.svg +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/khoj.css +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/assets/utils.js +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/base_config.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/content_source_github_input.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/login.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/interface/web/utils.html +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/main.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/manage.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_offline_chat_default_model.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_offline_chat_default_model_2.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_offline_chat_schema.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_offline_model.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_processor_config_openai.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_server_pg.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/migrations/migrate_version.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/docx/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/docx/docx_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/github/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/github/github_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/images/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/images/image_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/markdown/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/markdown/markdown_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/notion/notion_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/org_mode/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/org_mode/org_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/org_mode/orgnode.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/pdf/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/pdf/pdf_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/plaintext/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/plaintext/plaintext_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/content/text_to_entries.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/anthropic/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/anthropic/anthropic_chat.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/anthropic/utils.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/offline/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/offline/chat_model.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/offline/utils.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/offline/whisper.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/openai/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/openai/gpt.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/openai/utils.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/openai/whisper.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/prompts.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/conversation/utils.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/embeddings.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/speech/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/speech/text_to_speech.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/processor/tools/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/api.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/api_agents.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/api_content.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/api_model.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/api_phone.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/auth.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/email.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/notion.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/storage.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/subscription.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/twilio.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/routers/web_client.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_filter/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_filter/base_filter.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_filter/date_filter.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_filter/file_filter.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_filter/word_filter.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_type/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/search_type/text_search.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/__init__.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/cli.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/config.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/constants.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/fs_syncer.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/helpers.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/initialization.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/jsonl.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/models.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/rawconfig.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/state.py +0 -0
- {khoj-1.20.5.dev15 → khoj-1.20.5.dev18}/src/khoj/utils/yaml.py +0 -0
|
@@ -32,10 +32,9 @@ from khoj.database.adapters import (
|
|
|
32
32
|
ClientApplicationAdapters,
|
|
33
33
|
ConversationAdapters,
|
|
34
34
|
ProcessLockAdapters,
|
|
35
|
-
SubscriptionState,
|
|
36
35
|
aget_or_create_user_by_phone_number,
|
|
37
36
|
aget_user_by_phone_number,
|
|
38
|
-
|
|
37
|
+
ais_user_subscribed,
|
|
39
38
|
delete_user_requests,
|
|
40
39
|
get_all_users,
|
|
41
40
|
get_or_create_search_models,
|
|
@@ -119,15 +118,7 @@ class UserAuthenticationBackend(AuthenticationBackend):
|
|
|
119
118
|
.afirst()
|
|
120
119
|
)
|
|
121
120
|
if user:
|
|
122
|
-
|
|
123
|
-
return AuthCredentials(["authenticated", "premium"]), AuthenticatedKhojUser(user)
|
|
124
|
-
|
|
125
|
-
subscription_state = await aget_user_subscription_state(user)
|
|
126
|
-
subscribed = (
|
|
127
|
-
subscription_state == SubscriptionState.SUBSCRIBED.value
|
|
128
|
-
or subscription_state == SubscriptionState.TRIAL.value
|
|
129
|
-
or subscription_state == SubscriptionState.UNSUBSCRIBED.value
|
|
130
|
-
)
|
|
121
|
+
subscribed = await ais_user_subscribed(user)
|
|
131
122
|
if subscribed:
|
|
132
123
|
return AuthCredentials(["authenticated", "premium"]), AuthenticatedKhojUser(user)
|
|
133
124
|
return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user)
|
|
@@ -144,15 +135,7 @@ class UserAuthenticationBackend(AuthenticationBackend):
|
|
|
144
135
|
.afirst()
|
|
145
136
|
)
|
|
146
137
|
if user_with_token:
|
|
147
|
-
|
|
148
|
-
return AuthCredentials(["authenticated", "premium"]), AuthenticatedKhojUser(user_with_token.user)
|
|
149
|
-
|
|
150
|
-
subscription_state = await aget_user_subscription_state(user_with_token.user)
|
|
151
|
-
subscribed = (
|
|
152
|
-
subscription_state == SubscriptionState.SUBSCRIBED.value
|
|
153
|
-
or subscription_state == SubscriptionState.TRIAL.value
|
|
154
|
-
or subscription_state == SubscriptionState.UNSUBSCRIBED.value
|
|
155
|
-
)
|
|
138
|
+
subscribed = await ais_user_subscribed(user_with_token.user)
|
|
156
139
|
if subscribed:
|
|
157
140
|
return AuthCredentials(["authenticated", "premium"]), AuthenticatedKhojUser(user_with_token.user)
|
|
158
141
|
return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user_with_token.user)
|
|
@@ -189,20 +172,10 @@ class UserAuthenticationBackend(AuthenticationBackend):
|
|
|
189
172
|
if user is None:
|
|
190
173
|
return AuthCredentials(), UnauthenticatedUser()
|
|
191
174
|
|
|
192
|
-
|
|
193
|
-
return AuthCredentials(["authenticated", "premium"]), AuthenticatedKhojUser(user, client_application)
|
|
175
|
+
subscribed = await ais_user_subscribed(user)
|
|
194
176
|
|
|
195
|
-
subscription_state = await aget_user_subscription_state(user)
|
|
196
|
-
subscribed = (
|
|
197
|
-
subscription_state == SubscriptionState.SUBSCRIBED.value
|
|
198
|
-
or subscription_state == SubscriptionState.TRIAL.value
|
|
199
|
-
or subscription_state == SubscriptionState.UNSUBSCRIBED.value
|
|
200
|
-
)
|
|
201
177
|
if subscribed:
|
|
202
|
-
return (
|
|
203
|
-
AuthCredentials(["authenticated", "premium"]),
|
|
204
|
-
AuthenticatedKhojUser(user, client_application),
|
|
205
|
-
)
|
|
178
|
+
return AuthCredentials(["authenticated", "premium"]), AuthenticatedKhojUser(user, client_application)
|
|
206
179
|
return AuthCredentials(["authenticated"]), AuthenticatedKhojUser(user, client_application)
|
|
207
180
|
|
|
208
181
|
# No auth required if server in anonymous mode
|
|
@@ -300,6 +300,38 @@ async def aget_user_subscription_state(user: KhojUser) -> str:
|
|
|
300
300
|
return subscription_to_state(user_subscription)
|
|
301
301
|
|
|
302
302
|
|
|
303
|
+
async def ais_user_subscribed(user: KhojUser) -> bool:
|
|
304
|
+
"""
|
|
305
|
+
Get whether the user is subscribed
|
|
306
|
+
"""
|
|
307
|
+
if not state.billing_enabled or state.anonymous_mode:
|
|
308
|
+
return True
|
|
309
|
+
|
|
310
|
+
subscription_state = await aget_user_subscription_state(user)
|
|
311
|
+
subscribed = (
|
|
312
|
+
subscription_state == SubscriptionState.SUBSCRIBED.value
|
|
313
|
+
or subscription_state == SubscriptionState.TRIAL.value
|
|
314
|
+
or subscription_state == SubscriptionState.UNSUBSCRIBED.value
|
|
315
|
+
)
|
|
316
|
+
return subscribed
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def is_user_subscribed(user: KhojUser) -> bool:
|
|
320
|
+
"""
|
|
321
|
+
Get whether the user is subscribed
|
|
322
|
+
"""
|
|
323
|
+
if not state.billing_enabled or state.anonymous_mode:
|
|
324
|
+
return True
|
|
325
|
+
|
|
326
|
+
subscription_state = get_user_subscription_state(user.email)
|
|
327
|
+
subscribed = (
|
|
328
|
+
subscription_state == SubscriptionState.SUBSCRIBED.value
|
|
329
|
+
or subscription_state == SubscriptionState.TRIAL.value
|
|
330
|
+
or subscription_state == SubscriptionState.UNSUBSCRIBED.value
|
|
331
|
+
)
|
|
332
|
+
return subscribed
|
|
333
|
+
|
|
334
|
+
|
|
303
335
|
async def get_user_by_email(email: str) -> KhojUser:
|
|
304
336
|
return await KhojUser.objects.filter(email=email).afirst()
|
|
305
337
|
|
|
@@ -751,17 +783,23 @@ class ConversationAdapters:
|
|
|
751
783
|
|
|
752
784
|
@staticmethod
|
|
753
785
|
def get_conversation_config(user: KhojUser):
|
|
786
|
+
subscribed = is_user_subscribed(user)
|
|
787
|
+
if not subscribed:
|
|
788
|
+
return ConversationAdapters.get_default_conversation_config()
|
|
754
789
|
config = UserConversationConfig.objects.filter(user=user).first()
|
|
755
|
-
if
|
|
756
|
-
return
|
|
757
|
-
return
|
|
790
|
+
if config:
|
|
791
|
+
return config.setting
|
|
792
|
+
return ConversationAdapters.get_advanced_conversation_config()
|
|
758
793
|
|
|
759
794
|
@staticmethod
|
|
760
795
|
async def aget_conversation_config(user: KhojUser):
|
|
796
|
+
subscribed = await ais_user_subscribed(user)
|
|
797
|
+
if not subscribed:
|
|
798
|
+
return await ConversationAdapters.aget_default_conversation_config()
|
|
761
799
|
config = await UserConversationConfig.objects.filter(user=user).prefetch_related("setting").afirst()
|
|
762
|
-
if
|
|
763
|
-
return
|
|
764
|
-
return
|
|
800
|
+
if config:
|
|
801
|
+
return config.setting
|
|
802
|
+
return ConversationAdapters.aget_advanced_conversation_config()
|
|
765
803
|
|
|
766
804
|
@staticmethod
|
|
767
805
|
async def aget_voice_model_config(user: KhojUser) -> Optional[VoiceModelOption]:
|
|
@@ -784,35 +822,38 @@ class ConversationAdapters:
|
|
|
784
822
|
@staticmethod
|
|
785
823
|
def get_default_conversation_config():
|
|
786
824
|
server_chat_settings = ServerChatSettings.objects.first()
|
|
787
|
-
if server_chat_settings is None or server_chat_settings.
|
|
825
|
+
if server_chat_settings is None or server_chat_settings.chat_default is None:
|
|
788
826
|
return ChatModelOptions.objects.filter().first()
|
|
789
|
-
return server_chat_settings.
|
|
827
|
+
return server_chat_settings.chat_default
|
|
790
828
|
|
|
791
829
|
@staticmethod
|
|
792
830
|
async def aget_default_conversation_config():
|
|
793
831
|
server_chat_settings: ServerChatSettings = (
|
|
794
832
|
await ServerChatSettings.objects.filter()
|
|
795
|
-
.prefetch_related("
|
|
833
|
+
.prefetch_related("chat_default", "chat_default__openai_config")
|
|
796
834
|
.afirst()
|
|
797
835
|
)
|
|
798
|
-
if server_chat_settings is None or server_chat_settings.
|
|
836
|
+
if server_chat_settings is None or server_chat_settings.chat_default is None:
|
|
799
837
|
return await ChatModelOptions.objects.filter().prefetch_related("openai_config").afirst()
|
|
800
|
-
return server_chat_settings.
|
|
838
|
+
return server_chat_settings.chat_default
|
|
801
839
|
|
|
802
840
|
@staticmethod
|
|
803
|
-
|
|
841
|
+
def get_advanced_conversation_config():
|
|
842
|
+
server_chat_settings = ServerChatSettings.objects.first()
|
|
843
|
+
if server_chat_settings is None or server_chat_settings.chat_advanced is None:
|
|
844
|
+
return ConversationAdapters.get_default_conversation_config()
|
|
845
|
+
return server_chat_settings.chat_advanced
|
|
846
|
+
|
|
847
|
+
@staticmethod
|
|
848
|
+
async def aget_advanced_conversation_config():
|
|
804
849
|
server_chat_settings: ServerChatSettings = (
|
|
805
850
|
await ServerChatSettings.objects.filter()
|
|
806
|
-
.prefetch_related(
|
|
807
|
-
"summarizer_model", "default_model", "default_model__openai_config", "summarizer_model__openai_config"
|
|
808
|
-
)
|
|
851
|
+
.prefetch_related("chat_advanced", "chat_advanced__openai_config")
|
|
809
852
|
.afirst()
|
|
810
853
|
)
|
|
811
|
-
if server_chat_settings is None or
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
return await ChatModelOptions.objects.filter().prefetch_related("openai_config").afirst()
|
|
815
|
-
return server_chat_settings.summarizer_model or server_chat_settings.default_model
|
|
854
|
+
if server_chat_settings is None or server_chat_settings.chat_advanced is None:
|
|
855
|
+
return await ConversationAdapters.aget_default_conversation_config()
|
|
856
|
+
return server_chat_settings.chat_advanced
|
|
816
857
|
|
|
817
858
|
@staticmethod
|
|
818
859
|
def create_conversation_from_public_conversation(
|
|
@@ -26,6 +26,7 @@ from khoj.database.models import (
|
|
|
26
26
|
SpeechToTextModelOptions,
|
|
27
27
|
Subscription,
|
|
28
28
|
TextToImageModelConfig,
|
|
29
|
+
UserConversationConfig,
|
|
29
30
|
UserSearchModelConfig,
|
|
30
31
|
UserVoiceModelConfig,
|
|
31
32
|
VoiceModelOption,
|
|
@@ -101,6 +102,7 @@ admin.site.register(GithubConfig)
|
|
|
101
102
|
admin.site.register(NotionConfig)
|
|
102
103
|
admin.site.register(UserVoiceModelConfig)
|
|
103
104
|
admin.site.register(VoiceModelOption)
|
|
105
|
+
admin.site.register(UserConversationConfig)
|
|
104
106
|
|
|
105
107
|
|
|
106
108
|
@admin.register(Agent)
|
|
@@ -191,8 +193,8 @@ class SearchModelConfigAdmin(admin.ModelAdmin):
|
|
|
191
193
|
@admin.register(ServerChatSettings)
|
|
192
194
|
class ServerChatSettingsAdmin(admin.ModelAdmin):
|
|
193
195
|
list_display = (
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
+
"chat_default",
|
|
197
|
+
"chat_advanced",
|
|
196
198
|
)
|
|
197
199
|
|
|
198
200
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Generated by Django 5.0.7 on 2024-08-16 18:18
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
dependencies = [
|
|
9
|
+
("database", "0056_searchmodelconfig_cross_encoder_model_config"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.RenameField(
|
|
14
|
+
model_name="serverchatsettings",
|
|
15
|
+
old_name="default_model",
|
|
16
|
+
new_name="chat_default",
|
|
17
|
+
),
|
|
18
|
+
migrations.RemoveField(
|
|
19
|
+
model_name="serverchatsettings",
|
|
20
|
+
name="summarizer_model",
|
|
21
|
+
),
|
|
22
|
+
migrations.AddField(
|
|
23
|
+
model_name="chatmodeloptions",
|
|
24
|
+
name="subscribed_max_prompt_size",
|
|
25
|
+
field=models.IntegerField(blank=True, default=None, null=True),
|
|
26
|
+
),
|
|
27
|
+
migrations.AddField(
|
|
28
|
+
model_name="serverchatsettings",
|
|
29
|
+
name="chat_advanced",
|
|
30
|
+
field=models.ForeignKey(
|
|
31
|
+
blank=True,
|
|
32
|
+
default=None,
|
|
33
|
+
null=True,
|
|
34
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
35
|
+
related_name="chat_advanced",
|
|
36
|
+
to="database.chatmodeloptions",
|
|
37
|
+
),
|
|
38
|
+
),
|
|
39
|
+
migrations.AlterField(
|
|
40
|
+
model_name="serverchatsettings",
|
|
41
|
+
name="chat_default",
|
|
42
|
+
field=models.ForeignKey(
|
|
43
|
+
blank=True,
|
|
44
|
+
default=None,
|
|
45
|
+
null=True,
|
|
46
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
47
|
+
related_name="chat_default",
|
|
48
|
+
to="database.chatmodeloptions",
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
]
|
|
@@ -89,6 +89,7 @@ class ChatModelOptions(BaseModel):
|
|
|
89
89
|
ANTHROPIC = "anthropic"
|
|
90
90
|
|
|
91
91
|
max_prompt_size = models.IntegerField(default=None, null=True, blank=True)
|
|
92
|
+
subscribed_max_prompt_size = models.IntegerField(default=None, null=True, blank=True)
|
|
92
93
|
tokenizer = models.CharField(max_length=200, default=None, null=True, blank=True)
|
|
93
94
|
chat_model = models.CharField(max_length=200, default="NousResearch/Hermes-2-Pro-Mistral-7B-GGUF")
|
|
94
95
|
model_type = models.CharField(max_length=200, choices=ModelType.choices, default=ModelType.OFFLINE)
|
|
@@ -205,11 +206,11 @@ class GithubRepoConfig(BaseModel):
|
|
|
205
206
|
|
|
206
207
|
|
|
207
208
|
class ServerChatSettings(BaseModel):
|
|
208
|
-
|
|
209
|
-
ChatModelOptions, on_delete=models.CASCADE, default=None, null=True, blank=True, related_name="
|
|
209
|
+
chat_default = models.ForeignKey(
|
|
210
|
+
ChatModelOptions, on_delete=models.CASCADE, default=None, null=True, blank=True, related_name="chat_default"
|
|
210
211
|
)
|
|
211
|
-
|
|
212
|
-
ChatModelOptions, on_delete=models.CASCADE, default=None, null=True, blank=True, related_name="
|
|
212
|
+
chat_advanced = models.ForeignKey(
|
|
213
|
+
ChatModelOptions, on_delete=models.CASCADE, default=None, null=True, blank=True, related_name="chat_advanced"
|
|
213
214
|
)
|
|
214
215
|
|
|
215
216
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/0e790e04fd40ad16-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/1538cedb321e3a97.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/9d5b867ec04494a6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-072d1cbdec7e1782.js"/><script src="/_next/static/chunks/fd9d1056-2b978342deb60015.js" async=""></script><script src="/_next/static/chunks/7023-52c1be60135eb057.js" async=""></script><script src="/_next/static/chunks/main-app-6d6ee3495efe03d4.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';"/><title>404: This page could not be found.</title><title>Khoj AI - Home</title><meta name="description" content="Your Second Brain."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta property="og:title" content="Khoj AI - Home"/><meta property="og:description" content="Your Second Brain."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Home"/><meta name="twitter:description" content="Your Second Brain."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_90df87"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-072d1cbdec7e1782.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e790e04fd40ad16-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/1538cedb321e3a97.css\",\"style\"]\n3:HL[\"/_next/static/css/9d5b867ec04494a6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[95751,[],\"\"]\n6:I[39275,[],\"\"]\n7:I[61343,[],\"\"]\nd:I[76130,[],\"\"]\n8:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n9:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\na:{\"display\":\"inline-block\"}\nb:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1538cedb321e3a97.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9d5b867ec04494a6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"buildId\":\"K0mF1QxJRVM2LVZZQ_Edc\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found/\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_90df87\",\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$9\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$a\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$b\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"25\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"26\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"5:null\n"])</script></body></html>
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/0e790e04fd40ad16-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/1538cedb321e3a97.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/9d5b867ec04494a6.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-072d1cbdec7e1782.js"/><script src="/_next/static/chunks/fd9d1056-2b978342deb60015.js" async=""></script><script src="/_next/static/chunks/7023-52c1be60135eb057.js" async=""></script><script src="/_next/static/chunks/main-app-6d6ee3495efe03d4.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';"/><title>404: This page could not be found.</title><title>Khoj AI - Home</title><meta name="description" content="Your Second Brain."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta property="og:title" content="Khoj AI - Home"/><meta property="og:description" content="Your Second Brain."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Home"/><meta name="twitter:description" content="Your Second Brain."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_90df87"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-072d1cbdec7e1782.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/0e790e04fd40ad16-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/1538cedb321e3a97.css\",\"style\"]\n3:HL[\"/_next/static/css/9d5b867ec04494a6.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[95751,[],\"\"]\n6:I[39275,[],\"\"]\n7:I[61343,[],\"\"]\nd:I[76130,[],\"\"]\n8:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n9:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\na:{\"display\":\"inline-block\"}\nb:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1538cedb321e3a97.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9d5b867ec04494a6.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L4\",null,{\"buildId\":\"StJQhDfsnRaHEWnrxvjj3\",\"assetPrefix\":\"\",\"initialCanonicalUrl\":\"/_not-found/\",\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]]],null],null]},[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\",\"styles\":null}],null]},[[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_90df87\",\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$9\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$a\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$b\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[],\"styles\":null}]}]]}],null],null],\"couldBeIntercepted\":false,\"initialHead\":[false,\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"25\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"26\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"5:null\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9178],{89178:function(e,t,a){"use strict";a.d(t,{H:function(){return Q},Z:function(){return X}});var s=a(57437),n=a(34531),l=a.n(n),r=a(14944),o=a(39952),c=a.n(o),i=a(2265);a(7395);var d=a(26100),h=a(36013),u=a(13304),m=a(12218),g=a(74697),p=a(37440);let f=u.fC,x=u.xz;u.x8;let w=u.h_,j=i.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,s.jsx)(u.aV,{className:(0,p.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...n,ref:t})});j.displayName=u.aV.displayName;let y=(0,m.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),b=i.forwardRef((e,t)=>{let{side:a="right",className:n,children:l,...r}=e;return(0,s.jsxs)(w,{children:[(0,s.jsx)(j,{}),(0,s.jsxs)(u.VY,{ref:t,className:(0,p.cn)(y({side:a}),n),...r,children:[l,(0,s.jsxs)(u.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(g.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});b.displayName=u.VY.displayName;let N=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,p.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};N.displayName="SheetHeader";let k=i.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,s.jsx)(u.Dx,{ref:t,className:(0,p.cn)("text-lg font-semibold text-foreground",a),...n})});k.displayName=u.Dx.displayName;let C=i.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,s.jsx)(u.dk,{ref:t,className:(0,p.cn)("text-sm text-muted-foreground",a),...n})});C.displayName=u.dk.displayName;var M=a(19573),v=a(11838),_=a.n(v),R=a(89417);let E=new r.Z({html:!0,linkify:!0,typographer:!0});function T(e){let t=(0,R.L)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?_().sanitize(E.render(t)):_().sanitize(t)}(e),[n,l]=(0,i.useState)(!1);return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(M.J2,{open:n&&!e.showFullContent,onOpenChange:l,children:[(0,s.jsx)(M.xo,{asChild:!0,children:(0,s.jsxs)(h.Zb,{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg p-2 bg-muted border-none"),children:[(0,s.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.title]}),(0,s.jsx)("p",{className:"".concat(e.showFullContent?"block":"overflow-hidden line-clamp-2"),dangerouslySetInnerHTML:{__html:a}})]})}),(0,s.jsx)(M.yk,{className:"w-[400px] mx-2",children:(0,s.jsxs)(h.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg p-2 border-none",children:[(0,s.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,s.jsx)("p",{className:"overflow-hidden line-clamp-3",dangerouslySetInnerHTML:{__html:a}})]})})]})})}function L(e){let[t,a]=(0,i.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let n="https://www.google.com/s2/favicons?domain=globe",l="unknown";try{l=new URL(e.link).hostname,n="https://www.google.com/s2/favicons?domain=".concat(l)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(M.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,s.jsx)(M.xo,{asChild:!0,children:(0,s.jsx)(h.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words rounded-lg text-balance p-2 bg-muted border-none"),children:(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline p-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("img",{src:n,alt:"",className:"!w-4 h-4 mr-2"}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground"),children:l})]}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,s.jsx)("p",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]})})})}),(0,s.jsx)(M.yk,{className:"w-[400px] mx-2",children:(0,s.jsx)(h.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline p-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("img",{src:n,alt:"",className:"!w-4 h-4 mr-2"}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground"),children:l})]}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,s.jsx)("p",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-3"),children:e.description})]})})})})]})})}function D(e){let[t,a]=(0,i.useState)(3);(0,i.useEffect)(()=>{a(e.isMobileWidth?1:3)},[e.isMobileWidth]);let n=e.notesReferenceCardData.slice(0,t),l=n.length<t?e.onlineReferenceCardData.slice(0,t-n.length):[],r=e.notesReferenceCardData.length>0||e.onlineReferenceCardData.length>0,o=e.notesReferenceCardData.length+e.onlineReferenceCardData.length;return 0===o?null:(0,s.jsxs)("div",{className:"pt-0 px-4 pb-4 md:px-6",children:[(0,s.jsxs)("h3",{className:"inline-flex items-center",children:["References",(0,s.jsxs)("p",{className:"text-gray-400 m-2",children:[o," sources"]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[n.map((e,t)=>(0,i.createElement)(T,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),l.map((e,t)=>(0,i.createElement)(L,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),r&&(0,s.jsx)(F,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData})]})]})}function F(e){return e.notesReferenceCardData||e.onlineReferenceCardData?(0,s.jsxs)(f,{children:[(0,s.jsxs)(x,{className:"text-balance w-auto md:w-[200px] justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center !m-2 inline-flex",children:["View references",(0,s.jsx)(d.o,{className:"m-1"})]}),(0,s.jsxs)(b,{className:"overflow-y-scroll",children:[(0,s.jsxs)(N,{children:[(0,s.jsx)(k,{children:"References"}),(0,s.jsx)(C,{children:"View all references for this response"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.notesReferenceCardData.map((e,t)=>(0,i.createElement)(T,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,i.createElement)(L,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]}):null}var S=a(34149),B=a(29386),H=a(31784),O=a(60665),A=a(96006),Z=a(18444),q=a(35304),$=a(8589),P=a(63205),W=a(92880),z=a(48408),G=a(67722),I=a(58485),U=a(58575),V=a(25800);let Y=new r.Z({html:!0,linkify:!0,typographer:!0});function J(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function K(e){let{uquery:t,kquery:a}=e,[n,r]=(0,i.useState)(null);return(0,i.useEffect)(()=>{null!==n&&setTimeout(()=>{r(null)},2e3)},[n]),(0,s.jsxs)("div",{className:"".concat(l().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,s.jsx)("button",{title:"Like",className:l().thumbsUpButton,disabled:null!==n,onClick:()=>{J(t,a,"positive"),r(!0)},children:!0===n?(0,s.jsx)(S.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,s.jsx)(S.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,s.jsx)("button",{title:"Dislike",className:l().thumbsDownButton,disabled:null!==n,onClick:()=>{J(t,a,"negative"),r(!1)},children:!1===n?(0,s.jsx)(B.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,s.jsx)(B.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function Q(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),n="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,s.jsx)(H.a,{className:"".concat(n)}):a.includes("generating")?(0,s.jsx)(O.Z,{className:"".concat(n)}):a.includes("data sources")||a.includes("notes")?(0,s.jsx)(A.g,{className:"".concat(n)}):a.includes("read")?(0,s.jsx)(Z.f,{className:"".concat(n)}):a.includes("search")?(0,s.jsx)(q.Y,{className:"".concat(n)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,s.jsx)($.u,{className:"".concat(n)}):a.includes("paint")?(0,s.jsx)(P.Y,{className:"".concat(n)}):(0,s.jsx)(H.a,{className:"".concat(n)})}(t?t[1]:"",e.primary?(0,U.oz)(e.agentColor):"text-gray-500"),n=_().sanitize(Y.render(e.message));return(0,s.jsxs)("div",{className:"".concat(l().trainOfThoughtElement," items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(l().trainOfThought," ").concat(e.primary?l().primary:""),children:[a,(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:n}})]})}function X(e){var t,a;let n,r,o,c,d;let[h,u]=(0,i.useState)(!1),[m,g]=(0,i.useState)(!1),[p,f]=(0,i.useState)(""),[x,w]=(0,i.useState)(!1),[j,y]=(0,i.useState)(!1),b=(0,i.useRef)(!1),N=(0,i.useRef)(null);if((0,i.useEffect)(()=>{b.current=j},[j]),(0,i.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(N.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,V.Z)(N.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1}]})});return N.current&&e.observe(N.current,{childList:!0}),()=>e.disconnect()},[N.current]),(0,i.useEffect)(()=>{var t;let a=e.chatMessage.message;a=a.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),e.chatMessage.intent&&"text-to-image"==e.chatMessage.intent.type?a=""):e.chatMessage.intent&&"text-to-image2"==e.chatMessage.intent.type?a=""):e.chatMessage.intent&&"text-to-image-v3"==e.chatMessage.intent.type&&(a="")),e.chatMessage.intent&&e.chatMessage.intent.type.includes("text-to-image")&&(null===(t=e.chatMessage.intent["inferred-queries"])||void 0===t?void 0:t.length)>0&&(a+="\n\n**Inferred Query**\n\n".concat(e.chatMessage.intent["inferred-queries"][0]));let s=Y.render(a);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),f(_().sanitize(s))},[e.chatMessage.message,e.chatMessage.intent]),(0,i.useEffect)(()=>{h&&setTimeout(()=>{u(!1)},2e3)},[h]),(0,i.useEffect)(()=>{N.current&&(N.current.querySelectorAll("pre > .hljs").forEach(e=>{let t=document.createElement("button"),a=document.createElement("img");a.src="/static/copy-button.svg",a.alt="Copy",a.width=24,a.height=24,t.appendChild(a),t.className="hljs ".concat(l().codeCopyButton),t.addEventListener("click",()=>{let t=e.textContent||"";t=(t=(t=t.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(t),a.src="/static/copy-button-success.svg"}),e.prepend(t)}),console.log("render katex within the chat message"),(0,V.Z)(N.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1}]}))},[p,m,N]),!e.chatMessage.message)return null;async function k(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;w(!0);let a=C(t[0]);for(let e=0;e<t.length&&!b.current;e++){let s=a;e<t.length-1&&(a=C(t[e+1]));try{let e=await s,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let s=new Audio(e);s.onended=t,s.onerror=a,s.play()})}(t)}catch(e){console.error("Error:",e);break}}w(!1),y(!1)}async function C(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}let M=function(e,t){let a=[],s=[];if(t){let e=[];for(let[a,s]of Object.entries(t)){if(s.answerBox&&e.push({title:s.answerBox.title,description:s.answerBox.answer,link:s.answerBox.source}),s.knowledgeGraph&&e.push({title:s.knowledgeGraph.title,description:s.knowledgeGraph.description,link:s.knowledgeGraph.descriptionLink}),s.webpages){if(s.webpages instanceof Array){let t=s.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=s.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(s.organic){let t=s.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}a.push(...e)}if(e){let t=e.map(e=>e.compiled?{title:e.file,content:e.compiled}:{title:e.split("\n")[0],content:e.split("\n").slice(1).join("\n")});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:a}}(e.chatMessage.context,e.chatMessage.onlineContext);return(0,s.jsxs)("div",{className:(t=e.chatMessage,(n=[l().chatMessageContainer,"shadow-md"]).push(l()[t.by]),e.customClassName&&n.push(l()["".concat(t.by).concat(e.customClassName)]),n.join(" ")),onMouseLeave:e=>g(!1),onMouseEnter:e=>g(!0),onClick:"khoj"===e.chatMessage.by?e=>void 0:void 0,children:[(0,s.jsx)("div",{className:(a=e.chatMessage,(r=[l().chatMessageWrapper]).push(l()[a.by]),"khoj"===a.by&&r.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),r.join(" ")),children:(0,s.jsx)("div",{ref:N,className:l().chatMessage,dangerouslySetInnerHTML:{__html:p}})}),(0,s.jsx)("div",{className:l().teaserReferencesContainer,children:(0,s.jsx)(D,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:M.notesReferenceCardData,onlineReferenceCardData:M.onlineReferenceCardData})}),(0,s.jsx)("div",{className:l().chatFooter,children:(m||e.isMobileWidth||e.isLastMessage||x)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{title:(c=(o=new Date(e.chatMessage.created+"Z")).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),d=o.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," "),"".concat(c," on ").concat(d)),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),a=new Date().getTime()-t.getTime();return a<6e4?"Just now":a<36e5?"".concat(Math.round(a/6e4),"m ago"):a<864e5?"".concat(Math.round(a/36e5),"h ago"):"".concat(Math.round(a/864e5),"d ago")}(e.chatMessage.created)}),(0,s.jsxs)("div",{className:"".concat(l().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(x?j?(0,s.jsx)(I.l,{iconClassName:"p-0",className:"m-0"}):(0,s.jsx)("button",{title:"Pause Speech",onClick:e=>y(!0),children:(0,s.jsx)(W.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,s.jsx)("button",{title:"Speak",onClick:e=>k(),children:(0,s.jsx)(z.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),(0,s.jsx)("button",{title:"Copy",className:"".concat(l().copyButton),onClick:()=>{navigator.clipboard.writeText(e.chatMessage.message),u(!0)},children:h?(0,s.jsx)(G.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,s.jsx)(G.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,s.jsx)(K,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,s.jsx)(K,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})}Y.use(c(),{inline:!0,code:!0})},34531:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9178],{89178:function(e,t,a){"use strict";a.d(t,{H:function(){return Q},Z:function(){return X}});var s=a(57437),n=a(34531),l=a.n(n),r=a(14944),o=a(39952),c=a.n(o),i=a(2265);a(7395);var d=a(26100),h=a(36013),u=a(13304),m=a(12218),g=a(74697),p=a(37440);let f=u.fC,x=u.xz;u.x8;let w=u.h_,j=i.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,s.jsx)(u.aV,{className:(0,p.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...n,ref:t})});j.displayName=u.aV.displayName;let y=(0,m.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),b=i.forwardRef((e,t)=>{let{side:a="right",className:n,children:l,...r}=e;return(0,s.jsxs)(w,{children:[(0,s.jsx)(j,{}),(0,s.jsxs)(u.VY,{ref:t,className:(0,p.cn)(y({side:a}),n),...r,children:[l,(0,s.jsxs)(u.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(g.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});b.displayName=u.VY.displayName;let N=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,p.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};N.displayName="SheetHeader";let k=i.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,s.jsx)(u.Dx,{ref:t,className:(0,p.cn)("text-lg font-semibold text-foreground",a),...n})});k.displayName=u.Dx.displayName;let C=i.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,s.jsx)(u.dk,{ref:t,className:(0,p.cn)("text-sm text-muted-foreground",a),...n})});C.displayName=u.dk.displayName;var M=a(19573),v=a(11838),_=a.n(v),R=a(89417);let E=new r.Z({html:!0,linkify:!0,typographer:!0});function T(e){let t=(0,R.L)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=function(e){let t=["org","md","markdown"].includes(e.title.split(".").pop()||"")?e.content.split("\n").slice(1).join("\n"):e.content;return e.showFullContent?_().sanitize(E.render(t)):_().sanitize(t)}(e),[n,l]=(0,i.useState)(!1);return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(M.J2,{open:n&&!e.showFullContent,onOpenChange:l,children:[(0,s.jsx)(M.xo,{asChild:!0,children:(0,s.jsxs)(h.Zb,{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words text-balance rounded-lg p-2 bg-muted border-none"),children:[(0,s.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.title]}),(0,s.jsx)("p",{className:"".concat(e.showFullContent?"block":"overflow-hidden line-clamp-2"),dangerouslySetInnerHTML:{__html:a}})]})}),(0,s.jsx)(M.yk,{className:"w-[400px] mx-2",children:(0,s.jsxs)(h.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg p-2 border-none",children:[(0,s.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,s.jsx)("p",{className:"overflow-hidden line-clamp-3",dangerouslySetInnerHTML:{__html:a}})]})})]})})}function L(e){let[t,a]=(0,i.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let n="https://www.google.com/s2/favicons?domain=globe",l="unknown";try{l=new URL(e.link).hostname,n="https://www.google.com/s2/favicons?domain=".concat(l)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(M.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,s.jsx)(M.xo,{asChild:!0,children:(0,s.jsx)(h.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto":"w-[200px]"," overflow-hidden break-words rounded-lg text-balance p-2 bg-muted border-none"),children:(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline p-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("img",{src:n,alt:"",className:"!w-4 h-4 mr-2"}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground"),children:l})]}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,s.jsx)("p",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]})})})}),(0,s.jsx)(M.yk,{className:"w-[400px] mx-2",children:(0,s.jsx)(h.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline p-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("img",{src:n,alt:"",className:"!w-4 h-4 mr-2"}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground"),children:l})]}),(0,s.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,s.jsx)("p",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-3"),children:e.description})]})})})})]})})}function D(e){let[t,a]=(0,i.useState)(3);(0,i.useEffect)(()=>{a(e.isMobileWidth?1:3)},[e.isMobileWidth]);let n=e.notesReferenceCardData.slice(0,t),l=n.length<t?e.onlineReferenceCardData.slice(0,t-n.length):[],r=e.notesReferenceCardData.length>0||e.onlineReferenceCardData.length>0,o=e.notesReferenceCardData.length+e.onlineReferenceCardData.length;return 0===o?null:(0,s.jsxs)("div",{className:"pt-0 px-4 pb-4 md:px-6",children:[(0,s.jsxs)("h3",{className:"inline-flex items-center",children:["References",(0,s.jsxs)("p",{className:"text-gray-400 m-2",children:[o," sources"]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[n.map((e,t)=>(0,i.createElement)(T,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),l.map((e,t)=>(0,i.createElement)(L,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),r&&(0,s.jsx)(F,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData})]})]})}function F(e){return e.notesReferenceCardData||e.onlineReferenceCardData?(0,s.jsxs)(f,{children:[(0,s.jsxs)(x,{className:"text-balance w-auto md:w-[200px] justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center !m-2 inline-flex",children:["View references",(0,s.jsx)(d.o,{className:"m-1"})]}),(0,s.jsxs)(b,{className:"overflow-y-scroll",children:[(0,s.jsxs)(N,{children:[(0,s.jsx)(k,{children:"References"}),(0,s.jsx)(C,{children:"View all references for this response"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.notesReferenceCardData.map((e,t)=>(0,i.createElement)(T,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,i.createElement)(L,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]}):null}var S=a(34149),B=a(29386),H=a(31784),O=a(60665),A=a(96006),Z=a(18444),q=a(35304),$=a(8589),P=a(63205),W=a(92880),z=a(48408),G=a(67722),I=a(58485),U=a(58575),V=a(25800);let Y=new r.Z({html:!0,linkify:!0,typographer:!0});function J(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function K(e){let{uquery:t,kquery:a}=e,[n,r]=(0,i.useState)(null);return(0,i.useEffect)(()=>{null!==n&&setTimeout(()=>{r(null)},2e3)},[n]),(0,s.jsxs)("div",{className:"".concat(l().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,s.jsx)("button",{title:"Like",className:l().thumbsUpButton,disabled:null!==n,onClick:()=>{J(t,a,"positive"),r(!0)},children:!0===n?(0,s.jsx)(S.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,s.jsx)(S.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,s.jsx)("button",{title:"Dislike",className:l().thumbsDownButton,disabled:null!==n,onClick:()=>{J(t,a,"negative"),r(!1)},children:!1===n?(0,s.jsx)(B.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,s.jsx)(B.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function Q(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),n="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,s.jsx)(H.a,{className:"".concat(n)}):a.includes("generating")?(0,s.jsx)(O.Z,{className:"".concat(n)}):a.includes("data sources")||a.includes("notes")?(0,s.jsx)(A.g,{className:"".concat(n)}):a.includes("read")?(0,s.jsx)(Z.f,{className:"".concat(n)}):a.includes("search")?(0,s.jsx)(q.Y,{className:"".concat(n)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,s.jsx)($.u,{className:"".concat(n)}):a.includes("paint")?(0,s.jsx)(P.Y,{className:"".concat(n)}):(0,s.jsx)(H.a,{className:"".concat(n)})}(t?t[1]:"",e.primary?(0,U.oz)(e.agentColor):"text-gray-500"),n=_().sanitize(Y.render(e.message));return(0,s.jsxs)("div",{className:"".concat(l().trainOfThoughtElement," items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(l().trainOfThought," ").concat(e.primary?l().primary:""),children:[a,(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:n}})]})}function X(e){var t,a;let n,r,o,c,d;let[h,u]=(0,i.useState)(!1),[m,g]=(0,i.useState)(!1),[p,f]=(0,i.useState)(""),[x,w]=(0,i.useState)(!1),[j,y]=(0,i.useState)(!1),b=(0,i.useRef)(!1),N=(0,i.useRef)(null);if((0,i.useEffect)(()=>{b.current=j},[j]),(0,i.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(N.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,V.Z)(N.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1}]})});return N.current&&e.observe(N.current,{childList:!0}),()=>e.disconnect()},[N.current]),(0,i.useEffect)(()=>{var t;let a=e.chatMessage.message;a=a.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),e.chatMessage.intent&&"text-to-image"==e.chatMessage.intent.type?a=""):e.chatMessage.intent&&"text-to-image2"==e.chatMessage.intent.type?a=""):e.chatMessage.intent&&"text-to-image-v3"==e.chatMessage.intent.type&&(a="")),e.chatMessage.intent&&e.chatMessage.intent.type.includes("text-to-image")&&(null===(t=e.chatMessage.intent["inferred-queries"])||void 0===t?void 0:t.length)>0&&(a+="\n\n**Inferred Query**\n\n".concat(e.chatMessage.intent["inferred-queries"][0]));let s=Y.render(a);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),f(_().sanitize(s))},[e.chatMessage.message,e.chatMessage.intent]),(0,i.useEffect)(()=>{h&&setTimeout(()=>{u(!1)},2e3)},[h]),(0,i.useEffect)(()=>{N.current&&(N.current.querySelectorAll("pre > .hljs").forEach(e=>{let t=document.createElement("button"),a=document.createElement("img");a.src="/static/copy-button.svg",a.alt="Copy",a.width=24,a.height=24,t.appendChild(a),t.className="hljs ".concat(l().codeCopyButton),t.addEventListener("click",()=>{let t=e.textContent||"";t=(t=(t=t.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(t),a.src="/static/copy-button-success.svg"}),e.prepend(t)}),(0,V.Z)(N.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1}]}))},[p,m,N]),!e.chatMessage.message)return null;async function k(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;w(!0);let a=C(t[0]);for(let e=0;e<t.length&&!b.current;e++){let s=a;e<t.length-1&&(a=C(t[e+1]));try{let e=await s,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let s=new Audio(e);s.onended=t,s.onerror=a,s.play()})}(t)}catch(e){console.error("Error:",e);break}}w(!1),y(!1)}async function C(e){let t=await fetch("/api/chat/speech?text=".concat(encodeURIComponent(e)),{method:"POST",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Network response was not ok");return await t.blob()}let M=function(e,t){let a=[],s=[];if(t){let e=[];for(let[a,s]of Object.entries(t)){if(s.answerBox&&e.push({title:s.answerBox.title,description:s.answerBox.answer,link:s.answerBox.source}),s.knowledgeGraph&&e.push({title:s.knowledgeGraph.title,description:s.knowledgeGraph.description,link:s.knowledgeGraph.descriptionLink}),s.webpages){if(s.webpages instanceof Array){let t=s.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=s.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(s.organic){let t=s.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}a.push(...e)}if(e){let t=e.map(e=>e.compiled?{title:e.file,content:e.compiled}:{title:e.split("\n")[0],content:e.split("\n").slice(1).join("\n")});s.push(...t)}return{notesReferenceCardData:s,onlineReferenceCardData:a}}(e.chatMessage.context,e.chatMessage.onlineContext);return(0,s.jsxs)("div",{className:(t=e.chatMessage,(n=[l().chatMessageContainer,"shadow-md"]).push(l()[t.by]),e.customClassName&&n.push(l()["".concat(t.by).concat(e.customClassName)]),n.join(" ")),onMouseLeave:e=>g(!1),onMouseEnter:e=>g(!0),onClick:"khoj"===e.chatMessage.by?e=>void 0:void 0,children:[(0,s.jsx)("div",{className:(a=e.chatMessage,(r=[l().chatMessageWrapper]).push(l()[a.by]),"khoj"===a.by&&r.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),r.join(" ")),children:(0,s.jsx)("div",{ref:N,className:l().chatMessage,dangerouslySetInnerHTML:{__html:p}})}),(0,s.jsx)("div",{className:l().teaserReferencesContainer,children:(0,s.jsx)(D,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:M.notesReferenceCardData,onlineReferenceCardData:M.onlineReferenceCardData})}),(0,s.jsx)("div",{className:l().chatFooter,children:(m||e.isMobileWidth||e.isLastMessage||x)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{title:(c=(o=new Date(e.chatMessage.created+"Z")).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),d=o.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," "),"".concat(c," on ").concat(d)),className:"text-gray-400 relative top-0 left-4",children:function(e){e.endsWith("Z")||(e+="Z");let t=new Date(e),a=new Date().getTime()-t.getTime();return a<6e4?"Just now":a<36e5?"".concat(Math.round(a/6e4),"m ago"):a<864e5?"".concat(Math.round(a/36e5),"h ago"):"".concat(Math.round(a/864e5),"d ago")}(e.chatMessage.created)}),(0,s.jsxs)("div",{className:"".concat(l().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(x?j?(0,s.jsx)(I.l,{iconClassName:"p-0",className:"m-0"}):(0,s.jsx)("button",{title:"Pause Speech",onClick:e=>y(!0),children:(0,s.jsx)(W.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,s.jsx)("button",{title:"Speak",onClick:e=>k(),children:(0,s.jsx)(z.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),(0,s.jsx)("button",{title:"Copy",className:"".concat(l().copyButton),onClick:()=>{navigator.clipboard.writeText(e.chatMessage.message),u(!0)},children:h?(0,s.jsx)(G.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,s.jsx)(G.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,s.jsx)(K,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,s.jsx)(K,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})}Y.use(c(),{inline:!0,code:!0})},34531:function(e){e.exports={chatMessageContainer:"chatMessage_chatMessageContainer__sAivf",chatMessageWrapper:"chatMessage_chatMessageWrapper__u5m8A",khojfullHistory:"chatMessage_khojfullHistory__NPu2l",youfullHistory:"chatMessage_youfullHistory__ioyfH",you:"chatMessage_you__6GUC4",khoj:"chatMessage_khoj__cjWON",khojChatMessage:"chatMessage_khojChatMessage__BabQz",author:"chatMessage_author__muRtC",chatFooter:"chatMessage_chatFooter__0vR8s",chatButtons:"chatMessage_chatButtons__Lbk8T",codeCopyButton:"chatMessage_codeCopyButton__Y_Ujv",feedbackButtons:"chatMessage_feedbackButtons___Brdy",copyButton:"chatMessage_copyButton__jd7q7",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}}}]);
|
khoj-1.20.5.dev18/src/khoj/interface/compiled/_next/static/chunks/app/chat/page-c2ebc47a09abc8ae.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return x}});var n=s(57437),a=s(65104),o=s.n(a),c=s(2265),r=s(48861),i=s(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),g=s(38423),m=s(79306);function f(e){let t=(0,l.useSearchParams)().get("conversationId"),[s,a]=(0,c.useState)(""),[r,d]=(0,c.useState)(!1),[u,h]=(0,c.useState)(null),m=e.setQueryToProcess,f=e.onConversationIdChange;if((0,c.useEffect)(()=>{let e=localStorage.getItem("message");e&&(d(!0),m(e))},[m]),(0,c.useEffect)(()=>{s&&(d(!0),m(s))},[s,m]),(0,c.useEffect)(()=>{t&&(null==f||f(t))},[t,f]),(0,c.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?d(!1):a("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:o().chatBodyFull,children:(0,n.jsx)(i.Z,{conversationId:t,setTitle:e.setTitle,setAgent:h,pendingMessage:r?s:"",incomingMessages:e.streamedMessages})}),(0,n.jsx)("div",{className:"".concat(o().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl"),children:(0,n.jsx)(g.Z,{agentColor:null==u?void 0:u.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>a(e),sendDisabled:r,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]})}function x(){let e="Khoj AI - Chat",[t,s]=(0,c.useState)(null),[a,i]=(0,c.useState)(!0),[l,g]=(0,c.useState)(e),[x,p]=(0,c.useState)(null),[v,_]=(0,c.useState)([]),[y,j]=(0,c.useState)(""),[b,w]=(0,c.useState)(!1),[M,C]=(0,c.useState)([]),S=(0,h.k6)(),I=(0,m.G)(),N=(0,h.IC)();async function B(e){if(!e.ok)throw Error(e.statusText);if(!e.body)throw Error("Response body is null");let t=e.body.getReader(),s=new TextDecoder,n="␃\uD83D\uDD1A␗",a="",o=[],c={};for(;;){let e;let{done:r,value:i}=await t.read();if(r){j(""),w(!1);break}for(a+=s.decode(i,{stream:!0});-1!==(e=a.indexOf(n));){let t=a.slice(0,e);if(a=a.slice(e+n.length),t){let e=v.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:o,onlineContext:c}=(0,u.VK)(t,e,o,c)),_([...v])}}}}async function E(){if(localStorage.removeItem("message"),!y||!x)return;let e="/api/chat?q=".concat(encodeURIComponent(y),"&conversation_id=").concat(x,"&stream=true&client=web");S&&(e+="®ion=".concat(S.region,"&country=").concat(S.country,"&city=").concat(S.city,"&timezone=").concat(S.timezone));let t=await fetch(e);try{await B(t)}catch(s){console.error(s);let e=v.find(e=>!e.completed);if(!e)return;let t=s.message;e.rawResponse="Encountered Error: ".concat(t,". Please try again later."),e.completed=!0,_([...v]),j(""),w(!1)}}return((0,c.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{i(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,c.useEffect)(()=>{if(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||""};_(t=>[...t,e]),w(!0)}},[y]),(0,c.useEffect)(()=>{b&&E()},[b]),a)?(0,n.jsx)(d.Z,{}):(0,n.jsxs)("div",{className:"".concat(o().main," ").concat(o().chatLayout),children:[(0,n.jsx)("title",{children:"".concat(e).concat(l&&l!==e?": ".concat(l):"")}),(0,n.jsx)("div",{children:(0,n.jsx)(r.Z,{conversationId:x,uploadedFiles:M,isMobileWidth:N})}),(0,n.jsx)("div",{className:o().chatBox,children:(0,n.jsxs)("div",{className:o().chatBoxBody,children:[!N&&(0,n.jsx)("div",{className:"text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8",children:l&&(0,n.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden pt-6",children:l})}),(0,n.jsx)(c.Suspense,{fallback:(0,n.jsx)(d.Z,{}),children:(0,n.jsx)(f,{isLoggedIn:null!==I,streamedMessages:v,chatOptionsData:t,setTitle:g,setQueryToProcess:j,setUploadedFiles:C,isMobileWidth:N,onConversationIdChange:e=>{p(e)}})})]})})]})}},82697:function(e,t,s){"use strict";s.d(t,{Z:function(){return p}});var n=s(57437),a=s(15238),o=s.n(a),c=s(2265),r=s(89178),i=s(94880),l=s(58485),d=s(16288),u=s(26100),h=s(19666),g=s(50495),m=e=>{let{name:t,avatar:s,link:a,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(h.pn,{children:(0,n.jsxs)(h.u,{children:[(0,n.jsx)(h.aJ,{asChild:!0,children:(0,n.jsxs)(g.z,{variant:"ghost",className:"flex items-center justify-center",children:[s,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(h._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"mt-1 ml-2 block no-underline",children:(0,n.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[s,(0,n.jsxs)("div",{className:"mr-2 mt-1 flex justify-center items-center text-sm font-semibold text-gray-800",children:[t,(0,n.jsx)(u.o,{weight:"bold",className:"ml-1"})]})]})}),o&&(0,n.jsx)("p",{className:"mt-2 ml-6 text-sm text-gray-600 line-clamp-2",children:o||"A Khoj agent"})]})})]})})})},f=s(89417),x=s(69591);function p(e){let[t,s]=(0,c.useState)(null),[a,u]=(0,c.useState)(0),[h,g]=(0,c.useState)(!0),p=(0,c.useRef)(null),v=(0,c.useRef)(null),_=(0,c.useRef)(null),[y,j]=(0,c.useState)(null),[b,w]=(0,c.useState)(!1),M=(0,x.IC)();(0,c.useEffect)(()=>{a<2&&((null==t?void 0:t.chat.length)||setTimeout(()=>{C()},500))},[t,a]),(0,c.useEffect)(()=>{if(!h||b)return;let n=new IntersectionObserver(n=>{n[0].isIntersecting&&h&&(w(!0),function(n){if(!h||b)return;let a=n+1,o="";if(e.conversationId)o="/api/chat/history?client=web&conversation_id=".concat(e.conversationId,"&n=").concat(10*a);else{if(!e.publicConversationSlug)return;o="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(10*a)}fetch(o).then(e=>e.json()).then(a=>{if(e.setTitle(a.response.slug),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(a.response.chat.length===(null==t?void 0:t.chat.length)){g(!1),w(!1);return}e.setAgent(a.response.agent),s(a.response),n<2&&C(),w(!1)}else{if(a.response.agent&&a.response.conversation_id){let t={chat:[],agent:a.response.agent,conversation_id:a.response.conversation_id,slug:a.response.slug};e.setAgent(a.response.agent),s(t)}g(!1),w(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(a),u(e=>e+1))},{threshold:1});return _.current&&n.observe(_.current),()=>n.disconnect()},[h,a,b]),(0,c.useEffect)(()=>{g(!0),w(!1),u(0),s(null)},[e.conversationId]),(0,c.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&j(e.incomingMessages.length-1)}S()&&C()},[e.incomingMessages]);let C=()=>{v.current&&v.current.scrollIntoView(!1)},S=()=>{if(!v.current)return!1;let{scrollTop:e,scrollHeight:t,clientHeight:s}=v.current;return e+s>=t-25};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(i.x,{className:"h-[80vh]",children:(0,n.jsx)("div",{ref:p,children:(0,n.jsxs)("div",{className:o().chatHistory,ref:v,children:[(0,n.jsx)("div",{ref:_,style:{height:"1px"},children:b&&(0,n.jsx)(l.l,{message:"Loading Conversation",className:"opacity-50"})}),t&&t.chat&&t.chat.map((e,s)=>(0,n.jsx)(r.Z,{isMobileWidth:M,chatMessage:e,customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:s===t.chat.length-1},"".concat(s,"fullHistory"))),e.incomingMessages&&e.incomingMessages.map((e,s)=>(0,n.jsxs)(c.Fragment,{children:[(0,n.jsx)(r.Z,{isMobileWidth:M,chatMessage:{message:e.rawQuery,context:[],onlineContext:{},created:e.timestamp,by:"you",automationId:""},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500")},"".concat(s,"outgoing")),e.trainOfThought&&function(e,t,s,a){let c=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=e.length-1;return(0,n.jsxs)("div",{className:"".concat(o().trainOfThought," shadow-sm"),children:[!c&&(0,n.jsx)(l.l,{className:"float-right"}),e.map((e,a)=>(0,n.jsx)(r.H,{message:e,primary:a===i&&t&&!c,agentColor:s},"train-".concat(a)))]},a)}(e.trainOfThought,s===y,(null==t?void 0:t.agent.color)||"orange","".concat(s,"trainOfThought"),e.completed),(0,n.jsx)(r.Z,{isMobileWidth:M,chatMessage:{message:e.rawResponse,context:e.context,onlineContext:e.onlineContext,created:e.timestamp,by:"khoj",automationId:"",rawQuery:e.rawQuery},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"".concat(s,"incoming"))]},"incomingMessage".concat(s))),e.pendingMessage&&(0,n.jsx)(r.Z,{isMobileWidth:M,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},created:new Date().getTime().toString(),by:"you",automationId:""},customClassName:"fullHistory",borderLeftColor:"".concat(null==t?void 0:t.agent.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),t&&(0,n.jsx)("div",{className:"".concat(o().agentIndicator," pb-4"),children:(0,n.jsx)("div",{className:"relative group mx-2 cursor-pointer",children:(0,n.jsx)(m,{name:t&&t.agent&&t.agent.name?t.agent.name:"Agent",link:t&&t.agent&&t.agent.slug?"/agents?agent=".concat(t.agent.slug):"/agents",avatar:(0,f.T)(t.agent.icon,t.agent.color)||(0,n.jsx)(d.v,{}),description:t&&t.agent&&t.agent.persona?t.agent.persona:""})})})]})})}):null}},16463:function(e,t,s){"use strict";var n=s(71169);s.o(n,"useSearchParams")&&s.d(t,{useSearchParams:function(){return n.useSearchParams}})},65104:function(e){e.exports={main:"chat_main__8xQu5",suggestions:"chat_suggestions__m8n2t",inputBox:"chat_inputBox__LOFws",chatBodyFull:"chat_chatBodyFull__FfKEK",chatBody:"chat_chatBody__sS1LX",chatLayout:"chat_chatLayout__pR203",chatBox:"chat_chatBox__FBct_",titleBar:"chat_titleBar__R5QlK",chatBoxBody:"chat_chatBoxBody__qT_SC",agentIndicator:"chat_agentIndicator__8V55w"}},15238:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",chatLayout:"chatHistory_chatLayout__ABli_",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}}},function(e){e.O(0,[7812,9427,929,3954,9001,3062,743,7071,2614,9693,1603,9417,9178,8423,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6938],{62960:function(e,s,t){Promise.resolve().then(t.bind(t,95982))},95982:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return eh}});var a,n,r=t(57437),l=t(55268),i=t.n(l);t(80541);var o=t(2265),c=t(35657),d=t(79306),h=t(69591),u=t(19748),m=t(50495),x=t(66431),p=t(32309),f=t(37440);let j=o.forwardRef((e,s)=>{let{className:t,containerClassName:a,...n}=e;return(0,r.jsx)(x.uZ,{ref:s,containerClassName:(0,f.cn)("flex items-center gap-2 has-[:disabled]:opacity-50",a),className:(0,f.cn)("disabled:cursor-not-allowed",t),...n})});j.displayName="InputOTP";let g=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{ref:s,className:(0,f.cn)("flex items-center",t),...a})});g.displayName="InputOTPGroup";let b=o.forwardRef((e,s)=>{let{index:t,className:a,...n}=e,{char:l,hasFakeCaret:i,isActive:c}=o.useContext(x.VM).slots[t];return(0,r.jsxs)("div",{ref:s,className:(0,f.cn)("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",c&&"z-10 ring-2 ring-ring ring-offset-background",a),...n,children:[l,i&&(0,r.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});b.displayName="InputOTPSlot",o.forwardRef((e,s)=>{let{...t}=e;return(0,r.jsx)("div",{ref:s,role:"separator",...t,children:(0,r.jsx)(p.Z,{})})}).displayName="InputOTPSeparator";var N=t(83102),y=t(36013),w=t(46910);let v=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,f.cn)("w-full caption-bottom text-sm",t),...a})})});v.displayName="Table",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("thead",{ref:s,className:(0,f.cn)("[&_tr]:border-b",t),...a})}).displayName="TableHeader";let _=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tbody",{ref:s,className:(0,f.cn)("[&_tr:last-child]:border-0",t),...a})});_.displayName="TableBody",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tfoot",{ref:s,className:(0,f.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a})}).displayName="TableFooter";let k=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("tr",{ref:s,className:(0,f.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a})});k.displayName="TableRow",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("th",{ref:s,className:(0,f.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...a})}).displayName="TableHead";let S=o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("td",{ref:s,className:(0,f.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a})});S.displayName="TableCell",o.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)("caption",{ref:s,className:(0,f.cn)("mt-4 text-sm text-muted-foreground",t),...a})}).displayName="TableCaption";var C=t(42491),T=t(9950),D=t(35418),F=t(15340),E=t(84120),P=t(55362),O=t(48252),A=t(60787),I=t(26058),z=t(95616),Y=t(11961),R=t(76782),Z=t(98325),K=t(96917),M=t(10813),W=t(56194),L=t(9476),U=t(43010),V=t(72151),B=t(53876),G=t(90445),H=t(17541),J=t(63205),$=t(49806),q=t(67722),X=t(57087),Q=t(27082),ee=t(26100),es=t(48861),et=t(58485),ea=t(47947),en=t(9557),er=t(6780),el=t(70571),ei=t(87138);let eo=e=>{let{onClose:s}=e,[t,a]=(0,o.useState)([]),[n,l]=(0,o.useState)([]),[i,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,x]=(0,o.useState)(null),[p,f]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[b,N]=(0,o.useState)(0),[y,w]=(0,o.useState)([]),v=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(j||N(0),j){let e=setInterval(()=>{N(e=>{let s=e+(Math.floor(5*Math.random())+1);return s<100?s:100})},800);return()=>clearInterval(e)}},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/content/computer");if(!e.ok)throw Error("Failed to fetch files");let s=await e.json();Array.isArray(s)?a(s.toSorted()):console.error("Unexpected data format from API")}catch(e){console.error("Error fetching files:",e)}})()},[y]);let _=t.filter(e=>e.toLowerCase().includes(i.toLowerCase())),k=async()=>{let e=n.length>0?n:_;if(console.log("Delete selected files",e),0===e.length){console.log("No files to delete");return}try{if(!(await fetch("/api/content/files",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:e})})).ok)throw Error("Failed to delete files");a(s=>s.filter(s=>!e.includes(s))),l([]),console.log("Deleted files:",e)}catch(e){console.error("Error deleting files:",e)}},S=async e=>{console.log("Delete selected file",e);try{if(!(await fetch("/api/content/file?filename=".concat(encodeURIComponent(e)),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to delete file");a(s=>s.filter(s=>s!==e)),l(s=>s.filter(s=>s!==e)),console.log("Deleted file:",e)}catch(e){console.error("Error deleting file:",e)}};function O(e){(0,en.ko)(e,x,g,f,w)}return(0,r.jsxs)(C.m5,{open:!0,onOpenChange:s,children:[(0,r.jsx)(er.aR,{open:null!==u||null!=p,children:(0,r.jsxs)(er._T,{children:[(0,r.jsx)(er.fY,{children:(0,r.jsx)(er.f$,{children:"Alert"})}),(0,r.jsx)(er.yT,{children:u||p}),(0,r.jsx)(er.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{x(null),f(null),g(!1)},children:"Close"})]})}),(0,r.jsxs)("div",{className:"flex flex-col h-full",onDragOver:function(e){e.preventDefault(),h(!0)},onDragLeave:function(e){e.preventDefault(),h(!1)},onDrop:function(e){e.preventDefault(),h(!1),e.dataTransfer.files&&O(e.dataTransfer.files)},onClick:function(){v&&v.current&&v.current.click()},children:[(0,r.jsx)("input",{type:"file",multiple:!0,ref:v,style:{display:"none"},onChange:function(e){e.target.files&&O(e.target.files)}}),(0,r.jsxs)("div",{className:"flex-none p-4",children:["Upload files",j&&(0,r.jsx)(el.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:b})]}),(0,r.jsx)("div",{className:"flex-none p-4 bg-secondary border-b ".concat(d?"animate-pulse":""),children:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-32 border-2 border-dashed border-gray-300 rounded-lg",children:d?(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(T.u,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drop files to upload"})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,r.jsx)(D.v,{className:"h-6 w-6 mr-2"}),(0,r.jsx)("span",{children:"Drag and drop files here"})]})})})]}),(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex-none p-4",children:"Synced files"}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-b",children:(0,r.jsx)(C.sZ,{placeholder:"Find synced files",value:i,onValueChange:c})}),(0,r.jsx)("div",{className:"flex-grow overflow-auto",children:(0,r.jsxs)(C.e8,{children:[(0,r.jsx)(C.rb,{children:0===t.length?(0,r.jsxs)("div",{className:"flex items-center justify-center",children:[(0,r.jsx)(F.C,{className:"h-4 w-4 mr-2",weight:"bold"}),"No files synced"]}):(0,r.jsxs)("div",{children:["Could not find a good match.",(0,r.jsx)(ei.default,{href:"/search",className:"block",children:"Need advanced search? Click here."})]})}),(0,r.jsx)(C.fu,{heading:"Synced files",children:_.map(e=>(0,r.jsx)(C.di,{value:e,onSelect:e=>{l(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},children:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(n.includes(e)?"font-semibold":""),children:[n.includes(e)&&(0,r.jsx)(E.J,{className:"h-4 w-4 mr-2"}),(0,r.jsx)("span",{className:"break-all",children:e})]}),(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>S(e),className:"ml-auto",children:(0,r.jsx)(P.r,{className:"h-4 w-4"})})]})},e))})]})}),(0,r.jsx)("div",{className:"flex-none p-4 bg-background border-t",children:(0,r.jsx)("div",{className:"flex justify-between",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:k,className:"mr-2",children:[(0,r.jsx)(P.r,{className:"h-4 w-4 mr-2"}),n.length>0?"Delete Selected (".concat(n.length,")"):"Delete All"]})})})]})]})},ec=e=>{var s,t;let{items:a,selected:n,callbackFunc:l}=e,[i,c]=(0,o.useState)(null!==(t=null==n?void 0:n.toString())&&void 0!==t?t:"0");return!!n&&(0,r.jsx)("div",{className:"overflow-hidden shadow-md rounded-lg",children:(0,r.jsxs)(w.h_,{children:[(0,r.jsx)(w.$F,{asChild:!0,className:"w-full rounded-lg",children:(0,r.jsxs)(m.z,{variant:"outline",className:"justify-start py-6 rounded-lg",children:[null===(s=a.find(e=>e.id.toString()===i))||void 0===s?void 0:s.name," ",(0,r.jsx)(O.p,{className:"h-4 w-4 ml-auto text-muted-foreground"})]})}),(0,r.jsx)(w.AW,{children:(0,r.jsx)(w._x,{value:i,onValueChange:async e=>{c(e),await l(e)},children:a.map(e=>(0,r.jsx)(w.qB,{value:e.id.toString(),children:e.name},e.id.toString()))})})]})})},ed=()=>{let[e,s]=(0,o.useState)([]),{toast:t}=(0,c.pm)(),a=async()=>{try{let e=await fetch("/auth/token",{method:"POST",headers:{"Content-Type":"application/json"}}),t=await e.json();s(e=>[...e,t])}catch(e){console.error("Error generating API key:",e)}},n=async e=>{try{await navigator.clipboard.writeText(e),t({title:"\uD83D\uDD11 API Key",description:"Copied to clipboard"})}catch(e){console.error("Error copying API key:",e)}},r=async e=>{try{(await fetch("/auth/token?token=".concat(e),{method:"DELETE"})).ok&&s(s=>s.filter(s=>s.token!==e))}catch(e){console.error("Error deleting API key:",e)}},l=async()=>{try{let e=await fetch("/auth/token"),t=await e.json();(null==t?void 0:t.length)>0&&s(t)}catch(e){console.error("Error listing API keys:",e)}};return(0,o.useEffect)(()=>{l()},[]),{apiKeys:e,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:r}};function eh(){let[e,s]=(0,o.useState)("Settings"),{apiKeys:t,generateAPIKey:a,copyAPIKey:n,deleteAPIKey:l}=ed(),{userConfig:x}=(0,d.h)(!0),[p,f]=(0,o.useState)(null),[w,C]=(0,o.useState)(void 0),[E,O]=(0,o.useState)(null),[en,er]=(0,o.useState)(void 0),[el,ei]=(0,o.useState)(""),[eh,eu]=(0,o.useState)("verified"),[em,ex]=(0,o.useState)(!1),{toast:ep}=(0,c.pm)(),ef=(0,h.IC)(),ej="w-full lg:w-1/3 grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950";(0,o.useEffect)(()=>{var e;f(x),er(null==x?void 0:x.phone_number),eu((null==x?void 0:x.is_phone_number_verified)?"verified":(null==x?void 0:x.phone_number)?"otp":"setup"),C(null==x?void 0:x.given_name),O(null!==(e=null==x?void 0:x.notion_token)&&void 0!==e?e:null)},[x]);let eg=async()=>{try{if(!(await fetch("/api/phone?phone_number=".concat(en),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to send OTP");eu("verify")}catch(e){console.error("Error sending OTP:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to send OTP. Try again or contact us at team@khoj.dev"})}},eb=async()=>{try{if(!(await fetch("/api/phone/verify?code=".concat(el),{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to verify OTP");eu("verified"),ep({title:"\uD83D\uDCF1 Phone",description:"Phone number verified"})}catch(e){console.error("Error verifying OTP:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to verify OTP. Try again or contact us at team@khoj.dev"})}},eN=async()=>{try{if(!(await fetch("/api/phone",{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect phone number");er(void 0),eu("setup"),ep({title:"\uD83D\uDCF1 Phone",description:"Phone number disconnected"})}catch(e){console.error("Error disconnecting phone number:",e),ep({title:"\uD83D\uDCF1 Phone",description:"Failed to disconnect phone number. Try again or contact us at team@khoj.dev"})}},ey=async e=>{try{let s="/api/subscription?email=".concat(null==p?void 0:p.username,"&operation=").concat(e);if(!(await fetch(s,{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to change subscription");p&&(p.subscription_state="cancel"===e?"unsubscribed":"subscribed",f(p)),ep({title:"\uD83D\uDCB3 Subscription",description:(null==p?void 0:p.subscription_state)==="unsubscribed"?"Your subscription was cancelled":"Your Futurist subscription has been renewed"})}catch(s){console.error("Error changing subscription:",s),ep({title:"\uD83D\uDCB3 Subscription",description:"cancel"===e?"Failed to cancel subscription. Try again or contact us at team@khoj.dev":"Failed to renew subscription. Try again or contact us at team@khoj.dev"})}},ew=async()=>{if(w)try{if(!(await fetch("/api/user/name?name=".concat(w),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update name");p&&(p.given_name=w,f(p)),ep({title:"✅ Updated Profile",description:"You name has been updated to ".concat(w)})}catch(e){console.error("Error updating name:",e),ep({title:"⚠️ Failed to Update Profile",description:"Failed to update name. Try again or contact team@khoj.dev"})}},ev=e=>async s=>{if(!(null==p?void 0:p.is_active)&&"search"!==e){ep({title:"Model Update",description:"You need to be subscribed to update ".concat(e," models"),variant:"destructive"});return}try{if(!(await fetch("/api/model/".concat(e,"?id=")+s,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to update model");ep({title:"✅ Updated ".concat((0,h.LF)(e)," Model")})}catch(s){console.error("Failed to update ".concat(e," model:"),s),ep({description:"❌ Failed to update ".concat((0,h.LF)(e)," model. Try again."),variant:"destructive"})}},e_=async()=>{if(E)try{if(!(await fetch("/api/content/notion",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:E})})).ok)throw Error("Failed to save Notion API key");p&&(p.notion_token=E,f(p)),ep({title:"✅ Saved Notion Settings",description:"You Notion API key has been saved."})}catch(e){console.error("Error updating name:",e),ep({title:"⚠️ Failed to Save Notion Settings",description:"Failed to save Notion API key. Try again or contact team@khoj.dev"})}},ek=async e=>{try{if(!(await fetch("/api/content?t=".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to sync content from ".concat(e));ep({title:"\uD83D\uDD04 Syncing ".concat(e),description:"Your ".concat(e," content is being synced.")})}catch(s){console.error("Error syncing content:",s),ep({title:"⚠️ Failed to Sync ".concat(e),description:"Failed to sync ".concat(e," content. Try again or contact team@khoj.dev")})}},eS=async e=>{try{if(!(await fetch("/api/content/".concat(e),{method:"DELETE",headers:{"Content-Type":"application/json"}})).ok)throw Error("Failed to disconnect ".concat(e));p&&("computer"===e?p.enabled_content_source.computer=!1:"notion"===e?(p.enabled_content_source.notion=!1,p.notion_token=null,O(p.notion_token)):"github"===e&&(p.enabled_content_source.github=!1),f(p)),"computer"===e?ep({title:"✅ Deleted Synced Files",description:"Your synced documents have been deleted."}):ep({title:"✅ Disconnected ".concat(e),description:"Your ".concat(e," integration to Khoj has been disconnected.")})}catch(s){console.error("Error disconnecting ".concat(e,":"),s),ep({title:"⚠️ Failed to Disconnect ".concat(e),description:"Failed to disconnect from ".concat(e,". Try again or contact team@khoj.dev")})}};return p?(0,r.jsxs)("div",{className:i().page,children:[(0,r.jsx)("title",{children:e}),(0,r.jsx)("div",{className:i().sidePanel,children:(0,r.jsx)(es.Z,{conversationId:null,uploadedFiles:[],isMobileWidth:ef})}),(0,r.jsx)("div",{className:i().content,children:(0,r.jsx)("div",{className:"".concat(i().contentBody," mx-10 my-2"),children:(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)(et.Z,{}),children:(0,r.jsxs)("div",{id:"content",className:"grid grid-flow-column sm:grid-flow-row gap-16 m-8",children:[(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Profile"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(A.Y,{className:"h-7 w-7 mr-2"}),"Name"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden",children:[(0,r.jsx)("p",{className:"pb-4 text-gray-400",children:"What should Khoj refer to you as?"}),(0,r.jsx)(N.I,{type:"text",onChange:e=>C(e.target.value),value:w,className:"w-full border border-gray-300 rounded-lg p-4 py-6"})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:ew,disabled:w===p.given_name,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-2"}),"Save"]})})]}),(0,r.jsxs)(y.Zb,{id:"subscription",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(z.a,{className:"h-7 w-7 mr-2"}),"Subscription"]}),(0,r.jsxs)(y.aY,{className:"grid gap-2 overflow-hidden",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Current Plan"}),"trial"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist (Trial)"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["You are on a 14 day trial of the Khoj Futurist plan. Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})||"subscribed"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl text-primary/80",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"renews"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})]})||"unsubscribed"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Futurist"}),(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"ends"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})]})||"expired"===p.subscription_state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-xl",children:"Free Plan"}),p.subscription_renewal_date&&(0,r.jsxs)("p",{className:"text-gray-400",children:["Subscription ",(0,r.jsx)("b",{children:"expired"})," on"," ",(0,r.jsx)("b",{children:p.subscription_renewal_date})]})||(0,r.jsxs)("p",{className:"text-gray-400",children:["Check"," ",(0,r.jsx)("a",{href:"https://khoj.dev/pricing",target:"_blank",children:"pricing page"})," ","to compare plans."]})]})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:"subscribed"==p.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"hover:text-red-400",onClick:()=>ey("cancel"),children:[(0,r.jsx)(Y.b,{className:"h-5 w-5 mr-2"}),"Unsubscribe"]})||"unsubscribed"==p.subscription_state&&(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>ey("resubscribe"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Resubscribe"]})||(0,r.jsxs)(m.z,{variant:"outline",className:"text-primary/80 hover:text-primary",onClick:()=>window.open("".concat(p.khoj_cloud_subscription_url,"?prefilled_email=").concat(p.username),"_blank","noopener,noreferrer"),children:[(0,r.jsx)(R.e,{weight:"bold",className:"h-5 w-5 mr-2"}),"Subscribe"]})})]})]})]}),em&&(0,r.jsx)(eo,{onClose:()=>ex(!1)}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Content"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[(0,r.jsxs)(y.Zb,{id:"computer",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(Z.I,{className:"h-8 w-8 mr-2"}),"Files",p.enabled_content_source.computer&&(0,r.jsx)(K.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsx)(y.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Manage your synced files"}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",onClick:()=>ex(!0),children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.enabled_content_source.computer||"hidden"),onClick:()=>eS("computer"),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(y.Zb,{id:"github",className:"".concat(ej," hidden"),children:[(0,r.jsxs)(y.Ol,{className:"flex flex-row text-2xl",children:[(0,r.jsx)(L.b,{className:"h-8 w-8 mr-2"}),"Github"]}),(0,r.jsx)(y.aY,{className:"overflow-hidden pb-12 text-gray-400",children:"Set Github repositories to index"}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[(0,r.jsx)(m.z,{variant:"outline",size:"sm",children:p.enabled_content_source.github&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.h,{className:"h-5 w-5 inline mr-1"}),"Manage"]})||(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]})}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.enabled_content_source.github||"hidden"),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 inline mr-1"}),"Disable"]})]})]}),(0,r.jsxs)(y.Zb,{id:"notion",className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(V.F,{className:"h-7 w-7 mr-2"}),"Notion",p.enabled_content_source.notion&&(0,r.jsx)(K.f,{className:"h-6 w-6 ml-auto text-green-500",weight:"fill"})]}),(0,r.jsxs)(y.aY,{className:"grid gap-4",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Sync your Notion workspace."}),!p.notion_oauth_url&&(0,r.jsx)(N.I,{onChange:e=>O(e.target.value),value:E||"",placeholder:"Enter API Key of your Khoj integration on Notion",className:"w-full border border-gray-300 rounded-lg px-4 py-6"})]}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:[p.notion_oauth_url&&!p.enabled_content_source.notion?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>{window.open(p.notion_oauth_url)},children:[(0,r.jsx)(U.F,{className:"h-5 w-5 inline mr-1"}),"Connect"]}):p.enabled_content_source.notion&&E===p.notion_token?(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:()=>ek("notion"),children:[(0,r.jsx)(B.t,{className:"h-5 w-5 inline mr-1"}),"Sync"]}):p.notion_oauth_url?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)(m.z,{variant:"outline",size:"sm",onClick:e_,disabled:E===p.notion_token,children:[(0,r.jsx)(I.B,{className:"h-5 w-5 inline mr-1"}),p.enabled_content_source.notion&&"Update API Key"||"Set API Key"]}),(0,r.jsxs)(m.z,{variant:"outline",size:"sm",className:"".concat(p.notion_token||"hidden"),onClick:()=>eS("notion"),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 inline mr-1"}),"Disconnect"]})]})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{className:"text-2xl",children:"Models"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-16",children:[p.chat_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(G.G,{className:"h-7 w-7 mr-2"}),"Chat"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the chat model to generate text responses"}),(0,r.jsx)(ec,{items:p.chat_model_options,selected:p.selected_chat_model_config,callbackFunc:ev("chat")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),p.search_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(H.r,{className:"h-7 w-7 mr-2"}),"Search"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the search model to find your documents"}),(0,r.jsx)(ec,{items:p.search_model_options,selected:p.selected_search_model_config,callbackFunc:ev("search")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4"})]}),p.paint_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(J.Y,{className:"h-7 w-7 mr-2"}),"Paint"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the paint model to generate image responses"}),(0,r.jsx)(ec,{items:p.paint_model_options,selected:p.selected_paint_model_config,callbackFunc:ev("paint")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]}),p.voice_model_options.length>0&&(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(T.u,{className:"h-7 w-7 mr-2"}),"Voice"]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden pb-12 grid gap-8 h-fit",children:[(0,r.jsx)("p",{className:"text-gray-400",children:"Pick the voice model to generate speech responses"}),(0,r.jsx)(ec,{items:p.voice_model_options,selected:p.selected_voice_model_config,callbackFunc:ev("voice")})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4",children:!p.is_active&&(0,r.jsx)("p",{className:"text-gray-400",children:"Subscribe to switch model"})})]})]})]}),(0,r.jsxs)("div",{className:"section grid gap-8",children:[(0,r.jsx)("div",{id:"clients",className:"text-2xl",children:"Clients"}),(0,r.jsxs)("div",{className:"cards flex flex-wrap gap-8",children:[!p.anonymous_mode&&(0,r.jsxs)(y.Zb,{className:"grid grid-flow-column border border-gray-300 shadow-md rounded-lg bg-gradient-to-b from-background to-gray-50 dark:to-gray-950",children:[(0,r.jsxs)(y.Ol,{className:"text-xl grid grid-flow-col grid-cols-[1fr_auto] pb-0",children:[(0,r.jsxs)("span",{className:"flex flex-wrap",children:[(0,r.jsx)($.s,{className:"h-7 w-7 mr-2"}),"API Keys"]}),(0,r.jsxs)(m.z,{variant:"secondary",className:"!mt-0",onClick:a,children:[(0,r.jsx)(D.v,{weight:"bold",className:"h-5 w-5 mr-2"}),"Generate Key"]})]}),(0,r.jsxs)(y.aY,{className:"overflow-hidden grid gap-6",children:[(0,r.jsxs)("p",{className:"text-md text-gray-400",children:["Access Khoj from the"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Desktop",target:"_blank",children:"Desktop"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Obsidian",children:"Obsidian"}),","," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/Emacs",children:"Emacs"})," ","apps and more."]}),(0,r.jsx)(v,{children:(0,r.jsx)(_,{children:t.map(e=>(0,r.jsxs)(k,{children:[(0,r.jsx)(S,{className:"pl-0 py-3",children:e.name}),(0,r.jsxs)(S,{className:"grid grid-flow-col grid-cols-[1fr_auto] bg-secondary rounded-xl p-3 m-1",children:[(0,r.jsx)("span",{children:"".concat(e.token.slice(0,6),"...").concat(e.token.slice(-4))}),(0,r.jsxs)("div",{className:"grid grid-flow-col",children:[(0,r.jsx)(q.C,{weight:"bold",className:"h-4 w-4 mr-2 hover:bg-primary/40",onClick:()=>{ep({title:"\uD83D\uDD11 Copied API Key: ".concat(e.name),description:"Set this API key in the Khoj apps you want to connect to this Khoj account"}),n(e.token)}}),(0,r.jsx)(P.r,{weight:"bold",className:"h-4 w-4 mr-2 md:ml-4 text-red-400 hover:bg-primary/40",onClick:()=>{ep({title:"\uD83D\uDD11 Deleted API Key: ".concat(e.name),description:"Apps using this API key will no longer connect to this Khoj account"}),l(e.token)}})]})]})]},e.token))})})]}),(0,r.jsx)(y.eW,{className:"flex flex-wrap gap-4"})]}),(0,r.jsxs)(y.Zb,{className:ej,children:[(0,r.jsxs)(y.Ol,{className:"text-xl flex flex-row",children:[(0,r.jsx)(X.V,{className:"h-7 w-7 mr-2"}),"Chat on Whatsapp","verified"===eh&&(0,r.jsx)(K.f,{weight:"bold",className:"h-4 w-4 ml-1 text-green-400"})||"setup"!==eh&&(0,r.jsx)(F.C,{weight:"bold",className:"h-4 w-4 ml-1 text-yellow-400"})]}),(0,r.jsxs)(y.aY,{className:"grid gap-4",children:[(0,r.jsxs)("p",{className:"text-gray-400",children:["Connect your number to chat with Khoj on WhatsApp. Learn more about the integration"," ",(0,r.jsx)("a",{href:"https://docs.khoj.dev/clients/whatsapp",children:"here"}),"."]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(ea.Z,{initialValue:en||"",onChangeNumber:er,disabled:"verify"===eh,initOptions:{separateDialCode:!0,initialCountry:"af",utilsScript:"https://assets.khoj.dev/intl-tel-input%4023.8.0_build_js_utils.js",containerClass:"".concat(i().phoneInput)}}),"verify"===eh&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Enter the OTP sent to your number: ".concat(en)}),(0,r.jsx)(j,{autoFocus:!0,maxLength:6,value:el||"",onChange:ei,onComplete:()=>eu("verify"),children:(0,r.jsxs)(g,{children:[(0,r.jsx)(b,{index:0}),(0,r.jsx)(b,{index:1}),(0,r.jsx)(b,{index:2}),(0,r.jsx)(b,{index:3}),(0,r.jsx)(b,{index:4}),(0,r.jsx)(b,{index:5})]})})]})]})]}),(0,r.jsxs)(y.eW,{className:"flex flex-wrap gap-4",children:["verify"===eh&&(0,r.jsx)(m.z,{variant:"outline",onClick:eb,children:"Verify"})||(0,r.jsx)(m.z,{variant:"outline",disabled:!en||en===p.phone_number&&"verified"===eh||!(0,u.y)(en),onClick:eg,children:p.phone_number?en&&(en!==p.phone_number||"verified"!==eh)&&(0,u.y)(en)?(0,r.jsxs)(r.Fragment,{children:["Send OTP"," ",(0,r.jsx)(ee.o,{className:"inline ml-2",weight:"bold"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Q.F,{className:"inline mr-2 text-green-400"}),"Switch Number"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U.F,{className:"inline mr-2"}),"Setup Whatsapp"]})}),"verified"===eh&&(0,r.jsxs)(m.z,{variant:"outline",onClick:()=>eN(),children:[(0,r.jsx)(W.u,{className:"h-5 w-5 mr-2"}),"Disconnect"]})]})]})]})]})]})})})})]}):(0,r.jsx)(et.Z,{})}(a=n||(n={})).Setup="setup",a.SendOTP="otp",a.VerifyOTP="verify",a.Verified="verified"},70571:function(e,s,t){"use strict";t.d(s,{E:function(){return i}});var a=t(57437),n=t(2265),r=t(52431),l=t(37440);let i=n.forwardRef((e,s)=>{let{className:t,value:n,indicatorColor:i,...o}=e;return(0,a.jsx)(r.fC,{ref:s,className:(0,l.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...o,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(i),style:{transform:"translateX(-".concat(100-(n||0),"%)")}})})});i.displayName=r.fC.displayName},35657:function(e,s,t){"use strict";t.d(s,{pm:function(){return u}});var a=t(2265);let n=0,r=new Map,l=e=>{if(r.has(e))return;let s=setTimeout(()=>{r.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);r.set(e,s)},i=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===s.toast.id?{...e,...s.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=s;return t?l(t):e.toasts.forEach(e=>{l(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===s.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==s.toastId)}}},o=[],c={toasts:[]};function d(e){c=i(c,e),o.forEach(e=>{e(c)})}function h(e){let{...s}=e,t=(n=(n+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:t});return d({type:"ADD_TOAST",toast:{...s,id:t,open:!0,onOpenChange:e=>{e||a()}}}),{id:t,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function u(){let[e,s]=a.useState(c);return a.useEffect(()=>(o.push(s),()=>{let e=o.indexOf(s);e>-1&&o.splice(e,1)}),[e]),{...e,toast:h,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},55268:function(e){e.exports={page:"settings_page__mP7qk",contentBody:"settings_contentBody__uZjue",phoneInput:"settings_phoneInput__j6xJN",sidePanel:"settings_sidePanel__osdez"}}},function(e){e.O(0,[4229,9427,9001,3062,3678,1603,2971,7023,1744],function(){return e(e.s=62960)}),_N_E=e.O()}]);
|