agentvibes 2.0.17-beta.2 → 2.0.17-beta.21

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 (339) hide show
  1. package/.bmad-core/agent-teams/team-all.yaml +15 -0
  2. package/.bmad-core/agent-teams/team-fullstack.yaml +19 -0
  3. package/.bmad-core/agent-teams/team-ide-minimal.yaml +11 -0
  4. package/.bmad-core/agent-teams/team-no-ui.yaml +14 -0
  5. package/.bmad-core/agents/analyst.md +84 -0
  6. package/.bmad-core/agents/architect.md +85 -0
  7. package/.bmad-core/agents/bmad-master.md +110 -0
  8. package/.bmad-core/agents/bmad-orchestrator.md +147 -0
  9. package/.bmad-core/agents/dev.md +81 -0
  10. package/.bmad-core/agents/pm.md +84 -0
  11. package/.bmad-core/agents/po.md +79 -0
  12. package/.bmad-core/agents/qa.md +87 -0
  13. package/.bmad-core/agents/sm.md +65 -0
  14. package/.bmad-core/agents/ux-expert.md +69 -0
  15. package/.bmad-core/checklists/architect-checklist.md +440 -0
  16. package/.bmad-core/checklists/change-checklist.md +184 -0
  17. package/.bmad-core/checklists/pm-checklist.md +372 -0
  18. package/.bmad-core/checklists/po-master-checklist.md +434 -0
  19. package/.bmad-core/checklists/story-dod-checklist.md +96 -0
  20. package/.bmad-core/checklists/story-draft-checklist.md +155 -0
  21. package/.bmad-core/core-config.yaml +22 -0
  22. package/.bmad-core/data/bmad-kb.md +809 -0
  23. package/.bmad-core/data/brainstorming-techniques.md +38 -0
  24. package/.bmad-core/data/elicitation-methods.md +156 -0
  25. package/.bmad-core/data/technical-preferences.md +5 -0
  26. package/.bmad-core/data/test-levels-framework.md +148 -0
  27. package/.bmad-core/data/test-priorities-matrix.md +174 -0
  28. package/.bmad-core/enhanced-ide-development-workflow.md +248 -0
  29. package/.bmad-core/install-manifest.yaml +230 -0
  30. package/.bmad-core/tasks/advanced-elicitation.md +119 -0
  31. package/.bmad-core/tasks/apply-qa-fixes.md +150 -0
  32. package/.bmad-core/tasks/brownfield-create-epic.md +162 -0
  33. package/.bmad-core/tasks/brownfield-create-story.md +149 -0
  34. package/.bmad-core/tasks/correct-course.md +72 -0
  35. package/.bmad-core/tasks/create-brownfield-story.md +314 -0
  36. package/.bmad-core/tasks/create-deep-research-prompt.md +280 -0
  37. package/.bmad-core/tasks/create-doc.md +103 -0
  38. package/.bmad-core/tasks/create-next-story.md +114 -0
  39. package/.bmad-core/tasks/document-project.md +345 -0
  40. package/.bmad-core/tasks/execute-checklist.md +88 -0
  41. package/.bmad-core/tasks/facilitate-brainstorming-session.md +138 -0
  42. package/.bmad-core/tasks/generate-ai-frontend-prompt.md +53 -0
  43. package/.bmad-core/tasks/index-docs.md +175 -0
  44. package/.bmad-core/tasks/kb-mode-interaction.md +77 -0
  45. package/.bmad-core/tasks/nfr-assess.md +345 -0
  46. package/.bmad-core/tasks/qa-gate.md +163 -0
  47. package/.bmad-core/tasks/review-story.md +316 -0
  48. package/.bmad-core/tasks/risk-profile.md +355 -0
  49. package/.bmad-core/tasks/shard-doc.md +187 -0
  50. package/.bmad-core/tasks/test-design.md +176 -0
  51. package/.bmad-core/tasks/trace-requirements.md +266 -0
  52. package/.bmad-core/tasks/validate-next-story.md +136 -0
  53. package/.bmad-core/templates/architecture-tmpl.yaml +651 -0
  54. package/.bmad-core/templates/brainstorming-output-tmpl.yaml +156 -0
  55. package/.bmad-core/templates/brownfield-architecture-tmpl.yaml +477 -0
  56. package/.bmad-core/templates/brownfield-prd-tmpl.yaml +281 -0
  57. package/.bmad-core/templates/competitor-analysis-tmpl.yaml +307 -0
  58. package/.bmad-core/templates/front-end-architecture-tmpl.yaml +219 -0
  59. package/.bmad-core/templates/front-end-spec-tmpl.yaml +350 -0
  60. package/.bmad-core/templates/fullstack-architecture-tmpl.yaml +824 -0
  61. package/.bmad-core/templates/market-research-tmpl.yaml +253 -0
  62. package/.bmad-core/templates/prd-tmpl.yaml +203 -0
  63. package/.bmad-core/templates/project-brief-tmpl.yaml +222 -0
  64. package/.bmad-core/templates/qa-gate-tmpl.yaml +103 -0
  65. package/.bmad-core/templates/story-tmpl.yaml +138 -0
  66. package/.bmad-core/user-guide.md +577 -0
  67. package/.bmad-core/utils/bmad-doc-template.md +327 -0
  68. package/.bmad-core/utils/workflow-management.md +71 -0
  69. package/.bmad-core/workflows/brownfield-fullstack.yaml +298 -0
  70. package/.bmad-core/workflows/brownfield-service.yaml +188 -0
  71. package/.bmad-core/workflows/brownfield-ui.yaml +198 -0
  72. package/.bmad-core/workflows/greenfield-fullstack.yaml +241 -0
  73. package/.bmad-core/workflows/greenfield-service.yaml +207 -0
  74. package/.bmad-core/workflows/greenfield-ui.yaml +236 -0
  75. package/.bmad-core/working-in-the-brownfield.md +606 -0
  76. package/.claude/commands/BMad/agents/analyst.md +88 -0
  77. package/.claude/commands/BMad/agents/architect.md +89 -0
  78. package/.claude/commands/BMad/agents/bmad-master.md +114 -0
  79. package/.claude/commands/BMad/agents/bmad-orchestrator.md +151 -0
  80. package/.claude/commands/BMad/agents/dev.md +85 -0
  81. package/.claude/commands/BMad/agents/pm.md +88 -0
  82. package/.claude/commands/BMad/agents/po.md +83 -0
  83. package/.claude/commands/BMad/agents/qa.md +91 -0
  84. package/.claude/commands/BMad/agents/sm.md +69 -0
  85. package/.claude/commands/BMad/agents/ux-expert.md +73 -0
  86. package/.claude/commands/BMad/tasks/advanced-elicitation.md +123 -0
  87. package/.claude/commands/BMad/tasks/apply-qa-fixes.md +154 -0
  88. package/.claude/commands/BMad/tasks/brownfield-create-epic.md +166 -0
  89. package/.claude/commands/BMad/tasks/brownfield-create-story.md +153 -0
  90. package/.claude/commands/BMad/tasks/correct-course.md +76 -0
  91. package/.claude/commands/BMad/tasks/create-brownfield-story.md +318 -0
  92. package/.claude/commands/BMad/tasks/create-deep-research-prompt.md +284 -0
  93. package/.claude/commands/BMad/tasks/create-doc.md +107 -0
  94. package/.claude/commands/BMad/tasks/create-next-story.md +118 -0
  95. package/.claude/commands/BMad/tasks/document-project.md +349 -0
  96. package/.claude/commands/BMad/tasks/execute-checklist.md +92 -0
  97. package/.claude/commands/BMad/tasks/facilitate-brainstorming-session.md +142 -0
  98. package/.claude/commands/BMad/tasks/generate-ai-frontend-prompt.md +57 -0
  99. package/.claude/commands/BMad/tasks/index-docs.md +179 -0
  100. package/.claude/commands/BMad/tasks/kb-mode-interaction.md +81 -0
  101. package/.claude/commands/BMad/tasks/nfr-assess.md +349 -0
  102. package/.claude/commands/BMad/tasks/qa-gate.md +167 -0
  103. package/.claude/commands/BMad/tasks/review-story.md +320 -0
  104. package/.claude/commands/BMad/tasks/risk-profile.md +359 -0
  105. package/.claude/commands/BMad/tasks/shard-doc.md +191 -0
  106. package/.claude/commands/BMad/tasks/test-design.md +180 -0
  107. package/.claude/commands/BMad/tasks/trace-requirements.md +270 -0
  108. package/.claude/commands/BMad/tasks/validate-next-story.md +140 -0
  109. package/.claude/commands/agent-vibes/add.md +0 -0
  110. package/.claude/commands/agent-vibes/agent-vibes.md +0 -0
  111. package/.claude/commands/agent-vibes/bmad.md +0 -0
  112. package/.claude/commands/agent-vibes/commands.json +24 -0
  113. package/.claude/commands/agent-vibes/get.md +0 -0
  114. package/.claude/commands/agent-vibes/language.md +23 -0
  115. package/.claude/commands/agent-vibes/learn.md +67 -0
  116. package/.claude/commands/agent-vibes/list.md +0 -0
  117. package/.claude/commands/agent-vibes/personality.md +0 -0
  118. package/.claude/commands/agent-vibes/preview.md +0 -0
  119. package/.claude/commands/agent-vibes/replay-target.md +14 -0
  120. package/.claude/commands/agent-vibes/replay.md +0 -0
  121. package/.claude/commands/agent-vibes/sample.md +0 -0
  122. package/.claude/commands/agent-vibes/sentiment.md +0 -0
  123. package/.claude/commands/agent-vibes/set-language.md +0 -0
  124. package/.claude/commands/agent-vibes/set-pretext.md +0 -0
  125. package/.claude/commands/agent-vibes/set-speed.md +41 -0
  126. package/.claude/commands/agent-vibes/switch.md +0 -0
  127. package/.claude/commands/agent-vibes/target-voice.md +26 -0
  128. package/.claude/commands/agent-vibes/target.md +30 -0
  129. package/.claude/commands/agent-vibes/update.md +0 -0
  130. package/.claude/commands/agent-vibes/version.md +0 -0
  131. package/.claude/commands/agent-vibes/whoami.md +0 -0
  132. package/.claude/github-star-reminder.txt +1 -1
  133. package/.claude/hooks/language-manager.sh +167 -13
  134. package/.claude/hooks/learn-manager.sh +443 -0
  135. package/.claude/hooks/play-tts-elevenlabs.sh +52 -8
  136. package/.claude/hooks/play-tts-piper.sh +82 -8
  137. package/.claude/hooks/play-tts.sh +30 -4
  138. package/.claude/hooks/provider-commands.sh +46 -3
  139. package/.claude/hooks/provider-manager.sh +56 -4
  140. package/.claude/hooks/replay-target-audio.sh +64 -0
  141. package/.claude/hooks/speed-manager.sh +226 -0
  142. package/.claude/language-voices.yaml +0 -0
  143. package/.claude/output-styles/agent-vibes.md +0 -0
  144. package/.claude/personalities/angry.md +0 -0
  145. package/.claude/personalities/annoying.md +0 -0
  146. package/.claude/personalities/crass.md +0 -0
  147. package/.claude/personalities/dramatic.md +0 -0
  148. package/.claude/personalities/dry-humor.md +0 -0
  149. package/.claude/personalities/flirty.md +0 -0
  150. package/.claude/personalities/funny.md +0 -0
  151. package/.claude/personalities/grandpa.md +0 -0
  152. package/.claude/personalities/millennial.md +0 -0
  153. package/.claude/personalities/moody.md +0 -0
  154. package/.claude/personalities/normal.md +0 -0
  155. package/.claude/personalities/pirate.md +0 -0
  156. package/.claude/personalities/poetic.md +0 -0
  157. package/.claude/personalities/professional.md +0 -0
  158. package/.claude/personalities/robot.md +0 -0
  159. package/.claude/personalities/sarcastic.md +0 -0
  160. package/.claude/personalities/sassy.md +0 -0
  161. package/.claude/personalities/surfer-dude.md +0 -0
  162. package/.claude/personalities/zen.md +0 -0
  163. package/.claude/piper-voices/en_US-lessac-medium.onnx +0 -0
  164. package/.claude/piper-voices/en_US-lessac-medium.onnx.json +0 -0
  165. package/.claude/piper-voices-dir.txt +0 -0
  166. package/.claude/plugins/bmad-voices-enabled.flag +0 -0
  167. package/.claude/plugins/bmad-voices.md +0 -0
  168. package/.mcp-minimal.json +6 -8
  169. package/AUDIO_TUNNEL_FIX_SUMMARY.md +0 -0
  170. package/INSTALL_MCP_WINDOWS.md +120 -42
  171. package/LICENSE +0 -0
  172. package/NPM_PUBLISH_GUIDE.md +0 -0
  173. package/README.md +19 -6
  174. package/RELEASE_NOTES.md +97 -0
  175. package/RELEASE_NOTES_V2.md +136 -5
  176. package/agentvibes.org/.claude/commands/agent-vibes/add.md +21 -0
  177. package/agentvibes.org/.claude/commands/agent-vibes/agent-vibes.md +68 -0
  178. package/agentvibes.org/.claude/commands/agent-vibes/commands.json +53 -0
  179. package/agentvibes.org/.claude/commands/agent-vibes/get.md +9 -0
  180. package/agentvibes.org/.claude/commands/agent-vibes/list.md +13 -0
  181. package/agentvibes.org/.claude/commands/agent-vibes/personality.md +79 -0
  182. package/agentvibes.org/.claude/commands/agent-vibes/preview.md +16 -0
  183. package/agentvibes.org/.claude/commands/agent-vibes/provider.md +54 -0
  184. package/agentvibes.org/.claude/commands/agent-vibes/replay.md +19 -0
  185. package/agentvibes.org/.claude/commands/agent-vibes/sample.md +12 -0
  186. package/agentvibes.org/.claude/commands/agent-vibes/sentiment.md +52 -0
  187. package/agentvibes.org/.claude/commands/agent-vibes/set-language.md +47 -0
  188. package/agentvibes.org/.claude/commands/agent-vibes/set-pretext.md +65 -0
  189. package/agentvibes.org/.claude/commands/agent-vibes/switch.md +53 -0
  190. package/agentvibes.org/.claude/commands/agent-vibes/update.md +20 -0
  191. package/agentvibes.org/.claude/commands/agent-vibes/version.md +10 -0
  192. package/agentvibes.org/.claude/commands/agent-vibes/whoami.md +7 -0
  193. package/agentvibes.org/.claude/hooks/bmad-voice-manager.sh +278 -0
  194. package/agentvibes.org/.claude/hooks/language-manager.sh +190 -0
  195. package/agentvibes.org/.claude/hooks/personality-manager.sh +279 -0
  196. package/agentvibes.org/.claude/hooks/piper-download-voices.sh +133 -0
  197. package/agentvibes.org/.claude/hooks/piper-voice-manager.sh +227 -0
  198. package/agentvibes.org/.claude/hooks/play-tts-elevenlabs.sh +201 -0
  199. package/agentvibes.org/.claude/hooks/play-tts-piper.sh +175 -0
  200. package/agentvibes.org/.claude/hooks/play-tts.sh +138 -0
  201. package/agentvibes.org/.claude/hooks/provider-commands.sh +374 -0
  202. package/agentvibes.org/.claude/hooks/provider-manager.sh +196 -0
  203. package/agentvibes.org/.claude/hooks/sentiment-manager.sh +163 -0
  204. package/agentvibes.org/.claude/hooks/voice-manager.sh +349 -0
  205. package/agentvibes.org/.claude/hooks/voices-config.sh +33 -0
  206. package/agentvibes.org/.claude/journal/2025-10-07.html +373 -0
  207. package/agentvibes.org/.claude/journal/index.html +91 -0
  208. package/agentvibes.org/.claude/output-styles/agent-vibes.md +203 -0
  209. package/agentvibes.org/.claude/personalities/angry.md +16 -0
  210. package/agentvibes.org/.claude/personalities/annoying.md +16 -0
  211. package/agentvibes.org/.claude/personalities/crass.md +16 -0
  212. package/agentvibes.org/.claude/personalities/dramatic.md +16 -0
  213. package/agentvibes.org/.claude/personalities/dry-humor.md +52 -0
  214. package/agentvibes.org/.claude/personalities/flirty.md +22 -0
  215. package/agentvibes.org/.claude/personalities/funny.md +16 -0
  216. package/agentvibes.org/.claude/personalities/grandpa.md +34 -0
  217. package/agentvibes.org/.claude/personalities/millennial.md +16 -0
  218. package/agentvibes.org/.claude/personalities/moody.md +16 -0
  219. package/agentvibes.org/.claude/personalities/normal.md +18 -0
  220. package/agentvibes.org/.claude/personalities/pirate.md +16 -0
  221. package/agentvibes.org/.claude/personalities/poetic.md +16 -0
  222. package/agentvibes.org/.claude/personalities/professional.md +16 -0
  223. package/agentvibes.org/.claude/personalities/robot.md +16 -0
  224. package/agentvibes.org/.claude/personalities/sarcastic.md +40 -0
  225. package/agentvibes.org/.claude/personalities/sassy.md +16 -0
  226. package/agentvibes.org/.claude/personalities/surfer-dude.md +16 -0
  227. package/agentvibes.org/.claude/personalities/zen.md +16 -0
  228. package/agentvibes.org/.mcp-minimal.json +60 -0
  229. package/agentvibes.org/CHANGELOG.md +56 -0
  230. package/agentvibes.org/README.md +93 -0
  231. package/agentvibes.org/app/(auth)/layout.tsx +15 -0
  232. package/agentvibes.org/app/(auth)/reset-password/page.tsx +45 -0
  233. package/agentvibes.org/app/(auth)/signin/page.tsx +82 -0
  234. package/agentvibes.org/app/(auth)/signup/page.tsx +104 -0
  235. package/agentvibes.org/app/(default)/layout.tsx +31 -0
  236. package/agentvibes.org/app/(default)/page.tsx +20 -0
  237. package/agentvibes.org/app/api/hello/route.ts +3 -0
  238. package/agentvibes.org/app/css/additional-styles/theme.css +82 -0
  239. package/agentvibes.org/app/css/additional-styles/utility-patterns.css +55 -0
  240. package/agentvibes.org/app/css/style.css +100 -0
  241. package/agentvibes.org/app/layout.tsx +63 -0
  242. package/agentvibes.org/components/cta.tsx +58 -0
  243. package/agentvibes.org/components/features.tsx +256 -0
  244. package/agentvibes.org/components/hero-home.tsx +133 -0
  245. package/agentvibes.org/components/modal-video.tsx +137 -0
  246. package/agentvibes.org/components/page-illustration.tsx +55 -0
  247. package/agentvibes.org/components/spotlight.tsx +77 -0
  248. package/agentvibes.org/components/testimonials.tsx +282 -0
  249. package/agentvibes.org/components/ui/footer.tsx +82 -0
  250. package/agentvibes.org/components/ui/header.tsx +53 -0
  251. package/agentvibes.org/components/ui/logo.tsx +10 -0
  252. package/agentvibes.org/components/workflows.tsx +176 -0
  253. package/agentvibes.org/next.config.js +4 -0
  254. package/agentvibes.org/package-lock.json +1974 -0
  255. package/agentvibes.org/package.json +30 -0
  256. package/agentvibes.org/pnpm-lock.yaml +1141 -0
  257. package/agentvibes.org/postcss.config.js +5 -0
  258. package/agentvibes.org/public/audio/02-sarcastic.mp3 +0 -0
  259. package/agentvibes.org/public/audio/03-angry.mp3 +0 -0
  260. package/agentvibes.org/public/audio/04-grandpa.mp3 +0 -0
  261. package/agentvibes.org/public/audio/05-sarcastic-example2.mp3 +0 -0
  262. package/agentvibes.org/public/audio/french-rachel.mp3 +0 -0
  263. package/agentvibes.org/public/audio/spanish-antoni.mp3 +0 -0
  264. package/agentvibes.org/public/favicon.ico +0 -0
  265. package/agentvibes.org/public/fonts/nacelle-italic.woff2 +0 -0
  266. package/agentvibes.org/public/fonts/nacelle-regular.woff2 +0 -0
  267. package/agentvibes.org/public/fonts/nacelle-semibold.woff2 +0 -0
  268. package/agentvibes.org/public/fonts/nacelle-semibolditalic.woff2 +0 -0
  269. package/agentvibes.org/public/images/blurred-shape-gray.svg +1 -0
  270. package/agentvibes.org/public/images/blurred-shape.svg +1 -0
  271. package/agentvibes.org/public/images/client-logo-01.svg +1 -0
  272. package/agentvibes.org/public/images/client-logo-02.svg +1 -0
  273. package/agentvibes.org/public/images/client-logo-03.svg +1 -0
  274. package/agentvibes.org/public/images/client-logo-04.svg +1 -0
  275. package/agentvibes.org/public/images/client-logo-05.svg +1 -0
  276. package/agentvibes.org/public/images/client-logo-06.svg +1 -0
  277. package/agentvibes.org/public/images/client-logo-07.svg +1 -0
  278. package/agentvibes.org/public/images/client-logo-08.svg +1 -0
  279. package/agentvibes.org/public/images/client-logo-09.svg +1 -0
  280. package/agentvibes.org/public/images/features.png +0 -0
  281. package/agentvibes.org/public/images/footer-illustration.svg +1 -0
  282. package/agentvibes.org/public/images/hero-image-01.jpg +0 -0
  283. package/agentvibes.org/public/images/logo.svg +1 -0
  284. package/agentvibes.org/public/images/page-illustration.svg +1 -0
  285. package/agentvibes.org/public/images/secondary-illustration.svg +1 -0
  286. package/agentvibes.org/public/images/testimonial-01.jpg +0 -0
  287. package/agentvibes.org/public/images/testimonial-02.jpg +0 -0
  288. package/agentvibes.org/public/images/testimonial-03.jpg +0 -0
  289. package/agentvibes.org/public/images/testimonial-04.jpg +0 -0
  290. package/agentvibes.org/public/images/testimonial-05.jpg +0 -0
  291. package/agentvibes.org/public/images/testimonial-06.jpg +0 -0
  292. package/agentvibes.org/public/images/testimonial-07.jpg +0 -0
  293. package/agentvibes.org/public/images/testimonial-08.jpg +0 -0
  294. package/agentvibes.org/public/images/testimonial-09.jpg +0 -0
  295. package/agentvibes.org/public/images/workflow-01.png +0 -0
  296. package/agentvibes.org/public/images/workflow-02.png +0 -0
  297. package/agentvibes.org/public/images/workflow-03.png +0 -0
  298. package/agentvibes.org/public/videos/video.mp4 +0 -0
  299. package/agentvibes.org/tsconfig.json +28 -0
  300. package/agentvibes.org/utils/useMasonry.tsx +67 -0
  301. package/agentvibes.org/utils/useMousePosition.tsx +27 -0
  302. package/bin/mcp-server.js +122 -0
  303. package/docs/ai-optimized-documentation-standards.md +0 -0
  304. package/docs/architecture/provider-system.md +0 -0
  305. package/docs/remote-audio-setup.md +0 -0
  306. package/docs/voice-mapping-format.md +0 -0
  307. package/linkedin/vibe-coding-and-pulseaudio.md +121 -0
  308. package/mcp-server/QUICK_START.md +0 -0
  309. package/mcp-server/README.md +0 -0
  310. package/mcp-server/examples/claude_desktop_config.json +0 -0
  311. package/mcp-server/examples/claude_desktop_config_piper.json +0 -0
  312. package/mcp-server/examples/custom_instructions.md +0 -0
  313. package/mcp-server/pyproject.toml +0 -0
  314. package/mcp-server/requirements.txt +0 -0
  315. package/mcp-server/server.py +87 -25
  316. package/package.json +2 -2
  317. package/scripts/AUTO-MONITOR-SETUP.md +233 -0
  318. package/scripts/CHANGELOG-2025-10-16.md +268 -0
  319. package/scripts/README.md +114 -0
  320. package/scripts/TROUBLESHOOTING.md +258 -0
  321. package/scripts/audio-tunnel.config +17 -0
  322. package/scripts/audio-tunnel.config.example +18 -0
  323. package/scripts/fix-audio-tunnel-complete.sh +255 -0
  324. package/scripts/fix-audio-tunnel.sh +244 -54
  325. package/scripts/health-check-tunnel.sh +93 -0
  326. package/scripts/piper-voice/README.md +0 -0
  327. package/scripts/setup-auto-monitor.sh +86 -0
  328. package/scripts/setup-windows-audio.ps1 +0 -0
  329. package/src/commands/install-mcp.js +0 -0
  330. package/src/installer.js +18 -0
  331. package/templates/activation-instructions-bmad.md +0 -0
  332. package/templates/output-styles/agent-vibes.md +0 -0
  333. package/test/README.md +0 -0
  334. package/test/helpers/test-helper.bash +0 -0
  335. package/test/test-framework.md +0 -0
  336. package/test/unit/personality-manager.bats +0 -0
  337. package/test/unit/play-tts.bats +0 -0
  338. package/test/unit/voice-manager.bats +0 -0
  339. /package/bin/{mcp-server → mcp-server.sh} +0 -0
@@ -0,0 +1,255 @@
1
+ #!/bin/bash
2
+ # Complete Audio Tunnel Fix Script
3
+ # Fixes audio tunnel issues between ubuntu-rdp and Windows WSL
4
+ # Updated: 2025-10-16 - Handles stale SSH processes and socat bridge
5
+
6
+ set -e
7
+
8
+ REMOTE_HOST="ubuntu-rdp"
9
+ TUNNEL_PORT="14713"
10
+
11
+ echo "🔧 Complete Audio Tunnel Fix"
12
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
13
+ echo ""
14
+
15
+ # Detect if we're running on WSL or ubuntu-rdp
16
+ if grep -qi microsoft /proc/version 2>/dev/null; then
17
+ RUNNING_ON="wsl"
18
+ echo "📍 Detected: Running on WSL (Windows side)"
19
+ elif [ -f /etc/hostname ] && grep -q "ubuntu-rdp" /etc/hostname; then
20
+ RUNNING_ON="ubuntu-rdp"
21
+ echo "📍 Detected: Running on ubuntu-rdp (Remote server)"
22
+ else
23
+ RUNNING_ON="unknown"
24
+ echo "⚠️ Warning: Could not detect environment"
25
+ fi
26
+
27
+ echo ""
28
+
29
+ # Function to check if socat is running on WSL
30
+ check_socat() {
31
+ if ss -tlnp 2>/dev/null | grep -q ":${TUNNEL_PORT}.*socat"; then
32
+ return 0
33
+ else
34
+ return 1
35
+ fi
36
+ }
37
+
38
+ # Function to kill stale SSH processes on remote server
39
+ kill_remote_stale_processes() {
40
+ echo "1️⃣ Checking for stale SSH processes on ${REMOTE_HOST}..."
41
+
42
+ # Get list of processes using the port
43
+ STALE_PROCS=$(ssh ${REMOTE_HOST} "sudo lsof -i :${TUNNEL_PORT} 2>/dev/null | grep -v COMMAND || echo 'none'")
44
+
45
+ if [ "$STALE_PROCS" != "none" ] && [ -n "$STALE_PROCS" ]; then
46
+ echo " 🔍 Found stale processes:"
47
+ echo "$STALE_PROCS" | sed 's/^/ /'
48
+ echo ""
49
+ echo " 🗑️ Killing stale processes..."
50
+ ssh ${REMOTE_HOST} "sudo fuser -k ${TUNNEL_PORT}/tcp 2>/dev/null || true"
51
+ echo " ✅ Stale processes killed"
52
+ sleep 2
53
+ else
54
+ echo " ℹ️ No stale processes found"
55
+ fi
56
+ echo ""
57
+ }
58
+
59
+ # Function to fix socat bridge (WSL only)
60
+ fix_socat_bridge() {
61
+ echo "2️⃣ Checking socat bridge on WSL..."
62
+
63
+ if check_socat; then
64
+ echo " ✅ socat bridge is already running"
65
+ else
66
+ echo " ⚠️ socat bridge not running, restarting..."
67
+
68
+ # Kill any existing socat
69
+ pkill socat 2>/dev/null || true
70
+ sleep 1
71
+
72
+ # Start socat in background
73
+ nohup socat "TCP-LISTEN:${TUNNEL_PORT},fork,reuseaddr" "UNIX-CONNECT:/mnt/wslg/PulseServer" \
74
+ > /tmp/socat-audio-${TUNNEL_PORT}.log 2>&1 &
75
+
76
+ sleep 2
77
+
78
+ if check_socat; then
79
+ echo " ✅ socat bridge started successfully"
80
+ else
81
+ echo " ❌ Failed to start socat bridge"
82
+ echo " Check logs: /tmp/socat-audio-${TUNNEL_PORT}.log"
83
+ return 1
84
+ fi
85
+ fi
86
+ echo ""
87
+ }
88
+
89
+ # Function to kill local stale SSH tunnels (WSL only)
90
+ kill_local_ssh_tunnels() {
91
+ echo "3️⃣ Killing local stale SSH tunnels..."
92
+
93
+ if pgrep -f "ssh.*${REMOTE_HOST}" > /dev/null; then
94
+ pkill -f "ssh.*${REMOTE_HOST}" 2>/dev/null || true
95
+ echo " ✅ Killed stale SSH tunnels"
96
+ sleep 2
97
+ else
98
+ echo " ℹ️ No stale SSH tunnels found"
99
+ fi
100
+ echo ""
101
+ }
102
+
103
+ # Function to create SSH tunnel (WSL only)
104
+ create_ssh_tunnel() {
105
+ echo "4️⃣ Creating fresh SSH tunnel..."
106
+
107
+ # Create tunnel in background
108
+ ssh -f -N -R ${TUNNEL_PORT}:localhost:${TUNNEL_PORT} ${REMOTE_HOST} 2>/dev/null || {
109
+ echo " ⚠️ Tunnel creation returned warning (this is normal if tunnel already exists)"
110
+ }
111
+
112
+ sleep 2
113
+
114
+ # Verify tunnel exists on remote
115
+ echo " 🔍 Verifying tunnel on ${REMOTE_HOST}..."
116
+ if ssh ${REMOTE_HOST} "netstat -tlnp 2>/dev/null | grep -q ${TUNNEL_PORT}"; then
117
+ echo " ✅ SSH tunnel established successfully"
118
+ else
119
+ echo " ❌ Failed to establish SSH tunnel"
120
+ return 1
121
+ fi
122
+ echo ""
123
+ }
124
+
125
+ # Function to test audio connection
126
+ test_audio() {
127
+ echo "5️⃣ Testing audio connection..."
128
+
129
+ # Test PulseAudio connection
130
+ if ssh ${REMOTE_HOST} "export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT} && timeout 5 pactl info > /dev/null 2>&1"; then
131
+ echo " ✅ PulseAudio connection successful"
132
+
133
+ # Get server info
134
+ SERVER_INFO=$(ssh ${REMOTE_HOST} "export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT} && pactl info | head -3")
135
+ echo " 📊 Server Info:"
136
+ echo "$SERVER_INFO" | sed 's/^/ /'
137
+ else
138
+ echo " ⚠️ PulseAudio connection test failed"
139
+ return 1
140
+ fi
141
+ echo ""
142
+ }
143
+
144
+ # Main execution based on environment
145
+ if [ "$RUNNING_ON" = "wsl" ]; then
146
+ echo "🔄 Running complete fix from WSL..."
147
+ echo ""
148
+
149
+ # Step 1: Kill stale processes on remote
150
+ kill_remote_stale_processes
151
+
152
+ # Step 2: Fix socat bridge
153
+ fix_socat_bridge || exit 1
154
+
155
+ # Step 3: Kill local SSH tunnels
156
+ kill_local_ssh_tunnels
157
+
158
+ # Step 4: Create fresh tunnel
159
+ create_ssh_tunnel || exit 1
160
+
161
+ # Step 5: Test audio
162
+ test_audio || {
163
+ echo "⚠️ Audio test failed, but tunnel is established"
164
+ echo " Try manually: ssh ${REMOTE_HOST}"
165
+ echo " Then: export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}"
166
+ echo " Test: speaker-test -t sine -f 1000 -l 1"
167
+ }
168
+
169
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
170
+ echo "✅ Audio tunnel fix complete!"
171
+ echo ""
172
+ echo "To use audio on ${REMOTE_HOST}:"
173
+ echo " export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}"
174
+ echo " speaker-test -t sine -f 1000 -l 1"
175
+ echo ""
176
+ echo "For persistent audio, add to ~/.bashrc:"
177
+ echo " echo 'export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}' >> ~/.bashrc"
178
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
179
+
180
+ elif [ "$RUNNING_ON" = "ubuntu-rdp" ]; then
181
+ echo "🔄 Running local fix on ubuntu-rdp..."
182
+ echo ""
183
+
184
+ # Kill any process using port 14713
185
+ echo "1️⃣ Killing stale connections on port ${TUNNEL_PORT}..."
186
+ if sudo fuser -k ${TUNNEL_PORT}/tcp 2>/dev/null; then
187
+ echo " ✅ Killed processes using port ${TUNNEL_PORT}"
188
+ else
189
+ echo " ℹ️ No processes were using port ${TUNNEL_PORT}"
190
+ fi
191
+
192
+ echo ""
193
+ echo "2️⃣ Waiting for tunnel to be re-established..."
194
+ echo " (Run from Windows/WSL: ssh -N -R ${TUNNEL_PORT}:localhost:${TUNNEL_PORT} ${REMOTE_HOST})"
195
+ echo ""
196
+
197
+ # Wait for tunnel to come back up (max 60 seconds)
198
+ TIMEOUT=60
199
+ ELAPSED=0
200
+ TUNNEL_UP=false
201
+
202
+ while [ $ELAPSED -lt $TIMEOUT ]; do
203
+ if ss -tlnp 2>/dev/null | grep -q :${TUNNEL_PORT}; then
204
+ TUNNEL_UP=true
205
+ break
206
+ fi
207
+ sleep 5
208
+ ELAPSED=$((ELAPSED + 5))
209
+ echo " Still waiting... (${ELAPSED}s elapsed)"
210
+ done
211
+
212
+ echo ""
213
+
214
+ if [ "$TUNNEL_UP" = true ]; then
215
+ echo "✅ Audio tunnel is UP!"
216
+ echo ""
217
+
218
+ # Export PULSE_SERVER for this session
219
+ export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}
220
+
221
+ # Test PulseAudio connection
222
+ if pactl info >/dev/null 2>&1; then
223
+ echo "🎵 Testing audio connection..."
224
+ echo ""
225
+
226
+ # Test with speaker-test
227
+ speaker-test -t sine -f 1000 -l 1 2>/dev/null || echo " (Audio test completed)"
228
+
229
+ echo ""
230
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
231
+ echo "✅ Audio tunnel fixed successfully!"
232
+ echo " AgentVibes TTS will now play through Windows speakers."
233
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
234
+ echo ""
235
+ else
236
+ echo "⚠️ Tunnel exists but PulseAudio connection failed"
237
+ echo " Check if socat bridge is running on Windows/WSL:"
238
+ echo " wsl ss -tlnp | grep ${TUNNEL_PORT}"
239
+ fi
240
+ else
241
+ echo "❌ Timeout: Tunnel did not come up after ${TIMEOUT} seconds"
242
+ echo ""
243
+ echo " Run this from Windows/WSL to fix:"
244
+ echo " wsl bash /path/to/fix-audio-tunnel-complete.sh"
245
+ echo ""
246
+ exit 1
247
+ fi
248
+
249
+ else
250
+ echo "❌ Unknown environment. This script should run on either:"
251
+ echo " - WSL (Windows Subsystem for Linux)"
252
+ echo " - ubuntu-rdp (Remote server)"
253
+ echo ""
254
+ exit 1
255
+ fi
@@ -1,83 +1,273 @@
1
1
  #!/bin/bash
2
- # Fix Audio Tunnel Script
3
- # Kills stale connections on port 14713 and waits for tunnel to be re-established
2
+ # Complete Audio Tunnel Fix Script
3
+ # Fixes audio tunnel issues between remote server and Windows WSL
4
+ # Updated: 2025-10-16 - Handles stale SSH processes and socat bridge
4
5
 
5
- echo "🔧 Fixing Audio Tunnel..."
6
- echo ""
6
+ set -e
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ CONFIG_FILE="${SCRIPT_DIR}/audio-tunnel.config"
7
10
 
8
- # Kill any process using port 14713
9
- echo "1️⃣ Killing stale connections on port 14713..."
10
- if sudo fuser -k 14713/tcp 2>/dev/null; then
11
- echo " ✅ Killed processes using port 14713"
11
+ # Load configuration if it exists, otherwise use defaults
12
+ if [ -f "$CONFIG_FILE" ]; then
13
+ source "$CONFIG_FILE"
12
14
  else
13
- echo " ℹ️ No processes were using port 14713"
15
+ # Default values (can be overridden by config)
16
+ REMOTE_HOST="${REMOTE_HOST:-ubuntu-rdp}"
17
+ TUNNEL_PORT="${TUNNEL_PORT:-14713}"
18
+ PULSE_SOCKET="${PULSE_SOCKET:-/mnt/wslg/PulseServer}"
14
19
  fi
15
20
 
21
+ echo "🔧 Complete Audio Tunnel Fix"
22
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
16
23
  echo ""
17
- echo "2️⃣ Waiting for tunnel to be re-established..."
18
- echo " (Run from Windows: ssh -N -R 14713:localhost:14713 ubuntu-rdp)"
24
+
25
+ # Detect if we're running on WSL or remote server
26
+ if grep -qi microsoft /proc/version 2>/dev/null; then
27
+ RUNNING_ON="wsl"
28
+ echo "📍 Detected: Running on WSL (Windows side)"
29
+ elif [ -n "$SSH_CONNECTION" ] || [ -n "$SSH_CLIENT" ]; then
30
+ RUNNING_ON="remote"
31
+ echo "📍 Detected: Running on remote server"
32
+ else
33
+ # Check if hostname matches REMOTE_HOST
34
+ CURRENT_HOST=$(hostname)
35
+ if [ "$CURRENT_HOST" = "$REMOTE_HOST" ]; then
36
+ RUNNING_ON="remote"
37
+ echo "📍 Detected: Running on remote server ($REMOTE_HOST)"
38
+ else
39
+ RUNNING_ON="wsl"
40
+ echo "📍 Assumed: Running on WSL (use config file to customize)"
41
+ fi
42
+ fi
43
+
19
44
  echo ""
20
45
 
21
- # Wait for tunnel to come back up (max 60 seconds)
22
- TIMEOUT=60
23
- ELAPSED=0
24
- TUNNEL_UP=false
46
+ # Function to check if socat is running on WSL
47
+ check_socat() {
48
+ if ss -tlnp 2>/dev/null | grep -q ":${TUNNEL_PORT}.*socat"; then
49
+ return 0
50
+ else
51
+ return 1
52
+ fi
53
+ }
25
54
 
26
- while [ $ELAPSED -lt $TIMEOUT ]; do
27
- if ss -tlnp 2>/dev/null | grep -q :14713; then
28
- TUNNEL_UP=true
29
- break
55
+ # Function to kill stale SSH processes on remote server
56
+ kill_remote_stale_processes() {
57
+ echo "1️⃣ Checking for stale SSH processes on ${REMOTE_HOST}..."
58
+
59
+ # Get list of processes using the port
60
+ STALE_PROCS=$(ssh ${REMOTE_HOST} "sudo lsof -i :${TUNNEL_PORT} 2>/dev/null | grep -v COMMAND || echo 'none'")
61
+
62
+ if [ "$STALE_PROCS" != "none" ] && [ -n "$STALE_PROCS" ]; then
63
+ echo " 🔍 Found stale processes:"
64
+ echo "$STALE_PROCS" | sed 's/^/ /'
65
+ echo ""
66
+ echo " 🗑️ Killing stale processes..."
67
+ ssh ${REMOTE_HOST} "sudo fuser -k ${TUNNEL_PORT}/tcp 2>/dev/null || true"
68
+ echo " ✅ Stale processes killed"
69
+ sleep 2
70
+ else
71
+ echo " ℹ️ No stale processes found"
30
72
  fi
31
- sleep 1
32
- ELAPSED=$((ELAPSED + 1))
33
- # Show progress dots every 5 seconds
34
- if [ $((ELAPSED % 5)) -eq 0 ]; then
35
- echo " Still waiting... (${ELAPSED}s elapsed)"
73
+ echo ""
74
+ }
75
+
76
+ # Function to fix socat bridge (WSL only)
77
+ fix_socat_bridge() {
78
+ echo "2️⃣ Checking socat bridge on WSL..."
79
+
80
+ if check_socat; then
81
+ echo " ✅ socat bridge is already running"
82
+ else
83
+ echo " ⚠️ socat bridge not running, restarting..."
84
+
85
+ # Kill any existing socat
86
+ pkill socat 2>/dev/null || true
87
+ sleep 1
88
+
89
+ # Start socat in background
90
+ nohup socat "TCP-LISTEN:${TUNNEL_PORT},fork,reuseaddr" "UNIX-CONNECT:${PULSE_SOCKET}" \
91
+ > /tmp/socat-audio-${TUNNEL_PORT}.log 2>&1 &
92
+
93
+ sleep 2
94
+
95
+ if check_socat; then
96
+ echo " ✅ socat bridge started successfully"
97
+ else
98
+ echo " ❌ Failed to start socat bridge"
99
+ echo " Check logs: /tmp/socat-audio-${TUNNEL_PORT}.log"
100
+ return 1
101
+ fi
36
102
  fi
37
- done
103
+ echo ""
104
+ }
38
105
 
39
- echo ""
106
+ # Function to kill local stale SSH tunnels (WSL only)
107
+ kill_local_ssh_tunnels() {
108
+ echo "3️⃣ Killing local stale SSH tunnels..."
109
+
110
+ if pgrep -f "ssh.*${REMOTE_HOST}" > /dev/null; then
111
+ pkill -f "ssh.*${REMOTE_HOST}" 2>/dev/null || true
112
+ echo " ✅ Killed stale SSH tunnels"
113
+ sleep 2
114
+ else
115
+ echo " ℹ️ No stale SSH tunnels found"
116
+ fi
117
+ echo ""
118
+ }
119
+
120
+ # Function to create SSH tunnel (WSL only)
121
+ create_ssh_tunnel() {
122
+ echo "4️⃣ Creating fresh SSH tunnel..."
123
+
124
+ # Create tunnel in background
125
+ ssh -f -N -R ${TUNNEL_PORT}:localhost:${TUNNEL_PORT} ${REMOTE_HOST} 2>/dev/null || {
126
+ echo " ⚠️ Tunnel creation returned warning (this is normal if tunnel already exists)"
127
+ }
40
128
 
41
- if [ "$TUNNEL_UP" = true ]; then
42
- echo "✅ Audio tunnel is UP!"
129
+ sleep 2
130
+
131
+ # Verify tunnel exists on remote
132
+ echo " 🔍 Verifying tunnel on ${REMOTE_HOST}..."
133
+ if ssh ${REMOTE_HOST} "netstat -tlnp 2>/dev/null | grep -q ${TUNNEL_PORT}"; then
134
+ echo " ✅ SSH tunnel established successfully"
135
+ else
136
+ echo " ❌ Failed to establish SSH tunnel"
137
+ return 1
138
+ fi
43
139
  echo ""
140
+ }
44
141
 
45
- # Export PULSE_SERVER for this session
46
- export PULSE_SERVER=tcp:localhost:14713
142
+ # Function to test audio connection
143
+ test_audio() {
144
+ echo "5️⃣ Testing audio connection..."
47
145
 
48
146
  # Test PulseAudio connection
49
- if pactl info >/dev/null 2>&1; then
50
- echo "🎵 Playing confirmation message..."
147
+ if ssh ${REMOTE_HOST} "export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT} && timeout 5 pactl info > /dev/null 2>&1"; then
148
+ echo " PulseAudio connection successful"
149
+
150
+ # Get server info
151
+ SERVER_INFO=$(ssh ${REMOTE_HOST} "export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT} && pactl info | head -3")
152
+ echo " 📊 Server Info:"
153
+ echo "$SERVER_INFO" | sed 's/^/ /'
154
+ else
155
+ echo " ⚠️ PulseAudio connection test failed"
156
+ return 1
157
+ fi
158
+ echo ""
159
+ }
160
+
161
+ # Main execution based on environment
162
+ if [ "$RUNNING_ON" = "wsl" ]; then
163
+ echo "🔄 Running complete fix from WSL..."
164
+ echo ""
165
+
166
+ # Step 1: Kill stale processes on remote
167
+ kill_remote_stale_processes
168
+
169
+ # Step 2: Fix socat bridge
170
+ fix_socat_bridge || exit 1
171
+
172
+ # Step 3: Kill local SSH tunnels
173
+ kill_local_ssh_tunnels
174
+
175
+ # Step 4: Create fresh tunnel
176
+ create_ssh_tunnel || exit 1
177
+
178
+ # Step 5: Test audio
179
+ test_audio || {
180
+ echo "⚠️ Audio test failed, but tunnel is established"
181
+ echo " Try manually: ssh ${REMOTE_HOST}"
182
+ echo " Then: export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}"
183
+ echo " Test: speaker-test -t sine -f 1000 -l 1"
184
+ }
185
+
186
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
187
+ echo "✅ Audio tunnel fix complete!"
188
+ echo ""
189
+ echo "To use audio on ${REMOTE_HOST}:"
190
+ echo " export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}"
191
+ echo " speaker-test -t sine -f 1000 -l 1"
192
+ echo ""
193
+ echo "For persistent audio, add to ~/.bashrc:"
194
+ echo " echo 'export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}' >> ~/.bashrc"
195
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
196
+
197
+ elif [ "$RUNNING_ON" = "remote" ]; then
198
+ echo "🔄 Running local fix on remote server..."
199
+ echo ""
200
+
201
+ # Kill any process using port 14713
202
+ echo "1️⃣ Killing stale connections on port ${TUNNEL_PORT}..."
203
+ if sudo fuser -k ${TUNNEL_PORT}/tcp 2>/dev/null; then
204
+ echo " ✅ Killed processes using port ${TUNNEL_PORT}"
205
+ else
206
+ echo " ℹ️ No processes were using port ${TUNNEL_PORT}"
207
+ fi
208
+
209
+ echo ""
210
+ echo "2️⃣ Waiting for tunnel to be re-established..."
211
+ echo " (Run from Windows/WSL: ssh -N -R ${TUNNEL_PORT}:localhost:${TUNNEL_PORT} ${REMOTE_HOST})"
212
+ echo ""
213
+
214
+ # Wait for tunnel to come back up (max 60 seconds)
215
+ TIMEOUT=60
216
+ ELAPSED=0
217
+ TUNNEL_UP=false
218
+
219
+ while [ $ELAPSED -lt $TIMEOUT ]; do
220
+ if ss -tlnp 2>/dev/null | grep -q :${TUNNEL_PORT}; then
221
+ TUNNEL_UP=true
222
+ break
223
+ fi
224
+ sleep 5
225
+ ELAPSED=$((ELAPSED + 5))
226
+ echo " Still waiting... (${ELAPSED}s elapsed)"
227
+ done
228
+
229
+ echo ""
230
+
231
+ if [ "$TUNNEL_UP" = true ]; then
232
+ echo "✅ Audio tunnel is UP!"
51
233
  echo ""
52
234
 
53
- # Play TTS confirmation message through the tunnel
54
- # Check if we have espeak or piper available
55
- if command -v espeak >/dev/null 2>&1; then
56
- echo "Audio tunnel is fixed, new tunnel created!" | espeak -s 150 2>/dev/null
57
- elif [ -f /usr/local/bin/piper ] || command -v piper >/dev/null 2>&1; then
58
- echo "Audio tunnel is fixed, new tunnel created!" | piper --model en_US-lessac-medium --output-raw | aplay -r 22050 -f S16_LE -t raw - 2>/dev/null
235
+ # Export PULSE_SERVER for this session
236
+ export PULSE_SERVER=tcp:localhost:${TUNNEL_PORT}
237
+
238
+ # Test PulseAudio connection
239
+ if pactl info >/dev/null 2>&1; then
240
+ echo "🎵 Testing audio connection..."
241
+ echo ""
242
+
243
+ # Test with speaker-test
244
+ speaker-test -t sine -f 1000 -l 1 2>/dev/null || echo " (Audio test completed)"
245
+
246
+ echo ""
247
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
248
+ echo "✅ Audio tunnel fixed successfully!"
249
+ echo " AgentVibes TTS will now play through Windows speakers."
250
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
251
+ echo ""
59
252
  else
60
- # Fallback: just use speaker-test
61
- echo " (TTS not available, playing test tone)"
62
- speaker-test -t sine -f 1000 -l 1 -s 1 2>/dev/null
253
+ echo "⚠️ Tunnel exists but PulseAudio connection failed"
254
+ echo " Check if socat bridge is running on Windows/WSL:"
255
+ echo " wsl ss -tlnp | grep ${TUNNEL_PORT}"
63
256
  fi
64
-
257
+ else
258
+ echo "❌ Timeout: Tunnel did not come up after ${TIMEOUT} seconds"
65
259
  echo ""
66
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
67
- echo " Audio tunnel fixed successfully!"
68
- echo " AgentVibes TTS will now play through Windows speakers."
69
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
260
+ echo " Run this from Windows/WSL to fix:"
261
+ echo " wsl bash /path/to/fix-audio-tunnel.sh"
70
262
  echo ""
71
- else
72
- echo "⚠️ Tunnel exists but PulseAudio connection failed"
73
- echo " Check if socat bridge is running on Windows:"
74
- echo " wsl ss -tlnp | grep 14713"
263
+ exit 1
75
264
  fi
265
+
76
266
  else
77
- echo "❌ Timeout: Tunnel did not come up after ${TIMEOUT} seconds"
78
- echo ""
79
- echo " Make sure you run this from Windows:"
80
- echo " ssh -N -R 14713:localhost:14713 ubuntu-rdp"
267
+ echo "❌ Unknown environment. This script should run on either:"
268
+ echo " - WSL (Windows Subsystem for Linux)"
269
+ echo " - Remote server (configured as REMOTE_HOST in config file)"
81
270
  echo ""
271
+ echo "Create audio-tunnel.config from audio-tunnel.config.example"
82
272
  exit 1
83
273
  fi
@@ -0,0 +1,93 @@
1
+ #!/bin/bash
2
+ # Audio Tunnel Health Check Script
3
+ # Monitors audio tunnel and automatically runs fix if needed
4
+ # This script uses audio-tunnel.config for all user-specific settings
5
+
6
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ CONFIG_FILE="${SCRIPT_DIR}/audio-tunnel.config"
8
+
9
+ # Load configuration
10
+ if [ ! -f "$CONFIG_FILE" ]; then
11
+ echo "❌ Configuration file not found: $CONFIG_FILE"
12
+ echo " Copy audio-tunnel.config.example to audio-tunnel.config"
13
+ echo " and customize it for your setup."
14
+ exit 1
15
+ fi
16
+
17
+ source "$CONFIG_FILE"
18
+
19
+ # Validate required variables
20
+ if [ -z "$REMOTE_HOST" ] || [ "$REMOTE_HOST" = "your-remote-host" ]; then
21
+ echo "❌ REMOTE_HOST not configured in $CONFIG_FILE"
22
+ exit 1
23
+ fi
24
+
25
+ TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
26
+ FIX_SCRIPT="${SCRIPT_DIR}/fix-audio-tunnel.sh"
27
+
28
+ # Function to log messages
29
+ log_message() {
30
+ echo "[$TIMESTAMP] $1" >> "$AUTO_FIX_LOG"
31
+ }
32
+
33
+ # Check if socat bridge is running
34
+ check_socat() {
35
+ if ss -tlnp 2>/dev/null | grep -q ":${TUNNEL_PORT}.*socat"; then
36
+ return 0
37
+ else
38
+ return 1
39
+ fi
40
+ }
41
+
42
+ # Check if SSH tunnel exists on remote
43
+ check_remote_tunnel() {
44
+ if ssh "$REMOTE_HOST" "netstat -tlnp 2>/dev/null | grep -q ${TUNNEL_PORT}"; then
45
+ return 0
46
+ else
47
+ return 1
48
+ fi
49
+ }
50
+
51
+ # Main healthcheck
52
+ NEEDS_FIX=false
53
+
54
+ # Check 1: socat bridge
55
+ if ! check_socat; then
56
+ log_message "ALERT: socat bridge not running on port ${TUNNEL_PORT}"
57
+ NEEDS_FIX=true
58
+ fi
59
+
60
+ # Check 2: SSH tunnel (only if we're on WSL)
61
+ if grep -qi microsoft /proc/version 2>/dev/null; then
62
+ if ! check_remote_tunnel; then
63
+ log_message "ALERT: SSH tunnel not found on ${REMOTE_HOST}:${TUNNEL_PORT}"
64
+ NEEDS_FIX=true
65
+ fi
66
+ fi
67
+
68
+ # Run fix if needed
69
+ if [ "$NEEDS_FIX" = true ]; then
70
+ log_message "Running automatic fix..."
71
+
72
+ if [ -f "$FIX_SCRIPT" ]; then
73
+ "$FIX_SCRIPT" >> "$AUTO_FIX_LOG" 2>&1
74
+
75
+ # Verify fix worked
76
+ sleep 3
77
+ if check_socat; then
78
+ log_message "SUCCESS: Audio tunnel restored automatically"
79
+
80
+ # Play TTS notification if AgentVibes is available
81
+ TTS_SCRIPT="${SCRIPT_DIR}/../.claude/hooks/play-tts.sh"
82
+ if [ -f "$TTS_SCRIPT" ]; then
83
+ "$TTS_SCRIPT" "Audio tunnel self healed!" 2>/dev/null || true
84
+ fi
85
+ else
86
+ log_message "ERROR: Automatic fix failed, manual intervention needed"
87
+ fi
88
+ else
89
+ log_message "ERROR: Fix script not found at $FIX_SCRIPT"
90
+ fi
91
+ else
92
+ log_message "OK: Audio tunnel is healthy"
93
+ fi
File without changes