feat: add mainland-reachable desktop distribution

This commit is contained in:
2026-08-16 23:00:54 +08:00
parent e8eeb4ac72
commit a3e1f11e85
42 changed files with 3661 additions and 191 deletions

View File

@@ -9,6 +9,12 @@ ROOT = Path(__file__).resolve().parents[1]
class VisionPluginFilesTests(unittest.TestCase):
def test_client_registers_system_settings_slots(self):
client = (ROOT / "plugins" / "dsh-desktop-vision" / "client.js").read_text(
encoding="utf-8"
)
self.assertIn("settings.section", client)
self.assertNotIn("settings.plugins.tab", client)
self.assertIn("modlens-vision", client)
client = (ROOT / "plugins" / "dsh-desktop-vision" / "client.js").read_text(
encoding="utf-8"
)
@@ -36,6 +42,40 @@ class VisionPluginFilesTests(unittest.TestCase):
self.assertIn("example: 'haiku'", host)
class VoicePluginFilesTests(unittest.TestCase):
def test_client_registers_composer_and_settings(self):
client = (ROOT / "plugins" / "dsh-desktop-voice" / "client.js").read_text(
encoding="utf-8"
)
host = (ROOT / "plugins" / "dsh-desktop-voice" / "index.js").read_text(
encoding="utf-8"
)
pkg = (ROOT / "plugins" / "dsh-desktop-voice" / "package.json").read_text(
encoding="utf-8"
)
self.assertIn("settings.section", client)
self.assertIn("conversation.input.right", client)
self.assertIn("dsh-desktop-voice", client)
self.assertIn("Ctrl+E", client)
self.assertIn("dictationMode", client)
self.assertIn("whisper-1", host)
self.assertIn("/dsh-desktop/voice", host)
self.assertIn("/dsh-desktop/voice/transcribe", host)
self.assertIn("/dsh-desktop/voice/model", host)
self.assertIn("SenseVoice", client)
self.assertIn("sherpa-onnx@", host)
self.assertNotIn("SpeechRecognition", client)
self.assertNotIn("engine === 'browser'", client)
self.assertIn("engine === 'openai'", client)
self.assertIn("cfg.engine === 'openai'", host)
self.assertFalse(
(ROOT / "plugins" / "dsh-desktop-voice" / "model.int8.onnx").exists()
)
self.assertIn("https://api.openai.com/v1", host)
self.assertIn("@deepseek-ai/dsh-client-ui-conversation", pkg)
self.assertIn("@deepseek-ai/dsh-client-ui-settings", pkg)
class ClipboardIngestTests(unittest.TestCase):
def test_inject_delivers_images_as_paste_not_only_drop(self):
ingest = (ROOT / "ui" / "inject" / "ingest.js").read_text(encoding="utf-8")
@@ -67,6 +107,9 @@ class BundledAttributionTests(unittest.TestCase):
self.assertIn("3.16.6", text)
self.assertIn("ffb845c5480adc953392a6db6f8a98ede621174b", text)
self.assertIn("dsh-desktop-vision", text)
self.assertIn("dsh-desktop-voice", text)
self.assertIn("https://github.com/dsh-market/dsh-market", text)
self.assertIn("1.9.0", text)
self.assertIn("dsh-plugin", readme)
self.assertIn("带上眼睛", readme)
self.assertIn("+8%", readme)
@@ -74,6 +117,7 @@ class BundledAttributionTests(unittest.TestCase):
self.assertTrue(
(ROOT / "docs" / "licenses" / "dsh-anchored-standard.NOTICE").is_file()
)
self.assertTrue((ROOT / "docs" / "licenses" / "dshmarket.LICENSE").is_file())
for name in ("splash.png", "session.png", "vision.png", "menu.png"):
self.assertTrue((ROOT / "docs" / "screenshots" / name).is_file())