vibe-remote 2.1.6__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 (52) hide show
  1. config/__init__.py +37 -0
  2. config/paths.py +56 -0
  3. config/v2_compat.py +74 -0
  4. config/v2_config.py +206 -0
  5. config/v2_sessions.py +73 -0
  6. config/v2_settings.py +115 -0
  7. core/__init__.py +0 -0
  8. core/controller.py +736 -0
  9. core/handlers/__init__.py +13 -0
  10. core/handlers/command_handlers.py +342 -0
  11. core/handlers/message_handler.py +365 -0
  12. core/handlers/session_handler.py +233 -0
  13. core/handlers/settings_handler.py +362 -0
  14. modules/__init__.py +0 -0
  15. modules/agent_router.py +58 -0
  16. modules/agents/__init__.py +38 -0
  17. modules/agents/base.py +91 -0
  18. modules/agents/claude_agent.py +344 -0
  19. modules/agents/codex_agent.py +368 -0
  20. modules/agents/opencode_agent.py +2155 -0
  21. modules/agents/service.py +41 -0
  22. modules/agents/subagent_router.py +136 -0
  23. modules/claude_client.py +154 -0
  24. modules/im/__init__.py +63 -0
  25. modules/im/base.py +323 -0
  26. modules/im/factory.py +60 -0
  27. modules/im/formatters/__init__.py +4 -0
  28. modules/im/formatters/base_formatter.py +639 -0
  29. modules/im/formatters/slack_formatter.py +127 -0
  30. modules/im/slack.py +2091 -0
  31. modules/session_manager.py +138 -0
  32. modules/settings_manager.py +587 -0
  33. vibe/__init__.py +6 -0
  34. vibe/__main__.py +12 -0
  35. vibe/_version.py +34 -0
  36. vibe/api.py +412 -0
  37. vibe/cli.py +637 -0
  38. vibe/runtime.py +213 -0
  39. vibe/service_main.py +101 -0
  40. vibe/templates/slack_manifest.json +65 -0
  41. vibe/ui/dist/assets/index-8g3mNwMK.js +35 -0
  42. vibe/ui/dist/assets/index-M55aMB5R.css +1 -0
  43. vibe/ui/dist/assets/logo-BzryTZ7u.png +0 -0
  44. vibe/ui/dist/index.html +17 -0
  45. vibe/ui/dist/logo.png +0 -0
  46. vibe/ui/dist/vite.svg +1 -0
  47. vibe/ui_server.py +346 -0
  48. vibe_remote-2.1.6.dist-info/METADATA +295 -0
  49. vibe_remote-2.1.6.dist-info/RECORD +52 -0
  50. vibe_remote-2.1.6.dist-info/WHEEL +4 -0
  51. vibe_remote-2.1.6.dist-info/entry_points.txt +2 -0
  52. vibe_remote-2.1.6.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,127 @@
1
+ from .base_formatter import BaseMarkdownFormatter
2
+
3
+
4
+ class SlackFormatter(BaseMarkdownFormatter):
5
+ """Slack mrkdwn formatter
6
+
7
+ Slack uses its own markup language called mrkdwn which is similar to Markdown
8
+ but with some differences.
9
+ Reference: https://api.slack.com/reference/surfaces/formatting
10
+ """
11
+
12
+ def format_bold(self, text: str) -> str:
13
+ """Format bold text using single asterisks"""
14
+ # In Slack, single asterisks make text bold
15
+ return f"*{text}*"
16
+
17
+ def format_italic(self, text: str) -> str:
18
+ """Format italic text using underscores"""
19
+ return f"_{text}_"
20
+
21
+ def format_strikethrough(self, text: str) -> str:
22
+ """Format strikethrough text using tildes"""
23
+ return f"~{text}~"
24
+
25
+ def format_link(self, text: str, url: str) -> str:
26
+ """Format hyperlink in Slack style"""
27
+ # Slack uses a different link format: <url|text>
28
+ return f"<{url}|{text}>"
29
+
30
+ def escape_special_chars(self, text: str) -> str:
31
+ """Escape Slack mrkdwn special characters
32
+
33
+ Slack requires escaping these characters: &, <, >
34
+ """
35
+ text = text.replace("&", "&amp;")
36
+ text = text.replace("<", "&lt;")
37
+ text = text.replace(">", "&gt;")
38
+ return text
39
+
40
+ def format_code_inline(self, text: str) -> str:
41
+ """Format inline code - no escaping inside code blocks"""
42
+ # In Slack, content inside backticks should NOT be escaped
43
+ # Special characters like . and | are literal inside code blocks
44
+ return f"`{text}`"
45
+
46
+ def format_code_block(self, code: str, language: str = "") -> str:
47
+ """Format code block - Slack style"""
48
+ # Slack also supports triple backticks for code blocks
49
+ # Language hint is not displayed but can be included
50
+ return f"```\n{code}\n```"
51
+
52
+ def format_quote(self, text: str) -> str:
53
+ """Format quoted text - Slack style"""
54
+ # Slack uses > for quotes, same as standard markdown
55
+ lines = text.split('\n')
56
+ return '\n'.join(f">{line}" for line in lines)
57
+
58
+ def format_list_item(self, text: str, level: int = 0) -> str:
59
+ """Format list item - Slack style"""
60
+ # Slack doesn't support nested lists well, so we simplify
61
+ if level == 0:
62
+ return f"• {text}"
63
+ else:
64
+ # Use spaces for indentation
65
+ indent = " " * level
66
+ return f"{indent}◦ {text}"
67
+
68
+ def format_numbered_list_item(self, text: str, number: int, level: int = 0) -> str:
69
+ """Format numbered list item - Slack style"""
70
+ indent = " " * level
71
+ return f"{indent}{number}. {text}"
72
+
73
+ # Slack-specific formatting methods
74
+ def format_user_mention(self, user_id: str) -> str:
75
+ """Format user mention in Slack style"""
76
+ return f"<@{user_id}>"
77
+
78
+ def format_channel_mention(self, channel_id: str) -> str:
79
+ """Format channel mention in Slack style"""
80
+ return f"<#{channel_id}>"
81
+
82
+ def format_emoji(self, emoji: str, name: str = None) -> str:
83
+ """Format emoji - Slack supports both Unicode and :name: format"""
84
+ if name:
85
+ return f":{name}:"
86
+ return emoji
87
+
88
+ # Override convenience methods for Slack-specific behavior
89
+ def format_section_header(self, title: str, emoji: str = "") -> str:
90
+ """Format section header - Slack doesn't have headers, so we use bold"""
91
+ if emoji:
92
+ return f"{emoji} {self.format_bold(title)}"
93
+ return self.format_bold(title)
94
+
95
+ def format_key_value(self, key: str, value: str, inline: bool = True) -> str:
96
+ """Format key-value pair - override to avoid double escaping"""
97
+ # Only escape the value, not the key (key is bolded)
98
+ escaped_value = self.escape_special_chars(value)
99
+
100
+ if inline:
101
+ return f"{self.format_bold(key)}: {escaped_value}"
102
+ else:
103
+ return f"{self.format_bold(key)}:\n{escaped_value}"
104
+
105
+ def format_horizontal_rule(self) -> str:
106
+ """Format horizontal rule - Slack doesn't support this well"""
107
+ # Use a series of dashes as a visual separator
108
+ return "─" * 40
109
+
110
+ def format_tool_name(self, tool_name: str, emoji: str = "🔧") -> str:
111
+ """Format tool name with emoji and styling"""
112
+ # Don't escape tool name - it goes directly in code blocks
113
+ return f"{emoji} {self.format_bold('Tool')}: {self.format_code_inline(tool_name)}"
114
+
115
+ def format_file_path(self, path: str, emoji: str = "📁") -> str:
116
+ """Format file path with emoji"""
117
+ # Don't escape path - it goes directly in code blocks
118
+ return f"{emoji} File: {self.format_code_inline(path)}"
119
+
120
+ def format_command(self, command: str) -> str:
121
+ """Format shell command"""
122
+ # For multi-line or long commands, use code block
123
+ if "\n" in command or len(command) > 80:
124
+ return f"💻 Command:\n{self.format_code_block(command)}"
125
+ else:
126
+ # Don't escape command - it goes directly in code blocks
127
+ return f"💻 Command: {self.format_code_inline(command)}"