entari-plugin-hyw 4.0.0rc7__py3-none-any.whl → 4.0.0rc8__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.
- entari_plugin_hyw/Untitled-1 +1865 -0
- entari_plugin_hyw/__init__.py +726 -394
- entari_plugin_hyw/history.py +26 -13
- entari_plugin_hyw/misc.py +3 -0
- entari_plugin_hyw/search_cache.py +154 -0
- {entari_plugin_hyw-4.0.0rc7.dist-info → entari_plugin_hyw-4.0.0rc8.dist-info}/METADATA +3 -1
- entari_plugin_hyw-4.0.0rc8.dist-info/RECORD +68 -0
- {entari_plugin_hyw-4.0.0rc7.dist-info → entari_plugin_hyw-4.0.0rc8.dist-info}/WHEEL +1 -1
- {entari_plugin_hyw-4.0.0rc7.dist-info → entari_plugin_hyw-4.0.0rc8.dist-info}/top_level.txt +1 -0
- hyw_core/__init__.py +94 -0
- hyw_core/browser_control/__init__.py +65 -0
- hyw_core/browser_control/assets/card-dist/index.html +409 -0
- hyw_core/browser_control/assets/index.html +5691 -0
- hyw_core/browser_control/engines/__init__.py +17 -0
- {entari_plugin_hyw/browser → hyw_core/browser_control}/engines/duckduckgo.py +42 -8
- {entari_plugin_hyw/browser → hyw_core/browser_control}/engines/google.py +1 -1
- {entari_plugin_hyw/browser → hyw_core/browser_control}/manager.py +15 -8
- entari_plugin_hyw/render_vue.py → hyw_core/browser_control/renderer.py +29 -14
- {entari_plugin_hyw/browser → hyw_core/browser_control}/service.py +287 -112
- hyw_core/config.py +154 -0
- hyw_core/core.py +322 -0
- hyw_core/definitions.py +83 -0
- entari_plugin_hyw/modular_pipeline.py → hyw_core/pipeline.py +121 -97
- {entari_plugin_hyw → hyw_core}/search.py +19 -14
- hyw_core/stages/__init__.py +21 -0
- entari_plugin_hyw/stage_base.py → hyw_core/stages/base.py +2 -2
- entari_plugin_hyw/stage_summary.py → hyw_core/stages/summary.py +34 -11
- entari_plugin_hyw/assets/card-dist/index.html +0 -387
- entari_plugin_hyw/browser/__init__.py +0 -10
- entari_plugin_hyw/browser/engines/bing.py +0 -95
- entari_plugin_hyw/card-ui/.gitignore +0 -24
- entari_plugin_hyw/card-ui/README.md +0 -5
- entari_plugin_hyw/card-ui/index.html +0 -16
- entari_plugin_hyw/card-ui/package-lock.json +0 -2342
- entari_plugin_hyw/card-ui/package.json +0 -31
- entari_plugin_hyw/card-ui/public/logos/anthropic.svg +0 -1
- entari_plugin_hyw/card-ui/public/logos/cerebras.svg +0 -9
- entari_plugin_hyw/card-ui/public/logos/deepseek.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/gemini.svg +0 -1
- entari_plugin_hyw/card-ui/public/logos/google.svg +0 -1
- entari_plugin_hyw/card-ui/public/logos/grok.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/huggingface.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/microsoft.svg +0 -15
- entari_plugin_hyw/card-ui/public/logos/minimax.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/mistral.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/nvida.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/openai.svg +0 -1
- entari_plugin_hyw/card-ui/public/logos/openrouter.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/perplexity.svg +0 -24
- entari_plugin_hyw/card-ui/public/logos/qwen.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/xai.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/xiaomi.png +0 -0
- entari_plugin_hyw/card-ui/public/logos/zai.png +0 -0
- entari_plugin_hyw/card-ui/public/vite.svg +0 -1
- entari_plugin_hyw/card-ui/src/App.vue +0 -787
- entari_plugin_hyw/card-ui/src/assets/vue.svg +0 -1
- entari_plugin_hyw/card-ui/src/components/HelloWorld.vue +0 -41
- entari_plugin_hyw/card-ui/src/components/MarkdownContent.vue +0 -382
- entari_plugin_hyw/card-ui/src/components/SectionCard.vue +0 -41
- entari_plugin_hyw/card-ui/src/components/StageCard.vue +0 -240
- entari_plugin_hyw/card-ui/src/main.ts +0 -5
- entari_plugin_hyw/card-ui/src/style.css +0 -29
- entari_plugin_hyw/card-ui/src/test_regex.js +0 -103
- entari_plugin_hyw/card-ui/src/types.ts +0 -61
- entari_plugin_hyw/card-ui/tsconfig.app.json +0 -16
- entari_plugin_hyw/card-ui/tsconfig.json +0 -7
- entari_plugin_hyw/card-ui/tsconfig.node.json +0 -26
- entari_plugin_hyw/card-ui/vite.config.ts +0 -16
- entari_plugin_hyw/definitions.py +0 -174
- entari_plugin_hyw/stage_instruct.py +0 -355
- entari_plugin_hyw/stage_instruct_deepsearch.py +0 -104
- entari_plugin_hyw/stage_vision.py +0 -113
- entari_plugin_hyw-4.0.0rc7.dist-info/RECORD +0 -102
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/anthropic.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/cerebras.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/deepseek.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/gemini.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/google.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/grok.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/huggingface.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/microsoft.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/minimax.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/mistral.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/nvida.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/openai.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/openrouter.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/perplexity.svg +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/qwen.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/xai.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/xiaomi.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/logos/zai.png +0 -0
- {entari_plugin_hyw → hyw_core/browser_control}/assets/card-dist/vite.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/anthropic.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/cerebras.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/deepseek.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/gemini.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/google.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/grok.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/huggingface.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/microsoft.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/minimax.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/mistral.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/nvida.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/openai.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/openrouter.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/perplexity.svg +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/qwen.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/xai.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/xiaomi.png +0 -0
- {entari_plugin_hyw/assets/icon → hyw_core/browser_control/assets/logos}/zai.png +0 -0
- {entari_plugin_hyw/browser → hyw_core/browser_control}/engines/base.py +0 -0
- {entari_plugin_hyw/browser → hyw_core/browser_control}/engines/default.py +0 -0
- {entari_plugin_hyw/browser → hyw_core/browser_control}/landing.html +0 -0
- {entari_plugin_hyw → hyw_core}/image_cache.py +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
from .manager import get_shared_browser_manager, close_shared_browser
|
|
2
|
-
from .service import get_screenshot_service, close_screenshot_service, prestart_browser
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"get_shared_browser_manager",
|
|
6
|
-
"close_shared_browser",
|
|
7
|
-
"get_screenshot_service",
|
|
8
|
-
"close_screenshot_service",
|
|
9
|
-
"prestart_browser",
|
|
10
|
-
]
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import urllib.parse
|
|
3
|
-
import re
|
|
4
|
-
from typing import List, Dict, Any
|
|
5
|
-
from loguru import logger
|
|
6
|
-
from .base import SearchEngine
|
|
7
|
-
|
|
8
|
-
class BingEngine(SearchEngine):
|
|
9
|
-
"""
|
|
10
|
-
Search engine implementation for Bing.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
def build_url(self, query: str, limit: int = 10) -> str:
|
|
14
|
-
encoded_query = urllib.parse.quote(query)
|
|
15
|
-
base = "https://www.bing.com/search"
|
|
16
|
-
return f"{base}?form=&q={encoded_query}"
|
|
17
|
-
|
|
18
|
-
def parse(self, content: str) -> List[Dict[str, Any]]:
|
|
19
|
-
results = []
|
|
20
|
-
# Split by b_algo to isolate results
|
|
21
|
-
chunks = content.split('class="b_algo"')
|
|
22
|
-
|
|
23
|
-
# Helper to decode Bing URLs roughly
|
|
24
|
-
def decode_bing_url(u):
|
|
25
|
-
if "bing.com/ck/a?" not in u: return u
|
|
26
|
-
try:
|
|
27
|
-
# Url is usually like ...&u=a1<base64>&...
|
|
28
|
-
# We look for &u=...
|
|
29
|
-
import base64
|
|
30
|
-
match = re.search(r'[?&]u=a1([^&]+)', u)
|
|
31
|
-
if match:
|
|
32
|
-
# Bing uses a modified base64 (url safe) and adds 'a1' prefix
|
|
33
|
-
# We stripped 'a1' in regex match group
|
|
34
|
-
b64 = match.group(1)
|
|
35
|
-
# padding
|
|
36
|
-
b64 += '=' * (-len(b64) % 4)
|
|
37
|
-
# url safe
|
|
38
|
-
b64 = b64.replace('-', '+').replace('_', '/')
|
|
39
|
-
decoded = base64.b64decode(b64).decode('utf-8')
|
|
40
|
-
return decoded
|
|
41
|
-
except Exception:
|
|
42
|
-
pass
|
|
43
|
-
return u
|
|
44
|
-
|
|
45
|
-
seen_urls = set()
|
|
46
|
-
|
|
47
|
-
for chunk in chunks[1:]:
|
|
48
|
-
# Exact regexes for title and snippet within the chunk
|
|
49
|
-
# Title: <h2><a href="...">...</a></h2>
|
|
50
|
-
link_match = re.search(r'<h2[^>]*>.*?<a[^>]+href=["\'](http[^"\']+)["\'][^>]*>(.*?)</a>', chunk, re.IGNORECASE | re.DOTALL)
|
|
51
|
-
if not link_match:
|
|
52
|
-
# Fallback: pure a tag
|
|
53
|
-
link_match = re.search(r'<a[^>]+href=["\'](http[^"\']+)["\'][^>]*>(.*?)</a>', chunk, re.IGNORECASE | re.DOTALL)
|
|
54
|
-
|
|
55
|
-
if link_match:
|
|
56
|
-
raw_url = link_match.group(1)
|
|
57
|
-
title_html = link_match.group(2)
|
|
58
|
-
title = re.sub(r'<[^>]+>', '', title_html).strip()
|
|
59
|
-
|
|
60
|
-
url = decode_bing_url(raw_url)
|
|
61
|
-
|
|
62
|
-
if url in seen_urls: continue
|
|
63
|
-
seen_urls.add(url)
|
|
64
|
-
|
|
65
|
-
# Snippet: class="b_caption" ... <p> ... </p> or just div text
|
|
66
|
-
snippet = ""
|
|
67
|
-
caption_match = re.search(r'class="b_caption"[^>]*>(.*?)</div>', chunk, re.IGNORECASE | re.DOTALL)
|
|
68
|
-
if caption_match:
|
|
69
|
-
snippet_html = caption_match.group(1)
|
|
70
|
-
snippet = re.sub(r'<[^>]+>', ' ', snippet_html).strip()
|
|
71
|
-
else:
|
|
72
|
-
# Fallback snippet
|
|
73
|
-
start = link_match.end()
|
|
74
|
-
snippet = re.sub(r'<[^>]+>', ' ', chunk[start:start+600]).strip()
|
|
75
|
-
|
|
76
|
-
snippet = re.sub(r'\s+', ' ', snippet).strip()
|
|
77
|
-
|
|
78
|
-
# Image extraction (basic)
|
|
79
|
-
images = []
|
|
80
|
-
img_matches = re.findall(r'<img[^>]+src=["\'](http[^"\']+)["\']', chunk)
|
|
81
|
-
for img_url in img_matches:
|
|
82
|
-
if not any(x in img_url for x in ['favicon', 'icon', 'tracking', 'pixel']):
|
|
83
|
-
images.append(img_url)
|
|
84
|
-
|
|
85
|
-
if url and title:
|
|
86
|
-
results.append({
|
|
87
|
-
"title": title,
|
|
88
|
-
"url": url,
|
|
89
|
-
"domain": urllib.parse.urlparse(url).hostname or "",
|
|
90
|
-
"content": snippet[:5000],
|
|
91
|
-
"images": images[:3]
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
logger.info(f"BingEngine parsed {len(results)} results.")
|
|
95
|
-
return results
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
node_modules
|
|
11
|
-
dist
|
|
12
|
-
dist-ssr
|
|
13
|
-
*.local
|
|
14
|
-
|
|
15
|
-
# Editor directories and files
|
|
16
|
-
.vscode/*
|
|
17
|
-
!.vscode/extensions.json
|
|
18
|
-
.idea
|
|
19
|
-
.DS_Store
|
|
20
|
-
*.suo
|
|
21
|
-
*.ntvs*
|
|
22
|
-
*.njsproj
|
|
23
|
-
*.sln
|
|
24
|
-
*.sw?
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Vue 3 + TypeScript + Vite
|
|
2
|
-
|
|
3
|
-
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
-
|
|
5
|
-
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
|
@@ -1,16 +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>Card Renderer</title>
|
|
8
|
-
<script>window.RENDER_DATA = {}</script>
|
|
9
|
-
</head>
|
|
10
|
-
|
|
11
|
-
<body>
|
|
12
|
-
<div id="app"></div>
|
|
13
|
-
<script type="module" src="/src/main.ts"></script>
|
|
14
|
-
</body>
|
|
15
|
-
|
|
16
|
-
</html>
|