khoj 1.17.1.dev223__py3-none-any.whl → 1.17.1.dev233__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 (51) hide show
  1. khoj/routers/web_client.py +29 -130
  2. {khoj-1.17.1.dev223.dist-info → khoj-1.17.1.dev233.dist-info}/METADATA +1 -1
  3. {khoj-1.17.1.dev223.dist-info → khoj-1.17.1.dev233.dist-info}/RECORD +6 -51
  4. khoj/interface/web/404.html +0 -56
  5. khoj/interface/web/agent.html +0 -312
  6. khoj/interface/web/agents.html +0 -276
  7. khoj/interface/web/assets/icons/cancel.svg +0 -3
  8. khoj/interface/web/assets/icons/collapse.svg +0 -17
  9. khoj/interface/web/assets/icons/computer.png +0 -0
  10. khoj/interface/web/assets/icons/confirm-icon.svg +0 -1
  11. khoj/interface/web/assets/icons/copy-button-success.svg +0 -6
  12. khoj/interface/web/assets/icons/copy-button.svg +0 -5
  13. khoj/interface/web/assets/icons/credit-card.png +0 -0
  14. khoj/interface/web/assets/icons/delete.svg +0 -26
  15. khoj/interface/web/assets/icons/docx.svg +0 -7
  16. khoj/interface/web/assets/icons/edit.svg +0 -4
  17. khoj/interface/web/assets/icons/key.svg +0 -4
  18. khoj/interface/web/assets/icons/markdown.svg +0 -1
  19. khoj/interface/web/assets/icons/new.svg +0 -23
  20. khoj/interface/web/assets/icons/notion.svg +0 -4
  21. khoj/interface/web/assets/icons/openai-logomark.svg +0 -1
  22. khoj/interface/web/assets/icons/org.svg +0 -1
  23. khoj/interface/web/assets/icons/pdf.svg +0 -23
  24. khoj/interface/web/assets/icons/pencil-edit.svg +0 -5
  25. khoj/interface/web/assets/icons/plaintext.svg +0 -1
  26. khoj/interface/web/assets/icons/question-mark-icon.svg +0 -1
  27. khoj/interface/web/assets/icons/send.svg +0 -1
  28. khoj/interface/web/assets/icons/share.svg +0 -8
  29. khoj/interface/web/assets/icons/speaker.svg +0 -4
  30. khoj/interface/web/assets/icons/stop-solid.svg +0 -37
  31. khoj/interface/web/assets/icons/thumbs-down-svgrepo-com.svg +0 -6
  32. khoj/interface/web/assets/icons/thumbs-up-svgrepo-com.svg +0 -6
  33. khoj/interface/web/assets/icons/user-silhouette.svg +0 -4
  34. khoj/interface/web/assets/icons/voice.svg +0 -8
  35. khoj/interface/web/assets/icons/web.svg +0 -2
  36. khoj/interface/web/assets/icons/whatsapp.svg +0 -17
  37. khoj/interface/web/assets/markdown-it.min.js +0 -8476
  38. khoj/interface/web/assets/natural-cron.min.js +0 -1
  39. khoj/interface/web/assets/org.min.js +0 -1823
  40. khoj/interface/web/assets/pico.min.css +0 -5
  41. khoj/interface/web/assets/purify.min.js +0 -3
  42. khoj/interface/web/chat.html +0 -3436
  43. khoj/interface/web/config_automation.html +0 -1103
  44. khoj/interface/web/content_source_computer_input.html +0 -139
  45. khoj/interface/web/content_source_notion_input.html +0 -94
  46. khoj/interface/web/public_conversation.html +0 -2006
  47. khoj/interface/web/search.html +0 -470
  48. khoj/interface/web/settings.html +0 -1011
  49. {khoj-1.17.1.dev223.dist-info → khoj-1.17.1.dev233.dist-info}/WHEEL +0 -0
  50. {khoj-1.17.1.dev223.dist-info → khoj-1.17.1.dev233.dist-info}/entry_points.txt +0 -0
  51. {khoj-1.17.1.dev223.dist-info → khoj-1.17.1.dev233.dist-info}/licenses/LICENSE +0 -0
@@ -1,139 +0,0 @@
1
- {% extends "base_config.html" %}
2
- {% block content %}
3
- <div class="page">
4
- <div class="section">
5
- <h2 class="section-title">
6
- <img class="card-icon" src="/static/assets/icons/computer.png?v={{ khoj_version }}" alt="files">
7
- <span class="card-title-text">Files</span>
8
- <div class="instructions">
9
- <p class="card-description">Manage files from your computer</p>
10
- <p id="get-desktop-client" class="card-description">Get the Khoj <a href="https://khoj.dev/downloads">Desktop</a>, <a href="https://docs.khoj.dev/#/obsidian?id=setup">Obsidian</a> or <a href="https://docs.khoj.dev/#/emacs?id=setup">Emacs</a> app to sync documents from your computer</p>
11
- </div>
12
- </h2>
13
- <div class="section-manage-files">
14
- <div id="delete-all-files" class="delete-all-files">
15
- <button id="delete-all-files-button" type="submit" title="Remove all computer files from Khoj">🗑️ Delete all</button>
16
- </div>
17
- <div class="indexed-files">
18
- </div>
19
- </div>
20
- </div>
21
- </div>
22
- <style>
23
- #desktop-client {
24
- font-weight: normal;
25
- }
26
- .indexed-files {
27
- width: 100%;
28
- }
29
- .content-name {
30
- font-size: smaller;
31
- }
32
- </style>
33
- <script>
34
- function removeFile(path) {
35
- fetch('/api/content/file?filename=' + path, {
36
- method: 'DELETE',
37
- headers: {
38
- 'Content-Type': 'application/json',
39
- }
40
- })
41
- .then(response => response.ok ? response.json() : Promise.reject(response))
42
- .then(data => {
43
- if (data.status == "ok") {
44
- getAllComputerFilenames();
45
- }
46
- })
47
- }
48
-
49
- // Get all currently indexed files
50
- function getAllComputerFilenames() {
51
- fetch('/api/content/computer')
52
- .then(response => response.json())
53
- .then(data => {
54
- var indexedFiles = document.getElementsByClassName("indexed-files")[0];
55
- indexedFiles.innerHTML = "";
56
-
57
- if (data.length == 0) {
58
- document.getElementById("delete-all-files").style.display = "none";
59
- let noFilesElement = document.createElement("div");
60
- noFilesElement.classList.add("card-description");
61
- noFilesElement.textContent = "No documents synced with Khoj";
62
- indexedFiles.appendChild(noFilesElement);
63
- } else {
64
- document.getElementById("get-desktop-client").style.display = "none";
65
- document.getElementById("delete-all-files").style.display = "block";
66
- }
67
-
68
- for (var filename of data) {
69
- let fileElement = document.createElement("div");
70
- fileElement.classList.add("file-element");
71
-
72
- let fileExtension = filename.split('.').pop();
73
- if (fileExtension === "org")
74
- image_name = "org.svg"
75
- else if (fileExtension === "pdf")
76
- image_name = "pdf.svg"
77
- else if (fileExtension === "markdown" || fileExtension === "md")
78
- image_name = "markdown.svg"
79
- else if (fileExtension === "docx")
80
- image_name = "docx.svg"
81
- else
82
- image_name = "plaintext.svg"
83
-
84
- let fileIconElement = document.createElement("img");
85
- fileIconElement.classList.add("card-icon");
86
- fileIconElement.src = `/static/assets/icons/${image_name}`;
87
- fileIconElement.alt = "File";
88
- fileElement.appendChild(fileIconElement);
89
-
90
- let fileNameElement = document.createElement("div");
91
- fileNameElement.classList.add("content-name");
92
- fileNameElement.textContent = filename;
93
- fileElement.appendChild(fileNameElement);
94
-
95
- let buttonContainer = document.createElement("div");
96
- buttonContainer.classList.add("remove-button-container");
97
- let removeFileButton = document.createElement("button");
98
- removeFileButton.classList.add("remove-file-button");
99
- removeFileButton.textContent = "🗑️";
100
- removeFileButton.addEventListener("click", ((filename) => {
101
- return () => {
102
- removeFile(filename);
103
- };
104
- })(filename));
105
- buttonContainer.appendChild(removeFileButton);
106
- fileElement.appendChild(buttonContainer);
107
- indexedFiles.appendChild(fileElement);
108
- }
109
- })
110
- .catch((error) => {
111
- console.error('Error:', error);
112
- });
113
- }
114
-
115
- // Get all currently indexed files on page load
116
- getAllComputerFilenames();
117
-
118
- let deleteAllComputerFilesButton = document.getElementById("delete-all-files-button");
119
- deleteAllComputerFilesButton.addEventListener("click", function(event) {
120
- event.preventDefault();
121
- originalDeleteAllComputerFilesButtonText = deleteAllComputerFilesButton.textContent;
122
- deleteAllComputerFilesButton.textContent = "🗑️ Deleting...";
123
- deleteAllComputerFilesButton.disabled = true;
124
-
125
- fetch('/api/content/computer', {
126
- method: 'DELETE',
127
- headers: {
128
- 'Content-Type': 'application/json',
129
- }
130
- })
131
- .then(response => response.json())
132
- .finally(() => {
133
- getAllComputerFilenames();
134
- deleteAllComputerFilesButton.textContent = originalDeleteAllComputerFilesButtonText;
135
- deleteAllComputerFilesButton.disabled = false;
136
- });
137
- });
138
- </script>
139
- {% endblock %}
@@ -1,94 +0,0 @@
1
- {% extends "base_config.html" %}
2
- {% block content %}
3
- <div class="page">
4
- <div class="section">
5
- <h2 class="section-title">
6
- <img class="card-icon" src="/static/assets/icons/notion.svg?v={{ khoj_version }}" alt="Notion">
7
- <span class="card-title-text">Notion</span>
8
- <div class="instructions">
9
- <a href="https://docs.khoj.dev/data-sources/notion_integration">ⓘ Help</a>
10
- </div>
11
- <table>
12
- <tr>
13
- <td>
14
- <label for="token">Token</label>
15
- </td>
16
- <td>
17
- <input type="text" id="token" name="pat" value="{{ current_config['token'] }}">
18
- </td>
19
- </tr>
20
- </table>
21
- <div class="section">
22
- <div id="success" style="display: none;"></div>
23
- <button id="submit" type="submit">Sync to Update</button>
24
- </div>
25
- </form>
26
- </div>
27
- </div>
28
- <script>
29
- const submit = document.getElementById("submit");
30
-
31
- submit.addEventListener("click", function(event) {
32
- event.preventDefault();
33
-
34
- const token = document.getElementById("token").value;
35
-
36
- if (token == "") {
37
- document.getElementById("success").textContent = "❌ Please enter a Notion Token.";
38
- document.getElementById("success").style.display = "block";
39
- return;
40
- }
41
-
42
- const submitButton = document.getElementById("submit");
43
- submitButton.disabled = true;
44
- submitButton.textContent = "Syncing...";
45
-
46
- // Save Notion config on server
47
- const csrfToken = document.cookie.split('; ').find(row => row.startsWith('csrftoken'))?.split('=')[1];
48
- fetch('/api/content/notion', {
49
- method: 'POST',
50
- headers: {
51
- 'Content-Type': 'application/json',
52
- 'X-CSRFToken': csrfToken,
53
- },
54
- body: JSON.stringify({
55
- "token": token,
56
- })
57
- })
58
- .then(response => response.json())
59
- .then(data => { data["status"] === "ok" ? data : Promise.reject(data) })
60
- .catch(error => {
61
- document.getElementById("success").textContent = "⚠️ Failed to save Notion settings.";
62
- document.getElementById("success").style.display = "block";
63
- submitButton.textContent = "⚠️ Failed to save settings";
64
- setTimeout(function() {
65
- submitButton.textContent = "Save";
66
- submitButton.disabled = false;
67
- }, 2000);
68
- return;
69
- });
70
-
71
- // Index Notion content on server
72
- fetch('/api/update?t=notion')
73
- .then(response => response.json())
74
- .then(data => { data["status"] == "ok" ? data : Promise.reject(data) })
75
- .then(data => {
76
- document.getElementById("success").style.display = "none";
77
- submitButton.textContent = "✅ Successfully updated";
78
- setTimeout(function() {
79
- submitButton.textContent = "Save";
80
- submitButton.disabled = false;
81
- }, 2000);
82
- })
83
- .catch(error => {
84
- document.getElementById("success").textContent = "⚠️ Failed to save Notion content.";
85
- document.getElementById("success").style.display = "block";
86
- submitButton.textContent = "⚠️ Failed to save content";
87
- setTimeout(function() {
88
- submitButton.textContent = "Save";
89
- submitButton.disabled = false;
90
- }, 2000);
91
- });
92
- });
93
- </script>
94
- {% endblock %}