khoj 2.0.0b13.dev19__py3-none-any.whl → 2.0.0b14.dev7__py3-none-any.whl

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.
Files changed (61) hide show
  1. khoj/interface/compiled/404/index.html +2 -2
  2. khoj/interface/compiled/_next/static/chunks/{2327-fe87dd989d71d0eb.js → 2327-438aaec1657c5ada.js} +1 -1
  3. khoj/interface/compiled/_next/static/chunks/{3260-43d3019b92c315bb.js → 3260-82d2521fab032ff1.js} +1 -1
  4. khoj/interface/compiled/_next/static/chunks/7127-9273a602fbda737e.js +1 -0
  5. khoj/interface/compiled/_next/static/chunks/app/agents/layout-0114c87d7ccf6d9b.js +1 -0
  6. khoj/interface/compiled/_next/static/chunks/app/agents/{page-e291b49977f43880.js → page-f04757fab73908a4.js} +1 -1
  7. khoj/interface/compiled/_next/static/chunks/app/automations/layout-8639ff99d6c2fec6.js +1 -0
  8. khoj/interface/compiled/_next/static/chunks/app/automations/{page-198b26df6e09bbb0.js → page-fb0e9353e86acd25.js} +1 -1
  9. khoj/interface/compiled/_next/static/chunks/app/chat/layout-2ff3e18a6feae92a.js +1 -0
  10. khoj/interface/compiled/_next/static/chunks/app/chat/page-fd693f65831a2f97.js +1 -0
  11. khoj/interface/compiled/_next/static/chunks/app/{page-1567cac7b79a7c59.js → page-89f5654035b07c00.js} +1 -1
  12. khoj/interface/compiled/_next/static/chunks/app/search/layout-78dd7cdd97510485.js +1 -0
  13. khoj/interface/compiled/_next/static/chunks/app/search/{page-3639e50ec3e9acfd.js → page-6ca71d3d56fc6935.js} +1 -1
  14. khoj/interface/compiled/_next/static/chunks/app/settings/{page-6081362437c82470.js → page-a798de3944f59629.js} +1 -1
  15. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-9781b62e39ca7785.js +1 -0
  16. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-e0dcb1762f8c8f88.js → page-07d7ff92aee0bb69.js} +1 -1
  17. khoj/interface/compiled/_next/static/chunks/{webpack-d60b0c57a6c38d0f.js → webpack-8087292aa01e8e55.js} +1 -1
  18. khoj/interface/compiled/_next/static/css/{23b26df423cd8a9c.css → a0c2fd63bb396f04.css} +1 -1
  19. khoj/interface/compiled/_next/static/css/ee66643a6a5bf71c.css +1 -0
  20. khoj/interface/compiled/_next/static/css/fbacbdfd5e7f3f0e.css +1 -0
  21. khoj/interface/compiled/agents/index.html +2 -2
  22. khoj/interface/compiled/agents/index.txt +2 -2
  23. khoj/interface/compiled/automations/index.html +2 -2
  24. khoj/interface/compiled/automations/index.txt +3 -3
  25. khoj/interface/compiled/chat/index.html +2 -2
  26. khoj/interface/compiled/chat/index.txt +5 -4
  27. khoj/interface/compiled/index.html +2 -2
  28. khoj/interface/compiled/index.txt +2 -2
  29. khoj/interface/compiled/search/index.html +2 -2
  30. khoj/interface/compiled/search/index.txt +2 -2
  31. khoj/interface/compiled/settings/index.html +2 -2
  32. khoj/interface/compiled/settings/index.txt +2 -2
  33. khoj/interface/compiled/share/chat/index.html +2 -2
  34. khoj/interface/compiled/share/chat/index.txt +2 -2
  35. khoj/processor/conversation/google/utils.py +59 -12
  36. khoj/processor/conversation/openai/gpt.py +65 -28
  37. khoj/processor/conversation/openai/utils.py +356 -24
  38. khoj/processor/conversation/prompts.py +16 -9
  39. khoj/processor/conversation/utils.py +4 -1
  40. khoj/routers/api_chat.py +5 -2
  41. khoj/routers/api_content.py +1 -1
  42. khoj/routers/helpers.py +18 -4
  43. khoj/routers/research.py +7 -5
  44. khoj/utils/constants.py +6 -0
  45. khoj/utils/helpers.py +6 -6
  46. {khoj-2.0.0b13.dev19.dist-info → khoj-2.0.0b14.dev7.dist-info}/METADATA +1 -1
  47. {khoj-2.0.0b13.dev19.dist-info → khoj-2.0.0b14.dev7.dist-info}/RECORD +52 -52
  48. khoj/interface/compiled/_next/static/chunks/7127-97b83757db125ba6.js +0 -1
  49. khoj/interface/compiled/_next/static/chunks/app/agents/layout-4e2a134ec26aa606.js +0 -1
  50. khoj/interface/compiled/_next/static/chunks/app/automations/layout-63603d2cb33279f7.js +0 -1
  51. khoj/interface/compiled/_next/static/chunks/app/chat/layout-ad4d1792ab1a4108.js +0 -1
  52. khoj/interface/compiled/_next/static/chunks/app/chat/page-9a75d7369f2a7cd2.js +0 -1
  53. khoj/interface/compiled/_next/static/chunks/app/search/layout-c02531d586972d7d.js +0 -1
  54. khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js +0 -1
  55. khoj/interface/compiled/_next/static/css/2945c4a857922f3b.css +0 -1
  56. khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +0 -1
  57. /khoj/interface/compiled/_next/static/{N-GdBSXoYe-DuObnbXVRO → suayGPC1Ee3s2bFUreGaV}/_buildManifest.js +0 -0
  58. /khoj/interface/compiled/_next/static/{N-GdBSXoYe-DuObnbXVRO → suayGPC1Ee3s2bFUreGaV}/_ssgManifest.js +0 -0
  59. {khoj-2.0.0b13.dev19.dist-info → khoj-2.0.0b14.dev7.dist-info}/WHEEL +0 -0
  60. {khoj-2.0.0b13.dev19.dist-info → khoj-2.0.0b14.dev7.dist-info}/entry_points.txt +0 -0
  61. {khoj-2.0.0b13.dev19.dist-info → khoj-2.0.0b14.dev7.dist-info}/licenses/LICENSE +0 -0
khoj/routers/api_chat.py CHANGED
@@ -786,6 +786,9 @@ async def event_generator(
786
786
  if interrupt_query == ChatEvent.END_EVENT.value:
787
787
  cancellation_event.set()
788
788
  logger.debug(f"Chat cancelled by user {user} via interrupt queue.")
789
+ elif interrupt_query == ChatEvent.INTERRUPT.value:
790
+ cancellation_event.set()
791
+ logger.debug("Chat interrupted.")
789
792
  else:
790
793
  # Pass the interrupt query to child tasks
791
794
  logger.info(f"Continuing chat with the new instruction: {interrupt_query}")
@@ -995,7 +998,7 @@ async def event_generator(
995
998
  )
996
999
  except ValueError as e:
997
1000
  logger.error(f"Error getting data sources and output format: {e}. Falling back to default.")
998
- conversation_commands = [ConversationCommand.General]
1001
+ chosen_io = {"sources": [ConversationCommand.General], "output": ConversationCommand.Text}
999
1002
 
1000
1003
  conversation_commands = chosen_io.get("sources") + [chosen_io.get("output")]
1001
1004
 
@@ -1556,7 +1559,7 @@ async def chat_ws(
1556
1559
  except WebSocketDisconnect:
1557
1560
  logger.info(f"WebSocket disconnected for user {websocket.scope['user'].object.id}")
1558
1561
  if current_task and not current_task.done():
1559
- current_task.cancel()
1562
+ interrupt_queue.put_nowait(ChatEvent.INTERRUPT.value)
1560
1563
  except Exception as e:
1561
1564
  logger.error(f"Error in websocket chat: {e}", exc_info=True)
1562
1565
  if current_task and not current_task.done():
@@ -570,7 +570,7 @@ async def indexer(
570
570
  file_data.content.decode(file_data.encoding) if file_data.encoding else file_data.content
571
571
  )
572
572
  else:
573
- logger.warning(f"Skipped indexing unsupported file type sent by {client} client: {file_data.name}")
573
+ logger.debug(f"Skipped indexing unsupported file type sent by {client} client: {file_data.name}")
574
574
 
575
575
  indexer_input = IndexerInput(
576
576
  org=index_files["org"],
khoj/routers/helpers.py CHANGED
@@ -1264,6 +1264,7 @@ async def extract_questions(
1264
1264
  location_data: LocationData = None,
1265
1265
  query_images: Optional[List[str]] = None,
1266
1266
  query_files: str = None,
1267
+ max_queries: int = 5,
1267
1268
  tracer: dict = {},
1268
1269
  ):
1269
1270
  """
@@ -1293,14 +1294,20 @@ async def extract_questions(
1293
1294
  location=location,
1294
1295
  username=username,
1295
1296
  personality_context=personality_context,
1297
+ max_queries=max_queries,
1296
1298
  )
1297
1299
 
1298
1300
  prompt = prompts.extract_questions_user_message.format(text=query, chat_history=chat_history_str)
1299
1301
 
1300
1302
  class DocumentQueries(BaseModel):
1301
- """Choose searches to run on user documents."""
1303
+ """Choose semantic search queries to run on user documents."""
1302
1304
 
1303
- queries: List[str] = Field(..., min_items=1, description="List of search queries to run on user documents.")
1305
+ queries: List[str] = Field(
1306
+ ...,
1307
+ min_length=1,
1308
+ max_length=max_queries,
1309
+ description="List of semantic search queries to run on user documents.",
1310
+ )
1304
1311
 
1305
1312
  raw_response = await send_message_to_model_wrapper(
1306
1313
  system_message=system_prompt,
@@ -2995,7 +3002,7 @@ async def grep_files(
2995
3002
  lines_after = lines_after or 0
2996
3003
 
2997
3004
  try:
2998
- regex = re.compile(regex_pattern, re.IGNORECASE)
3005
+ regex = re.compile(regex_pattern, re.IGNORECASE | re.MULTILINE)
2999
3006
  except re.error as e:
3000
3007
  yield {
3001
3008
  "query": _generate_query(0, 0, path_prefix, regex_pattern, lines_before, lines_after),
@@ -3005,7 +3012,14 @@ async def grep_files(
3005
3012
  return
3006
3013
 
3007
3014
  try:
3008
- file_matches = await FileObjectAdapters.aget_file_objects_by_regex(user, regex_pattern, path_prefix)
3015
+ # Make db pushdown filters more permissive by removing line anchors
3016
+ # The precise line-anchored matching will be done in Python stage
3017
+ db_pattern = regex_pattern
3018
+ db_pattern = re.sub(r"\(\?\w*\)", "", db_pattern) # Remove inline flags like (?i), (?m), (?im)
3019
+ db_pattern = re.sub(r"^\^", "", db_pattern) # Remove ^ at regex pattern start
3020
+ db_pattern = re.sub(r"\$$", "", db_pattern) # Remove $ at regex pattern end
3021
+
3022
+ file_matches = await FileObjectAdapters.aget_file_objects_by_regex(user, db_pattern, path_prefix)
3009
3023
 
3010
3024
  line_matches = []
3011
3025
  for file_object in file_matches:
khoj/routers/research.py CHANGED
@@ -100,7 +100,7 @@ async def apick_next_tool(
100
100
  ConversationCommand.Notes.value: [tool.value for tool in document_research_tools],
101
101
  ConversationCommand.Webpage.value: [ConversationCommand.ReadWebpage.value],
102
102
  ConversationCommand.Online.value: [ConversationCommand.SearchWeb.value],
103
- ConversationCommand.Code.value: [ConversationCommand.RunCode.value],
103
+ ConversationCommand.Code.value: [ConversationCommand.PythonCoder.value],
104
104
  ConversationCommand.Operator.value: [ConversationCommand.OperateComputer.value],
105
105
  }
106
106
  for input_tool, research_tools in input_tools_to_research_tools.items():
@@ -197,7 +197,7 @@ async def apick_next_tool(
197
197
  if i.warning is None and isinstance(i.query, ToolCall)
198
198
  }
199
199
  if (parsed_response.name, dict_to_tuple(parsed_response.args)) in previous_tool_query_combinations:
200
- warning = "Repeated tool, query combination detected. Skipping iteration. Try something different."
200
+ warning = f"Repeated tool, query combination detected. You've already called {parsed_response.name} with args: {parsed_response.args}. Try something different."
201
201
  # Only send client status updates if we'll execute this iteration and model has thoughts to share.
202
202
  elif send_status_func and not is_none_or_empty(response.thought):
203
203
  async for event in send_status_func(response.thought):
@@ -412,11 +412,13 @@ async def research(
412
412
  this_iteration.warning = f"Error reading webpages: {e}"
413
413
  logger.error(this_iteration.warning, exc_info=True)
414
414
 
415
- elif this_iteration.query.name == ConversationCommand.RunCode:
415
+ elif this_iteration.query.name == ConversationCommand.PythonCoder:
416
416
  try:
417
417
  async for result in run_code(
418
418
  **this_iteration.query.args,
419
- conversation_history=construct_tool_chat_history(previous_iterations, ConversationCommand.RunCode),
419
+ conversation_history=construct_tool_chat_history(
420
+ previous_iterations, ConversationCommand.PythonCoder
421
+ ),
420
422
  context="",
421
423
  location_data=location,
422
424
  user=user,
@@ -433,7 +435,7 @@ async def research(
433
435
  this_iteration.codeContext = code_results
434
436
  async for result in send_status_func(f"**Ran code snippets**: {len(this_iteration.codeContext)}"):
435
437
  yield result
436
- except ValueError as e:
438
+ except (ValueError, TypeError) as e:
437
439
  this_iteration.warning = f"Error running code: {e}"
438
440
  logger.warning(this_iteration.warning, exc_info=True)
439
441
 
khoj/utils/constants.py CHANGED
@@ -40,6 +40,9 @@ model_to_cost: Dict[str, Dict[str, float]] = {
40
40
  "o3": {"input": 2.0, "output": 8.00},
41
41
  "o3-pro": {"input": 20.0, "output": 80.00},
42
42
  "o4-mini": {"input": 1.10, "output": 4.40},
43
+ "gpt-5-2025-08-07": {"input": 1.25, "output": 10.00, "cache_read": 0.125},
44
+ "gpt-5-mini-2025-08-07": {"input": 0.25, "output": 2.00, "cache_read": 0.025},
45
+ "gpt-5-nano-2025-08-07": {"input": 0.05, "output": 0.40, "cache_read": 0.005},
43
46
  # Gemini Pricing: https://ai.google.dev/pricing
44
47
  "gemini-1.5-flash": {"input": 0.075, "output": 0.30},
45
48
  "gemini-1.5-flash-002": {"input": 0.075, "output": 0.30},
@@ -68,4 +71,7 @@ model_to_cost: Dict[str, Dict[str, float]] = {
68
71
  "grok-3-latest": {"input": 3.0, "output": 15.0},
69
72
  "grok-3-mini": {"input": 0.30, "output": 0.50},
70
73
  "grok-3-mini-latest": {"input": 0.30, "output": 0.50},
74
+ # Groq pricing
75
+ "moonshotai/kimi-k2-instruct": {"input": 1.00, "output": 3.00},
76
+ "openai/gpt-oss-120b": {"input": 0.15, "output": 0.75},
71
77
  }
khoj/utils/helpers.py CHANGED
@@ -427,7 +427,7 @@ class ConversationCommand(str, Enum):
427
427
  SemanticSearchFiles = "semantic_search_files"
428
428
  SearchWeb = "search_web"
429
429
  ReadWebpage = "read_webpage"
430
- RunCode = "run_code"
430
+ PythonCoder = "run_code"
431
431
  OperateComputer = "operate_computer"
432
432
 
433
433
 
@@ -503,15 +503,15 @@ tools_for_research_llm = {
503
503
  "required": ["urls", "query"],
504
504
  },
505
505
  ),
506
- ConversationCommand.RunCode: ToolDefinition(
507
- name="run_code",
508
- description=e2b_tool_description if is_e2b_code_sandbox_enabled() else terrarium_tool_description,
506
+ ConversationCommand.PythonCoder: ToolDefinition(
507
+ name="python_coder",
508
+ description="Ask them " + e2b_tool_description if is_e2b_code_sandbox_enabled() else terrarium_tool_description,
509
509
  schema={
510
510
  "type": "object",
511
511
  "properties": {
512
512
  "query": {
513
513
  "type": "string",
514
- "description": "Detailed query and all input data required to generate, execute code in the sandbox.",
514
+ "description": "Detailed query and all input data required for the Python Coder to generate, execute code in the sandbox.",
515
515
  },
516
516
  },
517
517
  "required": ["query"],
@@ -588,7 +588,7 @@ tools_for_research_llm = {
588
588
  description=dedent(
589
589
  """
590
590
  To have the tool AI semantic search through the user's knowledge base.
591
- Helpful to answer questions for which finding some relevant notes or documents can complete the search. Example: "When was Tom born?"
591
+ Helpful to answer questions for which finding some relevant notes or documents can be useful. Example: "When was Tom born?"
592
592
  This tool AI cannot find all relevant notes or documents, only a subset of them.
593
593
  It is a good starting point to find keywords, discover similar topics or related concepts and some relevant notes or documents.
594
594
  For a given query, the tool AI can perform a maximum of {max_search_queries} semantic search subqueries per iteration.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: khoj
3
- Version: 2.0.0b13.dev19
3
+ Version: 2.0.0b14.dev7
4
4
  Summary: Your Second Brain
5
5
  Project-URL: Homepage, https://khoj.dev
6
6
  Project-URL: Documentation, https://docs.khoj.dev
@@ -133,17 +133,15 @@ khoj/interface/compiled/chat.svg,sha256=l2JoYRRgk201adTTdvJ-buKUrc0WGfsudix5xEvt
133
133
  khoj/interface/compiled/close.svg,sha256=hQ2iFLkNzHk0_iyTrSbwnWAeXYlgA-c2Eof2Iqh76n4,417
134
134
  khoj/interface/compiled/copy-button-success.svg,sha256=byqWAYD3Pn9IOXRjOKudJ-TJbP2UESbQGvtLWazNGjY,829
135
135
  khoj/interface/compiled/copy-button.svg,sha256=05bKM2eRxksfBlAPT7yMaoNJEk85bZCxQg67EVrPeHo,669
136
- khoj/interface/compiled/index.html,sha256=kPNegzi3-j80f2V80Wdy19PWYVl2F_q-w2fv7A1Lh-Y,53353
137
- khoj/interface/compiled/index.txt,sha256=oGrzix1P2uULu00e_vj4PbMXx5p68rIYJZtMXnyzJcw,7749
136
+ khoj/interface/compiled/index.html,sha256=NB9Aq-3Tj2tuLcUf-Rff3IzgM_d2_gQSaFY5GgCr-Tw,53663
137
+ khoj/interface/compiled/index.txt,sha256=jpFMBkSyqnZuDKjq0Sj2cxsq_ON_1c64VyNXMIoMaFg,7882
138
138
  khoj/interface/compiled/khoj.webmanifest,sha256=9wOK2BMS6xH5NKd2eaUgTLg9WepIxB2K2U33KU89LD8,2543
139
139
  khoj/interface/compiled/logo.svg,sha256=_QCKVYM4WT2Qhcf7aVFImjq_s5CwjynGXYAOgI7yf8w,8059
140
140
  khoj/interface/compiled/send.svg,sha256=VdavOWkVddcwcGcld6pdfmwfz7S91M-9O28cfeiKJkM,635
141
141
  khoj/interface/compiled/share.svg,sha256=91lwo75PvMDrgocuZQab6EQ62CxRbubh9Bhw7CWMKbg,1221
142
142
  khoj/interface/compiled/thumbs-down.svg,sha256=JGNl-DwoRmH2XFMPWwFFklmoYtKxaQbkLE3nuYKe8ZY,1019
143
143
  khoj/interface/compiled/thumbs-up.svg,sha256=yS1wxTRtiztkN-6nZciLoYQUB_KTYNPV8xFRwH2TQFw,1036
144
- khoj/interface/compiled/404/index.html,sha256=Ma2tDjmbZ5GwiESHDgmdfE9u5YIMWttrd2eUsjDuzH4,17407
145
- khoj/interface/compiled/_next/static/N-GdBSXoYe-DuObnbXVRO/_buildManifest.js,sha256=f2_nYnw25hHWQJ-39Lf5OH1u6kgdbOInyfplqgjvAV4,224
146
- khoj/interface/compiled/_next/static/N-GdBSXoYe-DuObnbXVRO/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
144
+ khoj/interface/compiled/404/index.html,sha256=eCcS0CMO4Wh263fmMgjIgIAILayKOy-gzhXxTyKvC6U,17407
147
145
  khoj/interface/compiled/_next/static/chunks/1225.ecac11e7421504c4.js,sha256=h7OGlQyJHNblfAxjh9NxeF2TfA5R-44W7kq30la-tWA,145739
148
146
  khoj/interface/compiled/_next/static/chunks/1320.ae930ad00affe685.js,sha256=_7Rr2YFKkuvZINMyuBk6HxVzmwtsMh7bHpPeWLZeVyc,71098
149
147
  khoj/interface/compiled/_next/static/chunks/1327-511bb0a862efce80.js,sha256=gF0GGZk14_JkuoTQHtktiq2fxMAjnU8hxETqmL67nV0,443139
@@ -152,12 +150,12 @@ khoj/interface/compiled/_next/static/chunks/1915-fbfe167c84ad60c5.js,sha256=qP_n
152
150
  khoj/interface/compiled/_next/static/chunks/1940.d082758bd04e08ae.js,sha256=J7kJooZjJ8Ez5ca_wtUn22HQv1NljO7BjysOYHQu8Nw,21715
153
151
  khoj/interface/compiled/_next/static/chunks/2117-e78b6902ad6f75ec.js,sha256=yOBtQrL5NRMjI60r4pmZRRTHZv8_xwZm4DQp-RI8H9M,123994
154
152
  khoj/interface/compiled/_next/static/chunks/2242.9a07e19f1a3a8b16.js,sha256=gE2wenv7eMCWo8FlC8uOffniVrbcSyi2BfpoDygPJbQ,6535
155
- khoj/interface/compiled/_next/static/chunks/2327-fe87dd989d71d0eb.js,sha256=mUs1El4NhPhQqJQnYeUMXszl0pGIwYyaYUYYdniK7j4,127516
153
+ khoj/interface/compiled/_next/static/chunks/2327-438aaec1657c5ada.js,sha256=NC9BlX61K2ZOUJNSVeJKivdbu3cTEIEi_xKmk_uFY_8,127516
156
154
  khoj/interface/compiled/_next/static/chunks/2475.57a0d0fd93d07af0.js,sha256=rcF8gL_mn3N98WkP3xiFZ8gnCeqntUnbCcU_O7N0yPw,20265
157
155
  khoj/interface/compiled/_next/static/chunks/2481.5ce6524ba0a73f90.js,sha256=UPXoJb1TBOwJRiEijKaL9_rmHizAA18qsSi3BXdevOw,25635
158
156
  khoj/interface/compiled/_next/static/chunks/2939-4d4084c5b888b960.js,sha256=8BI0oAQSZQj37UZX_igaTvuTgW0nGvVtvyG9G9byr_k,35749
159
157
  khoj/interface/compiled/_next/static/chunks/297.4c4c823ff6e3255b.js,sha256=N3uQRvmg4U54io0EUT3n7ryeZPM2k586EXB-u3M_Rvc,45849
160
- khoj/interface/compiled/_next/static/chunks/3260-43d3019b92c315bb.js,sha256=EiHltRhRqUOXnRTQg8ozsOEHDrUKrjs3XeWCr7evJSU,1643416
158
+ khoj/interface/compiled/_next/static/chunks/3260-82d2521fab032ff1.js,sha256=pKZoO7NyUEqDgLEA2cF1NzMF19_2tletHFRO3p1rwRs,1643416
161
159
  khoj/interface/compiled/_next/static/chunks/3353.1c6d553216a1acae.js,sha256=-FHSub1NvXb-bLyOsETXWtexNq02lICpwW0ZH3tVeFg,177
162
160
  khoj/interface/compiled/_next/static/chunks/3592-b2a2444b0ec7b119.js,sha256=ADfFNp0QHqmz0sHmTSpE-hWnh09AxVVzZb6zcx_ATmg,42200
163
161
  khoj/interface/compiled/_next/static/chunks/3595-ac8e81e04ecb89cb.js,sha256=43eYa6m0ZuFnnBOPTa6S-T0WeLftHEZDlkMe4b7fmIA,21564
@@ -179,7 +177,7 @@ khoj/interface/compiled/_next/static/chunks/584.d7ce3505f169b706.js,sha256=CDrxO
179
177
  khoj/interface/compiled/_next/static/chunks/6240.34f7c1fa692edd61.js,sha256=pBbYPG21QsQ6UjMev_R0E2MlgI4HpX0VVAbGD5qJPbI,11499
180
178
  khoj/interface/compiled/_next/static/chunks/6434.e6cd986d690f2cef.js,sha256=fVR1V4ENz1Qeebsoe8N8XNVbcwGBBhdnTJY-157Y0sg,36261
181
179
  khoj/interface/compiled/_next/static/chunks/6d3fe5a5-f9f3c16e0bc0cdf9.js,sha256=D5Zwf2k8bdsZHdA_rHYb1AkjPEzChzE2ikfYjdEcoCw,89810
182
- khoj/interface/compiled/_next/static/chunks/7127-97b83757db125ba6.js,sha256=2cUdQbJ6dowD9PJ6t6cdbdDIDpVRqEzA-GYdJlZ-x9M,43504
180
+ khoj/interface/compiled/_next/static/chunks/7127-9273a602fbda737e.js,sha256=GQnEiCuImCPlT6BUrkFCxDSCPqjUXZWJPL9ji0JNWRo,43592
183
181
  khoj/interface/compiled/_next/static/chunks/7200-93ab0072359b8028.js,sha256=TjO7mJfoHX12ZVRPYbZMnEh_t8hlM-h-gukzuMFXuKg,11416
184
182
  khoj/interface/compiled/_next/static/chunks/7553.f5ad54b1f6e92c49.js,sha256=RG6sFOVYxfl2MvzwJfvTdGQceQ0DNMppZKkywZoeiPk,76986
185
183
  khoj/interface/compiled/_next/static/chunks/7626-1b630f1654172341.js,sha256=b3P38z7c7HhEATw0zwOJsGB7r1rTeLehksMGjgyrK2I,83511
@@ -213,33 +211,33 @@ khoj/interface/compiled/_next/static/chunks/framework-8e0e0f4a6b83a956.js,sha256
213
211
  khoj/interface/compiled/_next/static/chunks/main-app-de1f09df97a3cfc7.js,sha256=bqnztujKItXfFBzQlaBmDZyfJpQt_M93CXOuchJfpD0,471
214
212
  khoj/interface/compiled/_next/static/chunks/main-fc8e0fefa2ef3d8c.js,sha256=t9FZIByh6V52m41LQ2yyAReF1CAuY7gLMBuWBeKCX2g,116793
215
213
  khoj/interface/compiled/_next/static/chunks/polyfills-42372ed130431b0a.js,sha256=CXPB1kyIrcjjyVBBDLWLKI9yEY1ZZbeASUON648vloM,112594
216
- khoj/interface/compiled/_next/static/chunks/webpack-d60b0c57a6c38d0f.js,sha256=Q7UbRcMDaRTnPF_BiY3oMrXzsBpzTc-E_v1wzzQLsCI,4996
214
+ khoj/interface/compiled/_next/static/chunks/webpack-8087292aa01e8e55.js,sha256=Jo3OyDM4LCyaOzN8rBggqJxE4RFbMDgNOFFyO46flTE,4996
217
215
  khoj/interface/compiled/_next/static/chunks/app/layout-c2de87a25fededbb.js,sha256=jcU3C37p73V24B118uVRQffNaQES9jihsTGYF4fZ_8o,3949
218
- khoj/interface/compiled/_next/static/chunks/app/page-1567cac7b79a7c59.js,sha256=6NPvd5JerCoemwVeQyz7yVhvyEi6g4O62SgkhWhYi-g,29931
216
+ khoj/interface/compiled/_next/static/chunks/app/page-89f5654035b07c00.js,sha256=y0kZUEFYi6kZd5-uO_Z1gZrnf3m35Zey1X6rGX3-AeY,29936
219
217
  khoj/interface/compiled/_next/static/chunks/app/_not-found/page-84f94d15b2da4eac.js,sha256=zElhiTkdu2JqrEvJ8Lrxh4HCyfLmPllBHHWOuDtrVlw,1755
220
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-4e2a134ec26aa606.js,sha256=B3HJ6CKzJccEIOk54Erl1FtKUxGJq2p-ch932X1vjwE,180
221
- khoj/interface/compiled/_next/static/chunks/app/agents/page-e291b49977f43880.js,sha256=j716nGiARDNN_58TNk5E25UzrKI3EzywnfuIzOovZfM,17487
222
- khoj/interface/compiled/_next/static/chunks/app/automations/layout-63603d2cb33279f7.js,sha256=4OX_fcTQdNVs6HxDdJVWdadMVC_gM86Tkqo2TjBA4gw,5143
223
- khoj/interface/compiled/_next/static/chunks/app/automations/page-198b26df6e09bbb0.js,sha256=a10MP-dFGmgOq8qRlT1e_bhp0_2txwxyaX6EZ20tagc,34764
224
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-ad4d1792ab1a4108.js,sha256=g815zvSZenVssWcOYjyqAOPDjTCa359nqspXeIsXQ5A,180
225
- khoj/interface/compiled/_next/static/chunks/app/chat/page-9a75d7369f2a7cd2.js,sha256=mfcKToCdhDlh2gxmnVlXS9GJkV_JklgI6Db2vIYhYlc,29308
226
- khoj/interface/compiled/_next/static/chunks/app/search/layout-c02531d586972d7d.js,sha256=VQACqzXZcJUaa3W_0wHsrdLP22pj8yqeAOGBQfVnQxw,180
227
- khoj/interface/compiled/_next/static/chunks/app/search/page-3639e50ec3e9acfd.js,sha256=DFDpUem-27PpUEfqc72xv3zo7TcZpTFjvyXszZSGrNM,30929
218
+ khoj/interface/compiled/_next/static/chunks/app/agents/layout-0114c87d7ccf6d9b.js,sha256=kF5sizKRen5WnXIeBI9wDEW4E5ykHXRSnBw0-shZK3s,175
219
+ khoj/interface/compiled/_next/static/chunks/app/agents/page-f04757fab73908a4.js,sha256=rW_Cg_G7uqP44wCJ4KVyEET3vjxEgJdFpSO-GeY9sDo,17492
220
+ khoj/interface/compiled/_next/static/chunks/app/automations/layout-8639ff99d6c2fec6.js,sha256=YyyuDO2d-3qEy6jBrihuQKxFAV9ki-mENrHq1XTzhvM,5148
221
+ khoj/interface/compiled/_next/static/chunks/app/automations/page-fb0e9353e86acd25.js,sha256=zrNe-tHOQuKUKnrCCCUqLZEg6sp9pyhn8h46HaadZBI,34769
222
+ khoj/interface/compiled/_next/static/chunks/app/chat/layout-2ff3e18a6feae92a.js,sha256=o4b4VL_8nN3WbUJ43qnXmgCTgnnGK8nBMRMu3VdCn38,5148
223
+ khoj/interface/compiled/_next/static/chunks/app/chat/page-fd693f65831a2f97.js,sha256=KIQwBBBg7swM0ACCdQl3ny06advZ870z71FZfbQjmuM,31504
224
+ khoj/interface/compiled/_next/static/chunks/app/search/layout-78dd7cdd97510485.js,sha256=V8eklRDWZZFNY8FDN_wdlACutXubhyt8DlpK8zzDS04,175
225
+ khoj/interface/compiled/_next/static/chunks/app/search/page-6ca71d3d56fc6935.js,sha256=GCSw4fBzRPRnj9YKz1lwEpVbwwOfWmp8p3n-jDeTGGk,30929
228
226
  khoj/interface/compiled/_next/static/chunks/app/settings/layout-f88cedfe9ad4df7c.js,sha256=aFBEgUCsKnoeyULmh7g-DmaznQ0ztcq6y2pj4bSMCIY,6132
229
- khoj/interface/compiled/_next/static/chunks/app/settings/page-6081362437c82470.js,sha256=uRj3Vu_cQgTTagYpgVXuFUNA8RJnsnFdZWO5tolqUpo,27895
230
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js,sha256=rcoit2AQboqPwZMTVlVhz1AbyHRJOs-xNMTdYonejCU,180
231
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-e0dcb1762f8c8f88.js,sha256=uTVd9QwMeyi-aWPYV5x2ZAqjjMw49xNPlLqV2HQvwyA,5563
227
+ khoj/interface/compiled/_next/static/chunks/app/settings/page-a798de3944f59629.js,sha256=77EvjMgieElgiH6eZAeO29P_mi1n_TRLdMMPim9OxrM,27900
228
+ khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-9781b62e39ca7785.js,sha256=EGENc2qMT6iJxbdxLfKMtRU2YsQreA2R5op-1X1wqjA,175
229
+ khoj/interface/compiled/_next/static/chunks/app/share/chat/page-07d7ff92aee0bb69.js,sha256=5H8dJYd1LQjmbarYKlyWQ56AfvCmfH4y2DDequ4YNG8,5568
232
230
  khoj/interface/compiled/_next/static/chunks/pages/_app-3c9ca398d360b709.js,sha256=UqtikLsCsOWtDUJOW6Tuk9P-bV1V3MhYd3ghrQuEmfs,286
233
231
  khoj/interface/compiled/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js,sha256=w_It3VzKT8O1M3CrJ_hZHsaU7M7dq3EAaVG8KvJ-fhU,253
234
- khoj/interface/compiled/_next/static/css/23b26df423cd8a9c.css,sha256=phmdXegDf59vMIRVETPEUiuioVjJzp09sj3ErX6_nFY,34642
235
- khoj/interface/compiled/_next/static/css/2945c4a857922f3b.css,sha256=ARp32IQvPZk88JXcPUb7fkM6WuvAEL1EqqGwhdnR2T8,9831
236
232
  khoj/interface/compiled/_next/static/css/3090706713c12a32.css,sha256=lHBNcr2SPiAMdZQONh2MMlVM_huteuNSM9jCqGkS2d0,3075782
237
- khoj/interface/compiled/_next/static/css/37a73b87f02df402.css,sha256=hp0vlekKu0K2eITR5YIqFmLHQPqV3JETFnRd_-Uh0mk,165
238
233
  khoj/interface/compiled/_next/static/css/5b28ced915454767.css,sha256=Bk56AIRHovIWNUw8QWvMbXIxxPiyWEiObkMA7RwpMrs,4842
239
234
  khoj/interface/compiled/_next/static/css/76c658ee459140a9.css,sha256=7tI24VB66ZUsAPUxRdQhboopun0AXLUnF64uv9RkC08,1833
240
235
  khoj/interface/compiled/_next/static/css/7889a30fe9c83846.css,sha256=IUkZhkx4GpYOIhN-EJw9T1DqGMO3Wa3mNpUwaOBuZoY,7204
236
+ khoj/interface/compiled/_next/static/css/a0c2fd63bb396f04.css,sha256=8q0xBA3l7uP-YOqSnRnQEfPbGUgP9xRP0Q75UHSt6vc,34737
241
237
  khoj/interface/compiled/_next/static/css/db7d90554f3ab82b.css,sha256=A3ZAf0StEG3sr_LxAIizczSTYRe1NbtNUpfslvmkqgk,17713
242
238
  khoj/interface/compiled/_next/static/css/ea5485b3f3859a5a.css,sha256=tn6qi2xSLTWhtzDUE8UlC8iipH9QGV6A9oGj1ap-Sk4,1659
239
+ khoj/interface/compiled/_next/static/css/ee66643a6a5bf71c.css,sha256=3JbJLrnwlX_IHdvjmS3l9y3Vgp5_V0XbfFI44ekLh9E,3106
240
+ khoj/interface/compiled/_next/static/css/fbacbdfd5e7f3f0e.css,sha256=83EGhzX5xQHd-qC-hAcrRUaUAHJJBowDdzi-7Lp81v8,6795
243
241
  khoj/interface/compiled/_next/static/media/1d8a05b60287ae6c-s.p.woff2,sha256=IzKBwB_bpSGvO7C9aRv29Js-jAbZPRDI-D-P4H2P918,14508
244
242
  khoj/interface/compiled/_next/static/media/2aa11a72f7f24b58-s.woff2,sha256=QjuuSKmViymmy-itXLB1UbSARxFNHWuMiPpCrYqClFI,22728
245
243
  khoj/interface/compiled/_next/static/media/383a65b63658737d-s.woff2,sha256=VH1XkI87HdFVhsurH5D5ekEjG_ZORTVBVg6xz7p87C8,16704
@@ -317,8 +315,10 @@ khoj/interface/compiled/_next/static/media/flags.3afdda2f.webp,sha256=M2AW_HLpBn
317
315
  khoj/interface/compiled/_next/static/media/flags@2x.5fbe9fc1.webp,sha256=BBeRPBZkxY3-aKkMnYv5TSkxmbeMbyUH4VRIPfrWg1E,137406
318
316
  khoj/interface/compiled/_next/static/media/globe.98e105ca.webp,sha256=g3ofb8-W9GM75zIhlvQhaS8I2py9TtrovOKR3_7Jf04,514
319
317
  khoj/interface/compiled/_next/static/media/globe@2x.974df6f8.webp,sha256=I_N7Yke3IOoS-0CC6XD8o0IUWG8PdPbrHmf6lpgWlZY,1380
320
- khoj/interface/compiled/agents/index.html,sha256=quF1avSWLZX0mhUr3Zqj9WoyVMxYVpqF-0jgUbuEnPo,16535
321
- khoj/interface/compiled/agents/index.txt,sha256=1A2zi5Jbw3CbgiRftOWFgcRwkMqW0Td_Re0-MlB-o2U,7353
318
+ khoj/interface/compiled/_next/static/suayGPC1Ee3s2bFUreGaV/_buildManifest.js,sha256=f2_nYnw25hHWQJ-39Lf5OH1u6kgdbOInyfplqgjvAV4,224
319
+ khoj/interface/compiled/_next/static/suayGPC1Ee3s2bFUreGaV/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
320
+ khoj/interface/compiled/agents/index.html,sha256=nU8tVZlzoO4wXRRDwnYcnrkKmmVy_0bTJwjC8APrkdM,16845
321
+ khoj/interface/compiled/agents/index.txt,sha256=k0WfRBxiaUaNQ3AO5-ktnDUp84GG97X2SONq6ubTo3k,7486
322
322
  khoj/interface/compiled/assets/icons/khoj_lantern.ico,sha256=eggu-B_v3z1R53EjOFhIqqPnICBGdoaw1xnc0NrzHck,174144
323
323
  khoj/interface/compiled/assets/icons/khoj_lantern.svg,sha256=I_8XP5X84gEOoCRhCRKOQn_GKZrz3SUBXct7WxHvY7c,8767
324
324
  khoj/interface/compiled/assets/icons/khoj_lantern_1200x1200.png,sha256=xDx0bbD-WMflgg8zck9oPIIuTIvywtuED2k7CjSQS4w,66194
@@ -333,16 +333,16 @@ khoj/interface/compiled/assets/samples/desktop-remember-plan-sample.png,sha256=i
333
333
  khoj/interface/compiled/assets/samples/phone-browse-draw-sample.png,sha256=Dd4fPwtFl6BWqnHjeb1mCK_ND0hhHsWtx8sNE7EiMuE,406179
334
334
  khoj/interface/compiled/assets/samples/phone-plain-chat-sample.png,sha256=DEDaNRCkfEWUeh3kYZWIQDTVK1a6KKnYdwj5ZWisN_Q,82985
335
335
  khoj/interface/compiled/assets/samples/phone-remember-plan-sample.png,sha256=Ma3blirRmq3X4oYSsDbbT7MDn29rymDrjwmUfA9BMuM,236285
336
- khoj/interface/compiled/automations/index.html,sha256=T9eS_Pirl8C8I_5Gklqa6jftWHpxu3vkj3pMObq5ey0,54405
337
- khoj/interface/compiled/automations/index.txt,sha256=Amufnbm09L2ZzDuZvSWQ2mfHHHMGpQZ2SznXrror68A,7582
338
- khoj/interface/compiled/chat/index.html,sha256=XVWUbytfspxtYmdcFa0ot5JgucC-dQrJnZP_4-KIr-g,53532
339
- khoj/interface/compiled/chat/index.txt,sha256=Dbbeoz5N5Z_Tn8oaW8NbvcTdEsvc0DIyXAqN36cebjY,7991
340
- khoj/interface/compiled/search/index.html,sha256=45DLBkbMrS5j7YRqISXQZ5k9pMFqtDDJP5CITr1mfRc,55611
341
- khoj/interface/compiled/search/index.txt,sha256=4gUmtbUMsBfHzD08Pn9akB2zTj_igBVNcjIO05lJgOg,6698
342
- khoj/interface/compiled/settings/index.html,sha256=AG0vRLT7zckmnDS0uFRvFvKshFEjpSQJ6_jQjeirHr0,53050
343
- khoj/interface/compiled/settings/index.txt,sha256=lvNSOG-5MR2whTlwNxYaJjq2sgMfncCnfh8XvoQGhmw,7834
344
- khoj/interface/compiled/share/chat/index.html,sha256=rFSaJba1DKQAo36KMcDHpAR7A7DPuZjAvl6vt2k_IL0,54112
345
- khoj/interface/compiled/share/chat/index.txt,sha256=p_YLaEkGCgJviuugQbwuJRCB5ZP4X9HYJFI7LTZwJcw,8453
336
+ khoj/interface/compiled/automations/index.html,sha256=nB1fmrLB6t6dMRMVneCYmmANNzl9A-y4tjC6ya0xcCs,54715
337
+ khoj/interface/compiled/automations/index.txt,sha256=xfnwwRbWSPCI131qeF4es_lKu37YgvM805IpRmmfhGk,7715
338
+ khoj/interface/compiled/chat/index.html,sha256=CZFuLmxWrLhO4jkbNtwyIg3ow1KsDxjrP5DCpUNs7nc,54488
339
+ khoj/interface/compiled/chat/index.txt,sha256=sC8bRN8wEeJXwHIKmzlVIxDHdH8mJtvSsDbXGeJiIoM,8322
340
+ khoj/interface/compiled/search/index.html,sha256=FyIaHKEtc6SX3IoYxHkBSNXp3xaCjS3efpLtsTJ4yu0,55611
341
+ khoj/interface/compiled/search/index.txt,sha256=BfpvWLRkyfcjijmm2KAiTpDIAqwZCcIxh3xWZfwhlvM,6698
342
+ khoj/interface/compiled/settings/index.html,sha256=oTgHUDraSIYq9GJRzCsl2LfGpdj7eSzoKOoFnhDuUN4,53360
343
+ khoj/interface/compiled/settings/index.txt,sha256=vBqKnArg486Hg5aV8BgJNpTmrV2-68aH8Js5vtuxdUc,7967
344
+ khoj/interface/compiled/share/chat/index.html,sha256=9GEYuNbuGBqlfzxeA30gdeKryOjwE9EX2P1YbkG6x_0,54422
345
+ khoj/interface/compiled/share/chat/index.txt,sha256=pP8MuOp94_tU_BA1MU5wJN2Ehct-Nwd7rZSibekdzkM,8586
346
346
  khoj/interface/email/feedback.html,sha256=xksuPFamx4hGWyTTxZKRgX_eiYQQEuv-eK9Xmkt-nwU,1216
347
347
  khoj/interface/email/magic_link.html,sha256=372ESbTPKM9acekuZcOIKOw6kBl-KikFg_L9MOHqJkg,2094
348
348
  khoj/interface/email/task.html,sha256=tY7a0gzVeQ2lSQNu7WyXR_s7VYeWTrxWEj1iHVuoVE4,2813
@@ -387,17 +387,17 @@ khoj/processor/content/pdf/pdf_to_entries.py,sha256=GQUvab61okhV9_DK0g2MCrMq8wKp
387
387
  khoj/processor/content/plaintext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
388
388
  khoj/processor/content/plaintext/plaintext_to_entries.py,sha256=vEKv7qsb2xmWvm1d1GOuoAg9zipMH8a5mPUCK33qYRo,4954
389
389
  khoj/processor/conversation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
390
- khoj/processor/conversation/prompts.py,sha256=DObfHd5l6IuRlLtC7EKqj70mCb3Qmjo4yP4qjkWOStg,53027
391
- khoj/processor/conversation/utils.py,sha256=qCWYD7rw3fOeqrpG9oGjliXE1ouUIdWmfKnc-v_deYU,47727
390
+ khoj/processor/conversation/prompts.py,sha256=EECwjxOAGquHv1RIqIlPty9q0vb_undcAQo_UMadUCA,53802
391
+ khoj/processor/conversation/utils.py,sha256=h3sRX_iurY4UOcwVMfOAxW6b9HQQiFe2kgQvslEF-t0,47837
392
392
  khoj/processor/conversation/anthropic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
393
393
  khoj/processor/conversation/anthropic/anthropic_chat.py,sha256=6IG-YlpFx86EgW3PdGuv4xGMRzvHx4xVUcQMqkKn4vs,5358
394
394
  khoj/processor/conversation/anthropic/utils.py,sha256=Z7mz-LnunLHubZvdzNEAozlJxukl2eNoLvYzeYzsglc,16568
395
395
  khoj/processor/conversation/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
396
396
  khoj/processor/conversation/google/gemini_chat.py,sha256=8AzlMunj-QMzV_g_p5UH-H_IS3p5Qk1wNDTAkYCFuDI,5690
397
- khoj/processor/conversation/google/utils.py,sha256=v_aDV4ZKkenjV0fwIqy7Fwzd09vtLjwoKzNdqYdqR6s,23307
397
+ khoj/processor/conversation/google/utils.py,sha256=miZXB6ufouwyS6J_5NwEDcmqAoZcLs0kppH8Blgbx38,25621
398
398
  khoj/processor/conversation/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
399
- khoj/processor/conversation/openai/gpt.py,sha256=B7TPhJk4lxwDNJ4RPLfJbTvfL4dZ2PJWAb-s8jcCiw4,6097
400
- khoj/processor/conversation/openai/utils.py,sha256=fqISHEoj47cWZZSZOVzi6SPIzPXsDy-HnxFTvQOHjQA,38617
399
+ khoj/processor/conversation/openai/gpt.py,sha256=2PoQMB8mEJDW-5JK-dfCXvyB2POFV2hEJWITG0s64VU,7485
400
+ khoj/processor/conversation/openai/utils.py,sha256=_zisLyqh8NwrE-DgbgibwFlbTGIq-3Tsw3nOP8nqyGI,53667
401
401
  khoj/processor/conversation/openai/whisper.py,sha256=zoEeK1LNCg_tzP4xzYi5vRPzNPGuDGzpkrkG7d1LUn4,447
402
402
  khoj/processor/image/generate.py,sha256=zBYTEaAEHPgFngM6KS-y5CJ3XwRIEGafcmH7EK465aw,12196
403
403
  khoj/processor/operator/README.md,sha256=QaV00W1IB7i8ZrvhNkpjmFMVDtORFt-OASieRQGE_UE,2308
@@ -421,16 +421,16 @@ khoj/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
421
421
  khoj/routers/api.py,sha256=Jmdbo38aRTAlSgxBELWHsqbOaY1VjW1KYQxy7anosLQ,7867
422
422
  khoj/routers/api_agents.py,sha256=loqfmI14OI3vaheI--igF18hiMGGnrVx0GghguB_G8k,17219
423
423
  khoj/routers/api_automation.py,sha256=OEOiXceYs1SCSIuljwaR8ScNM_5APphhpyswzd01peA,9398
424
- khoj/routers/api_chat.py,sha256=SYk2q5ouohneJ5jvnbOSeEhyVkrm7KfPgmuzdxYuS9g,69381
425
- khoj/routers/api_content.py,sha256=3HTrZnFJJHMSvABYocJO-hSnNQrrRTQy20h0epFZY7E,20503
424
+ khoj/routers/api_chat.py,sha256=gFFKTG3v8nBGW5R00PlFNV2je5vnG0sc1GbJTTP_C90,69628
425
+ khoj/routers/api_content.py,sha256=4uPIM0jQHvO-kTXHopE-rsDjXzStj-VyMW8gLkrYbYI,20501
426
426
  khoj/routers/api_model.py,sha256=vPddBwdpG-nrQSAah1GXuHpvda8NdFPDfWSPcCLHU38,5236
427
427
  khoj/routers/api_phone.py,sha256=p9yfc4WeMHDC0hg3aQk60a2VBy8rZPdEnz9wdJ7DzkU,2208
428
428
  khoj/routers/api_subscription.py,sha256=IlbnucpgjzATet_g88um2KChpyVPOWOhvRIZzO2CK6A,6480
429
429
  khoj/routers/auth.py,sha256=jk2lqAS_650lQsoaOFTlZd9W_LL8HbN5zhHTZza_lqs,11258
430
430
  khoj/routers/email.py,sha256=0nDwbMeon5c-9s3tvj0-fB3IOPlJEnIaoU1t7HGlNnI,3917
431
- khoj/routers/helpers.py,sha256=UK6ows5zZW_fzOdtkgbIzCaMNn6CGnSSKcLQSTBccOs,120606
431
+ khoj/routers/helpers.py,sha256=YpRX3ywCDcR1G1Ce_LaxC5T2WPTeBpjREzchg8hUvZQ,121247
432
432
  khoj/routers/notion.py,sha256=g53xyYFmjr2JnuIrTW2vytbfkiK_UkoRTxqnnLSmD5o,2802
433
- khoj/routers/research.py,sha256=_Vvs98wnLkn9pl0e3x4bW7QdufnFS3njFQ3tVwPHSM8,26320
433
+ khoj/routers/research.py,sha256=JAKmrtIViNZ8HWKZAvgOsXF2hf0riHzC6yCOE-aD6GY,26452
434
434
  khoj/routers/storage.py,sha256=lao0DvsF49QleZvOdjKM98RU2cGfCJDBb7WeoI7Rr3I,2172
435
435
  khoj/routers/twilio.py,sha256=MLsuCm4--ETvr3sLxbF0CL_ehlg_l2rKBSLR2Qh2Xls,1081
436
436
  khoj/routers/web_client.py,sha256=ArYv1yM04Lb3KOrDHzruf_rClVq1PEyBkdZ_e1W49_A,4573
@@ -444,16 +444,16 @@ khoj/search_type/text_search.py,sha256=wbvQgEs5tFbkZwZesyHqp-gi46j3GNQa7di6swhXM
444
444
  khoj/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
445
445
  khoj/utils/cli.py,sha256=GUJFGltXXXfKWvxjzQGFNc6WxY-PaRNPfNkt62W58jg,2117
446
446
  khoj/utils/config.py,sha256=5dGQ-RcAKZWA3nqP1-2t8mdfB_rbf6xu0bBez4KbB9Y,322
447
- khoj/utils/constants.py,sha256=jmpH2ROLqLccicZEFb42IGNLRs3G3GBYpqRUhEpVnMc,4002
448
- khoj/utils/helpers.py,sha256=7jIAM0vRm8dk3Kgb1UNpgOK0WaNTrb8y4_AFzuT8HiA,42600
447
+ khoj/utils/constants.py,sha256=OLNXaWrJ5qZJvc1sC4otTDSBHf5gkXlrf4OrMMIq0Nc,4394
448
+ khoj/utils/helpers.py,sha256=BACqq_jiUAmodt3OMQASzfqXHMbx91Y2qGYd3ggWOTk,42637
449
449
  khoj/utils/initialization.py,sha256=_qCa3Nospjg2F7c6CNQAU8Su8kD7bT6kyokVQW-4BoY,13121
450
450
  khoj/utils/jsonl.py,sha256=0Ac_COqr8sLCXntzZtquxuCEVRM2c3yKeDRGhgOBRpQ,1192
451
451
  khoj/utils/models.py,sha256=_7yEVUXXG59_2p8a0nbda2jzhpLkxnfMtlBYwi34U0k,1993
452
452
  khoj/utils/rawconfig.py,sha256=uABGqIR3pIj5h7Tn-QvYuITB2ogrmi6waSv-KBq1Qc0,3533
453
453
  khoj/utils/state.py,sha256=OwoWGeuz6O7nK-Pa98ADUScLz83GsK8ruyRYex9s3lw,1527
454
454
  khoj/utils/yaml.py,sha256=I8FfdcmxYLSEOjJWgkQxxl_xlrU9Wg1HIuxKj3dWJtE,264
455
- khoj-2.0.0b13.dev19.dist-info/METADATA,sha256=RMn4AgytkCZ07pMPt7NOGb-5-t5oUkG42iriraxaGzc,8961
456
- khoj-2.0.0b13.dev19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
457
- khoj-2.0.0b13.dev19.dist-info/entry_points.txt,sha256=KBIcez5N_jCgq_ER4Uxf-e1lxTBMTE_BBjMwwfeZyAg,39
458
- khoj-2.0.0b13.dev19.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
459
- khoj-2.0.0b13.dev19.dist-info/RECORD,,
455
+ khoj-2.0.0b14.dev7.dist-info/METADATA,sha256=j3I9V8-YgntbY3QcxC-uEaGMmlSav10MKex814EkGuo,8960
456
+ khoj-2.0.0b14.dev7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
457
+ khoj-2.0.0b14.dev7.dist-info/entry_points.txt,sha256=KBIcez5N_jCgq_ER4Uxf-e1lxTBMTE_BBjMwwfeZyAg,39
458
+ khoj-2.0.0b14.dev7.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
459
+ khoj-2.0.0b14.dev7.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7127],{27127:function(e,t,a){"use strict";a.d(t,{Z:function(){return eO}});var n=a(57437),s=a(42501),o=a.n(s),r=a(2265),l=a(48614),c=a(98239),i=a(91499),d=a.n(i),h=a(19983),u=a(13506),g=a.n(u),m=a(34040);a(2446);var f=a(37052),p=a(19273),x=a(3244),v=a(4235),j=a(66070),y=a(69304),w=a(57054),b=a(18848),M=a(42225),N=a(27648);let C=new h.Z({html:!0,linkify:!0,typographer:!0});function _(e){let t=(0,M.Le)(e.title||".txt","w-6 h-6 text-muted-foreground inline-flex mr-2"),a=e.title.split("/").pop()||e.title,s=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?b.Z.sanitize(C.render(t)):b.Z.sanitize(t)}(e),[o,l]=(0,r.useState)(!1);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(w.J2,{open:o&&!e.showFullContent,onOpenChange:l,children:[(0,n.jsx)(w.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("h3",{className:"".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground}"),children:[t,e.showFullContent?e.title:a]}),(0,n.jsx)("p",{className:"text-sm overflow-x-auto block",dangerouslySetInnerHTML:{__html:s}})]}):(0,n.jsx)(T,{type:"notes"},"".concat(e.title))})}),(0,n.jsx)(w.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("h3",{className:"line-clamp-2 text-muted-foreground}",children:[t,e.title]}),(0,n.jsx)("p",{className:"border-t mt-1 pt-1 text-sm overflow-hidden line-clamp-5",dangerouslySetInnerHTML:{__html:s}})]})})]})})}function k(e){var t,a,s,o,l,c;let i=(0,M.Le)(".py","!w-4 h-4 text-muted-foreground flex-shrink-0"),d=b.Z.sanitize(e.code),[h,u]=(0,r.useState)(!1),[g,m]=(0,r.useState)(!1),p=e=>{let t="text/plain",a=e.b64_data;e.filename.match(/\.(png|jpg|jpeg|webp)$/)?(t="image/".concat(e.filename.split(".").pop()),a=atob(e.b64_data)):e.filename.endsWith(".json")?t="application/json":e.filename.endsWith(".csv")&&(t="text/csv");let n=new ArrayBuffer(a.length),s=new Uint8Array(n);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);let o=new Blob([n],{type:t}),r=URL.createObjectURL(o),l=document.createElement("a");l.href=r,l.download=e.filename,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(r)},x=(t,a)=>(null==t?void 0:t.length)==0?null:(0,n.jsx)("div",{className:"".concat(a||e.showFullContent?"border-t mt-1 pt-1":void 0),children:t.slice(0,e.showFullContent?void 0:1).map((t,s)=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("h4",{className:"text-sm text-muted-foreground flex items-center",children:[(0,n.jsx)("span",{className:"overflow-hidden mr-2 font-bold ".concat(e.showFullContent?void 0:"line-clamp-1"),children:t.filename}),(0,n.jsx)("button",{className:"".concat(a?"hidden":void 0),onClick:e=>{e.preventDefault(),p(t)},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),title:"Download file: ".concat(t.filename),children:(0,n.jsx)(f.b,{className:"w-4 h-4",weight:g?"fill":"regular"})})]}),t.filename.match(/\.(txt|org|md|csv|json)$/)?(0,n.jsx)("pre",{className:"".concat(e.showFullContent?"block":"line-clamp-2"," text-sm mt-1 p-1 bg-background rounded overflow-x-auto"),children:t.b64_data}):t.filename.match(/\.(png|jpg|jpeg|webp)$/)?(0,n.jsx)("img",{src:"data:image/".concat(t.filename.split(".").pop(),";base64,").concat(t.b64_data),alt:t.filename,className:"mt-1 max-h-32 rounded"}):null]},"".concat(t.filename,"-").concat(s)))});return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(w.J2,{open:h&&!e.showFullContent,onOpenChange:u,children:[(0,n.jsx)(w.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)("div",{className:"flex flex-col px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(t=e.output_files)||void 0===t?void 0:t.length)>0?"artifacts":""]})]}),(0,n.jsx)("pre",{className:"text-xs pb-2 ".concat(e.showFullContent?"block overflow-x-auto":(null===(a=e.output_files)||void 0===a?void 0:a.length)>0?"hidden":"overflow-hidden line-clamp-3"),children:d}),(null===(s=e.output_files)||void 0===s?void 0:s.length)>0&&x(e.output_files,!1)]}):(0,n.jsx)(T,{type:"code"},"code-".concat(e.code))})}),(0,n.jsx)(w.yk,{className:"w-[400px] mx-2",children:(0,n.jsxs)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none p-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[i,(0,n.jsxs)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:["code ",(null===(o=e.output_files)||void 0===o?void 0:o.length)>0?"artifact":""]})]}),(null===(l=e.output_files)||void 0===l?void 0:l.length)>0&&x(null===(c=e.output_files)||void 0===c?void 0:c.slice(0,1),!0)||(0,n.jsx)("pre",{className:"text-xs border-t mt-1 pt-1 overflow-hidden line-clamp-10",children:d})]})})]})})}function R(e){let[t,a]=(0,r.useState)(!1);if(!e.link||e.link.split(" ").length>1)return null;let s="https://www.google.com/s2/favicons?domain=globe",o="unknown";try{o=new URL(e.link).hostname,s="https://www.google.com/s2/favicons?domain=".concat(o)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(w.J2,{open:t&&!e.showFullContent,onOpenChange:a,children:[(0,n.jsx)(w.xo,{asChild:!0,children:(0,n.jsx)(j.Zb,{onMouseEnter:()=>{a(!0)},onMouseLeave:()=>{a(!1)},className:"".concat(e.showFullContent?"w-auto bg-muted":"w-auto"," overflow-hidden break-words text-balance rounded-lg border-none p-2 shadow-none"),children:e.showFullContent?(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)(N.default,{href:e.link,children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," text-muted-foreground flex-grow"),children:o})]})}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-1"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-2"),children:e.description})]}):(0,n.jsx)(T,{type:"online",link:e.link},e.title)})}),(0,n.jsx)(w.yk,{className:"w-[400px] mx-2",children:(0,n.jsx)(j.Zb,{className:"w-auto overflow-hidden break-words text-balance rounded-lg border-none",children:(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"!no-underline px-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("img",{src:s,alt:"",className:"!w-4 h-4 flex-shrink-0"}),(0,n.jsx)("h3",{className:"overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," text-muted-foreground flex-grow"),children:o})]}),(0,n.jsx)("h3",{className:"border-t mt-1 pt-1 overflow-hidden ".concat(e.showFullContent?"block":"line-clamp-2"," font-bold"),children:e.title}),(0,n.jsx)("p",{className:"overflow-hidden text-sm ".concat(e.showFullContent?"block":"line-clamp-5"),children:e.description})]})})})})]})})}function T(e){let t="",a="unknown";if(e.link)try{a=new URL(e.link).hostname,t="https://www.google.com/s2/favicons?domain=".concat(a)}catch(t){return console.warn("Error parsing domain from link: ".concat(e.link)),null}let s=null,o="!w-4 !h-4 text-muted-foreground inline-flex mr-2 rounded-lg";switch(e.type){case"code":s=(0,n.jsx)(p.E,{className:"".concat(o)});break;case"online":s=(0,n.jsx)("img",{src:t,alt:"",className:"".concat(o)});break;case"notes":s=(0,n.jsx)(x.j,{className:"".concat(o)});break;default:s=null}return s?(0,n.jsx)("div",{className:"flex items-center gap-2",children:s}):null}function E(e){let t=e.notesReferenceCardData.length>0||e.codeReferenceCardData.length>0||e.onlineReferenceCardData.length>0,a=e.notesReferenceCardData.length+e.codeReferenceCardData.length+e.onlineReferenceCardData.length;return 0===a?null:(0,n.jsx)("div",{className:"pt-0 px-4 pb-4",children:(0,n.jsxs)("h3",{className:"inline-flex items-center",children:[(0,n.jsxs)("div",{className:"text-gray-400 m-2",children:[a," sources"]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2 w-auto m-2",children:t&&(0,n.jsx)(O,{notesReferenceCardData:e.notesReferenceCardData,onlineReferenceCardData:e.onlineReferenceCardData,codeReferenceCardData:e.codeReferenceCardData,isMobileWidth:e.isMobileWidth})})]})})}function O(e){let[t,a]=(0,r.useState)(3);if((0,r.useEffect)(()=>{a(e.isMobileWidth?3:5)},[e.isMobileWidth]),!e.notesReferenceCardData&&!e.onlineReferenceCardData)return null;let s=e.codeReferenceCardData.slice(0,t),o=e.notesReferenceCardData.slice(0,t-s.length),l=o.length+s.length<t?e.onlineReferenceCardData.filter(e=>e.link).slice(0,t-s.length-o.length):[];return(0,n.jsxs)(y.yo,{children:[(0,n.jsxs)(y.aM,{className:"text-balance w-auto justify-start overflow-hidden break-words p-0 bg-transparent border-none text-gray-400 align-middle items-center m-0 inline-flex",children:[s.map((e,t)=>(0,r.createElement)(k,{showFullContent:!1,...e,key:"code-".concat(t)})),o.map((e,t)=>(0,r.createElement)(_,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),l.map((e,t)=>(0,r.createElement)(R,{showFullContent:!1,...e,key:"".concat(e.title,"-").concat(t)})),(0,n.jsx)(v.o,{className:"m-0"})]}),(0,n.jsxs)(y.ue,{className:"overflow-y-scroll",children:[(0,n.jsxs)(y.Tu,{children:[(0,n.jsx)(y.bC,{children:"References"}),(0,n.jsx)(y.Ei,{children:"View all references for this response"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 w-auto mt-2",children:[e.codeReferenceCardData.map((e,t)=>(0,r.createElement)(k,{showFullContent:!0,...e,key:"code-".concat(t)})),e.notesReferenceCardData.map((e,t)=>(0,r.createElement)(_,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)})),e.onlineReferenceCardData.map((e,t)=>(0,r.createElement)(R,{showFullContent:!0,...e,key:"".concat(e.title,"-").concat(t)}))]})]})]})}var I=a(59199),S=a(24379),F=a(58441),L=a(49807),D=a(74541),B=a(52874),P=a(5033),z=a(30655),A=a(80382),q=a(7143),H=a(2585),U=a(58905),Z=a(39966),W=a(71640),V=a(24148),G=a(68382),J=a(78582),Q=a(96620),$=a(77276),K=a(39957),Y=a(14308),X=a(84671),ee=a(36663);let et=(0,a(30166).default)(()=>Promise.all([a.e(6555),a.e(7293),a.e(4609),a.e(2242)]).then(a.bind(a,92242)).then(e=>e.default),{loadableGenerated:{webpack:()=>[92242]},ssr:!1});function ea(e){return(0,n.jsx)(r.Suspense,{fallback:(0,n.jsx)(Y.Z,{}),children:(0,n.jsx)(et,{data:e.data})})}var en=a(26110),es=a(49027),eo=a(7436),er=a(19378),el=a(50656),ec=a(45199),ei=a(25778),ed=a(62869),eh=e=>{let{chart:t}=e,[a,s]=(0,r.useState)(null),[o]=(0,r.useState)("mermaid-chart-".concat(Math.random().toString(12).substring(7))),l=(0,r.useRef)(null);(0,r.useEffect)(()=>{el.Z.initialize({startOnLoad:!1}),el.Z.parseError=e=>{let t;console.error("Mermaid errors:",e);try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)},el.Z.contentLoaded()},[]);let c=async()=>{if(l.current)try{var e;let t=l.current.querySelector("svg");if(!t)throw Error("No SVG found");let[,,a,n]=(null===(e=t.getAttribute("viewBox"))||void 0===e?void 0:e.split(" ").map(Number))||[0,0,0,0],s=document.createElement("canvas");s.width=2*a,s.height=2*n;let o=s.getContext("2d");if(!o)throw Error("Failed to get canvas context");let r=new XMLSerializer().serializeToString(t),c=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(c),d=new Image;d.src=i,await new Promise((e,t)=>{d.onload=()=>{o.scale(2,2),o.drawImage(d,0,0,a,n),s.toBlob(a=>{if(!a){t(Error("Failed to create blob"));return}let n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download="mermaid-diagram-".concat(Date.now(),".png"),s.click(),URL.revokeObjectURL(n),URL.revokeObjectURL(i),e(!0)},"image/png")},d.onerror=()=>t(Error("Failed to load SVG"))})}catch(e){console.error("Error exporting diagram:",e),s("Failed to export diagram")}};return(0,r.useEffect)(()=>{l.current&&(l.current.removeAttribute("data-processed"),el.Z.run({nodes:[l.current]}).then(()=>{s(null)}).catch(e=>{let t;try{t="string"==typeof e?JSON.parse(e):e}catch(a){t=(null==e?void 0:e.toString())||"Unknown error"}console.log("Mermaid error message:",t),"element is null"!==t.str?s("Something went wrong while rendering the diagram. Please try again later or downvote the message if the issue persists."):s(null)}))},[t]),(0,n.jsxs)("div",{children:[a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 border border-red-500 rounded-md p-1 mt-3 text-red-900 text-sm",children:[(0,n.jsx)(ec.k,{className:"w-12 h-12"}),(0,n.jsx)("span",{children:a})]}),(0,n.jsx)("code",{className:"block bg-secondary text-secondary-foreground p-4 mt-3 rounded-lg font-mono text-sm whitespace-pre-wrap overflow-x-auto max-h-[400px] border border-gray-200",children:t})]}):(0,n.jsx)("div",{id:o,ref:l,className:"mermaid",style:{width:"auto",height:"auto",boxSizing:"border-box",overflow:"auto"},children:t}),!a&&(0,n.jsxs)(ed.z,{onClick:c,variant:"secondary",className:"mt-3",children:[(0,n.jsx)(ei.U,{className:"w-5 h-5"}),"Export as PNG"]})]})};let eu=new h.Z({html:!0,linkify:!0,typographer:!0});function eg(e,t,a){fetch("/api/chat/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uquery:e,kquery:t,sentiment:a})})}function em(e){let{uquery:t,kquery:a}=e,[s,o]=(0,r.useState)(null);return(0,r.useEffect)(()=>{null!==s&&setTimeout(()=>{o(null)},2e3)},[s]),(0,n.jsxs)("div",{className:"".concat(d().feedbackButtons," flex align-middle justify-center items-center"),children:[(0,n.jsx)("button",{title:"Like",className:d().thumbsUpButton,disabled:null!==s,onClick:()=>{eg(t,a,"positive"),o(!0)},children:!0===s?(0,n.jsx)(S.V,{alt:"Liked Message",className:"text-green-500",weight:"fill"}):(0,n.jsx)(S.V,{alt:"Like Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),(0,n.jsx)("button",{title:"Dislike",className:d().thumbsDownButton,disabled:null!==s,onClick:()=>{eg(t,a,"negative"),o(!1)},children:!1===s?(0,n.jsx)(F.L,{alt:"Disliked Message",className:"text-red-500",weight:"fill"}):(0,n.jsx)(F.L,{alt:"Dislike Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})})]})}function ef(e){let t=e.message.match(/\*\*(.*)\*\*/),a=function(e,t){let a=e.toLowerCase(),s="inline mt-1 mr-2 ".concat(t," h-4 w-4");return a.includes("understanding")?(0,n.jsx)(L.a,{className:"".concat(s)}):a.includes("generating")?(0,n.jsx)(D.Z,{className:"".concat(s)}):a.includes("tools")?(0,n.jsx)(B.v,{className:"".concat(s)}):a.includes("notes")?(0,n.jsx)(P.gt,{className:"".concat(s)}):a.includes("read")?(0,n.jsx)(z.f,{className:"".concat(s)}):a.includes("search")?(0,n.jsx)(A.Y,{className:"".concat(s)}):a.includes("summary")||a.includes("summarize")||a.includes("enhanc")?(0,n.jsx)(q.u,{className:"".concat(s)}):a.includes("diagram")?(0,n.jsx)(H.j,{className:"".concat(s)}):a.includes("paint")?(0,n.jsx)(U.Y,{className:"".concat(s)}):a.includes("code")?(0,n.jsx)(p.E,{className:"".concat(s)}):a.includes("operating")?(0,n.jsx)(Z.A,{className:"".concat(s)}):(0,n.jsx)(L.a,{className:"".concat(s)})}(t?t[1]:"",e.primary?(0,X.oz)(e.agentColor):"text-gray-500"),s=e.message,o=null;try{let e=s.match(/\{.*("action": "screenshot"|"type": "screenshot"|"image": "data:image\/.*").*\}/);if(e){o=JSON.parse(e[0]);let t='<img src="'.concat(o.image,'" alt="State of environment" class="max-w-full" />');s=s.replace(":\n**Action**: ".concat(e[0]),"\n\n- ".concat(o.text,"\n").concat(t))}}catch(e){console.error("Failed to parse screenshot data",e)}let r=b.Z.sanitize(eu.render(s));return r=r.replace(/<h[1-6].*?<\/h[1-6]>/g,""),(0,n.jsxs)("div",{className:"".concat(d().trainOfThoughtElement," break-words items-center ").concat(e.primary?"text-gray-400":"text-gray-300"," ").concat(d().trainOfThought," ").concat(e.primary?d().primary:""),children:[a,(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r},className:"break-words"})]})}eu.use(g(),{inline:!0,code:!0});let ep=(0,r.forwardRef)((e,t)=>{var a,s;let o,l;let[c,i]=(0,r.useState)(!1),[h,u]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),[p,x]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),[y,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)(""),[_,k]=(0,r.useState)(""),R=(0,r.useRef)(!1),T=(0,r.useRef)(null);function O(e){let t=new Date(e+"Z"),a=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}).toUpperCase(),n=t.toLocaleString("en-US",{year:"numeric",month:"short",day:"2-digit"}).replaceAll("-"," ");return"".concat(a," on ").concat(n)}async function S(){let t=e.chatMessage.message.match(/[^.!?]+[.!?]*/g)||[];if(!t||0===t.length||!t[0])return;j(!0);let a=F(t[0]);for(let e=0;e<t.length&&!R.current;e++){let n=a;e<t.length-1&&(a=F(t[e+1]));try{let e=await n,t=URL.createObjectURL(e);await function(e){return new Promise((t,a)=>{let n=new Audio(e);n.onended=t,n.onerror=a,n.play()})}(t)}catch(e){console.error("Error:",e);break}}j(!1),w(!1)}async function F(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()}(0,r.useEffect)(()=>{R.current=y},[y]),(0,r.useEffect)(()=>{let e=new MutationObserver((e,t)=>{if(T.current)for(let t of e)"childList"===t.type&&t.addedNodes.length>0&&(0,ee.Z)(T.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]})});return T.current&&e.observe(T.current,{childList:!0}),()=>e.disconnect()},[T.current]),(0,r.useEffect)(()=>{let t=e.chatMessage.message;e.chatMessage.excalidrawDiagram&&C(e.chatMessage.excalidrawDiagram),e.chatMessage.mermaidjsDiagram&&k(e.chatMessage.mermaidjsDiagram),t=t.replace(/\\\(/g,"LEFTPAREN").replace(/\\\)/g,"RIGHTPAREN").replace(/\\\[/g,"LEFTBRACKET").replace(/\\\]/g,"RIGHTBRACKET"),t=(0,I.AQ)(t,e.chatMessage.codeContext),e.chatMessage.codeContext&&Object.entries(e.chatMessage.codeContext).forEach(e=>{var a,n;let[s,o]=e;null===(n=o.results)||void 0===n||null===(a=n.output_files)||void 0===a||a.forEach(e=>{(e.filename.endsWith(".png")||e.filename.endsWith(".jpg"))&&!t.includes("![".concat(e.filename,"]("))&&(t+="\n\n![".concat(e.filename,"](data:image/png;base64,").concat(e.b64_data,")"))})});let a=t,n=t;if(e.chatMessage.images&&e.chatMessage.images.length>0){let t=e.chatMessage.images.map(e=>{let t=e.startsWith("data%3Aimage")?decodeURIComponent(e):e;return b.Z.sanitize(t)}),s=t.map((e,t)=>"![uploaded image ".concat(t+1,"](").concat(e,")")).join("\n"),o=t.map((e,t)=>'<div class="'.concat(d().imageWrapper,'"><img src="').concat(e,'" alt="uploaded image ').concat(t+1,'" /></div>')).join(""),r='<div class="'.concat(d().imagesContainer,'">').concat(o,"</div>");a="".concat(s,"\n\n").concat(a),n="".concat(r).concat(n)}f(a);let s=eu.render(n);s=s.replace(/LEFTPAREN/g,"\\(").replace(/RIGHTPAREN/g,"\\)").replace(/LEFTBRACKET/g,"\\[").replace(/RIGHTBRACKET/g,"\\]"),x(b.Z.sanitize(s))},[e.chatMessage.message,e.chatMessage.images,e.chatMessage.intent]),(0,r.useEffect)(()=>{c&&setTimeout(()=>{i(!1)},2e3)},[c]),(0,r.useEffect)(()=>{T.current&&(T.current.querySelectorAll("pre > .hljs").forEach(e=>{if(!e.querySelector("".concat(d().codeCopyButton))){let t=document.createElement("button"),a=(0,n.jsx)(W.w,{size:24});(0,m.createRoot)(t).render(a),t.className="hljs ".concat(d().codeCopyButton),t.addEventListener("click",()=>{let a=e.textContent||"";a=(a=(a=a.replace(/^\$+/,"")).replace(/^Copy/,"")).trim(),navigator.clipboard.writeText(a);let s=(0,n.jsx)(V.J,{size:24});(0,m.createRoot)(t).render(s)}),e.prepend(t)}}),(0,ee.Z)(T.current,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\[",right:"\\]",display:!0},{left:"\\(",right:"\\)",display:!1}]}))},[p,h,T]);let L=async t=>{let a=t.turnId||e.turnId;(await fetch("/api/chat/conversation/message",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversation_id:e.conversationId,turn_id:a})})).ok?e.onDeleteMessage(a):console.error("Failed to delete message")},D=function(e,t,a){let n=[],s=[],o=[];if(a)for(let[e,t]of Object.entries(a))t.results&&o.push({code:t.code,output:t.results.std_out,output_files:t.results.output_files,error:t.results.std_err});if(t){let e=[];for(let[a,n]of Object.entries(t)){if(n.answerBox&&e.push({title:n.answerBox.title,description:n.answerBox.answer,link:n.answerBox.source}),n.knowledgeGraph&&e.push({title:n.knowledgeGraph.title,description:n.knowledgeGraph.description,link:n.knowledgeGraph.descriptionLink}),n.webpages){if(n.webpages instanceof Array){let t=n.webpages.map(e=>({title:e.query,description:e.snippet,link:e.link}));e.push(...t)}else{let t=n.webpages;e.push({title:t.query,description:t.snippet,link:t.link})}}if(n.organic){let t=n.organic.map(e=>({title:e.title,description:e.snippet,link:e.link}));e.push(...t)}}n.push(...e)}if(e){let t=e.map(e=>e.compiled||""===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:n,codeReferenceCardData:o}}(e.chatMessage.context,e.chatMessage.onlineContext,e.chatMessage.codeContext);return(0,n.jsxs)("div",{ref:t,className:(a=e.chatMessage,o=[d().chatMessageContainer],"khoj"===a.by&&o.push("shadow-md"),o.push(d()[a.by]),a.message||o.push(d().emptyChatMessage),e.customClassName&&o.push(d()["".concat(a.by).concat(e.customClassName)]),o.join(" ")),onMouseLeave:e=>u(!1),onMouseEnter:e=>u(!0),"data-created":O(e.chatMessage.created),children:[(0,n.jsxs)("div",{className:(s=e.chatMessage,(l=[d().chatMessageWrapper]).push(d()[s.by]),"khoj"===s.by&&l.push("border-l-4 border-opacity-50 ".concat("border-l-"+e.borderLeftColor)),l.join(" ")),children:[e.chatMessage.queryFiles&&e.chatMessage.queryFiles.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap flex-col mb-2 max-w-full",children:e.chatMessage.queryFiles.map((e,t)=>(0,n.jsxs)(en.Vq,{children:[(0,n.jsx)(en.hg,{asChild:!0,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer bg-gray-500 bg-opacity-25 rounded-lg p-2 w-full ",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:(0,M.Le)(e.file_type)}),(0,n.jsx)("span",{className:"truncate flex-1 min-w-0 max-w-[200px]",children:e.name}),e.size&&(0,n.jsxs)("span",{className:"text-gray-400 flex-shrink-0",children:["(",(0,eo.xq)(e.size),")"]})]})}),(0,n.jsxs)(en.cZ,{children:[(0,n.jsx)(en.fK,{children:(0,n.jsx)(es.$N,{children:(0,n.jsx)("div",{className:"truncate min-w-0 break-words break-all text-wrap max-w-full whitespace-normal",children:e.name})})}),(0,n.jsx)(en.Be,{children:(0,n.jsx)(er.x,{className:"h-72 w-full rounded-md break-words break-all text-wrap",children:e.content})})]})]},t))}),(0,n.jsx)("div",{ref:T,className:d().chatMessage,dangerouslySetInnerHTML:{__html:p}}),N&&(0,n.jsx)(ea,{data:N}),_&&(0,n.jsx)(eh,{chart:_})]}),(0,n.jsx)("div",{className:d().teaserReferencesContainer,children:(0,n.jsx)(E,{isMobileWidth:e.isMobileWidth,notesReferenceCardData:D.notesReferenceCardData,onlineReferenceCardData:D.onlineReferenceCardData,codeReferenceCardData:D.codeReferenceCardData})}),(0,n.jsx)("div",{className:d().chatFooter,children:(h||e.isMobileWidth||e.isLastMessage||v)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{title:O(e.chatMessage.created),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,n.jsxs)("div",{className:"".concat(d().chatButtons," shadow-sm"),children:["khoj"===e.chatMessage.by&&(v?y?(0,n.jsx)(Y.l,{iconClassName:"p-0",className:"m-0"}):(0,n.jsx)("button",{title:"Pause Speech",onClick:e=>w(!0),children:(0,n.jsx)(G.d,{alt:"Pause Message",className:"hsl(var(--muted-foreground))"})}):(0,n.jsx)("button",{title:"Speak",onClick:e=>S(),children:(0,n.jsx)(J.j,{alt:"Speak Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})})),e.chatMessage.turnId&&(0,n.jsx)("button",{title:"Delete",className:"".concat(d().deleteButton),onClick:()=>L(e.chatMessage),children:(0,n.jsx)(Q.r,{alt:"Delete Message",className:"hsl(var(--muted-foreground)) hover:text-red-500"})}),"khoj"===e.chatMessage.by&&e.onRetryMessage&&e.isLastMessage&&(0,n.jsx)("button",{title:"Retry",className:"".concat(d().retryButton),onClick:()=>{var t,a,n;let s=e.chatMessage.turnId||e.turnId,o=e.chatMessage.rawQuery||(null===(t=e.chatMessage.intent)||void 0===t?void 0:t.query);if(console.log("Retry button clicked for turnId:",s),console.log("ChatMessage data:",{rawQuery:e.chatMessage.rawQuery,intent:e.chatMessage.intent,message:e.chatMessage.message}),console.log("Extracted query:",o),o)null===(a=e.onRetryMessage)||void 0===a||a.call(e,o,s);else{console.error("No original query found for retry");let t=prompt("Enter the original query to retry:");t&&(null===(n=e.onRetryMessage)||void 0===n||n.call(e,t,s))}},children:(0,n.jsx)($._,{alt:"Retry Message",className:"hsl(var(--muted-foreground)) hover:text-blue-500"})}),(0,n.jsx)("button",{title:"Copy",className:"".concat(d().copyButton),onClick:()=>{navigator.clipboard.writeText(g),i(!0)},children:c?(0,n.jsx)(K.C,{alt:"Copied Message",weight:"fill",className:"text-green-500"}):(0,n.jsx)(K.C,{alt:"Copy Message",className:"hsl(var(--muted-foreground)) hover:text-green-500"})}),"khoj"===e.chatMessage.by&&(e.chatMessage.intent?(0,n.jsx)(em,{uquery:e.chatMessage.intent.query,kquery:e.chatMessage.message}):(0,n.jsx)(em,{uquery:e.chatMessage.rawQuery||e.chatMessage.message,kquery:e.chatMessage.message}))]})]})})]})});ep.displayName="ChatMessage";var ex=a(17104),ev=a(66142),ej=a(25397),ey=a(44849),ew=a.n(ey);function eb(e){let{frames:t,autoPlay:a=!0,playbackSpeed:s=1e3}=e,[o,l]=(0,r.useState)(0),[c,i]=(0,r.useState)(a),[d,h]=(0,r.useState)(!0),u=(0,r.useRef)(null);(0,r.useEffect)(()=>{d&&t.length>0&&l(t.length-1)},[t.length,d]),(0,r.useEffect)(()=>(c&&t.length>1?u.current=setInterval(()=>{l(e=>{let a=e+1;return a>=t.length?(i(!1),e):a})},s):u.current&&(clearInterval(u.current),u.current=null),()=>{u.current&&clearInterval(u.current)}),[c,t.length,s]);let g=t[o],m=e=>{l(e),h(!1),i(!1)};return t.length?(0,n.jsxs)("div",{className:ew().videoPlayer,children:[(0,n.jsxs)("div",{className:ew().screen,children:[(null==g?void 0:g.image)&&(0,n.jsx)("img",{src:g.image,alt:"Train of thought frame ".concat(o+1),className:ew().screenImage}),(0,n.jsx)("div",{className:ew().textOverlay,children:(0,n.jsx)("div",{className:ew().thoughtText,children:null==g?void 0:g.text})})]}),(0,n.jsxs)("div",{className:ew().controls,children:[(0,n.jsxs)("div",{className:ew().timeline,children:[(0,n.jsx)("input",{type:"range",min:0,max:Math.max(0,t.length-1),value:o,onChange:e=>m(parseInt(e.target.value)),className:ew().timelineSlider}),(0,n.jsx)("div",{className:ew().frameMarkers,children:t.map((e,t)=>(0,n.jsx)("div",{className:"".concat(ew().frameMarker," ").concat(e.image?ew().hasImage:ew().textOnly," ").concat(t===o?ew().active:""),onClick:()=>m(t),title:"Frame ".concat(t+1,": ").concat(e.text.slice(0,50),"...")},t))})]}),(0,n.jsxs)("div",{className:ew().controlButtons,children:[(0,n.jsx)("button",{onClick:()=>{o>0&&(l(o-1),h(!1),i(!1))},disabled:0===o,title:"Previous frame",className:ew().controlButton,children:(0,n.jsx)(ex.F,{size:16})}),(0,n.jsx)("button",{onClick:()=>{i(!c),h(!1)},disabled:t.length<=1,title:c?"Pause":"Play",className:ew().controlButton,children:c?(0,n.jsx)(G.d,{size:16}):(0,n.jsx)(ev.s,{size:16})}),(0,n.jsx)("button",{onClick:()=>{o<t.length-1&&(l(o+1),h(!1),i(!1))},disabled:o===t.length-1,title:"Next frame",className:ew().controlButton,children:(0,n.jsx)(ej.N,{size:16})}),(0,n.jsx)("button",{onClick:()=>{h(!0),l(t.length-1),i(!1)},className:"".concat(ew().controlButton," ").concat(d?ew().active:""),title:"Auto-track latest",children:"Live"})]}),(0,n.jsx)("div",{className:ew().frameInfo,children:(0,n.jsxs)("span",{children:[o+1," / ",t.length]})})]})]}):null}var eM=a(72102),eN=a(23713),eC=a(795),e_=a(935),ek=a(81103),eR=e=>{let{name:t,avatar:a,link:s,description:o}=e;return(0,n.jsx)("div",{className:"relative group flex",children:(0,n.jsx)(ek.pn,{children:(0,n.jsxs)(ek.u,{delayDuration:0,children:[(0,n.jsx)(ek.aJ,{asChild:!0,children:(0,n.jsxs)(ed.z,{variant:"ghost",className:"flex items-center justify-center",children:[a,(0,n.jsx)("div",{children:t})]})}),(0,n.jsx)(ek._v,{children:(0,n.jsxs)("div",{className:"w-80 h-30",children:[(0,n.jsx)("a",{href:s,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:[a,(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)(v.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"})]})})]})})})},eT=a(37104);function eE(e){let[t,a]=(0,r.useState)(e.completed),[s,i]=(0,r.useState)([]);return(0,r.useEffect)(()=>{e.completed&&a(!0)},[e.completed]),(0,r.useEffect)(()=>{if(!e.trainOfThought||0===e.trainOfThought.length){i([]);return}i(function(e){if(!e)return[];let t=[],a=[],n=[];return e.forEach((e,s)=>{let o=e.data,r=!1;try{let e=o.match(/\{.*(\"action\": \"screenshot\"|\"type\": \"screenshot\"|\"image\": \"data:image\/.*\").*\}/);if(e){let l=JSON.parse(e[0]);l.image&&(r=!0,o=o.replace(":\n**Action**: ".concat(e[0]),""),l.text&&(o+="\n\n".concat(l.text)),n.length>0&&(t.push({type:"text",textEntries:[...n]}),n=[]),a.push({text:o,image:l.image,timestamp:s}))}}catch(e){console.error("Failed to parse screenshot data",e)}r||(a.length>0&&(t.push({type:"video",frames:[...a]}),a=[]),n.push(e))}),a.length>0&&t.push({type:"video",frames:a}),n.length>0&&t.push({type:"text",textEntries:n}),t}("string"==typeof e.trainOfThought[0]?e.trainOfThought.map((e,t)=>({type:"text",data:e})):e.trainOfThought))},[e.trainOfThought]),(0,n.jsxs)("div",{className:"".concat(t?"":o().trainOfThought+" border"," rounded-lg"),children:[!e.completed&&(0,n.jsx)(Y.l,{className:"float-right"}),e.completed&&(t?(0,n.jsxs)(ed.z,{className:"w-fit text-left justify-start content-start text-xs",onClick:()=>a(!1),variant:"ghost",size:"sm",children:["Thought Process ",(0,n.jsx)(eM.p,{size:16,className:"ml-1"})]}):(0,n.jsxs)(ed.z,{className:"w-fit text-left justify-start content-start text-xs p-0 h-fit",onClick:()=>a(!0),variant:"ghost",size:"sm",children:["Close ",(0,n.jsx)(eN.U,{size:16,className:"ml-1"})]})),(0,n.jsx)(l.M,{initial:!1,children:!t&&(0,n.jsx)(c.E.div,{initial:"closed",animate:"open",exit:"closed",variants:{open:{height:"auto",opacity:1,transition:{duration:.3,ease:"easeOut"}},closed:{height:0,opacity:0,transition:{duration:.3,ease:"easeIn"}}},children:s.map((t,a)=>(0,n.jsxs)("div",{children:["video"===t.type&&t.frames&&t.frames.length>0&&(0,n.jsx)(eb,{frames:t.frames,autoPlay:!1,playbackSpeed:1500}),"text"===t.type&&t.textEntries&&t.textEntries.map((o,r)=>{let l=s.length-1,c=r===t.textEntries.length-1,i=a===l&&c&&e.lastMessage&&!e.completed;return(0,n.jsx)(ef,{message:o.data,primary:i,agentColor:e.agentColor},"train-text-".concat(a,"-").concat(r,"-").concat(o.data.length))})]},"train-group-".concat(a)))})})]},e.keyId)}function eO(e){var t,a,s,l,c,i,d;let[h,u]=(0,r.useState)(null),[g,m]=(0,r.useState)(0),[f,p]=(0,r.useState)(!0),[x,v]=(0,r.useState)(null),j=(0,r.useRef)(null),y=(0,r.useRef)(null),w=(0,r.useRef)(null),b=(0,r.useRef)(null),N=(0,r.useRef)(null),[C,_]=(0,r.useState)(null),[k,R]=(0,r.useState)(!1),[T,E]=(0,r.useState)(!0),O=(0,eo.IC)(),I="[data-radix-scroll-area-viewport]",S=localStorage.getItem("message");(0,r.useEffect)(()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(I);if(!t)return;let a=()=>{let{scrollTop:e,scrollHeight:a,clientHeight:n}=t;E(a-(e+n)<=50)};return t.addEventListener("scroll",a),a(),()=>t.removeEventListener("scroll",a)},[y]),(0,r.useEffect)(()=>{e.incomingMessages&&e.incomingMessages.length>0&&T&&L(!0)},[e.incomingMessages,T]),(0,r.useEffect)(()=>{var t;let a=w.current,n=null===(t=y.current)||void 0===t?void 0:t.querySelector(I);if(!a||!n)return;let s=new ResizeObserver(()=>{let{scrollTop:t,scrollHeight:a,clientHeight:s}=n;if(a-(t+s)<=50&&e.incomingMessages&&e.incomingMessages.length>0){let t=e.incomingMessages[e.incomingMessages.length-1];(!t.completed||t.completed&&null!==C)&&L(!0)}});return s.observe(a),()=>s.disconnect()},[e.incomingMessages,C,y]),(0,r.useEffect)(()=>{h&&h.chat&&h.chat.length>0&&g<2&&requestAnimationFrame(()=>{var e;null===(e=b.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"})})},[h,g]),(0,r.useEffect)(()=>{if(!f||k)return;let t=new IntersectionObserver(t=>{t[0].isIntersecting&&f&&(R(!0),function(t){if(!f||k)return;let a=(t+1)*10,n="";if(e.conversationId)n="/api/chat/history?client=web&conversation_id=".concat(encodeURIComponent(e.conversationId),"&n=").concat(a);else{if(!e.publicConversationSlug)return;n="/api/chat/share/history?client=web&public_conversation_slug=".concat(e.publicConversationSlug,"&n=").concat(a)}fetch(n).then(e=>e.json()).then(a=>{var n;if(e.setTitle(a.response.slug),e.setIsOwner&&e.setIsOwner(null==a?void 0:null===(n=a.response)||void 0===n?void 0:n.is_owner),a&&a.response&&a.response.chat&&a.response.chat.length>0){if(m(Math.ceil(a.response.chat.length/10)),a.response.chat.length===(null==h?void 0:h.chat.length)){p(!1),R(!1);return}e.setAgent(a.response.agent),u(a.response),R(!1),0===t?L(!0):F()}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,is_owner:a.response.is_owner};e.setAgent(a.response.agent),u(t),e.setIsChatSideBarOpen&&!S&&e.setIsChatSideBarOpen(!0)}p(!1),R(!1)}}).catch(e=>{console.error(e),window.location.href="/"})}(g))},{threshold:1});return j.current&&t.observe(j.current),()=>t.disconnect()},[f,g,k]),(0,r.useEffect)(()=>{p(!0),R(!1),m(0),u(null)},[e.conversationId]),(0,r.useEffect)(()=>{if(e.incomingMessages){let t=e.incomingMessages[e.incomingMessages.length-1];t&&!t.completed&&(_(e.incomingMessages.length-1),e.setTitle(t.rawQuery),t.turnId&&v(t.turnId))}},[e.incomingMessages]);let F=()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.querySelector(I);requestAnimationFrame(()=>{var e;null===(e=N.current)||void 0===e||e.scrollIntoView({behavior:"auto",block:"start"}),null==t||t.scrollBy({behavior:"smooth",top:-150})})},L=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=null===(e=y.current)||void 0===e?void 0:e.querySelector(I);requestAnimationFrame(()=>{null==a||a.scrollTo({top:a.scrollHeight,behavior:t?"auto":"smooth"})}),(t||a&&a.scrollHeight-(a.scrollTop+a.clientHeight)<5)&&E(!0)};function D(){var e,t;return h&&h.agent&&(null===(e=h.agent)||void 0===e?void 0:e.name)?h.agent.is_hidden?"Khoj":null===(t=h.agent)||void 0===t?void 0:t.name:"Agent"}let B=t=>{t&&(u(e=>e&&t?{...e,chat:e.chat.filter(e=>e.turnId!==t)}:e),e.incomingMessages&&e.setIncomingMessages&&e.setIncomingMessages(e.incomingMessages.filter(e=>e.turnId!==t)))},P=(t,a)=>{var n;t&&(a&&B(a),null===(n=e.onRetryMessage)||void 0===n||n.call(e,t,a))};return e.conversationId||e.publicConversationSlug?(0,n.jsx)(er.x,{className:"\n h-[calc(100svh-theme(spacing.44))]\n sm:h-[calc(100svh-theme(spacing.44))]\n md:h-[calc(100svh-theme(spacing.44))]\n lg:h-[calc(100svh-theme(spacing.44))]\n ",ref:y,children:(0,n.jsxs)("div",{ref:w,children:[(0,n.jsxs)("div",{className:"print-only-header",children:[(0,n.jsxs)("div",{className:"print-header-content",children:[(0,n.jsx)("div",{className:"print-header-left",children:(0,n.jsx)(eT.S6,{className:"print-logo"})}),(0,n.jsxs)("div",{className:"print-header-right",children:[(0,n.jsx)("h1",{children:(null==h?void 0:h.slug)||"Conversation with Khoj"}),(0,n.jsx)("div",{className:"conversation-meta",children:(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:"Agent:"})," ",D()]})})]})]}),(0,n.jsx)("hr",{})]}),(0,n.jsxs)("div",{className:"".concat(o().chatHistory," ").concat(e.customClassName),children:[(0,n.jsx)("div",{ref:j,style:{height:"1px"},children:k&&(0,n.jsx)(Y.l,{className:"opacity-50"})}),h&&h.chat&&h.chat.map((t,a)=>{var s,o;return(0,n.jsxs)(r.Fragment,{children:[t.trainOfThought&&"khoj"===t.by&&(0,n.jsx)(eE,{trainOfThought:t.trainOfThought,lastMessage:!1,agentColor:(null==h?void 0:null===(s=h.agent)||void 0===s?void 0:s.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:!0},"".concat(a,"trainOfThought")),(0,n.jsx)(ep,{ref:a===h.chat.length-2?b:a===h.chat.length-(g-1)*10?N:null,isMobileWidth:O,chatMessage:t,customClassName:"fullHistory",borderLeftColor:"".concat(null==h?void 0:null===(o=h.agent)||void 0===o?void 0:o.color,"-500"),isLastMessage:a===h.chat.length-1,onDeleteMessage:B,onRetryMessage:P,conversationId:e.conversationId},"".concat(a,"fullHistory"))]},"chatMessage-".concat(a))}),e.incomingMessages&&e.incomingMessages.map((t,a)=>{var s,o,l,c,i;let d=null!==(i=null!==(c=t.turnId)&&void 0!==c?c:x)&&void 0!==i?i:void 0;return(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(ep,{isMobileWidth:O,chatMessage:{message:t.rawQuery,context:[],onlineContext:{},codeContext:{},created:t.timestamp,by:"you",automationId:"",images:t.images,conversationId:e.conversationId,turnId:d,queryFiles:t.queryFiles},customClassName:"fullHistory",borderLeftColor:"".concat(null==h?void 0:null===(s=h.agent)||void 0===s?void 0:s.color,"-500"),onDeleteMessage:B,onRetryMessage:P,conversationId:e.conversationId,turnId:d},"".concat(a,"outgoing")),t.trainOfThought&&t.trainOfThought.length>0&&(0,n.jsx)(eE,{trainOfThought:t.trainOfThought,lastMessage:a===C,agentColor:(null==h?void 0:null===(o=h.agent)||void 0===o?void 0:o.color)||"orange",keyId:"".concat(a,"trainOfThought"),completed:t.completed},"".concat(a,"trainOfThought-").concat(t.trainOfThought.length,"-").concat(t.trainOfThought.map(e=>e.length).join("-"))),(0,n.jsx)(ep,{isMobileWidth:O,chatMessage:{message:t.rawResponse,context:t.context,onlineContext:t.onlineContext,codeContext:t.codeContext,created:t.timestamp,by:"khoj",automationId:"",rawQuery:t.rawQuery,intent:{type:t.intentType||"",query:t.rawQuery,"memory-type":"","inferred-queries":t.inferredQueries||[]},conversationId:e.conversationId,images:t.generatedImages,queryFiles:t.generatedFiles,mermaidjsDiagram:t.generatedMermaidjsDiagram,turnId:d},conversationId:e.conversationId,turnId:d,onDeleteMessage:B,onRetryMessage:P,customClassName:"fullHistory",borderLeftColor:"".concat(null==h?void 0:null===(l=h.agent)||void 0===l?void 0:l.color,"-500"),isLastMessage:a===e.incomingMessages.length-1},"".concat(a,"incoming"))]},"incomingMessage".concat(a))}),e.pendingMessage&&(0,n.jsx)(ep,{isMobileWidth:O,chatMessage:{message:e.pendingMessage,context:[],onlineContext:{},codeContext:{},created:new Date().getTime().toString(),by:"you",automationId:"",conversationId:e.conversationId,turnId:void 0},conversationId:e.conversationId,onDeleteMessage:B,onRetryMessage:P,customClassName:"fullHistory",borderLeftColor:"".concat(null==h?void 0:null===(t=h.agent)||void 0===t?void 0:t.color,"-500"),isLastMessage:!0},"pendingMessage-".concat(e.pendingMessage.length)),h&&(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)(eR,{name:D(),link:h&&h.agent&&(null===(l=h.agent)||void 0===l?void 0:l.slug)?"/agents?agent=".concat(null===(c=h.agent)||void 0===c?void 0:c.slug):"/agents",avatar:(0,M.TI)(null===(a=h.agent)||void 0===a?void 0:a.icon,null===(s=h.agent)||void 0===s?void 0:s.color)||(0,n.jsx)(eC.v,{}),description:h&&h.agent?(null===(i=h.agent)||void 0===i?void 0:i.persona)?null===(d=h.agent)||void 0===d?void 0:d.persona:"You can set a persona for your agent in the Chat Options side panel.":"Your agent is no longer available. You will be reset to the default agent."})})})]}),(0,n.jsx)("div",{className:"".concat(e.customClassName," fixed bottom-[20%] z-10"),children:!T&&(0,n.jsx)("button",{title:"Scroll to bottom",className:"absolute bottom-0 right-0 bg-white dark:bg-[hsl(var(--background))] text-neutral-500 dark:text-white p-2 rounded-full shadow-xl",onClick:()=>{L()},children:(0,n.jsx)(e_.K,{size:24})})})]})}):null}},42501:function(e){e.exports={chatHistory:"chatHistory_chatHistory__CoaVT",agentIndicator:"chatHistory_agentIndicator__wOU1f",trainOfThought:"chatHistory_trainOfThought__mMWSR"}},91499: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",emptyChatMessage:"chatMessage_emptyChatMessage__J9JRn",imagesContainer:"chatMessage_imagesContainer__HTRjT",imageWrapper:"chatMessage_imageWrapper__DF92M",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",retryButton:"chatMessage_retryButton__Z7Pzk",trainOfThought:"chatMessage_trainOfThought__mR2Gg",primary:"chatMessage_primary__WYPEb",trainOfThoughtElement:"chatMessage_trainOfThoughtElement__le_bC"}},44849:function(e){e.exports={videoPlayer:"trainOfThoughtVideoPlayer_videoPlayer__Dz3mA",screen:"trainOfThoughtVideoPlayer_screen__dvEVh",screenImage:"trainOfThoughtVideoPlayer_screenImage__3SgOQ",textOverlay:"trainOfThoughtVideoPlayer_textOverlay__BGbhO",thoughtText:"trainOfThoughtVideoPlayer_thoughtText__zn_vT",controls:"trainOfThoughtVideoPlayer_controls__HDkO_",timeline:"trainOfThoughtVideoPlayer_timeline__hSpWu",timelineSlider:"trainOfThoughtVideoPlayer_timelineSlider__GQ8dx",frameMarkers:"trainOfThoughtVideoPlayer_frameMarkers__5y3He",frameMarker:"trainOfThoughtVideoPlayer_frameMarker__DBO9Y",hasImage:"trainOfThoughtVideoPlayer_hasImage__GFGAk",textOnly:"trainOfThoughtVideoPlayer_textOnly__okufk",active:"trainOfThoughtVideoPlayer_active__zp6u9",controlButtons:"trainOfThoughtVideoPlayer_controlButtons__rqfIH",controlButton:"trainOfThoughtVideoPlayer_controlButton___RdE_",frameInfo:"trainOfThoughtVideoPlayer_frameInfo__u5nwA"}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8459,3317,7138,244],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3179],{90836:function(t,e,r){Promise.resolve().then(r.bind(r,35976))},89534:function(t,e,r){"use strict";r.d(e,{FN:function(){return f},Mi:function(){return v},VW:function(){return d},_i:function(){return c},gD:function(){return p},lj:function(){return x},sA:function(){return m}});var s=r(57437),a=r(2265),n=r(41915),o=r(90535),i=r(32489),u=r(94508);let d=n.zt,c=a.forwardRef((t,e)=>{let{className:r,...a}=t;return(0,s.jsx)(n.l_,{ref:e,className:(0,u.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",r),...a})});c.displayName=n.l_.displayName;let l=(0,o.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),f=a.forwardRef((t,e)=>{let{className:r,variant:a,...o}=t;return(0,s.jsx)(n.fC,{ref:e,className:(0,u.cn)(l({variant:a}),r),...o})});f.displayName=n.fC.displayName;let p=a.forwardRef((t,e)=>{let{className:r,...a}=t;return(0,s.jsx)(n.aU,{ref:e,className:(0,u.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",r),...a})});p.displayName=n.aU.displayName;let m=a.forwardRef((t,e)=>{let{className:r,...a}=t;return(0,s.jsx)(n.x8,{ref:e,className:(0,u.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",r),"toast-close":"",...a,children:(0,s.jsx)(i.Z,{className:"h-4 w-4"})})});m.displayName=n.x8.displayName;let v=a.forwardRef((t,e)=>{let{className:r,...a}=t;return(0,s.jsx)(n.Dx,{ref:e,className:(0,u.cn)("text-sm font-semibold",r),...a})});v.displayName=n.Dx.displayName;let x=a.forwardRef((t,e)=>{let{className:r,...a}=t;return(0,s.jsx)(n.dk,{ref:e,className:(0,u.cn)("text-sm opacity-90",r),...a})});x.displayName=n.dk.displayName},35976:function(t,e,r){"use strict";r.d(e,{Toaster:function(){return o}});var s=r(57437),a=r(89534),n=r(77992);function o(){let{toasts:t}=(0,n.pm)();return(0,s.jsxs)(a.VW,{children:[t.map(function(t){let{id:e,title:r,description:n,action:o,...i}=t;return(0,s.jsxs)(a.FN,{...i,children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[r&&(0,s.jsx)(a.Mi,{children:r}),n&&(0,s.jsx)(a.lj,{children:n})]}),o,(0,s.jsx)(a.sA,{})]},e)}),(0,s.jsx)(a._i,{})]})}},77992:function(t,e,r){"use strict";r.d(e,{pm:function(){return f}});var s=r(2265);let a=0,n=new Map,o=t=>{if(n.has(t))return;let e=setTimeout(()=>{n.delete(t),c({type:"REMOVE_TOAST",toastId:t})},1e6);n.set(t,e)},i=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,1)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{let{toastId:r}=e;return r?o(r):t.toasts.forEach(t=>{o(t.id)}),{...t,toasts:t.toasts.map(t=>t.id===r||void 0===r?{...t,open:!1}:t)}}case"REMOVE_TOAST":if(void 0===e.toastId)return{...t,toasts:[]};return{...t,toasts:t.toasts.filter(t=>t.id!==e.toastId)}}},u=[],d={toasts:[]};function c(t){d=i(d,t),u.forEach(t=>{t(d)})}function l(t){let{...e}=t,r=(a=(a+1)%Number.MAX_SAFE_INTEGER).toString(),s=()=>c({type:"DISMISS_TOAST",toastId:r});return c({type:"ADD_TOAST",toast:{...e,id:r,open:!0,onOpenChange:t=>{t||s()}}}),{id:r,dismiss:s,update:t=>c({type:"UPDATE_TOAST",toast:{...t,id:r}})}}function f(){let[t,e]=s.useState(d);return s.useEffect(()=>(u.push(e),()=>{let t=u.indexOf(e);t>-1&&u.splice(t,1)}),[t]),{...t,toast:l,dismiss:t=>c({type:"DISMISS_TOAST",toastId:t})}}},94508:function(t,e,r){"use strict";r.d(e,{cn:function(){return n}});var s=r(61994),a=r(53335);function n(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return(0,a.m6)((0,s.W)(e))}}},function(t){t.O(0,[2939,1915,2971,2117,1744],function(){return t(t.s=90836)}),_N_E=t.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3317,8459,7138,244],{63521:function(){}},function(n){n.O(0,[2971,2117,1744],function(){return n(n.s=63521)}),_N_E=n.O()}]);