entari-plugin-hyw 3.3.0__py3-none-any.whl → 3.3.1__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.

Potentially problematic release.


This version of entari-plugin-hyw might be problematic. Click here for more details.

Files changed (48) hide show
  1. entari_plugin_hyw/__init__.py +309 -763
  2. entari_plugin_hyw/hyw_core.py +700 -0
  3. {entari_plugin_hyw-3.3.0.dist-info → entari_plugin_hyw-3.3.1.dist-info}/METADATA +28 -20
  4. entari_plugin_hyw-3.3.1.dist-info/RECORD +6 -0
  5. entari_plugin_hyw/assets/icon/anthropic.svg +0 -1
  6. entari_plugin_hyw/assets/icon/deepseek.png +0 -0
  7. entari_plugin_hyw/assets/icon/gemini.svg +0 -1
  8. entari_plugin_hyw/assets/icon/google.svg +0 -1
  9. entari_plugin_hyw/assets/icon/grok.png +0 -0
  10. entari_plugin_hyw/assets/icon/microsoft.svg +0 -15
  11. entari_plugin_hyw/assets/icon/minimax.png +0 -0
  12. entari_plugin_hyw/assets/icon/mistral.png +0 -0
  13. entari_plugin_hyw/assets/icon/nvida.png +0 -0
  14. entari_plugin_hyw/assets/icon/openai.svg +0 -1
  15. entari_plugin_hyw/assets/icon/openrouter.png +0 -0
  16. entari_plugin_hyw/assets/icon/perplexity.svg +0 -24
  17. entari_plugin_hyw/assets/icon/qwen.png +0 -0
  18. entari_plugin_hyw/assets/icon/xai.png +0 -0
  19. entari_plugin_hyw/assets/icon/zai.png +0 -0
  20. entari_plugin_hyw/assets/libs/highlight.css +0 -10
  21. entari_plugin_hyw/assets/libs/highlight.js +0 -1213
  22. entari_plugin_hyw/assets/libs/katex-auto-render.js +0 -1
  23. entari_plugin_hyw/assets/libs/katex.css +0 -1
  24. entari_plugin_hyw/assets/libs/katex.js +0 -1
  25. entari_plugin_hyw/assets/libs/tailwind.css +0 -1
  26. entari_plugin_hyw/assets/package-lock.json +0 -953
  27. entari_plugin_hyw/assets/package.json +0 -16
  28. entari_plugin_hyw/assets/tailwind.config.js +0 -12
  29. entari_plugin_hyw/assets/tailwind.input.css +0 -235
  30. entari_plugin_hyw/assets/template.html +0 -157
  31. entari_plugin_hyw/assets/template.html.bak +0 -157
  32. entari_plugin_hyw/assets/template.j2 +0 -307
  33. entari_plugin_hyw/core/__init__.py +0 -0
  34. entari_plugin_hyw/core/config.py +0 -35
  35. entari_plugin_hyw/core/history.py +0 -146
  36. entari_plugin_hyw/core/hyw.py +0 -41
  37. entari_plugin_hyw/core/pipeline.py +0 -1065
  38. entari_plugin_hyw/core/render.py +0 -596
  39. entari_plugin_hyw/core/render.py.bak +0 -926
  40. entari_plugin_hyw/utils/__init__.py +0 -2
  41. entari_plugin_hyw/utils/browser.py +0 -40
  42. entari_plugin_hyw/utils/misc.py +0 -93
  43. entari_plugin_hyw/utils/playwright_tool.py +0 -36
  44. entari_plugin_hyw/utils/prompts.py +0 -128
  45. entari_plugin_hyw/utils/search.py +0 -241
  46. entari_plugin_hyw-3.3.0.dist-info/RECORD +0 -46
  47. {entari_plugin_hyw-3.3.0.dist-info → entari_plugin_hyw-3.3.1.dist-info}/WHEEL +0 -0
  48. {entari_plugin_hyw-3.3.0.dist-info → entari_plugin_hyw-3.3.1.dist-info}/top_level.txt +0 -0
@@ -1,16 +0,0 @@
1
- {
2
- "name": "assets",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "tailwind.config.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC",
12
- "type": "commonjs",
13
- "dependencies": {
14
- "tailwindcss": "^3.4.17"
15
- }
16
- }
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- content: ["./template.j2", "../core/render.py"],
3
- theme: {
4
- extend: {
5
- fontFamily: {
6
- sans: ['Inter', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'],
7
- mono: ['SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'monospace'],
8
- }
9
- }
10
- },
11
- plugins: [],
12
- }
@@ -1,235 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- /* Custom scrollbar for code blocks */
6
- pre::-webkit-scrollbar {
7
- height: 8px;
8
- background-color: transparent;
9
- }
10
-
11
- pre::-webkit-scrollbar-thumb {
12
- background-color: rgba(255, 255, 255, 0.2);
13
- border-radius: 4px;
14
- }
15
-
16
- /* Markdown Styles Override/Enhancement */
17
- .markdown-body h1 {
18
- @apply text-2xl font-bold mt-6 mb-4 text-gray-800 border-b border-gray-200 pb-2;
19
- }
20
-
21
- .markdown-body h2 {
22
- @apply text-xl font-bold mt-5 mb-3 text-gray-800;
23
- }
24
-
25
- .markdown-body h3 {
26
- @apply text-lg font-bold mt-4 mb-2 text-gray-800;
27
- }
28
-
29
- .markdown-body h4 {
30
- @apply text-base font-bold mt-3 mb-2 text-gray-800;
31
- }
32
-
33
- .markdown-body p {
34
- @apply mb-4 leading-7 text-gray-700;
35
- }
36
-
37
- .markdown-body ul {
38
- @apply list-disc pl-5 mb-4 space-y-1 text-gray-700;
39
- }
40
-
41
- .markdown-body ol {
42
- @apply list-decimal pl-5 mb-4 space-y-1 text-gray-700;
43
- }
44
-
45
- .markdown-body li {
46
- @apply pl-1;
47
- }
48
-
49
- .markdown-body li>p {
50
- @apply mb-1;
51
- }
52
-
53
- .markdown-body a {
54
- @apply text-blue-600 underline decoration-blue-300 underline-offset-2 hover:text-blue-700 hover:decoration-blue-700 transition-colors;
55
- }
56
-
57
- .markdown-body blockquote {
58
- @apply border-l-4 border-gray-300 pl-4 italic text-gray-600 my-4 bg-gray-50 py-2 pr-2 rounded-r;
59
- }
60
-
61
- /* Code Highlight Customization (Pink & Warm Theme) */
62
- .hljs-keyword,
63
- .hljs-selector-tag,
64
- .hljs-built_in,
65
- .hljs-name,
66
- .hljs-tag {
67
- color: #db2777 !important;
68
- }
69
-
70
- /* pink-600 */
71
- .hljs-string,
72
- .hljs-title,
73
- .hljs-section,
74
- .hljs-attribute,
75
- .hljs-literal,
76
- .hljs-template-tag,
77
- .hljs-template-variable,
78
- .hljs-type,
79
- .hljs-addition {
80
- color: #d97706 !important;
81
- }
82
-
83
- /* amber-600 */
84
- .hljs-comment,
85
- .hljs-quote,
86
- .hljs-deletion,
87
- .hljs-meta {
88
- color: #9ca3af !important;
89
- }
90
-
91
- /* gray-400 */
92
- .hljs-number,
93
- .hljs-symbol,
94
- .hljs-bullet {
95
- color: #ea580c !important;
96
- }
97
-
98
- /* orange-600 */
99
- .hljs-keyword,
100
- .hljs-selector-tag,
101
- .hljs-literal,
102
- .hljs-title,
103
- .hljs-section,
104
- .hljs-doctag,
105
- .hljs-type,
106
- .hljs-name,
107
- .hljs-strong {
108
- font-weight: bold;
109
- }
110
-
111
- .markdown-body code {
112
- @apply bg-gray-100 px-1.5 py-0.5 rounded text-sm font-mono text-gray-700;
113
- }
114
-
115
- .markdown-body pre {
116
- @apply bg-gray-50 p-4 rounded-lg overflow-x-auto mb-4 text-sm leading-normal border border-gray-100 shadow-sm;
117
- }
118
-
119
- .markdown-body pre code {
120
- @apply bg-transparent p-0 text-gray-800 border-none;
121
- }
122
-
123
- .markdown-body img {
124
- @apply max-w-[60%] h-auto rounded-lg my-4 shadow-sm border border-gray-100;
125
- }
126
-
127
- .markdown-body table {
128
- @apply w-full border-collapse mb-4 text-sm;
129
- }
130
-
131
- .markdown-body th {
132
- @apply border border-gray-300 px-4 py-2 bg-gray-50 font-semibold text-left text-gray-700;
133
- }
134
-
135
- .markdown-body td {
136
- @apply border border-gray-300 px-4 py-2 text-gray-700;
137
- }
138
-
139
- .markdown-body hr {
140
- @apply my-6 border-gray-200;
141
- }
142
-
143
- .markdown-body>*:last-child {
144
- @apply mb-0;
145
- }
146
-
147
- /* KaTeX adjustments */
148
- .katex-display {
149
- @apply overflow-x-auto overflow-y-hidden py-2;
150
- }
151
-
152
- /* Mermaid adjustments */
153
- .mermaid {
154
- @apply flex justify-center my-4 bg-gray-50 p-4 rounded-lg border border-gray-100;
155
- }
156
-
157
- /* Citation Styles */
158
- .citation-ref {
159
- display: inline-flex;
160
- align-items: center;
161
- justify-content: center;
162
- vertical-align: super;
163
- font-size: 0.75em;
164
- font-weight: bold;
165
- color: #4b5563;
166
- background-color: #f3f4f6;
167
- border: 1px solid #e5e7eb;
168
- border-radius: 9999px;
169
- width: 1.4em;
170
- height: 1.4em;
171
- margin-left: 2px;
172
- cursor: pointer;
173
- text-decoration: none !important;
174
- transition: all 0.2s;
175
- position: relative;
176
- line-height: 1;
177
- box-shadow: none !important;
178
- }
179
-
180
- .citation-ref:hover {
181
- background-color: #4b5563;
182
- color: white;
183
- text-decoration: none !important;
184
- }
185
-
186
- .citation-tooltip {
187
- position: absolute;
188
- bottom: 100%;
189
- left: 50%;
190
- transform: translateX(-50%);
191
- margin-bottom: 8px;
192
- background: white;
193
- border: 1px solid #e5e7eb;
194
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
195
- border-radius: 8px;
196
- padding: 8px 12px;
197
- width: max-content;
198
- max-width: 300px;
199
- z-index: 50;
200
- opacity: 0;
201
- visibility: hidden;
202
- transition: all 0.2s;
203
- pointer-events: none;
204
- font-size: 12px;
205
- line-height: 1.4;
206
- color: #374151;
207
- text-align: left;
208
- font-weight: normal;
209
- }
210
-
211
- .citation-ref:hover .citation-tooltip {
212
- opacity: 1;
213
- visibility: visible;
214
- transform: translateX(-50%) translateY(-4px);
215
-
216
- }
217
-
218
- .citation-tooltip-title {
219
- font-weight: 600;
220
- color: #111827;
221
- margin-bottom: 2px;
222
- display: block;
223
- white-space: nowrap;
224
- overflow: hidden;
225
- text-overflow: ellipsis;
226
- max-width: 280px;
227
- }
228
-
229
- .citation-tooltip-url {
230
- color: #6b7280;
231
- font-size: 10px;
232
- display: flex;
233
- align-items: center;
234
- gap: 4px;
235
- }
@@ -1,157 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-CN">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Entari Render</title>
8
- <!-- @formatter:off -->
9
- <!-- prettier-ignore -->
10
- <!-- IMPORTANT: Asset placeholders MUST be {{ name }} on single line! -->
11
- <style>
12
- {
13
- {
14
- tailwind_css
15
- }
16
- }
17
- </style>
18
- <style>
19
- {
20
- {
21
- highlight_css
22
- }
23
- }
24
- </style>
25
- <script>{ { highlight_js } }</script>
26
- <style>
27
- {
28
- {
29
- katex_css
30
- }
31
- }
32
- </style>
33
- <script>{ { katex_js } }</script>
34
- <script>{ { katex_auto_render_js } }</script>
35
- <!-- @formatter:on -->
36
- <style>
37
- #markdown-content h1,
38
- #markdown-content h2,
39
- #markdown-content h3,
40
- #markdown-content h4,
41
- #markdown-content h5,
42
- #markdown-content h6 {
43
- color: #db2777;
44
- /* text-pink-600 */
45
- }
46
- </style>
47
- </head>
48
-
49
- <body class="bg-[#f2f2f2] p-0 box-border m-0 font-sans text-gray-800">
50
- <div id="main-container" class="w-full max-w-[450px] flex flex-col gap-4 mx-auto bg-[#f2f2f2] p-0 font-sans h-fit">
51
- <!-- Response Card (Content First) -->
52
- <div class="bg-[#f2f2f2] rounded-2xl p-5 overflow-hidden">
53
- <div id="markdown-content" class="markdown-body text-[15px] leading-relaxed text-gray-800">
54
- {{ content_html }}
55
- </div>
56
- </div>
57
-
58
-
59
-
60
- <!-- Speculation Card (Optional) -->
61
- {{ suggestions }}
62
-
63
- <!-- Model Header (Moved to Bottom) -->
64
- <div class="bg-[#f2f2f2] rounded-2xl p-5 overflow-hidden">
65
- {{ response_header }}
66
- <!-- Pipeline Stages -->
67
- {{ stages }}
68
- </div>
69
-
70
- <!-- Stats Footer -->
71
- {{ stats }}
72
- </div>
73
-
74
- <script>window.REFERENCES = {{ references_json }};</script>
75
-
76
- <script>
77
- document.addEventListener("DOMContentLoaded", () => {
78
- // Render Math (KaTeX)
79
- const contentDiv = document.getElementById("markdown-content");
80
- renderMathInElement(contentDiv, {
81
- delimiters: [
82
- { left: "$$", right: "$$", display: true },
83
- { left: "$", right: "$", display: false },
84
- { left: "\\(", right: "\\)", display: false },
85
- { left: "\\[", right: "\\]", display: true }
86
- ],
87
- throwOnError: false
88
- });
89
-
90
- // Process Citations
91
- function processCitations(rootNode) {
92
- const walker = document.createTreeWalker(
93
- rootNode,
94
- NodeFilter.SHOW_TEXT,
95
- null,
96
- false
97
- );
98
-
99
- const nodesToReplace = [];
100
- let node;
101
- while (node = walker.nextNode()) {
102
- if (node.parentElement.tagName === "SCRIPT" || node.parentElement.tagName === "STYLE" || node.parentElement.tagName === "A") continue;
103
- if (/\[\d+\]/.test(node.nodeValue)) {
104
- nodesToReplace.push(node);
105
- }
106
- }
107
-
108
- nodesToReplace.forEach(textNode => {
109
- const fragment = document.createDocumentFragment();
110
- let lastIndex = 0;
111
- const text = textNode.nodeValue;
112
- const regex = /\[(\d+)\]/g;
113
- let match;
114
-
115
- while ((match = regex.exec(text)) !== null) {
116
- fragment.appendChild(document.createTextNode(text.substring(lastIndex, match.index)));
117
-
118
- const id = match[1];
119
- const ref = window.REFERENCES ? window.REFERENCES.find(r => r.id == id) : null;
120
-
121
- if (ref) {
122
- const span = document.createElement("span");
123
- const title = ref.title.replace(/"/g, "&quot;");
124
- const url = ref.url;
125
- let domain = "unknown";
126
- try { domain = new URL(url).hostname; } catch (e) { }
127
- const favicon = `https://www.google.com/s2/favicons?domain=${domain}&sz=32`;
128
-
129
- span.innerHTML = `<a href="${url}" target="_blank" class="citation-ref" data-id="${id}">
130
- ${id}
131
- <span class="citation-tooltip">
132
- <span class="citation-tooltip-title">${title}</span>
133
- <span class="citation-tooltip-url">
134
- <img src="${favicon}" style="width:12px;height:12px;vertical-align:middle;margin-right:4px;">
135
- ${domain}
136
- </span>
137
- </span>
138
- </a>`;
139
- fragment.appendChild(span.firstElementChild);
140
- } else {
141
- fragment.appendChild(document.createTextNode(match[0]));
142
- }
143
-
144
- lastIndex = regex.lastIndex;
145
- }
146
-
147
- fragment.appendChild(document.createTextNode(text.substring(lastIndex)));
148
- textNode.parentNode.replaceChild(fragment, textNode);
149
- });
150
- }
151
-
152
- processCitations(contentDiv);
153
- });
154
- </script>
155
- </body>
156
-
157
- </html>
@@ -1,157 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="zh-CN">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Entari Render</title>
8
- <!-- @formatter:off -->
9
- <!-- prettier-ignore -->
10
- <!-- IMPORTANT: Asset placeholders MUST be {{ name }} on single line! -->
11
- <style>
12
- {
13
- {
14
- tailwind_css
15
- }
16
- }
17
- </style>
18
- <style>
19
- {
20
- {
21
- highlight_css
22
- }
23
- }
24
- </style>
25
- <script>{ { highlight_js } }</script>
26
- <style>
27
- {
28
- {
29
- katex_css
30
- }
31
- }
32
- </style>
33
- <script>{ { katex_js } }</script>
34
- <script>{ { katex_auto_render_js } }</script>
35
- <!-- @formatter:on -->
36
- <style>
37
- #markdown-content h1,
38
- #markdown-content h2,
39
- #markdown-content h3,
40
- #markdown-content h4,
41
- #markdown-content h5,
42
- #markdown-content h6 {
43
- color: #db2777;
44
- /* text-pink-600 */
45
- }
46
- </style>
47
- </head>
48
-
49
- <body class="bg-[#f2f2f2] p-0 box-border m-0 font-sans text-gray-800">
50
- <div id="main-container" class="w-full max-w-[450px] flex flex-col gap-4 mx-auto bg-[#f2f2f2] p-0 font-sans h-fit">
51
- <!-- Response Card (Content First) -->
52
- <div class="bg-[#f2f2f2] rounded-2xl p-5 overflow-hidden">
53
- <div id="markdown-content" class="markdown-body text-[15px] leading-relaxed text-gray-800">
54
- {{ content_html }}
55
- </div>
56
- </div>
57
-
58
-
59
-
60
- <!-- Speculation Card (Optional) -->
61
- {{ suggestions }}
62
-
63
- <!-- Model Header (Moved to Bottom) -->
64
- <div class="bg-[#f2f2f2] rounded-2xl p-5 overflow-hidden">
65
- {{ response_header }}
66
- <!-- Pipeline Stages -->
67
- {{ stages }}
68
- </div>
69
-
70
- <!-- Stats Footer -->
71
- {{ stats }}
72
- </div>
73
-
74
- <script>window.REFERENCES = {{ references_json }};</script>
75
-
76
- <script>
77
- document.addEventListener("DOMContentLoaded", () => {
78
- // Render Math (KaTeX)
79
- const contentDiv = document.getElementById("markdown-content");
80
- renderMathInElement(contentDiv, {
81
- delimiters: [
82
- { left: "$$", right: "$$", display: true },
83
- { left: "$", right: "$", display: false },
84
- { left: "\\(", right: "\\)", display: false },
85
- { left: "\\[", right: "\\]", display: true }
86
- ],
87
- throwOnError: false
88
- });
89
-
90
- // Process Citations
91
- function processCitations(rootNode) {
92
- const walker = document.createTreeWalker(
93
- rootNode,
94
- NodeFilter.SHOW_TEXT,
95
- null,
96
- false
97
- );
98
-
99
- const nodesToReplace = [];
100
- let node;
101
- while (node = walker.nextNode()) {
102
- if (node.parentElement.tagName === "SCRIPT" || node.parentElement.tagName === "STYLE" || node.parentElement.tagName === "A") continue;
103
- if (/\[\d+\]/.test(node.nodeValue)) {
104
- nodesToReplace.push(node);
105
- }
106
- }
107
-
108
- nodesToReplace.forEach(textNode => {
109
- const fragment = document.createDocumentFragment();
110
- let lastIndex = 0;
111
- const text = textNode.nodeValue;
112
- const regex = /\[(\d+)\]/g;
113
- let match;
114
-
115
- while ((match = regex.exec(text)) !== null) {
116
- fragment.appendChild(document.createTextNode(text.substring(lastIndex, match.index)));
117
-
118
- const id = match[1];
119
- const ref = window.REFERENCES ? window.REFERENCES.find(r => r.id == id) : null;
120
-
121
- if (ref) {
122
- const span = document.createElement("span");
123
- const title = ref.title.replace(/"/g, "&quot;");
124
- const url = ref.url;
125
- let domain = "unknown";
126
- try { domain = new URL(url).hostname; } catch (e) { }
127
- const favicon = `https://www.google.com/s2/favicons?domain=${domain}&sz=32`;
128
-
129
- span.innerHTML = `<a href="${url}" target="_blank" class="citation-ref" data-id="${id}">
130
- ${id}
131
- <span class="citation-tooltip">
132
- <span class="citation-tooltip-title">${title}</span>
133
- <span class="citation-tooltip-url">
134
- <img src="${favicon}" style="width:12px;height:12px;vertical-align:middle;margin-right:4px;">
135
- ${domain}
136
- </span>
137
- </span>
138
- </a>`;
139
- fragment.appendChild(span.firstElementChild);
140
- } else {
141
- fragment.appendChild(document.createTextNode(match[0]));
142
- }
143
-
144
- lastIndex = regex.lastIndex;
145
- }
146
-
147
- fragment.appendChild(document.createTextNode(text.substring(lastIndex)));
148
- textNode.parentNode.replaceChild(fragment, textNode);
149
- });
150
- }
151
-
152
- processCitations(contentDiv);
153
- });
154
- </script>
155
- </body>
156
-
157
- </html>