neuro-simulator 0.6.1__py3-none-any.whl → 0.6.3__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 (32) hide show
  1. README.md +40 -45
  2. neuro_simulator/agent/memory/core_memory.json +33 -6
  3. neuro_simulator/client/assets/index-rmyQl8Tr.css +1 -0
  4. neuro_simulator/client/assets/index-vrP1Bqp5.js +7 -0
  5. neuro_simulator/client/index.html +10 -10
  6. neuro_simulator/client/neuro_start.mp4 +0 -0
  7. neuro_simulator/core/application.py +129 -39
  8. neuro_simulator/dashboard/assets/{AgentView-DBq2msN_.js → AgentView-iU5hsY94.js} +2 -2
  9. neuro_simulator/dashboard/assets/{ChatBotView-BqQsuJUv.js → ChatBotView-nOYkrVxt.js} +2 -2
  10. neuro_simulator/dashboard/assets/{ConfigView-CPYMgl_d.js → ConfigView-Bl6IeKb4.js} +2 -2
  11. neuro_simulator/dashboard/assets/ContextTab-B2h9psAa.js +1 -0
  12. neuro_simulator/dashboard/assets/ContextTab-Cf-FBreH.css +1 -0
  13. neuro_simulator/dashboard/assets/{ControlView-BvflkxO-.js → ControlView-DUubzbkq.js} +1 -1
  14. neuro_simulator/dashboard/assets/{FieldRenderer-DyPAEyOT.js → FieldRenderer-CzisHAil.js} +1 -1
  15. neuro_simulator/dashboard/assets/{LogsTab-C-SZhHdN.js → LogsTab-D6Rjw8zO.js} +1 -1
  16. neuro_simulator/dashboard/assets/{LogsView-82wOs2Pp.js → LogsView-B_b_F2PW.js} +1 -1
  17. neuro_simulator/dashboard/assets/{MemoryTab-p3Q-Wa4e.js → MemoryTab-D49sjqDT.js} +1 -1
  18. neuro_simulator/dashboard/assets/{ToolsTab-BxbFZhXs.js → ToolsTab-DbZ5EIry.js} +1 -1
  19. neuro_simulator/dashboard/assets/{index-Ba5ZG3QB.js → index-CAD8DrUm.js} +18 -18
  20. neuro_simulator/dashboard/assets/{index-CcYt9OR6.css → index-w6MKUyz9.css} +2 -2
  21. neuro_simulator/dashboard/index.html +3 -3
  22. neuro_simulator/utils/websocket.py +12 -1
  23. {neuro_simulator-0.6.1.dist-info → neuro_simulator-0.6.3.dist-info}/METADATA +38 -39
  24. {neuro_simulator-0.6.1.dist-info → neuro_simulator-0.6.3.dist-info}/RECORD +28 -28
  25. requirements.txt +1 -0
  26. neuro_simulator/client/assets/index-C_kzLmQy.css +0 -1
  27. neuro_simulator/client/assets/index-DRLWJPZv.js +0 -7
  28. neuro_simulator/dashboard/assets/ContextTab-BSROkcd2.js +0 -1
  29. neuro_simulator/dashboard/assets/ContextTab-DyPsixHQ.css +0 -1
  30. {neuro_simulator-0.6.1.dist-info → neuro_simulator-0.6.3.dist-info}/WHEEL +0 -0
  31. {neuro_simulator-0.6.1.dist-info → neuro_simulator-0.6.3.dist-info}/entry_points.txt +0 -0
  32. {neuro_simulator-0.6.1.dist-info → neuro_simulator-0.6.3.dist-info}/licenses/LICENSE +0 -0
@@ -2,11 +2,11 @@
2
2
  <html lang="">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
- <link rel="icon" href="/favicon.ico">
5
+ <link rel="icon" href="/dashboard/favicon.ico">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>𝐯𝐞𝐝𝐚𝐥𝟗𝟖𝟕 𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐨𝐫</title>
8
- <script type="module" crossorigin src="/assets/index-Ba5ZG3QB.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-CcYt9OR6.css">
8
+ <script type="module" crossorigin src="/dashboard/assets/index-CAD8DrUm.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/dashboard/assets/index-w6MKUyz9.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>
@@ -40,11 +40,22 @@ class WebSocketManager:
40
40
  await self.send_personal_message(message, connection)
41
41
 
42
42
  async def broadcast_to_admins(self, message: dict):
43
+ dead_connections = []
43
44
  for connection in self.admin_connections:
44
45
  try:
45
- await connection.send_json(message)
46
+ if connection.client_state == WebSocketState.CONNECTED:
47
+ await connection.send_json(message)
48
+ else:
49
+ dead_connections.append(connection)
50
+ except (WebSocketDisconnect, ConnectionResetError):
51
+ dead_connections.append(connection)
46
52
  except Exception as e:
47
53
  logger.error(f"Failed to send message to admin connection: {e}")
54
+ dead_connections.append(connection)
55
+
56
+ for connection in dead_connections:
57
+ if connection in self.admin_connections:
58
+ self.admin_connections.remove(connection)
48
59
 
49
60
  # Global singleton instance
50
61
  connection_manager = WebSocketManager()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuro_simulator
3
- Version: 0.6.1
3
+ Version: 0.6.3
4
4
  Summary: Neuro Simulator Server
5
5
  Project-URL: Homepage, https://github.com/Moha-Master/neuro-simulator
6
6
  Project-URL: Repository, https://github.com/Moha-Master/neuro-simulator
@@ -21,6 +21,7 @@ Requires-Python: >=3.8
21
21
  Requires-Dist: azure-cognitiveservices-speech
22
22
  Requires-Dist: fastapi
23
23
  Requires-Dist: google-genai
24
+ Requires-Dist: httpx
24
25
  Requires-Dist: jinja2
25
26
  Requires-Dist: mutagen
26
27
  Requires-Dist: openai
@@ -41,14 +42,14 @@ Description-Content-Type: text/markdown
41
42
 
42
43
  *本临时README和所有代码均由AI生成*
43
44
 
44
- Neuro Simulator 是一个模拟 Neuro-sama 直播的项目
45
- 它通过调用 Letta(一个为 LLM 添加自主记忆功能的项目),也可使用自带的有记忆 Agent,配合其他 LLM 服务生成的模拟观众,模拟一场 Neuro-sama 的 Just Chatting 直播
46
- 它能生成实时的虚拟聊天内容,并通过 TTS 合成语音,提供沉浸式的 Twitch vedal987 频道观看体验
45
+ Neuro Simulator 是一个模拟 Neuro-sama 直播的项目。
46
+ 它通过使用自带的有记忆 Agent,~~也可调用 Letta(一个为 LLM 添加自主记忆功能的项目)~~,以及相同构造的 Chatbot Agent 作为虚拟观众,模拟一场 Neuro-sama 的 Just Chatting 直播。
47
+ 它能生成实时的虚拟聊天内容,并通过 TTS 合成语音,提供沉浸式的 Twitch vedal987 频道观看体验。
47
48
 
48
49
  ## 特性
49
50
 
50
- 和其他大佬的类似项目不同,本项目的重点在于尽可能模拟 Neuro-sama Twitch 上的 Tuesday Stream,因此不会有太多的自定义部分
51
- 后续有低成本低性能方法实现 Evil 音色模仿的时候,可能加入 Evil 的 Just Chatting 乃至各种主题的 Twin Stream
51
+ 和其他类似的 AI Vtuber 项目不同,本项目旨在尽可能模拟 Neuro-sama Twitch 上的 Tuesday Stream,因此在 Vtuber 部分不会有太多的自定义部分,也不会考虑引入 Neuro/Evil 以外的 Live2D。
52
+ 后续有低成本低性能方法实现 Evil 音色模仿的时候,可能加入 Evil Neuro。
52
53
 
53
54
  ### 预览
54
55
 
@@ -60,44 +61,44 @@ Neuro Simulator 是一个模拟 Neuro-sama 直播的项目
60
61
 
61
62
  ### 核心亮点
62
63
 
63
- - **多客户端支持**:支持多个客户端连接,实时广播内容
64
- - **配置热重载**:通过 Web 控制面板修改和热重载配置
65
- - **双 Agent 模式**:支持 Letta Agent 和内建 Agent,提供更多自定义选项
66
- - **Agent 记忆管理**:内建 Agent 支持多种记忆类型(初始化记忆、核心记忆、临时记忆、上下文)
64
+ - **多客户端支持**:支持多个客户端连接,实时广播内容。
65
+ - **配置热重载**:通过 Web 控制面板实时修改和热重载配置。
66
+ - ~~**双 Agent 模式**:支持 Letta Agent 和内建 Agent,提供更多自定义选项~~ 对 Letta Agent 的支持暂时下线,后续有缘再见。
67
67
 
68
68
  ## 快速开始
69
69
 
70
- 1. **准备外部服务**:确保你拥有必要的 API 密钥,包括 LLM(Gemini/OpenAI)和 Azure TTS;如果使用 Letta,也请注册好相关的 API
71
- 2. **安装服务端**:
70
+ 1. **准备外部服务**:确保你拥有必要的 API 密钥,包括 LLM(Gemini/OpenAI)和 Azure TTS;~~如果使用 Letta,也请注册好相关的 API 。~~
71
+ 2. **安装服务端**:已上传至 PyPi 作为可用 pip 安装的软件包,你可以用任何一个 pip 安装到全局或 venv 中。
72
72
  ```bash
73
73
  pip install neuro-simulator
74
74
  ```
75
+ 推荐使用 pipx,可以在不更改系统 Python 依赖的情况下直接安装为全局软件。
76
+
75
77
  3. **运行服务端**:
76
78
  ```bash
77
79
  neuro
78
80
  ```
79
- 记得填写好配置目录中的 `config.yaml`
80
- - 不指定 `--dir` 则自动创建和默认使用 `~/.config/neuro-simulator/` 作为工作目录
81
- - 在默认或指定目录及需要的文件不存在时,程序会自动用自带模板复制一份到工作目录下
81
+ 现在无需手动填写 `config.yaml`,程序在启动时会自动创建一份包含默认设置的配置文件,只需在管理面板中填写和为 Agent 分配 API 服务商即可。
82
+ - 不指定 `--dir, -D` 则自动创建和默认使用 `~/.config/neuro-simulator/` 作为工作目录。
83
+ - 程序会在工作目录下自动生成文件夹结构,拷贝需要的文件到目录内,保持程序包本体只读。
82
84
 
83
- 4. **安装客户端**:
84
- ```bash
85
- cd client
86
- npm install
87
- ```
88
- 5. **运行客户端**:
89
- ```bash
90
- npm run dev
91
- ```
92
- 6. **部署控制面板**:
93
- ```bash
94
- cd dashboard_web
95
- python -m http.server 8080
96
- ```
85
+ 程序启动后,如果工作正常,会默认在 `http://127.0.0.1:8000` 提供对外服务,你可以在设置中修改这个端口。
86
+
87
+ 4. **打开管理面板**:现在程序已经内置管理面板,直接在浏览器中打开 `http://127.0.0.1:8000/dashboard/` 即可,内置面板会自动连接到服务端。
88
+
89
+ **配置流程**:
90
+ 1. 在管理面板中打开“配置”页面。
91
+ 2. 在“LLM服务商”中添加一个以上的选项。
92
+ 3. 在“TTS服务商”中添加一个以上的 Azure TTS 服务。
93
+ 4. 在“Neuro”中分配一个 LLM 服务商和一个 TTS 服务商。
94
+ 5. 在“Chatbot”中分配一个 LLM 服务商。
95
+
96
+ 5. **打开客户端**:现在程序已经内置客户端,在浏览器中访问 `<http协议>://<服务端地址>/` 即可。
97
+ 但是这种方式下自动从哔哩哔哩获取最近回放的功能似乎不工作,需要对哔哩哔哩 API 进行反代。如果你安装了 nodejs,则可以使用 npm 运行开发服务器的方式使用客户端。
97
98
 
98
99
  更多更复杂或者更简单的使用方式,请参见三个部分的详细文档
99
100
 
100
- ## 项目结构
101
+ ## 项目结构(稍微过时,待更新)
101
102
 
102
103
  ```
103
104
  Neuro-Simulator/
@@ -117,7 +118,6 @@ Neuro-Simulator/
117
118
 
118
119
  - [服务端 README](server/README.md)
119
120
  - [客户端 README](client/README.md)
120
- - [控制面板 README](dashboard_web/README.md)
121
121
 
122
122
  ## 开发计划和已实现功能
123
123
 
@@ -141,7 +141,7 @@ Neuro-Simulator/
141
141
  - [ ] 模块化热插拔工具
142
142
  - [ ] 连接到 MCP 服务器
143
143
  - [ ] 兼容 Offical [Neuro SDK](https://github.com/VedalAI/neuro-sdk)
144
- - [ ] 拉起和对话 Evil Agent
144
+ - [ ] 拉起 Evil Agent 并进行对话
145
145
  - [ ] Evil Agent 模块,~~卖掉了~~ 待 Neuro Agent 完善、有低成本低性能方法实现 Evil 音色模仿的时候加入
146
146
  - [ ] 对 Neuroverse 更多成员的 AI Agent 复现,进而允许 Neuro Agent 向其发送 DM(语音聊天可能不太现实)
147
147
  - [x] Chatbot 模块
@@ -150,8 +150,8 @@ Neuro-Simulator/
150
150
  - [x] prompt 编辑
151
151
  - [x] 调用 Gemini 和 OpenAI API 格式的LLM
152
152
  - [x] 基于 Neuro Agent 的上一句内容而做出 Reaction
153
- - [ ] ~~在 prompt 中包含直播标题等更多信息~~ 将在更详细的 Chatbot Agent 中实现
154
- - [x] ~~实现更长的上下文~~ 将在更详细的 Chatbot Agent 中实现
153
+ - [ ] ~~在 prompt 中包含直播标题等更多信息~~ 将在更强大的 Chatbot Agent 中实现
154
+ - [x] ~~实现更长的上下文~~ 将在更强大的 Chatbot Agent 中实现
155
155
  - [x] Chatbot Agent
156
156
  - [x] 更好的用户名生成逻辑
157
157
  - [x] 更长的上下文,包括自身输出和 Neuro Agent 内容
@@ -171,7 +171,7 @@ Neuro-Simulator/
171
171
  - [x] TTS 合成和推送
172
172
  - [x] Azure TTS
173
173
  - [ ] 待定 TTS
174
- - [ ] 剔除 Emoji 等特殊字符
174
+ - [X] 剔除 Emoji 等特殊字符
175
175
  - [x] 进行直播和直播环节
176
176
  - [x] Just Chatting 单人直播
177
177
  - [x] Neuro Stream
@@ -191,8 +191,8 @@ Neuro-Simulator/
191
191
  - [x] 直播标题和标签等信息
192
192
  - [ ] 在非直播的空闲时间自动获取真实世界中 Neuro 的近期直播内容,更新完善记忆内容(不是微调训练)
193
193
  - [ ] 对 Ollama 等本地 LLM 的优化
194
- - [ ] 服务端内嵌管理面板
195
- - [ ] Web 控制面板
194
+ - [x] 服务端托管管理面板
195
+ - [x] Web 控制面板
196
196
  - [ ] 使用 PyInquiry 的命令行面板
197
197
  - 客户端
198
198
  - [ ] 仅包含直播区域的客户端,适用于希望使用 OBS 或其他软件推流画面的用户
@@ -237,6 +237,7 @@ Neuro-Simulator/
237
237
  - [ ] 真实的主播首页竖屏模式界面(目前沿用针对竖屏优化过的横屏样式)
238
238
  - [ ] 下滑的更多主播信息
239
239
  - [ ] 其他次级页面
240
+ - [x] 服务端托管客户端
240
241
  - [ ] 更多客户端(若实现原生客户端则弃用 tauri)
241
242
  - [x] 可托管的 Web 静态页面
242
243
  - [x] Windows 客户端
@@ -260,7 +261,6 @@ Neuro-Simulator/
260
261
  - [x] 对话方式展现
261
262
  - [x] 上下文方式展现
262
263
  - [x] 实时更新
263
- - [x] 更好的界面
264
264
  - [ ] 可视化展现 Agent 的详细执行流程
265
265
  - [x] 实时日志查看
266
266
  - [ ] 按照等级进行日志筛选
@@ -270,7 +270,6 @@ Neuro-Simulator/
270
270
  - [ ] 工具管理取决于服务端开发进度
271
271
  - 杂项,有一些可能永远不会实现,有一些可能很快就能完成
272
272
  - [ ] 一键启动器和整合包,适用于不需要分开部署的情况,或者面向普通小白用户
273
- - [ ] 把三个项目模块整合为一个
274
273
  - [ ] 基于静态立绘制作的简易Live2D,能动就行
275
274
  - [x] 目前不会考虑语音输入
276
275
 
@@ -1,6 +1,6 @@
1
- README.md,sha256=32Bfey7Pf2nAKO3ORsLHUoyg8XB6mP0Lh9ftU-uCuH8,6314
1
+ README.md,sha256=7pb9WxHIsbrrzlXps_W5ejL147vIu0ak3VTeDjIcfvU,6058
2
2
  WEBSOCKET_API.md,sha256=LkItXviJL-0DGqX85CSB9LAmcnj2cAnBzETvPIjRY8U,9203
3
- requirements.txt,sha256=4QYJ4CX6Q4nt2ShHwMuLZaRSM7wg8au-RX0i_rMVl7k,116
3
+ requirements.txt,sha256=YhzaOtVW_vk10JGQOBkXgUQYK3MsQ2E201qIA6pR-Io,122
4
4
  neuro_simulator/__init__.py,sha256=-tposzyvg6UckPcfSvtc03UjxBa9oCe_zRvlKf8splk,31
5
5
  neuro_simulator/cli.py,sha256=nG2-Ih7yF6ipxwoLrpfFORHHIC-DgqPEldipDecZH48,4261
6
6
  neuro_simulator/agent/__init__.py,sha256=t52CZlyTGWqcGjMs90qvpFpRckY2WSSlO7r_H3K_mSY,32
@@ -10,7 +10,7 @@ neuro_simulator/agent/memory_prompt.txt,sha256=wdpdnbOYhMKgPJnnGlcSejGdt2uItrXzD
10
10
  neuro_simulator/agent/neuro_prompt.txt,sha256=WSN5Fa6AwVnJaSFhz98fQTb2EtQ35U6w2qga_C-s1Go,1438
11
11
  neuro_simulator/agent/memory/__init__.py,sha256=YJ7cynQJI6kD7vjyv3rKc-CZqmoYSuGQtRZl_XdGEps,39
12
12
  neuro_simulator/agent/memory/chat_history.json,sha256=p4jwS2DJbzTvZinDddlrJilOHHwXSy_eZPDdNvRP84I,412
13
- neuro_simulator/agent/memory/core_memory.json,sha256=i-fu2zPyZX-hdV19sFm6UiKav9kZFzIkiOwrZbZ3ebY,4900
13
+ neuro_simulator/agent/memory/core_memory.json,sha256=AMQhNwFteUb7NaM8TFcAmx7Byey3JL9rBlFcErk9OyQ,5141
14
14
  neuro_simulator/agent/memory/init_memory.json,sha256=JdjEmZz4lAkawFeJGKSnj_wdtaJJBZ-xoAdctR3GjWk,3184
15
15
  neuro_simulator/agent/memory/manager.py,sha256=R9OsPTt8lXsc2Z95lYRJCmKAOghOtHARzpOtqOnU_Wg,6214
16
16
  neuro_simulator/agent/memory/temp_memory.json,sha256=ZZPzk0IwtWzJKVVsINfZCEMiDqKEDvFVQ3fke70HD-M,148
@@ -55,7 +55,7 @@ neuro_simulator/chatbot/tools/post_chat_message.py,sha256=lchGCSQKzPZgb1z__MIDkG
55
55
  neuro_simulator/core/__init__.py,sha256=-ojq25c8XA0CU25b0OxcGjH4IWFEDHR-HXSRSZIuKe8,57
56
56
  neuro_simulator/core/agent_factory.py,sha256=jX7wRyTS7Jd-qfIGj0kGs_0pblx5zUcyVAyRETIUhvw,1359
57
57
  neuro_simulator/core/agent_interface.py,sha256=ZXUCtkQUvsBQ5iCb0gTILJaShn5KmSrEgKhd7PK18HE,2794
58
- neuro_simulator/core/application.py,sha256=xgXLwYzq71AkiFLSn2L_hePuUp9sA0Eknb_DxjEeNDE,30292
58
+ neuro_simulator/core/application.py,sha256=ZUsZvTymnhVzMYztd5SQLm3_Kl2Fk9ViYg7R8yN3uO4,34427
59
59
  neuro_simulator/core/config.py,sha256=eH5LdTm7gtLBqV7bbiUulYTW2abKYUmK934x3zOS19w,4766
60
60
  neuro_simulator/core/path_manager.py,sha256=_MK3S5ab30zT9zDISC-noDbVE8Axs5y1A3WgImqD-wI,4284
61
61
  neuro_simulator/services/__init__.py,sha256=s3ZrAHg5TpJakadAAGY1h0wDw_xqN4Je4aJwJyRBmk4,61
@@ -67,7 +67,7 @@ neuro_simulator/utils/logging.py,sha256=fAM8mW4czr0RLgAUS6oN-YTWKj5daqwc5g7yjyAg
67
67
  neuro_simulator/utils/process.py,sha256=9OYWx8fzaJZqmFUcjQX37AnBhl7YWvrLxDWBa30vqwU,3192
68
68
  neuro_simulator/utils/queue.py,sha256=fJ0c7pwdAoUrLGC0qudehABkoBB7-pzROvmj_nA9D1c,2690
69
69
  neuro_simulator/utils/state.py,sha256=DdBqSAYfjOFtJfB1hEGhYPh32r1ZvFuVlN_-29_-luA,664
70
- neuro_simulator/utils/websocket.py,sha256=fjC-qipzjgM_e7XImP12DFmLhvxkMOSr2GnUWws7esE,2058
70
+ neuro_simulator/utils/websocket.py,sha256=PcbmNom49El4c6SLvpKsuc2P_YfwJC_WnBJmkpo0DH4,2566
71
71
  neuro_simulator/client/avatar.webp,sha256=gLkJF8g-akjXPXBzr_FRYmTt9RM9oXEmDnIEh12DkZs,25884
72
72
  neuro_simulator/client/background.webp,sha256=JD9OFItvxSm0xQ8jRJZ9eiXLZ1R-1xZXd7EMWr4b170,1174858
73
73
  neuro_simulator/client/background_old.webp,sha256=10Jv9ElOAvpysZUTPw24tC7kKi2-oi6x7KuvI9bE9aU,51214
@@ -75,15 +75,15 @@ neuro_simulator/client/banner.jpeg,sha256=LFqSS0alXwQPilUnHNZ4qkx63Jbc5VYF0HsJOi
75
75
  neuro_simulator/client/channel_points.png,sha256=Tmy9kmKQWNfK-gPMKVvUYrpEiT3CsPgSx6V1-PJRBhI,11509
76
76
  neuro_simulator/client/error.mp3,sha256=ovZ-JXAHrqYUkjFshP48_3ZQcoRi7gUxO_ZkShoeIyA,24048
77
77
  neuro_simulator/client/favicon.ico,sha256=8mR4U-Ufv6l8_Md9C6yqbv6mZ0WV9DRLSPpms8WKp4g,370418
78
- neuro_simulator/client/index.html,sha256=nlFEBvqmI2WtW_htLeJyY2-o9iYLEeYjTfk6eVOFHqE,22427
79
- neuro_simulator/client/neuro_start.mp4,sha256=xCLnNzv4THnzRYwkdV6EiqXc-XtFd867R2ZVLDvNp0Y,8226418
78
+ neuro_simulator/client/index.html,sha256=qdw4WnM37-VldXdT5D2Glx7IAuDpufLWujG3-XeIM9A,22417
79
+ neuro_simulator/client/neuro_start.mp4,sha256=nIxX0Ki58IzBX3-KwFKcNXgWRLYblDgaKBVQVkoN4BQ,8080037
80
80
  neuro_simulator/client/neurosama.png,sha256=FTyEEEu0XwRxicKtmQXQONiRVhYKgTsPqlOO2Ymbp1c,1447110
81
81
  neuro_simulator/client/sc_pink.png,sha256=bmC1Wn8I27nsc9lkQJ8-LeacL6Y-eOZor_JkmXy9Om0,56768
82
82
  neuro_simulator/client/sc_purple.png,sha256=XUs6fB0CHPTzQQ3npS1rje5gcigy-T4uao8k3RxOk50,57224
83
83
  neuro_simulator/client/sub_badge.svg,sha256=-Es6Nz9sd7c3sJ4Mys2q0vSd7AZVC9uE-Sq4ipCsioo,825
84
84
  neuro_simulator/client/user_avatar.jpg,sha256=j2MZCFm0MYmigPPOLsuFqA8PhvQ5SWb0GTpqb9VKqvY,29625
85
- neuro_simulator/client/assets/index-C_kzLmQy.css,sha256=ldHgSwFauTDidMP-jwCYOWpFSFsjJp-3FcqSniVfkFk,27793
86
- neuro_simulator/client/assets/index-DRLWJPZv.js,sha256=5sAhfYAN0xKCbG6iZv20bjA7CaXr4zmqR57wd5ko14o,37340
85
+ neuro_simulator/client/assets/index-rmyQl8Tr.css,sha256=ischTFPWjCjy3-vCQ863InoM-wjMuybtesUP0vaY-XA,27865
86
+ neuro_simulator/client/assets/index-vrP1Bqp5.js,sha256=vTzGaevLne-HptHxemLWRNWw5ZsCqVLDrG8FNO1YQFI,37629
87
87
  neuro_simulator/client/assets/inter-cyrillic-400-normal-BLGc9T1a.woff2,sha256=Y20TqrBe2fpJ3xnFf93btvPQhPRjdD7lJXVJ27cSQAU,7712
88
88
  neuro_simulator/client/assets/inter-cyrillic-400-normal-alAqRL36.woff,sha256=GmDEQlTts7GpPN_vX-7Kqig5IarhIL_nICL6SWvtq5Y,9780
89
89
  neuro_simulator/client/assets/inter-cyrillic-ext-400-normal-BE2fNs0E.woff,sha256=RHF2hsw99YHFTevMHQw7zGUUaXtPsetnWZbP0cfZaYA,13336
@@ -104,33 +104,33 @@ neuro_simulator/client/fonts/first-coffee.woff2,sha256=pUBfpDh_6HQ20V9EuKWq2UFLn
104
104
  neuro_simulator/client/fonts/noto-sans-sc.woff2,sha256=KsZkKouZc8g1eQ_5wzOWuGkIcSYzGGsHYZJhyu0hFDg,4182468
105
105
  neuro_simulator/dashboard/favicon.ico,sha256=8mR4U-Ufv6l8_Md9C6yqbv6mZ0WV9DRLSPpms8WKp4g,370418
106
106
  neuro_simulator/dashboard/first-coffee.woff2,sha256=pUBfpDh_6HQ20V9EuKWq2UFLnMi9RPHigLN2rOU9Jps,11496
107
- neuro_simulator/dashboard/index.html,sha256=ClWlZyXnWx8VnCKyxANGG39z3B0ecsfLMCDpSgrmfFI,489
108
- neuro_simulator/dashboard/assets/AgentView-DBq2msN_.js,sha256=Il81G74VymiZ_Jn3p4mjBQjVluEa4f7Dt6hhLEQuBu0,2413
107
+ neuro_simulator/dashboard/index.html,sha256=2EEXrZPFdXMVKSewGW6WMxO3SFNadHcN9yuh6HcKx8Y,519
109
108
  neuro_simulator/dashboard/assets/AgentView-TDgmx5bK.css,sha256=UjBaTbzD4yiDxAHXC5rSSgY-tDFyBfVYS_O1VNcmoYU,361
110
- neuro_simulator/dashboard/assets/ChatBotView-BqQsuJUv.js,sha256=YdaDcUiIRvT7NQdtRWFZoArLy2DPX-zyVMTZZrS46_c,2246
109
+ neuro_simulator/dashboard/assets/AgentView-iU5hsY94.js,sha256=RKTlDJqtGABAKyCh4TrW4lD-P5JmqpZJybIYxPzhDX4,2413
111
110
  neuro_simulator/dashboard/assets/ChatBotView-Dyd6g14G.css,sha256=61Z9sVqq9scsOWZJaOslumxe8Q0I_leQGY4jxy1Zm9o,367
112
- neuro_simulator/dashboard/assets/ConfigView-CPYMgl_d.js,sha256=bg0E8zHlMPqEQsFXsD3FBGV7aQT5lh1RIfLnQg_mQ2M,2932
111
+ neuro_simulator/dashboard/assets/ChatBotView-nOYkrVxt.js,sha256=KxdRT8A5BhLWw-upTDNVdrmVzy9bC9qJtI8lEe4xxes,2246
112
+ neuro_simulator/dashboard/assets/ConfigView-Bl6IeKb4.js,sha256=2oZAXRAF08moPhsIwgY2S_HjmngSuGuXjwDjj_F3KgM,2932
113
113
  neuro_simulator/dashboard/assets/ConfigView-aFribfyR.css,sha256=ubCvxhHoetmZ-Dr1BhA5WzniPouxSTHrVNUF_ernK8E,51
114
- neuro_simulator/dashboard/assets/ContextTab-BSROkcd2.js,sha256=rcKaY2Ya2bckj-ucnwz36VPwJ18VRj3xx91TkIeX2L8,1249
115
- neuro_simulator/dashboard/assets/ContextTab-DyPsixHQ.css,sha256=OuDxYxHQE6vR0K0olHcct5JbfJ8dRZqwsLoM6HUrJdY,306
114
+ neuro_simulator/dashboard/assets/ContextTab-B2h9psAa.js,sha256=DuEMp3MsqAjYcvMpHAvlzasW_KDPOqbzEFuod8t50JE,1224
115
+ neuro_simulator/dashboard/assets/ContextTab-Cf-FBreH.css,sha256=fIqARaEdmcJNOZbl5j1Ia2m86-wNMplrs9KaZcm41_Y,306
116
116
  neuro_simulator/dashboard/assets/ControlView-BUCt3umR.css,sha256=Nspx07838NWMuUKrWJCRgwRBdjl-zezVBzUSfdDBsiU,108
117
- neuro_simulator/dashboard/assets/ControlView-BvflkxO-.js,sha256=Kt2cVQ0a8tJ3YCbe4QYVPvQjK_KW8Kqfd41W3xgFCL0,1549
118
- neuro_simulator/dashboard/assets/FieldRenderer-DyPAEyOT.js,sha256=3f0uIZkMMGjNYF18vgfKVF4by9jHJ2VVMlpzXBEVuEQ,7598
119
- neuro_simulator/dashboard/assets/LogsTab-C-SZhHdN.js,sha256=sXEOoH7mEovSuKOzdxLceZGSurTRkUVCg8J_yrpvc_s,542
117
+ neuro_simulator/dashboard/assets/ControlView-DUubzbkq.js,sha256=YEUrUbmLDOmJzIKkl-ZUBiNSta08IuEhWjrEFAy4e6o,1549
118
+ neuro_simulator/dashboard/assets/FieldRenderer-CzisHAil.js,sha256=Iy23BdjpYrhKUyM0IIBg7zjRqbaEgsSQR4XlGrXmYH0,7598
119
+ neuro_simulator/dashboard/assets/LogsTab-D6Rjw8zO.js,sha256=2WUW_8GxQ-rjM6FgPr5n_JWWysYhNboe1RXDZsWwaQ8,542
120
120
  neuro_simulator/dashboard/assets/LogsTab-wg3i3S6b.css,sha256=hRDoXwSnuvWe9vt-lh8XbMiJTS-WV-HTHf3-JOmkfuE,254
121
- neuro_simulator/dashboard/assets/LogsView-82wOs2Pp.js,sha256=RLTJXNzKxDID08imN9zdTHYqwNV-5MvvoIWQ5AzXD00,788
121
+ neuro_simulator/dashboard/assets/LogsView-B_b_F2PW.js,sha256=n08Nj8txzmVGa-uJVsVt2eVg0cq0j8r9D24v90O_6QU,788
122
122
  neuro_simulator/dashboard/assets/LogsView-D2F8f-Mc.css,sha256=69G8eFicz4WLe-f3mnn7YMfo-odPHM7gcRT160oNgGo,254
123
+ neuro_simulator/dashboard/assets/MemoryTab-D49sjqDT.js,sha256=paiZH63CXPLu0Om9kIkwRtFMIhJUanDflEjqynYqkZk,9508
123
124
  neuro_simulator/dashboard/assets/MemoryTab-DPthi6jg.css,sha256=yZNqQVtHqNjjsKz3eCRmcuuYi4kKQFMTUHiWEHbOeHY,151
124
- neuro_simulator/dashboard/assets/MemoryTab-p3Q-Wa4e.js,sha256=lGoeWPr1EiOymbQhYp4p8qblOznto7J1R5exhp3Dy8w,9508
125
- neuro_simulator/dashboard/assets/ToolsTab-BxbFZhXs.js,sha256=P-0M57p5JNYotkITplN9P5KzC5bTDbHxObbM8pJ7EjU,3694
126
- neuro_simulator/dashboard/assets/index-Ba5ZG3QB.js,sha256=C5lgcP6ubbGwngH5_WKcd5C0agl-sjhyBvICWaGF9ZQ,629137
127
- neuro_simulator/dashboard/assets/index-CcYt9OR6.css,sha256=aw0iyjqWqN0owGgSVd8UFD9vZMd6GI7lc7ey3WYQ05I,804934
125
+ neuro_simulator/dashboard/assets/ToolsTab-DbZ5EIry.js,sha256=AWjnKERRjl_0A86CUSpLsezuH2PfaBToVEnqgG9ODtU,3694
126
+ neuro_simulator/dashboard/assets/index-CAD8DrUm.js,sha256=KyJ4pjphhKkLdCiSpcUw8wxrWnm6-fu3XEmURw4hAq4,629148
127
+ neuro_simulator/dashboard/assets/index-w6MKUyz9.css,sha256=wSK-tcF7Ip4EssJZqKvGRNa_hhBqPY250zZtXjUeg5I,804994
128
128
  neuro_simulator/dashboard/assets/materialdesignicons-webfont-B7mPwVP_.ttf,sha256=YeirpaTpgf4iz3yOi82-oAR251xiw38Bv37jM2HWhCg,1307660
129
129
  neuro_simulator/dashboard/assets/materialdesignicons-webfont-CSr8KVlo.eot,sha256=CxgxBNL8XyYZbnc8d72vLgVQn9QlnS0V7O3Kebh-hPk,1307880
130
130
  neuro_simulator/dashboard/assets/materialdesignicons-webfont-Dp5v-WZN.woff2,sha256=Zi_vqPL4qVwYWI0hd0eJwQfGTnccvmWmmvRikcQxGvw,403216
131
131
  neuro_simulator/dashboard/assets/materialdesignicons-webfont-PXm3-2wK.woff,sha256=pZKKDVwvYk5G-Y2bFcL2AEU3f3xZTdeKF1kTLqO0Y-s,587984
132
- neuro_simulator-0.6.1.dist-info/METADATA,sha256=_uIC9ykhARn1EvQ6-DhDymJ0xOhxAYSkZpMJ12UOt7k,11242
133
- neuro_simulator-0.6.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
- neuro_simulator-0.6.1.dist-info/entry_points.txt,sha256=qVd5ypnRRgU8Cw7rWfZ7o0OXyS9P9hgY-cRoN_mgz9g,51
135
- neuro_simulator-0.6.1.dist-info/licenses/LICENSE,sha256=cPsKhVNOnNSSva44vcCU-SDDFf8iE-EhpGXCiUK9tAM,1072
136
- neuro_simulator-0.6.1.dist-info/RECORD,,
132
+ neuro_simulator-0.6.3.dist-info/METADATA,sha256=GeJ_Pd2pppBhTpe93t49bJ_k6s7eKdI8nDoBv5xAd5o,12396
133
+ neuro_simulator-0.6.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
134
+ neuro_simulator-0.6.3.dist-info/entry_points.txt,sha256=qVd5ypnRRgU8Cw7rWfZ7o0OXyS9P9hgY-cRoN_mgz9g,51
135
+ neuro_simulator-0.6.3.dist-info/licenses/LICENSE,sha256=cPsKhVNOnNSSva44vcCU-SDDFf8iE-EhpGXCiUK9tAM,1072
136
+ neuro_simulator-0.6.3.dist-info/RECORD,,
requirements.txt CHANGED
@@ -2,6 +2,7 @@ fastapi
2
2
  uvicorn
3
3
  google-genai
4
4
  azure-cognitiveservices-speech
5
+ httpx
5
6
 
6
7
  openai
7
8
  pyyaml
@@ -1 +0,0 @@
1
- :root{--twitch-purple: #9147FF;--twitch-dark-bg: #F2F2F2;--twitch-chat-bg: #FFFFFF;--twitch-text-color: #18181B;--twitch-secondary-text-color: #6A6A6D;--twitch-border-color: #D3D3D3;--twitch-hover-bg: #EFEFF1;--twitch-button-bg: #EFEFF1;--twitch-button-text-color: #0E0E10;--twitch-button-hover-bg: #DFDFE1;--twitch-primary-button-bg: var(--twitch-purple);--twitch-primary-button-text-color: #FFFFFF;--twitch-primary-button-hover-bg: #772CE8;--twitch-tag-bg: #EFEFF1;--twitch-tag-text-color: #6A6A6D;--twitch-live-red: #EB0400;--twitch-viewer-red: #971311;--sidebar-width: 340px;--header-height: 50px;--neuro-shadow-color: #32003C;--neuro-avatar-display-width-percent: 50%;--fast-transition: background-color .2s, color .2s;--twitch-dark-button-bg: #333333;--twitch-dark-button-hover-bg: #444444;--twitch-dark-button-text-color: #FFFFFF;--sc-pink-bg-color: #f68795;--sc-purple-bg-color: #b97ad5}@font-face{font-family:First Coffee;src:url(../fonts/first-coffee.woff2) format("woff2");font-weight:400;font-style:normal}@font-face{font-family:Comic Sans MS;src:url(../fonts/comic.woff2) format("woff2");font-weight:400;font-style:normal}@font-face{font-family:Noto Sans SC;src:url(../fonts/noto-sans-sc.woff2) format("woff2");font-weight:400;font-style:normal}@font-face{font-family:Causten;src:url(../fonts/causten.woff2) format("woff2");font-weight:400;font-style:normal}html,body{height:100%;margin:0;padding:0;overflow:hidden}body{font-family:Inter,Arial,sans-serif;display:flex;flex-direction:column;background-color:var(--twitch-dark-bg);color:var(--twitch-text-color)}.twitch-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 10px;border-radius:100px;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:var(--twitch-button-bg);color:var(--twitch-button-text-color);height:32px;box-sizing:border-box;line-height:1}.twitch-button svg{width:1.2em;height:1.2em;fill:currentColor;vertical-align:middle}.twitch-button span{padding-top:2px}.twitch-button:hover:not(:disabled){background-color:var(--twitch-button-hover-bg)}.twitch-button.subscribe-button{background-color:var(--twitch-primary-button-bg);color:var(--twitch-primary-button-text-color)}.twitch-button.subscribe-button:hover:not(:disabled){background-color:var(--twitch-primary-button-hover-bg)}.twitch-button.icon-button{width:32px;padding:0;border-radius:50%}.nav-icon-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0;border-radius:50%;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:transparent;color:var(--twitch-button-text-color);width:32px;height:32px;box-sizing:border-box;line-height:1}.nav-icon-button:hover:not(:disabled){background-color:var(--twitch-button-hover-bg);border-radius:50%}.nav-icon-button svg{width:20px;height:20px;fill:currentColor;vertical-align:middle}.search-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:transparent;color:var(--twitch-button-text-color);width:32px;height:32px;box-sizing:border-box;line-height:1}.search-button:hover:not(:disabled){background-color:var(--twitch-button-hover-bg)}.search-button svg{width:20px;height:20px;fill:currentColor;vertical-align:middle}.chat-toolbar-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0;border-radius:50%;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:transparent;color:var(--twitch-button-text-color);width:32px;height:32px;box-sizing:border-box;line-height:1}.chat-toolbar-button:hover:not(:disabled){background-color:var(--twitch-button-hover-bg);border-radius:50%}.chat-toolbar-button svg{width:20px;height:20px;fill:currentColor;vertical-align:middle}.chat-toolbar-button img{width:20px;height:20px;object-fit:contain}.video-overlay-chat-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0;border-radius:50%;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:#0009;color:#fff;width:32px;height:32px;box-sizing:border-box;line-height:1}.video-overlay-chat-button:hover:not(:disabled){background-color:#000c;border-radius:50%}.video-overlay-chat-button svg{width:20px;height:20px;fill:#fff;vertical-align:middle}.mute-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0;border-radius:50%;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:#0009;color:#fff;width:32px;height:32px;box-sizing:border-box;line-height:1}.mute-button:hover:not(:disabled){background-color:#000c;border-radius:50%}.mute-button svg{width:20px;height:20px;fill:#fff;vertical-align:middle}.twitch-button.dark{background-color:var(--twitch-dark-button-bg);color:var(--twitch-dark-button-text-color)}.twitch-button.dark:hover:not(:disabled){background-color:var(--twitch-dark-button-hover-bg)}.twitch-button.dark svg,.twitch-button.dark img{fill:var(--twitch-dark-button-text-color)}.twitch-button img{width:20px;height:20px;object-fit:contain;vertical-align:middle}.chat-toolbar-text-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 10px;border-radius:100px;font-size:.9em;font-weight:600;cursor:pointer;border:none;transition:var(--fast-transition);outline:none;background-color:transparent;color:var(--twitch-button-text-color);height:32px;box-sizing:border-box;line-height:1}.chat-toolbar-text-button:hover:not(:disabled){background-color:var(--twitch-button-hover-bg)}.chat-toolbar-text-button svg,.chat-toolbar-text-button img{width:1.2em;height:1.2em;fill:currentColor;vertical-align:middle;object-fit:contain}.chat-toolbar-text-button .points-value{padding-top:2px}.chat-toolbar-text-button .channel-points-icon{width:1.2em;height:1.2em;object-fit:contain}#twitch-header{height:var(--header-height);background-color:var(--twitch-chat-bg);display:flex;justify-content:space-between;align-items:center;padding:0 1rem;border-bottom:1px solid var(--twitch-border-color);flex-shrink:0;z-index:100;color:var(--twitch-text-color);gap:1rem}.top-nav-left,.top-nav-right{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.top-nav-center{flex-grow:1;flex-shrink:1;display:flex;justify-content:center;min-width:150px}.twitch-logo-link{display:flex;align-items:center;text-decoration:none;margin-left:.5rem}.twitch-logo-container{margin:0;transform:scaleY(-1);transition:transform .3s ease-out}.twitch-logo-container:hover{transform:scaleY(1)}.twitch-logo-svg .logo-body{fill:var(--twitch-purple)}.twitch-logo-svg .logo-face{fill:var(--twitch-chat-bg)}.twitch-logo-svg .logo-eye-path{fill:var(--twitch-purple)}.nav-links-main{display:flex;gap:1.5rem;margin-left:1.5rem}.nav-link{display:flex;align-items:center;gap:.5rem;text-decoration:none;color:var(--twitch-text-color);font-weight:500;font-size:1.1rem;padding:.25rem .5rem;border-radius:4px;transition:var(--fast-transition)}.nav-link:hover{color:var(--twitch-purple)}.nav-link p{margin:0}.search-container{display:flex;align-items:center;width:100%;max-width:400px;border:1px solid var(--twitch-border-color);border-radius:8px;overflow:hidden;background-color:var(--twitch-button-bg)}.search-input{flex:1 1 0;min-width:50px;padding:.5rem .75rem;border:none;background-color:transparent;color:var(--twitch-text-color);font-size:.95rem;outline:none}.search-input::placeholder{color:var(--twitch-secondary-text-color)}.search-button{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:0 .5rem}.search-button svg{fill:var(--twitch-text-color)}.top-nav-right{gap:.75rem}.nav-user-avatar-button{background:none;border:none;cursor:pointer;padding:0;border-radius:50%;width:32px;height:32px;overflow:hidden;flex-shrink:0}.user-avatar-wrapper{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.user-avatar-img{width:100%;height:100%;object-fit:cover;border-radius:50%}#main-content-wrapper{flex-grow:1;display:flex;overflow:hidden;position:relative}#stream-and-info-container{flex-grow:1;flex-shrink:1;display:flex;flex-direction:column;overflow-y:auto;min-height:0;scrollbar-width:none}#stream-and-info-container::-webkit-scrollbar{display:none}#stream-display-viewport{flex-grow:1;background-color:#000;display:flex;justify-content:center;align-items:center;overflow:hidden;min-height:0;position:relative}#mute-button{position:absolute;bottom:1rem;left:1rem;z-index:60}#stream-display-area{position:relative;background-color:#000;overflow:hidden;flex-shrink:0;visibility:hidden;opacity:0;transition:opacity .3s ease-in-out;container-type:size;container-name:streamArea}#background-display,#startup-video-overlay{position:absolute;top:0;left:0;width:100%;height:100%}#background-display{z-index:0;pointer-events:none;background:url(../background.webp) center/cover no-repeat}#neuro-static-avatar-container{position:absolute;left:70%;transform:translate(-50%);width:var(--neuro-avatar-display-width-percent);height:auto;overflow:visible;pointer-events:none;z-index:15;visibility:hidden;transition:transform .5s ease-in-out}#neuro-static-avatar-container img{width:100%;height:auto;display:block}.spin-animation{animation:spin-counter-clockwise .75s linear}@keyframes spin-counter-clockwise{0%{transform:translate(-50%) rotate(0)}to{transform:translate(-50%) rotate(-360deg)}}#neuro-static-avatar-container.zoom-in{transform:translate(-50%) scale(1.15)}#neuro-caption{position:absolute;bottom:5%;left:50%;transform:translate(-50%);width:90%;padding:10px 20px;border-radius:10px;text-align:center;font-weight:400;opacity:1;pointer-events:none;z-index:20;color:#fff;transition:none;text-shadow:0 0 4px var(--neuro-shadow-color),0 0 4px var(--neuro-shadow-color),0 0 4px var(--neuro-shadow-color);font-family:First Coffee,Noto Sans SC;font-size:3cqi}#neuro-caption:not(.show){opacity:0}#startup-video-overlay{background-color:#000;z-index:10;display:flex;justify-content:center;align-items:center;opacity:1;transition:none}#startup-video-overlay.hidden{opacity:0;pointer-events:none;visibility:hidden}#startup-video{width:100%;height:100%;object-fit:contain}#show-chat-button{position:absolute;top:1rem;right:1rem;z-index:60;background-color:#0009;border:none;border-radius:50%;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;transition:background-color .2s,opacity .3s ease-in-out,visibility .3s ease-in-out;opacity:0;visibility:hidden;pointer-events:none;width:32px;height:32px;box-sizing:border-box}#show-chat-button:hover{background-color:#000c}#show-chat-button svg{width:20px;height:20px;fill:currentColor}body.chat-collapsed #show-chat-button{opacity:1;visibility:visible;pointer-events:auto}#twitch-chat-overlay{position:absolute;top:0;left:0;width:25%;height:50%;background-color:transparent;color:#fff;padding:10px;overflow-y:auto;z-index:5;font-size:1.5cqi;scrollbar-width:none;font-family:Comic Sans MS,Noto Sans SC;pointer-events:none;-webkit-user-select:none;user-select:none;scroll-behavior:auto}#twitch-chat-overlay::-webkit-scrollbar{display:none}#twitch-chat-overlay *{pointer-events:none;-webkit-user-select:none;user-select:none}#twitch-chat-overlay .chat-line__message{padding:2px 0;margin:0;text-shadow:-1px -1px 0 #00000080,1px -1px 0 #00000080,-1px 1px 0 #00000080,1px 1px 0 #00000080,2px 2px 0 rgba(0,0,0,.5);font-size:1.5cqi}#twitch-chat-overlay .chat-line__username{font-weight:700;margin-right:.25rem;font-size:1.5cqi}#twitch-chat-overlay .text-fragment{font-weight:700;color:#fff;font-size:1.5cqi}#twitch-chat-overlay .chat-author__display-name{font-size:1.5cqi}#twitch-chat-overlay .chat-line__message-container>span:not(.chat-line__username){font-weight:700;color:#fff;text-shadow:-1px -1px 0 #00000080,1px -1px 0 #00000080,-1px 1px 0 #00000080,1px 1px 0 #00000080,2px 2px 0 rgba(0,0,0,.5);font-size:1.5cqi}#stream-display-viewport *:not(.mute-button):not(#show-chat-button){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#stream-info{padding:10px 20px;background-color:var(--twitch-chat-bg);border-bottom:1px solid var(--twitch-border-color)}.stream-info-layout{display:flex;gap:16px;align-items:center}.stream-info-left-column{flex-shrink:0}.streamer-avatar-link{display:block;position:relative}.streamer-avatar-wrapper{position:relative}#streamer-avatar{width:64px;height:64px;border-radius:50%;border:2px solid transparent;transition:border-color .2s}.streamer-avatar-link:hover #streamer-avatar{border-color:var(--twitch-purple)}.live-indicator-wrapper{position:absolute;bottom:-2px;left:50%;transform:translate(-50%);z-index:2}.live-indicator-rect{background-color:var(--twitch-live-red);color:#fff;font-size:.7em;font-weight:600;padding:2px 6px;border-radius:4px;white-space:nowrap;border:2px solid var(--twitch-chat-bg);text-transform:uppercase}.stream-info-right-column{display:flex;flex-direction:column;flex-grow:1;gap:4px;min-width:0}.stream-info-main-row{display:flex;justify-content:space-between;align-items:center}.streamer-info-and-name{display:flex;align-items:center;gap:6px;min-width:0}#streamer-nickname{margin:0;font-size:1.2em;color:var(--twitch-text-color);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.verified-badge svg{width:16px;height:16px;fill:var(--twitch-purple)}.main-action-buttons{display:flex;gap:6px;align-items:center;flex-shrink:0}#stream-info .twitch-button{display:inline-flex;align-items:center;justify-content:center;height:30px;padding:6px 10px;box-sizing:border-box}#stream-info .twitch-button.follow-button,#stream-info .twitch-button.icon-button{width:30px;padding:0}#stream-info .twitch-button:not(.follow-button):not(.icon-button){padding-top:0;padding-bottom:1px}#stream-info .twitch-button svg{width:18px;height:18px}.stream-info-details-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.stream-details-left{display:flex;flex-direction:column;gap:6px;min-width:0}#stream-title-full{margin:0;font-size:.9em;font-weight:600;color:var(--twitch-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stream-category-and-tags{display:flex;align-items:center;gap:6px;min-width:0}.stream-category{font-size:.9em;color:var(--twitch-purple);text-decoration:none;font-weight:500;transition:color .2s;flex-shrink:0}.stream-category:hover{text-decoration:underline}.stream-tags{display:flex;gap:6px;align-items:center;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.stream-tags::-webkit-scrollbar{display:none}.stream-tag{display:inline-flex;align-items:center;padding:3px 8px;border-radius:100px;background-color:var(--twitch-tag-bg);color:var(--twitch-tag-text-color);font-size:.75em;font-weight:600;text-decoration:none;transition:background-color .2s;height:20px;box-sizing:border-box;flex-shrink:0}.stream-tag:hover{background-color:var(--twitch-button-hover-bg)}.stream-details-right{display:flex;align-items:center;gap:12px;flex-shrink:0}.stream-stats-section{display:flex;gap:0px;align-items:center;font-size:.9em;color:var(--twitch-secondary-text-color);justify-content:flex-end}.viewer-count,.stream-duration{display:flex;align-items:center;gap:4px}.viewer-count{color:var(--twitch-viewer-red)}.viewer-count svg{width:18px;height:18px;fill:currentColor}.viewer-count strong{font-weight:600}.stream-duration .duration-text{font-weight:500;color:var(--twitch-text-color);min-width:4.5em;text-align:right}.stream-secondary-actions{display:flex;gap:6px}.stream-secondary-actions .twitch-button{background-color:transparent}.stream-secondary-actions .twitch-button:hover:not(:disabled){background-color:var(--twitch-button-hover-bg)}#chat-sidebar{width:var(--sidebar-width);min-width:var(--sidebar-width);background-color:var(--twitch-chat-bg);flex-shrink:0;display:flex;flex-direction:column;border-left:1px solid var(--twitch-border-color);z-index:50;height:100%;transition:width .3s ease-in-out,min-width .3s ease-in-out}#chat-sidebar.collapsed{width:0;min-width:0;overflow:hidden;visibility:hidden;pointer-events:none}.chat-sidebar-header{height:3.5rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;border-bottom:1px solid var(--twitch-border-color);flex-shrink:0;position:relative}.chat-header-left,.chat-header-right{display:flex;align-items:center;gap:.5rem;z-index:1}.chat-sidebar-header .chat-title{position:absolute;left:50%;transform:translate(-50%);margin:0;font-size:1rem;font-weight:600;color:var(--twitch-text-color)}.chat-toggle-button{display:flex;align-items:center;justify-content:center;background:none;border:none;border-radius:50%;padding:0;cursor:pointer;color:var(--twitch-text-color);transition:background-color .2s;width:32px;height:32px;box-sizing:border-box}.chat-toggle-button:hover{background-color:var(--twitch-hover-bg)}.chat-toggle-button svg{width:20px;height:20px;fill:currentColor}#chat-sidebar.collapsed .chat-toggle-button{transform:rotate(180deg)}.messages-display{flex-grow:1;overflow-y:auto;padding:.5rem 1rem;min-height:0;scrollbar-width:thin;scrollbar-color:#B0B0B0 var(--twitch-hover-bg)}.messages-display::-webkit-scrollbar{width:8px}.messages-display::-webkit-scrollbar-track{background:var(--twitch-hover-bg);border-radius:4px}.messages-display::-webkit-scrollbar-thumb{background:#b0b0b0;border-radius:4px}.messages-display::-webkit-scrollbar-thumb:hover{background:#888}.chat-line__message{display:flex;align-items:flex-start;padding:.3rem 0;line-height:1.5;word-wrap:break-word;color:var(--twitch-text-color);border-radius:4px}.chat-line__message:hover{background-color:#ffffff0d}.chat-line__message-container{display:inline}.chat-line__username{font-weight:700;display:inline-block;margin-right:.1rem;cursor:pointer}.chat-author__display-name{font-size:.9rem}.text-fragment{font-size:.9rem;color:var(--twitch-text-color)}.chat-line__message.user-sent-message{background-color:#9147ff1a;border-left:3px solid var(--twitch-purple);padding-left:.75rem}.chat-line__message.system-message{color:var(--twitch-secondary-text-color);font-style:italic;font-size:.85rem;justify-content:center}.chat-line__message.system-message .chat-line__username,.chat-line__message.system-message .text-fragment{font-size:inherit;color:inherit;font-weight:400}.chat-input-area{padding:.75rem 1rem;border-top:1px solid var(--twitch-border-color);flex-shrink:0}.chat-input-and-buttons{display:flex;flex-direction:column;gap:.5rem}.chat-input-textarea-container{display:flex;align-items:center;border:1px solid var(--twitch-border-color);border-radius:4px;background-color:var(--twitch-button-bg);padding:0 .5rem;transition:var(--fast-transition)}.chat-input-textarea-container:focus-within{border-color:var(--twitch-purple);box-shadow:0 0 0 2px #9147ff33}.chat-input-prefix-icons,.chat-input-suffix-icons{display:flex;align-items:center}.chat-input-wrapper{flex-grow:1}.chat-input-element{width:100%;height:2.25rem;padding:0 .5rem;border:none;background-color:transparent;color:var(--twitch-text-color);font-size:.95rem;outline:none}.chat-input-element::placeholder{color:var(--twitch-secondary-text-color)}.chat-input-buttons-container{display:flex;justify-content:space-between;align-items:center}.chat-buttons-left,.chat-buttons-right{display:flex;align-items:center;gap:.5rem}.chat-points-display{display:flex;align-items:center;gap:.25rem;font-size:.85rem;color:var(--twitch-secondary-text-color)}.chat-points-display svg,.chat-points-display .channel-points-icon{width:18px;height:18px;fill:currentColor;object-fit:contain}.chat-points-display .points-value{color:var(--twitch-text-color);font-weight:600}#send-button:disabled{background-color:#b0b0b0;cursor:not-allowed}.chat-toolbar-text-button.selected{background-color:var(--twitch-purple-light);border:1px solid var(--twitch-purple);box-shadow:0 0 5px var(--twitch-purple-light)}#highlight-message-overlay{position:absolute;left:41%;transform:translate(-50%) translateY(-200%);width:24vw;height:auto;z-index:100;transition:transform 1s}#highlight-message-overlay.is-visible{transform:translate(-50%) translateY(0);transition-timing-function:cubic-bezier(.25,1,.5,1)}.sc-background-image{width:100%;height:auto;display:block;border-radius:20px}.sc-content{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2;color:#fff;font-family:Causten}.sc-user{position:absolute;top:20%;left:40%;transform:translate(-50%);font-size:2cqi;text-align:left}.sc-message{position:absolute;top:60%;left:50%;transform:translate(-50%,-50%);width:90%;font-size:2cqi;text-align:center;overflow-wrap:break-word}.settings-modal-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;display:flex;justify-content:center;align-items:center}.settings-modal-container.hidden{display:none}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#0009}.modal-content{position:relative;background-color:var(--twitch-chat-bg);color:var(--twitch-text-color);border-radius:8px;width:90%;max-width:450px;box-shadow:0 4px 20px #0003;display:flex;flex-direction:column}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.5rem;border-bottom:1px solid var(--twitch-border-color)}.modal-header h2{margin:0;font-size:1.25rem}.modal-body{padding:1.5rem;display:flex;flex-direction:column;gap:1.5rem}.setting-item{display:flex;flex-direction:column;gap:.5rem}.setting-item label{font-weight:600;font-size:.9rem}.modal-input{padding:.75rem;border:1px solid var(--twitch-border-color);border-radius:4px;background-color:var(--twitch-button-bg);color:var(--twitch-text-color);font-size:1rem}.modal-input:focus{outline:none;border-color:var(--twitch-purple);box-shadow:0 0 0 2px #9147ff33}.avatar-setting .avatar-preview-container{display:flex;align-items:center;gap:1rem}.avatar-preview{width:60px;height:60px;border-radius:50%;object-fit:cover;border:2px solid var(--twitch-border-color)}.avatar-upload-input{display:none}.modal-footer{padding:1rem 1.5rem;border-top:1px solid var(--twitch-border-color);display:flex;justify-content:flex-end}.setting-description{font-size:.8rem;color:var(--twitch-secondary-text-color);margin:4px 0 0}.turbo-button-icon{display:none}.turbo-button-full{display:inline-flex}@media (max-width: 992px){.turbo-button-full{display:none}.turbo-button-icon{display:inline-flex}}@media (max-width: 767px){body,#main-content-wrapper{flex-direction:column}#stream-and-info-container{width:100%}#chat-sidebar{width:100%;height:40vh;min-height:200px;min-width:unset;border-left:none;border-top:1px solid var(--twitch-border-color)}#chat-sidebar.collapsed{height:0;min-height:0;overflow:hidden;visibility:hidden;pointer-events:none}.nav-links-main,button[aria-label=Prime],button[aria-label=打开通知],button[aria-label=悄悄话],button[aria-label=购买呼币],button[aria-label=免费体验无广告观赏],button#show-chat-button,button[aria-label=通知],button.twitch-button[aria-label=购买呼币],button.twitch-button[aria-label=赠送一次订阅],.stream-details-right,.chat-sidebar-header{display:none!important}*{scrollbar-width:none!important}*::-webkit-scrollbar{display:none!important}*::-webkit-scrollbar-thumb{display:none!important}*::-webkit-scrollbar-track{display:none!important}#streamer-avatar{width:50px;height:50px}}.tooltip{position:absolute;background:#18181b;color:#fff;padding:6px 10px;font-size:12px;border-radius:4px;pointer-events:none;opacity:0;transition:opacity .2s ease;white-space:nowrap;z-index:1000;transform-origin:center bottom;-webkit-user-select:none;user-select:none}.tooltip.show{opacity:1}.tooltip:after{content:"";position:absolute;left:50%;transform:translate(-50%);border-width:6px;border-style:solid;top:100%;border-color:#18181b transparent transparent transparent;transition:border-color .2s ease,top .2s ease}.tooltip.tooltip-arrow-up:after{top:-12px;border-color:transparent transparent #18181b transparent}.hidden{display:none!important}#offline-content-container{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:wrap;width:100%;min-height:500px;flex-grow:1;background-image:url(../banner.jpeg);background-size:cover;background-position:center;background-repeat:no-repeat;padding:2rem;gap:2rem;box-sizing:border-box}.offline-info-card{display:flex;flex-direction:column;align-items:flex-start;background-color:#fff;padding:1.5rem;border-radius:0;color:#0e0e10;box-shadow:0 4px 10px #0000001a;box-sizing:border-box;flex:0 1 270px}.offline-status-section{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex-grow:1;gap:.75rem}.offline-status-badge{background-color:#000;color:#fff;font-size:.9em;font-weight:600;padding:2px 6px;border-radius:4px;white-space:nowrap;text-transform:uppercase}.offline-status-title{font-size:1.6rem;font-weight:600;margin:0}.offline-notification-section{width:100%;margin-left:-10px}.offline-notification-button{background-color:transparent;color:var(--twitch-primary-button-hover-bg);justify-content:flex-start}.offline-notification-button:hover{background-color:var(--twitch-button-hover-bg);color:var(--twitch-button-text-color)}.offline-notification-button svg{fill:currentColor}.offline-video-player{aspect-ratio:16 / 9;flex:0 1 576px;min-width:300px;max-width:576px}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-cyrillic-ext-400-normal-Dc4VJyIJ.woff2) format("woff2"),url(./inter-cyrillic-ext-400-normal-BE2fNs0E.woff) format("woff");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-cyrillic-400-normal-BLGc9T1a.woff2) format("woff2"),url(./inter-cyrillic-400-normal-alAqRL36.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-greek-ext-400-normal-Bput3-QP.woff2) format("woff2"),url(./inter-greek-ext-400-normal-XIH6-K3k.woff) format("woff");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-greek-400-normal-DxZsaF_h.woff2) format("woff2"),url(./inter-greek-400-normal-C3I71FoW.woff) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-vietnamese-400-normal-DMkecbls.woff2) format("woff2"),url(./inter-vietnamese-400-normal-Bbgyi5SW.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-latin-ext-400-normal-C1nco2VV.woff2) format("woff2"),url(./inter-latin-ext-400-normal-77YHD8bZ.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-latin-400-normal-C38fXH4l.woff2) format("woff2"),url(./inter-latin-400-normal-CyCys3Eg.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@@ -1,7 +0,0 @@
1
- var U=Object.defineProperty;var N=(a,e,t)=>e in a?U(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>N(a,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(n){if(n.ep)return;n.ep=!0;const i=t(n);fetch(n.href,i)}})();window.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-tooltip]").forEach(e=>{const t=document.createElement("div");t.className="tooltip",t.textContent=e.getAttribute("data-tooltip")||"",document.body.appendChild(t);function s(){const i=e.getBoundingClientRect(),r=window.pageXOffset,d=window.pageYOffset,h=50;let m,O;if(i.top<h)m=i.bottom+d+8,O="translateX(-50%)",t.classList.add("tooltip-arrow-up"),t.classList.remove("tooltip-arrow-down");else{t.style.left=i.left+i.width/2+r+"px",t.style.top=i.top+d+"px",t.style.transform="translateX(-50%)",t.classList.add("show");const R=t.offsetHeight;m=i.top+d-R-8,t.classList.remove("show"),t.style.top=m+"px",t.classList.add("tooltip-arrow-down"),t.classList.remove("tooltip-arrow-up")}t.style.left=i.left+i.width/2+r+"px",t.style.top=m+"px",t.style.transform=O,t.classList.add("show")}function n(){t.classList.remove("show")}e.addEventListener("mouseenter",s),e.addEventListener("mouseleave",n)})});window.addEventListener("DOMContentLoaded",()=>{const a="https://twitchtracker.com/api/channels/summary/vedal987",e=document.getElementById("avg-viewers");let t=0;const s=1;let n=null;async function i(){try{const r=new AbortController,d=setTimeout(()=>r.abort(),3e3),h=await fetch(a,{signal:r.signal});if(clearTimeout(d),!h.ok)throw new Error(`HTTP error! status: ${h.status}`);const m=await h.json();if(m&&typeof m.avg_viewers=="number")e.textContent=m.avg_viewers.toLocaleString(),t=0,n&&clearTimeout(n),n=setTimeout(i,5*60*60*1e3);else throw new Error("接口数据格式异常")}catch(r){console.warn("获取 avg_viewers 失败:",r.message),t++,t>s?(console.log("停止获取,1分钟后重试..."),setTimeout(()=>{t=0,i()},60*1e3)):i()}}i()});const p=document.getElementById("chat-messages"),y=document.getElementById("twitch-chat-overlay"),g=document.getElementById("highlight-message-overlay"),x="One_of_Swarm";class F{constructor(){p?console.log("ChatDisplay initialized."):console.error("ChatDisplay: Required chat messages container not found in DOM!")}appendChatMessage(e){if(!p){console.error("ChatDisplay: Cannot append message, container not found.");return}const t=document.createElement("div");t.className="chat-line__message";const s=document.createElement("div");s.className="chat-line__message-container",e.username===x&&e.is_user_message?t.classList.add("user-sent-message"):e.username==="System"?t.classList.add("system-message"):t.classList.add("audience-ai-message");const n=document.createElement("span");n.className="chat-line__username",n.style.color=e.username===x?"#9147FF":this.getRandomChatColor();const i=document.createElement("span");i.className="chat-author__display-name",i.textContent=e.username,n.appendChild(i);const r=document.createElement("span");r.textContent=": ",r.style.marginRight="0.3rem",r.className="text-fragment";const d=document.createElement("span");if(d.className="text-fragment",d.textContent=e.text,s.appendChild(n),s.appendChild(r),s.appendChild(d),t.appendChild(s),p.appendChild(t),y){const h=t.cloneNode(!0);y.appendChild(h),this.scrollToBottomOverlay()}this.scrollToBottom()}clearChat(){p&&(p.innerHTML="",console.log("Chat display cleared.")),y&&(y.innerHTML="")}scrollToBottom(){p&&(p.scrollTop=p.scrollHeight)}scrollToBottomOverlay(){y&&(y.scrollTop=y.scrollHeight)}getRandomChatColor(){const e=["#FF0000","#00FF00","#0000FF","#00FFFF","#FF00FF","#FF4500","#ADFF2F","#1E90FF","#FFD700","#8A2BE2","#00CED1","#FF69B4","#DA70D6","#BA55D3","#87CEEB","#32CD32","#CD853F"];return e[Math.floor(Math.random()*e.length)]}}function $(a,e,t){if(!g)return;const s=t==="bits"?"/sc_purple.png":"/sc_pink.png";g.innerHTML=`
2
- <img src="${s}" class="sc-background-image" alt="Super Chat background">
3
- <div class="sc-content">
4
- <div class="sc-user">${a}</div>
5
- <div class="sc-message">${e}</div>
6
- </div>
7
- `;const n=g.querySelector(".sc-message");n&&(n.style.color=t==="bits"?"var(--sc-purple-bg-color)":"var(--sc-pink-bg-color)"),g.classList.remove("hidden"),g.offsetHeight,g.classList.add("is-visible"),setTimeout(()=>{g.classList.remove("is-visible"),setTimeout(()=>{g.classList.add("hidden")},1e3)},9e3)}class W{constructor(e){o(this,"ws",null);o(this,"options");o(this,"reconnectAttempts",0);o(this,"reconnectTimeout",null);o(this,"explicitlyClosed",!1);this.options={reconnectInterval:3e3,maxReconnectAttempts:10,...e}}connect(){if(!this.options.url){console.warn("WebSocket URL is not set. Connection aborted.");return}if(this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)){console.warn(`WebSocket for ${this.options.url} is already connected or connecting.`);return}this.explicitlyClosed=!1,console.log(`Connecting to WebSocket: ${this.options.url}`),this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{var e,t;console.log(`WebSocket connected: ${this.options.url}`),this.reconnectAttempts=0,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),(t=(e=this.options).onOpen)==null||t.call(e)},this.ws.onmessage=e=>{var t,s;try{const n=JSON.parse(e.data);n.type==="processing_superchat"&&$(n.data.username,n.data.text,n.data.sc_type),(s=(t=this.options).onMessage)==null||s.call(t,n)}catch(n){console.error(`Error parsing message from ${this.options.url}:`,n,e.data)}},this.ws.onclose=e=>{var t,s,n,i;console.warn(`WebSocket closed: ${this.options.url}. Code: ${e.code}, Reason: ${e.reason}`),this.ws=null,(s=(t=this.options).onClose)==null||s.call(t,e),this.explicitlyClosed||((i=(n=this.options).onDisconnect)==null||i.call(n),this.options.autoReconnect&&e.code!==1e3&&this.tryReconnect())},this.ws.onerror=e=>{var t,s;console.error(`WebSocket error: ${this.options.url}`,e),(s=(t=this.options).onError)==null||s.call(t,e)}}tryReconnect(){if(this.options.maxReconnectAttempts===-1||this.reconnectAttempts<this.options.maxReconnectAttempts){this.reconnectAttempts++;const t=this.options.maxReconnectAttempts===-1?`(attempt ${this.reconnectAttempts})`:`(attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`;console.log(`Attempting to reconnect to ${this.options.url} in ${this.options.reconnectInterval/1e3} seconds... ${t}`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)}else console.error(`Max reconnect attempts reached for ${this.options.url}.`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):console.warn(`WebSocket for ${this.options.url} is not open. Message not sent.`)}disconnect(){this.explicitlyClosed=!0,this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.ws&&this.ws.close(1e3,"Client initiated disconnect")}updateOptions(e){console.log("WebSocket client options updated:",e),this.options={...this.options,...e}}getUrl(){return this.options.url}}const c=document.getElementById("neuro-caption"),T=document.getElementById("stream-display-area"),z=16,q=2,B=.4;function M(){if(!c||!T)return;c.style.fontSize="";const a=T.offsetHeight;if(c.textContent===""||a===0)return;if(c.offsetHeight>a*B){const t=window.getComputedStyle(c);let s=parseFloat(t.fontSize);for(;c.offsetHeight>a*B&&s>z;)s-=q,c.style.fontSize=`${s}px`;c.offsetHeight>a*B&&(c.style.fontSize=`${z}px`)}}let I=null,C=null;const H=3e3;function D(a,e){if(c)if(c.classList.add("show"),e&&a.trim().length>0){const t=a.split(/\s+/).filter(r=>r.length>0);if(t.length===0){c.textContent+=(c.textContent?" ":"")+a,M();return}const s=a.length;let n=c.textContent||"";const i=r=>{if(r<t.length){const d=t[r],h=d.length/s*e*1.01,m=Math.max(50,h*1e3);n+=(n.length>0?" ":"")+d,c.textContent=n,M(),I=setTimeout(()=>i(r+1),m)}else I=null};i(0),console.log(`Starting word-by-word caption for: "${a.substring(0,30)}..." (duration: ${e}s)`)}else c.textContent+=(c.textContent?" ":"")+a,M(),console.log(`Displaying full caption: "${a.substring(0,30)}..."`)}function A(){c&&(I&&(clearTimeout(I),I=null),C&&(clearTimeout(C),C=null),c.classList.remove("show"),c.textContent="",c.style.fontSize="",console.log("NeuroCaption hidden and cleared."))}function V(){C&&clearTimeout(C),C=setTimeout(()=>{A()},H)}!c||!T?console.error("neuroCaption.ts: Could not find #neuro-caption or #stream-display-area element."):console.log("NeuroCaption module initialized.");class j{constructor(){o(this,"audioQueue",[]);o(this,"isPlayingAudio",!1);o(this,"currentPlayingAudio",null);o(this,"allSegmentsReceived",!1);o(this,"errorSound");o(this,"lastSegmentEnd",!0);this.errorSound=new Audio("/error.mp3"),console.log("AudioPlayer initialized.")}playErrorSound(){this.stopAllAudio(),console.log("Playing dedicated error sound..."),this.errorSound.play().catch(e=>{console.error("Error playing dedicated error sound:",e)})}addAudioSegment(e,t,s){this.lastSegmentEnd&&A(),this.lastSegmentEnd=!1;const n=new Audio("data:audio/mp3;base64,"+t);try{const r=f.getAppInitializer().getMuteButton();n.muted=r.getIsMuted()}catch(i){console.warn("Could not get mute state, defaulting to muted:",i),n.muted=!0}this.audioQueue.push({text:e,audio:n,duration:s}),console.log(`Audio segment added to queue. Queue size: ${this.audioQueue.length}`),this.isPlayingAudio||this.playNextAudioSegment()}playNextAudioSegment(){if(this.audioQueue.length>0&&!this.isPlayingAudio){this.isPlayingAudio=!0;const e=this.audioQueue.shift();this.currentPlayingAudio=e.audio,D(e.text,e.duration),this.currentPlayingAudio.play().catch(t=>{console.error("Error playing audio segment:",t),this.isPlayingAudio=!1,this.currentPlayingAudio=null,this.playNextAudioSegment()}),this.currentPlayingAudio.addEventListener("ended",()=>{this.isPlayingAudio=!1,this.currentPlayingAudio=null,this.playNextAudioSegment()},{once:!0})}else if(this.audioQueue.length===0&&this.allSegmentsReceived){console.log("Neuro's full audio response played. Starting caption timeout and resetting zoom."),V();try{f.getAppInitializer().getNeuroAvatar().resetZoom()}catch(e){console.warn("Could not reset neuro avatar zoom at end of speech",e)}}}setAllSegmentsReceived(){this.allSegmentsReceived=!0,this.lastSegmentEnd=!0}stopAllAudio(){this.currentPlayingAudio&&(this.currentPlayingAudio.pause(),this.currentPlayingAudio.currentTime=0,this.currentPlayingAudio=null),this.audioQueue.length=0,this.isPlayingAudio=!1,this.allSegmentsReceived=!1,A();try{f.getAppInitializer().getNeuroAvatar().resetZoom()}catch(e){console.warn("Could not reset neuro avatar zoom on stop",e)}console.log("Neuro audio playback stopped, queue cleared.")}updateMuteState(){if(this.currentPlayingAudio)try{const t=f.getAppInitializer().getMuteButton();this.currentPlayingAudio.muted=t.getIsMuted()}catch(e){console.warn("Could not update current audio mute state:",e)}for(const e of this.audioQueue)try{const s=f.getAppInitializer().getMuteButton();e.audio.muted=s.getIsMuted()}catch(t){console.warn("Could not update queued audio mute state:",t)}}}const b=document.getElementById("startup-video-overlay"),u=document.getElementById("startup-video");class Q{constructor(){!b||!u?console.error("VideoPlayer: Required video elements not found in DOM!"):console.log("VideoPlayer initialized.")}showAndPlayVideo(e=0){if(!b||!u){console.error("VideoPlayer: Cannot show and play video, elements are missing.");return}b.classList.remove("hidden"),b.style.zIndex="10";const s=f.getAppInitializer().getMuteButton(),n=()=>{isFinite(u.duration)&&e>.1&&e<u.duration&&(u.currentTime=e,console.log(`Seeked to: ${e.toFixed(2)}s.`))};u.muted=!1;const i=u.play();i!==void 0&&i.then(()=>{console.log("Unmuted autoplay successful."),n()}).catch(r=>{console.warn("Unmuted autoplay failed. Showing unmute prompt and falling back to muted playback.",r),s.show(),u.muted=!0,u.play().then(()=>{console.log("Muted fallback playback started."),n()}).catch(h=>{console.error("Muted fallback playback also failed. This is unexpected.",h)})})}pauseAndMute(){u&&(u.pause(),u.muted=!0,console.log("Startup video paused and muted."))}hide(){b&&(b.classList.add("hidden"),console.log("Startup video overlay hidden."))}getVideoDuration(){return u&&!isNaN(u.duration)?u.duration:0}}const v={HIDDEN:"hidden",STEP1:"step1",STEP2:"step2"},l=document.getElementById("neuro-static-avatar-container");class J{constructor(){l?(console.log("NeuroAvatar initialized."),this.setStage(v.HIDDEN,!0)):console.error("NeuroAvatar: Required avatar container element not found in DOM!")}startIntroAnimation(e){console.log("Starting Neuro intro animation sequence..."),this.setStage(v.STEP1),setTimeout(()=>{console.log("Animating to Step 2..."),this.setStage(v.STEP2),setTimeout(()=>{console.log("Neuro intro animation sequence finished."),e&&e()},1e3)},2e3)}setStage(e,t=!1){if(!l)return;const s="transform 0.5s ease-in-out";switch(t?(l.style.transition="none",l.offsetHeight):e===v.STEP2?l.style.transition=`bottom 1s cubic-bezier(0.4, 0.0, 1, 1), ${s}`:l.style.transition=s,e){case v.HIDDEN:l.style.visibility="hidden",l.style.bottom="-207%",l.style.left="70%",l.style.zIndex="10";break;case v.STEP1:l.style.visibility="visible",l.style.bottom="-207%",l.style.left="70%",l.style.zIndex="15";break;case v.STEP2:l.style.visibility="visible",l.style.bottom="-125%",l.style.left="70%",l.style.zIndex="15";break}}triggerSpin(){l&&(console.log("Triggering avatar spin animation."),l.classList.add("spin-animation"),setTimeout(()=>{l.classList.remove("spin-animation"),console.log("Avatar spin animation finished.")},1e3))}triggerZoom(){l&&(console.log("Triggering avatar zoom-in animation."),l.classList.add("zoom-in"))}resetZoom(){l&&l.classList.contains("zoom-in")&&(console.log("Resetting avatar zoom."),l.classList.remove("zoom-in"))}}const k=document.getElementById("chat-input"),P=document.getElementById("send-button"),w=document.getElementById("sc-bits-button"),E=document.getElementById("sc-points-button");class X{constructor(){o(this,"onSendMessageCallback",null);!k||!P||!w||!E?console.error("UserInput: Required input elements not found in DOM!"):(this.setupEventListeners(),console.log("UserInput initialized."))}onSendMessage(e){this.onSendMessageCallback=e}setupEventListeners(){P.addEventListener("click",()=>this.handleSendMessage()),k.addEventListener("keypress",e=>{e.key==="Enter"&&this.handleSendMessage()}),w.addEventListener("click",()=>this.toggleSuperchatButton(w)),E.addEventListener("click",()=>this.toggleSuperchatButton(E))}toggleSuperchatButton(e){const t=e===w?E:w;e.classList.contains("selected")?e.classList.remove("selected"):(e.classList.add("selected"),t.classList.remove("selected"))}handleSendMessage(){const e=k.value.trim();if(!e){console.warn("Attempted to send empty message.");return}let t;const s=w.classList.contains("selected"),n=E.classList.contains("selected");s||n?t={type:"superchat",text:e,sc_type:s?"bits":"points"}:t={type:"user_message",text:e},this.onSendMessageCallback?this.onSendMessageCallback(t):console.warn("No callback registered for sending message."),k.value="",this.clearSuperchatSelection()}clearSuperchatSelection(){w.classList.remove("selected"),E.classList.remove("selected")}setInputDisabled(e){k.disabled=e,P.disabled=e,console.log(`User input elements disabled: ${e}`)}}class Z{constructor(){o(this,"viewportElement");o(this,"areaElement");o(this,"resizeObserver");if(this.viewportElement=document.getElementById("stream-display-viewport"),this.areaElement=document.getElementById("stream-display-area"),!this.viewportElement||!this.areaElement)throw new Error("LayoutManager: Required viewport or area element not found in DOM!");this.resizeObserver=new ResizeObserver(this.handleResize.bind(this))}handleResize(e){for(const t of e){const{width:s,height:n}=t.contentRect;this.updateLayout(s,n)}}updateLayout(e,t){if(e===0||t===0)return;const s=e/t,n=16/9;let i,r;s>n?(r=t,i=r*n):(i=e,r=i/n),this.areaElement.style.width=`${i}px`,this.areaElement.style.height=`${r}px`}start(){this.resizeObserver.observe(this.viewportElement),this.updateLayout(this.viewportElement.clientWidth,this.viewportElement.clientHeight),console.log("LayoutManager started and observing.")}stop(){this.resizeObserver.disconnect(),console.log("LayoutManager stopped.")}}class G{constructor(){o(this,"timerElement");o(this,"intervalId",null);o(this,"streamStartTime",0);if(this.timerElement=document.getElementById("stream-duration-text"),!this.timerElement)throw new Error("StreamTimer: Duration element '#stream-duration-text' not found!");this.reset()}formatTime(e){const t=Math.floor(e/3600),s=Math.floor(e%3600/60),n=Math.floor(e%60),i=r=>String(r).padStart(2,"0");return t>0?`${t}:${i(s)}:${i(n)}`:`${s}:${i(n)}`}updateDisplay(){if(this.streamStartTime>0){const t=(Date.now()-this.streamStartTime)/1e3;this.timerElement.textContent=this.formatTime(Math.max(0,t))}}start(e=0){this.stop(),this.streamStartTime=Date.now()-e*1e3,this.updateDisplay(),this.intervalId=window.setInterval(()=>this.updateDisplay(),1e3),console.log(`Stream timer started with initial ${e.toFixed(2)}s.`)}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,console.log("Stream timer stopped."))}reset(){this.stop(),this.streamStartTime=0,this.timerElement.textContent="0:00",console.log("Stream timer reset.")}}class Y{constructor(){o(this,"sidebarElement");o(this,"toggleButton");o(this,"showChatButton");o(this,"isCollapsed",!1);o(this,"bodyElement");if(this.sidebarElement=document.getElementById("chat-sidebar"),this.toggleButton=document.getElementById("toggle-chat-button"),this.showChatButton=document.getElementById("show-chat-button"),this.bodyElement=document.body,!this.sidebarElement||!this.toggleButton||!this.showChatButton)throw new Error("ChatSidebar: Required elements not found in DOM!");this.setupEventListeners(),this.setCollapsed(!1,!0),console.log("ChatSidebar initialized.")}setupEventListeners(){this.toggleButton.addEventListener("click",()=>this.toggleCollapse()),this.showChatButton.addEventListener("click",()=>this.toggleCollapse())}toggleCollapse(){this.setCollapsed(!this.isCollapsed)}setCollapsed(e,t=!1){this.isCollapsed=e,this.isCollapsed?this.bodyElement.classList.add("chat-collapsed"):this.bodyElement.classList.remove("chat-collapsed"),t?(this.sidebarElement.style.transition="none",this.toggleButton.style.transition="none",this.showChatButton.style.transition="none"):(this.sidebarElement.style.transition="width 0.3s ease-in-out, min-width 0.3s ease-in-out",this.toggleButton.style.transition="transform 0.3s ease-in-out, background-color 0.2s, color 0.2s",this.showChatButton.style.transition="opacity 0.3s ease-in-out, visibility 0.3s ease-in-out"),this.isCollapsed?(this.sidebarElement.classList.add("collapsed"),this.toggleButton.setAttribute("aria-label","展开聊天"),this.sidebarElement.querySelectorAll(":scope > *:not(.chat-sidebar-header)").forEach(s=>{s.style.opacity="0",s.style.pointerEvents="none"}),console.log("Chat sidebar collapsed.")):(this.sidebarElement.classList.remove("collapsed"),this.toggleButton.setAttribute("aria-label","重叠聊天"),this.sidebarElement.querySelectorAll(":scope > *:not(.chat-sidebar-header)").forEach(s=>{s.style.opacity="1",s.style.pointerEvents="auto"}),console.log("Chat sidebar expanded.")),t&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.sidebarElement.style.transition="",this.toggleButton.style.transition="",this.showChatButton.style.transition=""})})}getIsCollapsed(){return this.isCollapsed}}class K{constructor(){o(this,"indicatorElement");if(this.indicatorElement=document.querySelector(".live-indicator-rect"),!this.indicatorElement)throw new Error("LiveIndicator: Required .live-indicator-rect element not found in DOM!");this.hide()}show(){this.indicatorElement.classList.remove("hidden")}hide(){this.indicatorElement.classList.add("hidden")}}class ee{constructor(){o(this,"nicknameElement");o(this,"titleElement");o(this,"categoryElement");o(this,"tagsContainer");if(this.nicknameElement=document.getElementById("streamer-nickname"),this.titleElement=document.getElementById("stream-title-full"),this.categoryElement=document.querySelector(".stream-category"),this.tagsContainer=document.querySelector(".stream-tags"),!this.nicknameElement||!this.titleElement||!this.categoryElement||!this.tagsContainer)throw new Error("StreamInfoDisplay: One or more required elements not found in DOM!");console.log("StreamInfoDisplay initialized.")}update(e){this.nicknameElement.textContent=e.streamer_nickname,this.titleElement.textContent=e.stream_title,this.categoryElement.textContent=e.stream_category,this.tagsContainer.innerHTML="",e.stream_tags.forEach(t=>{const s=document.createElement("a");s.href="#",s.className="stream-tag",s.textContent=t,this.tagsContainer.appendChild(s)}),console.log("Stream info display updated with new metadata.")}}class te{constructor(){o(this,"wakeLockSentinel",null);o(this,"isSupported");this.isSupported="wakeLock"in navigator,this.isSupported?console.log("WakeLockManager initialized. API is supported."):console.warn("Wake Lock API is not supported in this browser. The device may go to sleep during playback.")}async requestWakeLock(){if(!(!this.isSupported||this.wakeLockSentinel))try{this.wakeLockSentinel=await navigator.wakeLock.request("screen"),this.wakeLockSentinel.addEventListener("release",()=>{console.log("Wake Lock was released by the browser."),this.wakeLockSentinel=null}),console.log("Wake Lock is active."),document.addEventListener("visibilitychange",this.handleVisibilityChange.bind(this))}catch(e){console.error(`Failed to acquire Wake Lock: ${e.name}, ${e.message}`),this.wakeLockSentinel=null}}async releaseWakeLock(){this.wakeLockSentinel&&(await this.wakeLockSentinel.release(),this.wakeLockSentinel=null,console.log("Wake Lock has been released.")),document.removeEventListener("visibilitychange",this.handleVisibilityChange.bind(this))}async handleVisibilityChange(){this.wakeLockSentinel===null&&document.visibilityState==="visible"&&(console.log("Page is visible again, re-acquiring Wake Lock..."),await this.requestWakeLock())}}class L{constructor(e){o(this,"modalContainer");o(this,"overlay");o(this,"closeButton");o(this,"saveButton");o(this,"usernameInput");o(this,"backendUrlInput");o(this,"avatarPreview");o(this,"avatarUploadInput");o(this,"avatarUploadButton");o(this,"reconnectAttemptsInput");o(this,"onSave");if(this.onSave=e,this.modalContainer=document.getElementById("settings-modal"),this.overlay=document.getElementById("settings-modal-overlay"),this.closeButton=document.getElementById("settings-close-button"),this.saveButton=document.getElementById("settings-save-button"),this.usernameInput=document.getElementById("username-setting-input"),this.backendUrlInput=document.getElementById("backend-url-input"),this.avatarPreview=document.getElementById("avatar-setting-preview"),this.avatarUploadInput=document.getElementById("avatar-setting-upload"),this.avatarUploadButton=document.getElementById("avatar-upload-button"),this.reconnectAttemptsInput=document.getElementById("reconnect-attempts-input"),!this.modalContainer)throw new Error("Settings modal container not found!");this.setupEventListeners(),console.log("SettingsModal initialized.")}setupEventListeners(){this.closeButton.addEventListener("click",()=>this.close()),this.overlay.addEventListener("click",()=>this.close()),this.saveButton.addEventListener("click",()=>this.handleSave()),this.avatarUploadButton.addEventListener("click",()=>this.avatarUploadInput.click()),this.avatarUploadInput.addEventListener("change",e=>this.handleAvatarUpload(e))}handleAvatarUpload(e){const t=e.target;if(t.files&&t.files[0]){const s=new FileReader;s.onload=n=>{var i;(i=n.target)!=null&&i.result&&(this.avatarPreview.src=n.target.result)},s.readAsDataURL(t.files[0])}}handleSave(){const e={username:this.usernameInput.value.trim()||"User",avatarDataUrl:this.avatarPreview.src,backendUrl:this.backendUrlInput.value.trim(),reconnectAttempts:parseInt(this.reconnectAttemptsInput.value,10)||-1};localStorage.setItem("neuro_settings",JSON.stringify(e)),this.onSave(e),this.close()}open(){this.loadSettings(),this.modalContainer.classList.remove("hidden")}close(){this.modalContainer.classList.add("hidden")}loadSettings(){const e=L.getSettings();this.usernameInput.value=e.username,this.avatarPreview.src=e.avatarDataUrl,this.backendUrlInput.value=e.backendUrl,this.reconnectAttemptsInput.value=String(e.reconnectAttempts)}static getSettings(){const e=localStorage.getItem("neuro_settings");if(e)try{return JSON.parse(e)}catch(t){console.error("Failed to parse settings from localStorage, returning defaults.",t)}return{username:"One_of_Swarm",avatarDataUrl:"/user_avatar.jpg",backendUrl:"ws://127.0.0.1:8000",reconnectAttempts:-1}}}class se{constructor(){o(this,"button",null);o(this,"isMuted",!0)}create(){return this.button=document.getElementById("mute-button"),this.button?this.button.addEventListener("click",e=>{e.stopPropagation(),this.unmute()}):console.error("Mute button element not found in DOM!"),this.button}show(){this.button&&(this.button.style.display="flex")}hide(){this.button&&(this.button.style.display="none")}unmute(){this.isMuted=!1,this.hide(),this.updateMediaElements()}updateMediaElements(){const e=document.getElementById("startup-video");e&&(e.muted=this.isMuted);try{f.getAppInitializer().getAudioPlayer().updateMuteState()}catch(t){console.warn("Could not update audio player mute state:",t)}}getElement(){return this.button}getIsMuted(){return this.isMuted}}async function ne(a,e={},t){return window.__TAURI_INTERNALS__.invoke(a,e,t)}const ie=typeof window<"u"&&window.__TAURI__!==void 0,oe="3546729368520811",ae="4281748";async function re(){var a,e;try{if(ie)return console.log("Running in Tauri, invoking 'get_latest_replay_video' command..."),await ne("get_latest_replay_video");{console.log("Running in Web, fetching from proxy...");const t=`/bilibili-api/x/series/archives?mid=${oe}&series_id=${ae}&ps=1&pn=1`,s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch from proxy: ${s.statusText}`);const n=await s.json();if(n.code!==0)throw new Error(`Bilibili API error: ${n.message}`);const i=(e=(a=n==null?void 0:n.data)==null?void 0:a.archives)==null?void 0:e[0];if(i&&i.bvid&&i.aid)return i;throw new Error("No matching video found in API response.")}}catch(t){return console.error("Failed to get latest replay video:",t),null}}function le(a){const e="//www.bilibili.com/blackboard/html5mobileplayer.html",t=new URLSearchParams({bvid:a.bvid,aid:String(a.aid),p:"1",autoplay:"1",danmaku:"0",hasMuteButton:"1",hideCoverInfo:"0",fjw:"0",high_quality:"1"});return`${e}?${t.toString()}`}class ce{constructor(){o(this,"wsClient");o(this,"audioPlayer");o(this,"videoPlayer");o(this,"neuroAvatar");o(this,"chatDisplay");o(this,"userInput");o(this,"layoutManager");o(this,"streamTimer");o(this,"chatSidebar");o(this,"liveIndicator");o(this,"streamInfoDisplay");o(this,"wakeLockManager");o(this,"settingsModal");o(this,"currentSettings");o(this,"muteButton");o(this,"resizeObserver",null);o(this,"offlinePlayerSrc",null);o(this,"isStarted",!1);o(this,"currentPhase","offline");o(this,"adjustOfflineLayout",()=>{if(this.currentPhase!=="offline")return;const e=document.getElementById("offline-content-container"),t=document.querySelector(".offline-video-player"),s=document.querySelector(".offline-info-card");if(!e||!t||!s)return;if(window.innerWidth<=767)e.style.flexWrap="wrap",s.style.width=t.offsetWidth+"px",s.style.height="auto",s.style.flex="0 0 auto";else{e.style.flexWrap="nowrap";const i=t.offsetHeight;i>0&&(s.style.height=`${i}px`,s.style.width=`${i}px`),s.style.flex="0 1 auto"}});this.layoutManager=new Z,this.streamTimer=new G,this.muteButton=new se,this.currentSettings=L.getSettings(),this.settingsModal=new L(t=>this.handleSettingsUpdate(t)),this.wsClient=null,this.audioPlayer=new j,this.videoPlayer=new Q,this.neuroAvatar=new J,this.chatDisplay=new F,this.userInput=new X,this.userInput.onSendMessage(t=>this.sendUserMessage(t)),this.chatSidebar=new Y,this.liveIndicator=new K,this.streamInfoDisplay=new ee,this.wakeLockManager=new te,this.setupSettingsModalTrigger(),this.setupMuteButton();const e=document.querySelector(".offline-video-player");e&&(this.offlinePlayerSrc=e.src),this.updateOfflinePlayerSrc()}start(){this.isStarted||(this.isStarted=!0,this.probeForIntegratedServer(),this.layoutManager.start(),this.goOffline(),this.updateUiWithSettings())}setupSettingsModalTrigger(){const e=document.querySelector(".nav-user-avatar-button");e&&e.addEventListener("click",()=>{this.settingsModal.open()})}setupMuteButton(){if(this.muteButton.create()){this.muteButton.show();const t=()=>{this.muteButton.unmute(),document.removeEventListener("click",t)};document.addEventListener("click",t)}}getMuteButton(){return this.muteButton}getAudioPlayer(){return this.audioPlayer}getNeuroAvatar(){return this.neuroAvatar}handleSettingsUpdate(e){if(console.log("Settings updated. Re-initializing connection with new settings:",e),this.currentSettings=e,this.updateUiWithSettings(),this.wsClient){const t=e.backendUrl?`${e.backendUrl}/ws/stream`:"";this.wsClient.updateOptions({url:t,maxReconnectAttempts:e.reconnectAttempts}),this.wsClient.disconnect(),setTimeout(()=>{this.wsClient&&this.wsClient.getUrl()?this.wsClient.connect():console.warn("Cannot connect: Backend URL is empty after update or WebSocket client not ready.")},500)}else console.warn("WebSocket client not initialized, cannot update settings.")}initWebSocketClient(e){const t=e?`${e}/ws/stream`:"",s=n=>this.handleWebSocketMessage(n);this.wsClient?(this.wsClient.updateOptions({url:t,autoReconnect:!0,maxReconnectAttempts:this.currentSettings.reconnectAttempts,onMessage:s,onOpen:()=>this.goOnline(),onDisconnect:()=>this.goOffline()}),t&&(this.wsClient.disconnect(),setTimeout(()=>{this.wsClient.connect()},500))):this.wsClient=new W({url:t,autoReconnect:!0,maxReconnectAttempts:this.currentSettings.reconnectAttempts,onMessage:s,onOpen:()=>this.goOnline(),onDisconnect:()=>this.goOffline()})}async probeForIntegratedServer(){const e=L.getSettings();console.log("Probing for integrated server. Stored settings:",e);try{const t=new URL("/api/system/health",window.location.origin).toString();console.log("Probing integrated server at:",t);const s=await fetch(t);if(s.ok){console.log("Integrated server detected via health check. Auto-connecting...");const n=window.location.origin;this.currentSettings={...this.currentSettings,backendUrl:n},localStorage.setItem("neuro_settings",JSON.stringify(this.currentSettings)),this.initWebSocketClient(n),this.wsClient&&n&&this.wsClient.connect();return}else console.log("Health check failed, not an integrated server. Status:",s.status)}catch(t){console.log("Failed to probe for integrated server, assuming standalone mode.",t)}console.log("Falling back to stored backend URL:",e.backendUrl),this.initWebSocketClient(e.backendUrl),this.wsClient&&e.backendUrl?this.wsClient.connect():e.backendUrl||(console.warn("Backend URL is not configured via probe or stored settings. Opening settings modal."),this.settingsModal.open())}updateUiWithSettings(){document.querySelectorAll(".user-avatar-img").forEach(t=>t.src=this.currentSettings.avatarDataUrl),console.log(`UI updated with username: ${this.currentSettings.username} and avatar.`)}async updateOfflinePlayerSrc(){console.log("Attempting to fetch the latest replay video...");const e=await re();if(e){const t=le(e);if(this.offlinePlayerSrc=t,console.log("Successfully updated offline player src to:",t),this.currentPhase==="offline"){const s=document.querySelector(".offline-video-player");s&&(s.src=this.offlinePlayerSrc)}}else console.log("Failed to fetch latest replay video, using default fallback.")}goOnline(){var s,n,i,r;console.log("Entering ONLINE state."),this.updateUiWithSettings();const e=document.querySelector(".offline-video-player");e&&(e.src="about:blank"),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),window.removeEventListener("resize",this.adjustOfflineLayout);const t=document.querySelector(".offline-info-card");t&&(t.style.height="",t.style.width=""),(s=document.getElementById("offline-content-container"))==null||s.classList.add("hidden"),(n=document.getElementById("stream-display-viewport"))==null||n.classList.remove("hidden"),(i=document.querySelector(".stream-info-details-row"))==null||i.classList.remove("hidden"),(r=document.getElementById("chat-sidebar"))==null||r.classList.remove("hidden"),this.showStreamContent(),this.chatDisplay.clearChat(),this.liveIndicator.show(),this.wakeLockManager.requestWakeLock()}goOffline(){var s,n,i,r;console.log("Entering OFFLINE state."),this.currentPhase="offline";const e=document.querySelector(".offline-video-player");e&&this.offlinePlayerSrc&&(e.src=this.offlinePlayerSrc),(s=document.getElementById("offline-content-container"))==null||s.classList.remove("hidden"),(n=document.getElementById("stream-display-viewport"))==null||n.classList.add("hidden"),(i=document.querySelector(".stream-info-details-row"))==null||i.classList.add("hidden"),(r=document.getElementById("chat-sidebar"))==null||r.classList.add("hidden"),this.hideStreamContent(),this.audioPlayer.stopAllAudio(),this.videoPlayer.hide(),this.neuroAvatar.setStage("hidden",!0),A(),this.streamTimer.stop(),this.streamTimer.reset(),this.chatDisplay.clearChat(),this.liveIndicator.hide(),this.wakeLockManager.releaseWakeLock(),this.muteButton.show();const t=()=>{this.muteButton.unmute(),document.removeEventListener("click",t)};document.addEventListener("click",t),setTimeout(()=>{this.adjustOfflineLayout();const d=document.querySelector(".offline-video-player");d&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver(this.adjustOfflineLayout),this.resizeObserver.observe(d),window.addEventListener("resize",this.adjustOfflineLayout))},0)}handleWebSocketMessage(e){switch(this.currentPhase==="offline"&&["play_welcome_video","start_avatar_intro","enter_live_phase"].includes(e.type)&&(console.log("Connection successful, transitioning from OFFLINE to active state."),this.goOnline()),e.elapsed_time_sec!==void 0&&this.streamTimer.start(e.elapsed_time_sec),e.type){case"offline":this.goOffline();break;case"model_spin":this.neuroAvatar.triggerSpin();break;case"model_zoom":this.neuroAvatar.triggerZoom();break;case"update_stream_metadata":this.streamInfoDisplay.update(e);break;case"play_welcome_video":this.currentPhase="initializing",this.videoPlayer.showAndPlayVideo(parseFloat(e.progress));break;case"start_avatar_intro":this.currentPhase="avatar_intro",this.videoPlayer.pauseAndMute(),this.neuroAvatar.startIntroAnimation(()=>{this.videoPlayer.hide()});break;case"enter_live_phase":this.currentPhase="live",this.videoPlayer.hide(),this.neuroAvatar.setStage("step2");break;case"neuro_is_speaking":break;case"neuro_speech_segment":const t=e;t.is_end?this.audioPlayer.setAllSegmentsReceived():t.audio_base64&&t.text&&typeof t.duration=="number"?this.audioPlayer.addAudioSegment(t.text,t.audio_base64,t.duration):console.warn("Received neuro_speech_segment message with missing audio/text/duration:",t);break;case"neuro_error_signal":console.warn("Received neuro_error_signal from backend."),D("Someone tell Vedal there is a problem with my AI."),this.audioPlayer.playErrorSound();break;case"chat_message":(!this.chatSidebar.getIsCollapsed()||e.is_user_message)&&this.chatDisplay.appendChatMessage(e);break;case"error":this.chatDisplay.appendChatMessage({type:"chat_message",username:"System",text:`后端错误: ${e.message}`,is_user_message:!1});break}}sendUserMessage(e){const t={username:this.currentSettings.username,...e};this.wsClient?this.wsClient.send(t):console.warn("Cannot send message: WebSocket client is not initialized.")}showStreamContent(){const e=document.getElementById("stream-display-area");e&&(e.style.visibility="visible",e.style.opacity="1")}hideStreamContent(){const e=document.getElementById("stream-display-area");e&&(e.style.visibility="hidden",e.style.opacity="0")}}const S=class S{constructor(){o(this,"appInitializerInstance",null)}static getInstance(){return S.instance||(S.instance=new S),S.instance}getAppInitializer(){return this.appInitializerInstance?console.log("Returning existing AppInitializer instance."):(console.log("Creating new AppInitializer instance..."),this.appInitializerInstance=new ce),this.appInitializerInstance}};o(S,"instance");let _=S;const f=_.getInstance();document.addEventListener("DOMContentLoaded",()=>{console.log("DOMContentLoaded event fired."),f.getAppInitializer().start()});console.log("main.ts loaded. Waiting for DOMContentLoaded to initialize the app.");
@@ -1 +0,0 @@
1
- import{d as m,k as g,A as x,a as v,x as f,b as C,n as o,o as s,g as r,e as h,t as l,h as p,F as y,p as b,f as w,_ as k}from"./index-Ba5ZG3QB.js";const V={class:"d-flex align-center mb-4"},S={key:0,class:"context-prompt-view"},A={key:1,class:"context-conversation-view"},M=m({__name:"ContextTab",setup(B){const t=g(!1),n=x(),c=v();async function i(){if(c.isConnected)if(t.value)try{const e=await c.sendAdminWsMessage("get_last_prompt");n.agentContext=e.prompt}catch(e){console.error("获取最新Prompt失败:",e),n.agentContext=`获取提示词失败: ${e}`}else try{const e=await c.sendAdminWsMessage("get_agent_context");n.agentContext=e}catch(e){console.error("获取上下文失败:",e)}}return f(t,i),i(),(e,d)=>{const u=C("v-switch");return s(),o("div",null,[r("div",V,[h(u,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=a=>t.value=a),label:"上下文模式",color:"primary","hide-details":""},null,8,["modelValue"])]),t.value?(s(),o("div",S,[r("pre",null,l(p(n).agentContext),1)])):(s(),o("div",A,[(s(!0),o(y,null,b(p(n).agentContext,(a,_)=>(s(),o("div",{key:_,class:"message-item"},[r("p",null,[r("strong",null,l(a.role)+":",1),w(" "+l(a.content),1)])]))),128))]))])}}}),T=k(M,[["__scopeId","data-v-dd6969bb"]]);export{T as default};
@@ -1 +0,0 @@
1
- .context-prompt-view pre[data-v-dd6969bb]{background-color:#1e1e1e;color:#d4d4d4;font-family:Courier New,Courier,monospace;padding:16px;border-radius:4px;white-space:pre-wrap;word-wrap:break-word;max-height:70vh;overflow-y:auto}.message-item[data-v-dd6969bb]{padding:8px 0;border-bottom:1px solid #e0e0e0}