kollabor 0.4.9__py3-none-any.whl → 0.4.15__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 (192) hide show
  1. agents/__init__.py +2 -0
  2. agents/coder/__init__.py +0 -0
  3. agents/coder/agent.json +4 -0
  4. agents/coder/api-integration.md +2150 -0
  5. agents/coder/cli-pretty.md +765 -0
  6. agents/coder/code-review.md +1092 -0
  7. agents/coder/database-design.md +1525 -0
  8. agents/coder/debugging.md +1102 -0
  9. agents/coder/dependency-management.md +1397 -0
  10. agents/coder/git-workflow.md +1099 -0
  11. agents/coder/refactoring.md +1454 -0
  12. agents/coder/security-hardening.md +1732 -0
  13. agents/coder/system_prompt.md +1448 -0
  14. agents/coder/tdd.md +1367 -0
  15. agents/creative-writer/__init__.py +0 -0
  16. agents/creative-writer/agent.json +4 -0
  17. agents/creative-writer/character-development.md +1852 -0
  18. agents/creative-writer/dialogue-craft.md +1122 -0
  19. agents/creative-writer/plot-structure.md +1073 -0
  20. agents/creative-writer/revision-editing.md +1484 -0
  21. agents/creative-writer/system_prompt.md +690 -0
  22. agents/creative-writer/worldbuilding.md +2049 -0
  23. agents/data-analyst/__init__.py +30 -0
  24. agents/data-analyst/agent.json +4 -0
  25. agents/data-analyst/data-visualization.md +992 -0
  26. agents/data-analyst/exploratory-data-analysis.md +1110 -0
  27. agents/data-analyst/pandas-data-manipulation.md +1081 -0
  28. agents/data-analyst/sql-query-optimization.md +881 -0
  29. agents/data-analyst/statistical-analysis.md +1118 -0
  30. agents/data-analyst/system_prompt.md +928 -0
  31. agents/default/__init__.py +0 -0
  32. agents/default/agent.json +4 -0
  33. agents/default/dead-code.md +794 -0
  34. agents/default/explore-agent-system.md +585 -0
  35. agents/default/system_prompt.md +1448 -0
  36. agents/kollabor/__init__.py +0 -0
  37. agents/kollabor/analyze-plugin-lifecycle.md +175 -0
  38. agents/kollabor/analyze-terminal-rendering.md +388 -0
  39. agents/kollabor/code-review.md +1092 -0
  40. agents/kollabor/debug-mcp-integration.md +521 -0
  41. agents/kollabor/debug-plugin-hooks.md +547 -0
  42. agents/kollabor/debugging.md +1102 -0
  43. agents/kollabor/dependency-management.md +1397 -0
  44. agents/kollabor/git-workflow.md +1099 -0
  45. agents/kollabor/inspect-llm-conversation.md +148 -0
  46. agents/kollabor/monitor-event-bus.md +558 -0
  47. agents/kollabor/profile-performance.md +576 -0
  48. agents/kollabor/refactoring.md +1454 -0
  49. agents/kollabor/system_prompt copy.md +1448 -0
  50. agents/kollabor/system_prompt.md +757 -0
  51. agents/kollabor/trace-command-execution.md +178 -0
  52. agents/kollabor/validate-config.md +879 -0
  53. agents/research/__init__.py +0 -0
  54. agents/research/agent.json +4 -0
  55. agents/research/architecture-mapping.md +1099 -0
  56. agents/research/codebase-analysis.md +1077 -0
  57. agents/research/dependency-audit.md +1027 -0
  58. agents/research/performance-profiling.md +1047 -0
  59. agents/research/security-review.md +1359 -0
  60. agents/research/system_prompt.md +492 -0
  61. agents/technical-writer/__init__.py +0 -0
  62. agents/technical-writer/agent.json +4 -0
  63. agents/technical-writer/api-documentation.md +2328 -0
  64. agents/technical-writer/changelog-management.md +1181 -0
  65. agents/technical-writer/readme-writing.md +1360 -0
  66. agents/technical-writer/style-guide.md +1410 -0
  67. agents/technical-writer/system_prompt.md +653 -0
  68. agents/technical-writer/tutorial-creation.md +1448 -0
  69. core/__init__.py +0 -2
  70. core/application.py +343 -88
  71. core/cli.py +229 -10
  72. core/commands/menu_renderer.py +463 -59
  73. core/commands/registry.py +14 -9
  74. core/commands/system_commands.py +2461 -14
  75. core/config/loader.py +151 -37
  76. core/config/service.py +18 -6
  77. core/events/bus.py +29 -9
  78. core/events/executor.py +205 -75
  79. core/events/models.py +27 -8
  80. core/fullscreen/command_integration.py +20 -24
  81. core/fullscreen/components/__init__.py +10 -1
  82. core/fullscreen/components/matrix_components.py +1 -2
  83. core/fullscreen/components/space_shooter_components.py +654 -0
  84. core/fullscreen/plugin.py +5 -0
  85. core/fullscreen/renderer.py +52 -13
  86. core/fullscreen/session.py +52 -15
  87. core/io/__init__.py +29 -5
  88. core/io/buffer_manager.py +6 -1
  89. core/io/config_status_view.py +7 -29
  90. core/io/core_status_views.py +267 -347
  91. core/io/input/__init__.py +25 -0
  92. core/io/input/command_mode_handler.py +711 -0
  93. core/io/input/display_controller.py +128 -0
  94. core/io/input/hook_registrar.py +286 -0
  95. core/io/input/input_loop_manager.py +421 -0
  96. core/io/input/key_press_handler.py +502 -0
  97. core/io/input/modal_controller.py +1011 -0
  98. core/io/input/paste_processor.py +339 -0
  99. core/io/input/status_modal_renderer.py +184 -0
  100. core/io/input_errors.py +5 -1
  101. core/io/input_handler.py +211 -2452
  102. core/io/key_parser.py +7 -0
  103. core/io/layout.py +15 -3
  104. core/io/message_coordinator.py +111 -2
  105. core/io/message_renderer.py +129 -4
  106. core/io/status_renderer.py +147 -607
  107. core/io/terminal_renderer.py +97 -51
  108. core/io/terminal_state.py +21 -4
  109. core/io/visual_effects.py +816 -165
  110. core/llm/agent_manager.py +1063 -0
  111. core/llm/api_adapters/__init__.py +44 -0
  112. core/llm/api_adapters/anthropic_adapter.py +432 -0
  113. core/llm/api_adapters/base.py +241 -0
  114. core/llm/api_adapters/openai_adapter.py +326 -0
  115. core/llm/api_communication_service.py +167 -113
  116. core/llm/conversation_logger.py +322 -16
  117. core/llm/conversation_manager.py +556 -30
  118. core/llm/file_operations_executor.py +84 -32
  119. core/llm/llm_service.py +934 -103
  120. core/llm/mcp_integration.py +541 -57
  121. core/llm/message_display_service.py +135 -18
  122. core/llm/plugin_sdk.py +1 -2
  123. core/llm/profile_manager.py +1183 -0
  124. core/llm/response_parser.py +274 -56
  125. core/llm/response_processor.py +16 -3
  126. core/llm/tool_executor.py +6 -1
  127. core/logging/__init__.py +2 -0
  128. core/logging/setup.py +34 -6
  129. core/models/resume.py +54 -0
  130. core/plugins/__init__.py +4 -2
  131. core/plugins/base.py +127 -0
  132. core/plugins/collector.py +23 -161
  133. core/plugins/discovery.py +37 -3
  134. core/plugins/factory.py +6 -12
  135. core/plugins/registry.py +5 -17
  136. core/ui/config_widgets.py +128 -28
  137. core/ui/live_modal_renderer.py +2 -1
  138. core/ui/modal_actions.py +5 -0
  139. core/ui/modal_overlay_renderer.py +0 -60
  140. core/ui/modal_renderer.py +268 -7
  141. core/ui/modal_state_manager.py +29 -4
  142. core/ui/widgets/base_widget.py +7 -0
  143. core/updates/__init__.py +10 -0
  144. core/updates/version_check_service.py +348 -0
  145. core/updates/version_comparator.py +103 -0
  146. core/utils/config_utils.py +685 -526
  147. core/utils/plugin_utils.py +1 -1
  148. core/utils/session_naming.py +111 -0
  149. fonts/LICENSE +21 -0
  150. fonts/README.md +46 -0
  151. fonts/SymbolsNerdFont-Regular.ttf +0 -0
  152. fonts/SymbolsNerdFontMono-Regular.ttf +0 -0
  153. fonts/__init__.py +44 -0
  154. {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/METADATA +54 -4
  155. kollabor-0.4.15.dist-info/RECORD +228 -0
  156. {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/top_level.txt +2 -0
  157. plugins/agent_orchestrator/__init__.py +39 -0
  158. plugins/agent_orchestrator/activity_monitor.py +181 -0
  159. plugins/agent_orchestrator/file_attacher.py +77 -0
  160. plugins/agent_orchestrator/message_injector.py +135 -0
  161. plugins/agent_orchestrator/models.py +48 -0
  162. plugins/agent_orchestrator/orchestrator.py +403 -0
  163. plugins/agent_orchestrator/plugin.py +976 -0
  164. plugins/agent_orchestrator/xml_parser.py +191 -0
  165. plugins/agent_orchestrator_plugin.py +9 -0
  166. plugins/enhanced_input/box_styles.py +1 -0
  167. plugins/enhanced_input/color_engine.py +19 -4
  168. plugins/enhanced_input/config.py +2 -2
  169. plugins/enhanced_input_plugin.py +61 -11
  170. plugins/fullscreen/__init__.py +6 -2
  171. plugins/fullscreen/example_plugin.py +1035 -222
  172. plugins/fullscreen/setup_wizard_plugin.py +592 -0
  173. plugins/fullscreen/space_shooter_plugin.py +131 -0
  174. plugins/hook_monitoring_plugin.py +436 -78
  175. plugins/query_enhancer_plugin.py +66 -30
  176. plugins/resume_conversation_plugin.py +1494 -0
  177. plugins/save_conversation_plugin.py +98 -32
  178. plugins/system_commands_plugin.py +70 -56
  179. plugins/tmux_plugin.py +154 -78
  180. plugins/workflow_enforcement_plugin.py +94 -92
  181. system_prompt/default.md +952 -886
  182. core/io/input_mode_manager.py +0 -402
  183. core/io/modal_interaction_handler.py +0 -315
  184. core/io/raw_input_processor.py +0 -946
  185. core/storage/__init__.py +0 -5
  186. core/storage/state_manager.py +0 -84
  187. core/ui/widget_integration.py +0 -222
  188. core/utils/key_reader.py +0 -171
  189. kollabor-0.4.9.dist-info/RECORD +0 -128
  190. {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/WHEEL +0 -0
  191. {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/entry_points.txt +0 -0
  192. {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/licenses/LICENSE +0 -0
core/cli.py CHANGED
@@ -8,15 +8,62 @@ import re
8
8
  from pathlib import Path
9
9
  from importlib.metadata import version, PackageNotFoundError
10
10
 
11
+ # Fix encoding for Windows to support Unicode characters
12
+ if sys.platform == "win32":
13
+ # Set UTF-8 mode for stdin/stdout/stderr
14
+ if hasattr(sys.stdout, 'reconfigure'):
15
+ sys.stdout.reconfigure(encoding='utf-8', errors='replace')
16
+ if hasattr(sys.stderr, 'reconfigure'):
17
+ sys.stderr.reconfigure(encoding='utf-8', errors='replace')
18
+ if hasattr(sys.stdin, 'reconfigure') and sys.stdin.isatty():
19
+ sys.stdin.reconfigure(encoding='utf-8', errors='replace')
20
+
21
+ # Also set console output code page to UTF-8
22
+ try:
23
+ import ctypes
24
+ kernel32 = ctypes.windll.kernel32
25
+ kernel32.SetConsoleOutputCP(65001) # UTF-8
26
+ kernel32.SetConsoleCP(65001) # UTF-8 for input too
27
+ except Exception:
28
+ pass # Ignore if this fails
29
+
11
30
  # Import from the same directory
12
31
  from .application import TerminalLLMChat
13
32
  from .logging import setup_bootstrap_logging
14
33
 
15
- # Get version from package metadata (set in pyproject.toml)
16
- try:
17
- __version__ = version("kollabor")
18
- except PackageNotFoundError:
19
- __version__ = "0.4.7" # Fallback for development mode
34
+ def _get_version_from_pyproject() -> str:
35
+ """Read version from pyproject.toml for development mode."""
36
+ try:
37
+ pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
38
+ if pyproject_path.exists():
39
+ content = pyproject_path.read_text()
40
+ for line in content.splitlines():
41
+ if line.startswith("version ="):
42
+ # Extract version from: version = "0.4.10"
43
+ return line.split("=")[1].strip().strip('"').strip("'")
44
+ except Exception:
45
+ pass
46
+ return None # Return None if not found
47
+
48
+ def _is_running_from_source() -> bool:
49
+ """Check if we're running from source (development mode) vs installed package."""
50
+ try:
51
+ # If pyproject.toml exists in parent directory, we're running from source
52
+ pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
53
+ return pyproject_path.exists()
54
+ except Exception:
55
+ return False
56
+
57
+ # Get version: prefer pyproject.toml when running from source, otherwise use installed version
58
+ if _is_running_from_source():
59
+ # Development mode: use pyproject.toml
60
+ __version__ = _get_version_from_pyproject() or "0.0.0"
61
+ else:
62
+ # Production mode: use installed package version
63
+ try:
64
+ __version__ = version("kollabor")
65
+ except PackageNotFoundError:
66
+ __version__ = "0.0.0"
20
67
 
21
68
 
22
69
  def parse_timeout(timeout_str: str) -> int:
@@ -57,8 +104,33 @@ def parse_timeout(timeout_str: str) -> int:
57
104
  raise ValueError(f"Unknown time unit: {unit}")
58
105
 
59
106
 
60
- def parse_arguments():
61
- """Parse command-line arguments.
107
+ def discover_plugin_args() -> list:
108
+ """Discover plugins and collect their CLI arg registrations.
109
+
110
+ Returns:
111
+ List of plugin class types that may register CLI args.
112
+ """
113
+ from pathlib import Path
114
+ from .plugins.discovery import PluginDiscovery
115
+
116
+ # Determine plugins directory (same logic as application.py)
117
+ package_dir = Path(__file__).parent.parent
118
+ plugins_dir = package_dir / "plugins"
119
+ if not plugins_dir.exists():
120
+ plugins_dir = Path.cwd() / "plugins"
121
+
122
+ discovery = PluginDiscovery(plugins_dir)
123
+ plugin_classes = discovery.discover_classes_only()
124
+
125
+ return plugin_classes
126
+
127
+
128
+ def parse_arguments(plugin_classes: list = None, argv: list[str] = None):
129
+ """Parse command-line arguments including plugin-registered args.
130
+
131
+ Args:
132
+ plugin_classes: Optional list of plugin classes for CLI arg registration.
133
+ argv: Optional list of argument strings to parse (defaults to sys.argv).
62
134
 
63
135
  Returns:
64
136
  Parsed arguments namespace
@@ -75,6 +147,13 @@ Examples:
75
147
  kollab --timeout 5min "long task" # Custom timeout (5 minutes)
76
148
  echo "hello" | kollab -p # Pipe input from stdin
77
149
  cat file.txt | kollab -p --timeout 1h # Process file with 1 hour timeout
150
+ kollab --system-prompt my-prompt.md # Use custom system prompt
151
+ kollab --agent lint-editor # Use specific agent
152
+ kollab -a lint-editor # Short form for agent
153
+ kollab --profile claude # Use specific LLM profile
154
+ kollab -a myagent -s coding -s review # Agent with multiple skills
155
+ kollab --agent myagent --skill coding # Agent with skill (long form)
156
+ kollab --reset-config # Reset configs to defaults with updated profiles
78
157
  """,
79
158
  )
80
159
 
@@ -106,7 +185,102 @@ Examples:
106
185
  help="Timeout for pipe mode processing (e.g., 30s, 2min, 1h). Default: 2min",
107
186
  )
108
187
 
109
- return parser.parse_args()
188
+ parser.add_argument(
189
+ "--system-prompt",
190
+ type=str,
191
+ default=None,
192
+ metavar="FILE",
193
+ help="Use a custom system prompt file (e.g., --system-prompt my-prompt.md)",
194
+ )
195
+
196
+ parser.add_argument(
197
+ "-a",
198
+ "--agent",
199
+ type=str,
200
+ default=None,
201
+ metavar="AGENT",
202
+ help="Use a specific agent (e.g., --agent lint-editor)",
203
+ )
204
+
205
+ parser.add_argument(
206
+ "--profile",
207
+ type=str,
208
+ default=None,
209
+ metavar="PROFILE",
210
+ help="Use a specific LLM profile (e.g., --profile claude, --profile openai)",
211
+ )
212
+
213
+ parser.add_argument(
214
+ "--save",
215
+ action="store_true",
216
+ default=False,
217
+ help="Save auto-created profile to config (use with --profile for env-var profiles)",
218
+ )
219
+
220
+ parser.add_argument(
221
+ "-s",
222
+ "--skill",
223
+ type=str,
224
+ action="append",
225
+ default=None,
226
+ metavar="SKILL",
227
+ help="Load a skill for the active agent (can be used multiple times: -s skill1 -s skill2)",
228
+ )
229
+
230
+ parser.add_argument(
231
+ "--font-dir",
232
+ action="store_true",
233
+ help="Print path to bundled Nerd Fonts directory and exit (for use with agg)",
234
+ )
235
+
236
+ parser.add_argument(
237
+ "--reset-config",
238
+ action="store_true",
239
+ help="Reset global and local config.json to defaults with updated profiles",
240
+ )
241
+
242
+ # Register plugin CLI arguments
243
+ if plugin_classes:
244
+ registered_args = set() # Track registered argument names to detect conflicts
245
+ for plugin_class in plugin_classes:
246
+ if hasattr(plugin_class, 'register_cli_args'):
247
+ try:
248
+ # Track arguments before registration
249
+ before_count = len(parser._actions)
250
+ plugin_class.register_cli_args(parser)
251
+ # Check for conflicts by detecting new argument names
252
+ for action in parser._actions[before_count:]:
253
+ for arg_str in action.option_strings:
254
+ if arg_str in registered_args:
255
+ logging.warning(
256
+ f"Plugin {plugin_class.__name__} argument conflict: "
257
+ f"{arg_str} already registered by another plugin"
258
+ )
259
+ registered_args.add(arg_str)
260
+ except Exception as e:
261
+ logging.warning(f"Plugin {plugin_class.__name__} arg registration failed: {e}")
262
+
263
+ return parser.parse_args(argv)
264
+
265
+
266
+ def handle_early_plugin_args(args, plugin_classes: list) -> bool:
267
+ """Let plugins handle args that should exit early.
268
+
269
+ Args:
270
+ args: Parsed command-line arguments.
271
+ plugin_classes: List of plugin classes.
272
+
273
+ Returns:
274
+ True if a plugin requested early exit, False otherwise.
275
+ """
276
+ for plugin_class in plugin_classes:
277
+ if hasattr(plugin_class, 'handle_early_args'):
278
+ try:
279
+ if plugin_class.handle_early_args(args):
280
+ return True # Plugin requested exit
281
+ except Exception as e:
282
+ logging.error(f"Plugin {plugin_class.__name__} early arg handler failed: {e}")
283
+ return False
110
284
 
111
285
 
112
286
  async def async_main() -> None:
@@ -115,7 +289,45 @@ async def async_main() -> None:
115
289
  setup_bootstrap_logging()
116
290
  logger = logging.getLogger(__name__)
117
291
 
118
- args = parse_arguments()
292
+ # Early plugin discovery for CLI args
293
+ plugin_classes = discover_plugin_args()
294
+
295
+ # Parse all args (core + plugin)
296
+ args = parse_arguments(plugin_classes)
297
+
298
+ # Handle early-exit args from plugins (like --capture)
299
+ if handle_early_plugin_args(args, plugin_classes):
300
+ return # Plugin handled it and requested exit
301
+
302
+ # Handle --reset-config: reset configs and exit
303
+ if args.reset_config:
304
+ from .utils.config_utils import initialize_config
305
+
306
+ global_config = Path.home() / ".kollabor-cli" / "config.json"
307
+ local_config = Path.cwd() / ".kollabor-cli" / "config.json"
308
+
309
+ print("Resetting configuration files...")
310
+ initialize_config(force=True)
311
+ print("Configuration reset complete!")
312
+ print(f" - Global config: {global_config}")
313
+ print(f" - Local config: {local_config}")
314
+ return
315
+
316
+ # Handle --font-dir: print font directory and exit
317
+ if args.font_dir:
318
+ try:
319
+ from fonts import get_font_dir
320
+
321
+ print(get_font_dir())
322
+ except ImportError:
323
+ # Fallback for development mode
324
+ font_dir = Path(__file__).parent.parent / "fonts"
325
+ if font_dir.exists():
326
+ print(font_dir)
327
+ else:
328
+ print("Error: fonts directory not found", file=sys.stderr)
329
+ sys.exit(1)
330
+ return
119
331
 
120
332
  # Determine if we're in pipe mode and what the input is
121
333
  piped_input = None
@@ -134,7 +346,14 @@ async def async_main() -> None:
134
346
  app = None
135
347
  try:
136
348
  logger.info("Creating application instance...")
137
- app = TerminalLLMChat()
349
+ app = TerminalLLMChat(
350
+ args=args,
351
+ system_prompt_file=args.system_prompt,
352
+ agent_name=args.agent,
353
+ profile_name=args.profile,
354
+ save_profile=args.save,
355
+ skill_names=args.skill,
356
+ )
138
357
  logger.info("Starting application...")
139
358
 
140
359
  if piped_input: