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.
- agents/__init__.py +2 -0
- agents/coder/__init__.py +0 -0
- agents/coder/agent.json +4 -0
- agents/coder/api-integration.md +2150 -0
- agents/coder/cli-pretty.md +765 -0
- agents/coder/code-review.md +1092 -0
- agents/coder/database-design.md +1525 -0
- agents/coder/debugging.md +1102 -0
- agents/coder/dependency-management.md +1397 -0
- agents/coder/git-workflow.md +1099 -0
- agents/coder/refactoring.md +1454 -0
- agents/coder/security-hardening.md +1732 -0
- agents/coder/system_prompt.md +1448 -0
- agents/coder/tdd.md +1367 -0
- agents/creative-writer/__init__.py +0 -0
- agents/creative-writer/agent.json +4 -0
- agents/creative-writer/character-development.md +1852 -0
- agents/creative-writer/dialogue-craft.md +1122 -0
- agents/creative-writer/plot-structure.md +1073 -0
- agents/creative-writer/revision-editing.md +1484 -0
- agents/creative-writer/system_prompt.md +690 -0
- agents/creative-writer/worldbuilding.md +2049 -0
- agents/data-analyst/__init__.py +30 -0
- agents/data-analyst/agent.json +4 -0
- agents/data-analyst/data-visualization.md +992 -0
- agents/data-analyst/exploratory-data-analysis.md +1110 -0
- agents/data-analyst/pandas-data-manipulation.md +1081 -0
- agents/data-analyst/sql-query-optimization.md +881 -0
- agents/data-analyst/statistical-analysis.md +1118 -0
- agents/data-analyst/system_prompt.md +928 -0
- agents/default/__init__.py +0 -0
- agents/default/agent.json +4 -0
- agents/default/dead-code.md +794 -0
- agents/default/explore-agent-system.md +585 -0
- agents/default/system_prompt.md +1448 -0
- agents/kollabor/__init__.py +0 -0
- agents/kollabor/analyze-plugin-lifecycle.md +175 -0
- agents/kollabor/analyze-terminal-rendering.md +388 -0
- agents/kollabor/code-review.md +1092 -0
- agents/kollabor/debug-mcp-integration.md +521 -0
- agents/kollabor/debug-plugin-hooks.md +547 -0
- agents/kollabor/debugging.md +1102 -0
- agents/kollabor/dependency-management.md +1397 -0
- agents/kollabor/git-workflow.md +1099 -0
- agents/kollabor/inspect-llm-conversation.md +148 -0
- agents/kollabor/monitor-event-bus.md +558 -0
- agents/kollabor/profile-performance.md +576 -0
- agents/kollabor/refactoring.md +1454 -0
- agents/kollabor/system_prompt copy.md +1448 -0
- agents/kollabor/system_prompt.md +757 -0
- agents/kollabor/trace-command-execution.md +178 -0
- agents/kollabor/validate-config.md +879 -0
- agents/research/__init__.py +0 -0
- agents/research/agent.json +4 -0
- agents/research/architecture-mapping.md +1099 -0
- agents/research/codebase-analysis.md +1077 -0
- agents/research/dependency-audit.md +1027 -0
- agents/research/performance-profiling.md +1047 -0
- agents/research/security-review.md +1359 -0
- agents/research/system_prompt.md +492 -0
- agents/technical-writer/__init__.py +0 -0
- agents/technical-writer/agent.json +4 -0
- agents/technical-writer/api-documentation.md +2328 -0
- agents/technical-writer/changelog-management.md +1181 -0
- agents/technical-writer/readme-writing.md +1360 -0
- agents/technical-writer/style-guide.md +1410 -0
- agents/technical-writer/system_prompt.md +653 -0
- agents/technical-writer/tutorial-creation.md +1448 -0
- core/__init__.py +0 -2
- core/application.py +343 -88
- core/cli.py +229 -10
- core/commands/menu_renderer.py +463 -59
- core/commands/registry.py +14 -9
- core/commands/system_commands.py +2461 -14
- core/config/loader.py +151 -37
- core/config/service.py +18 -6
- core/events/bus.py +29 -9
- core/events/executor.py +205 -75
- core/events/models.py +27 -8
- core/fullscreen/command_integration.py +20 -24
- core/fullscreen/components/__init__.py +10 -1
- core/fullscreen/components/matrix_components.py +1 -2
- core/fullscreen/components/space_shooter_components.py +654 -0
- core/fullscreen/plugin.py +5 -0
- core/fullscreen/renderer.py +52 -13
- core/fullscreen/session.py +52 -15
- core/io/__init__.py +29 -5
- core/io/buffer_manager.py +6 -1
- core/io/config_status_view.py +7 -29
- core/io/core_status_views.py +267 -347
- core/io/input/__init__.py +25 -0
- core/io/input/command_mode_handler.py +711 -0
- core/io/input/display_controller.py +128 -0
- core/io/input/hook_registrar.py +286 -0
- core/io/input/input_loop_manager.py +421 -0
- core/io/input/key_press_handler.py +502 -0
- core/io/input/modal_controller.py +1011 -0
- core/io/input/paste_processor.py +339 -0
- core/io/input/status_modal_renderer.py +184 -0
- core/io/input_errors.py +5 -1
- core/io/input_handler.py +211 -2452
- core/io/key_parser.py +7 -0
- core/io/layout.py +15 -3
- core/io/message_coordinator.py +111 -2
- core/io/message_renderer.py +129 -4
- core/io/status_renderer.py +147 -607
- core/io/terminal_renderer.py +97 -51
- core/io/terminal_state.py +21 -4
- core/io/visual_effects.py +816 -165
- core/llm/agent_manager.py +1063 -0
- core/llm/api_adapters/__init__.py +44 -0
- core/llm/api_adapters/anthropic_adapter.py +432 -0
- core/llm/api_adapters/base.py +241 -0
- core/llm/api_adapters/openai_adapter.py +326 -0
- core/llm/api_communication_service.py +167 -113
- core/llm/conversation_logger.py +322 -16
- core/llm/conversation_manager.py +556 -30
- core/llm/file_operations_executor.py +84 -32
- core/llm/llm_service.py +934 -103
- core/llm/mcp_integration.py +541 -57
- core/llm/message_display_service.py +135 -18
- core/llm/plugin_sdk.py +1 -2
- core/llm/profile_manager.py +1183 -0
- core/llm/response_parser.py +274 -56
- core/llm/response_processor.py +16 -3
- core/llm/tool_executor.py +6 -1
- core/logging/__init__.py +2 -0
- core/logging/setup.py +34 -6
- core/models/resume.py +54 -0
- core/plugins/__init__.py +4 -2
- core/plugins/base.py +127 -0
- core/plugins/collector.py +23 -161
- core/plugins/discovery.py +37 -3
- core/plugins/factory.py +6 -12
- core/plugins/registry.py +5 -17
- core/ui/config_widgets.py +128 -28
- core/ui/live_modal_renderer.py +2 -1
- core/ui/modal_actions.py +5 -0
- core/ui/modal_overlay_renderer.py +0 -60
- core/ui/modal_renderer.py +268 -7
- core/ui/modal_state_manager.py +29 -4
- core/ui/widgets/base_widget.py +7 -0
- core/updates/__init__.py +10 -0
- core/updates/version_check_service.py +348 -0
- core/updates/version_comparator.py +103 -0
- core/utils/config_utils.py +685 -526
- core/utils/plugin_utils.py +1 -1
- core/utils/session_naming.py +111 -0
- fonts/LICENSE +21 -0
- fonts/README.md +46 -0
- fonts/SymbolsNerdFont-Regular.ttf +0 -0
- fonts/SymbolsNerdFontMono-Regular.ttf +0 -0
- fonts/__init__.py +44 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/METADATA +54 -4
- kollabor-0.4.15.dist-info/RECORD +228 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/top_level.txt +2 -0
- plugins/agent_orchestrator/__init__.py +39 -0
- plugins/agent_orchestrator/activity_monitor.py +181 -0
- plugins/agent_orchestrator/file_attacher.py +77 -0
- plugins/agent_orchestrator/message_injector.py +135 -0
- plugins/agent_orchestrator/models.py +48 -0
- plugins/agent_orchestrator/orchestrator.py +403 -0
- plugins/agent_orchestrator/plugin.py +976 -0
- plugins/agent_orchestrator/xml_parser.py +191 -0
- plugins/agent_orchestrator_plugin.py +9 -0
- plugins/enhanced_input/box_styles.py +1 -0
- plugins/enhanced_input/color_engine.py +19 -4
- plugins/enhanced_input/config.py +2 -2
- plugins/enhanced_input_plugin.py +61 -11
- plugins/fullscreen/__init__.py +6 -2
- plugins/fullscreen/example_plugin.py +1035 -222
- plugins/fullscreen/setup_wizard_plugin.py +592 -0
- plugins/fullscreen/space_shooter_plugin.py +131 -0
- plugins/hook_monitoring_plugin.py +436 -78
- plugins/query_enhancer_plugin.py +66 -30
- plugins/resume_conversation_plugin.py +1494 -0
- plugins/save_conversation_plugin.py +98 -32
- plugins/system_commands_plugin.py +70 -56
- plugins/tmux_plugin.py +154 -78
- plugins/workflow_enforcement_plugin.py +94 -92
- system_prompt/default.md +952 -886
- core/io/input_mode_manager.py +0 -402
- core/io/modal_interaction_handler.py +0 -315
- core/io/raw_input_processor.py +0 -946
- core/storage/__init__.py +0 -5
- core/storage/state_manager.py +0 -84
- core/ui/widget_integration.py +0 -222
- core/utils/key_reader.py +0 -171
- kollabor-0.4.9.dist-info/RECORD +0 -128
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/WHEEL +0 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/entry_points.txt +0 -0
- {kollabor-0.4.9.dist-info → kollabor-0.4.15.dist-info}/licenses/LICENSE +0 -0
|
@@ -8,9 +8,10 @@ import logging
|
|
|
8
8
|
import subprocess
|
|
9
9
|
from datetime import datetime
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import Any, Dict, Optional
|
|
11
|
+
from typing import Any, Dict, Optional, List
|
|
12
12
|
|
|
13
13
|
from core.events.models import CommandDefinition, CommandCategory, CommandMode
|
|
14
|
+
from core.io.visual_effects import AgnosterSegment
|
|
14
15
|
|
|
15
16
|
logger = logging.getLogger(__name__)
|
|
16
17
|
|
|
@@ -18,13 +19,12 @@ logger = logging.getLogger(__name__)
|
|
|
18
19
|
class SaveConversationPlugin:
|
|
19
20
|
"""Plugin for saving conversations to file or clipboard."""
|
|
20
21
|
|
|
21
|
-
def __init__(self, name: str = "save_conversation",
|
|
22
|
+
def __init__(self, name: str = "save_conversation", event_bus=None,
|
|
22
23
|
renderer=None, config=None) -> None:
|
|
23
24
|
"""Initialize the save conversation plugin.
|
|
24
25
|
|
|
25
26
|
Args:
|
|
26
27
|
name: Plugin name (default: "save_conversation")
|
|
27
|
-
state_manager: State manager instance
|
|
28
28
|
event_bus: Event bus instance
|
|
29
29
|
renderer: Terminal renderer instance
|
|
30
30
|
config: Configuration manager instance
|
|
@@ -36,7 +36,6 @@ class SaveConversationPlugin:
|
|
|
36
36
|
self.logger = logger
|
|
37
37
|
|
|
38
38
|
# Store injected dependencies
|
|
39
|
-
self.state_manager = state_manager
|
|
40
39
|
self.event_bus = event_bus
|
|
41
40
|
self.renderer = renderer
|
|
42
41
|
self.config_manager = config
|
|
@@ -69,14 +68,64 @@ class SaveConversationPlugin:
|
|
|
69
68
|
# Register the /save command
|
|
70
69
|
self._register_commands()
|
|
71
70
|
|
|
71
|
+
# Register status view
|
|
72
|
+
await self._register_status_view()
|
|
73
|
+
|
|
72
74
|
self.logger.info("Save conversation plugin initialized successfully")
|
|
73
75
|
|
|
74
76
|
except Exception as e:
|
|
75
77
|
self.logger.error(f"Error initializing save conversation plugin: {e}")
|
|
76
78
|
raise
|
|
77
79
|
|
|
80
|
+
async def _register_status_view(self) -> None:
|
|
81
|
+
"""Register save conversation status view."""
|
|
82
|
+
try:
|
|
83
|
+
if (self.renderer and
|
|
84
|
+
hasattr(self.renderer, 'status_renderer') and
|
|
85
|
+
self.renderer.status_renderer and
|
|
86
|
+
hasattr(self.renderer.status_renderer, 'status_registry') and
|
|
87
|
+
self.renderer.status_renderer.status_registry):
|
|
88
|
+
|
|
89
|
+
from core.io.status_renderer import StatusViewConfig, BlockConfig
|
|
90
|
+
|
|
91
|
+
view = StatusViewConfig(
|
|
92
|
+
name="Save Conversation",
|
|
93
|
+
plugin_source="save_conversation",
|
|
94
|
+
priority=300,
|
|
95
|
+
blocks=[BlockConfig(
|
|
96
|
+
width_fraction=1.0,
|
|
97
|
+
content_provider=self._get_status_content,
|
|
98
|
+
title="Save",
|
|
99
|
+
priority=100
|
|
100
|
+
)],
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
registry = self.renderer.status_renderer.status_registry
|
|
104
|
+
registry.register_status_view("save_conversation", view)
|
|
105
|
+
self.logger.info("Registered 'Save Conversation' status view")
|
|
106
|
+
|
|
107
|
+
except Exception as e:
|
|
108
|
+
self.logger.error(f"Failed to register status view: {e}")
|
|
109
|
+
|
|
110
|
+
def _get_status_content(self) -> List[str]:
|
|
111
|
+
"""Get save conversation status (agnoster style)."""
|
|
112
|
+
try:
|
|
113
|
+
seg = AgnosterSegment()
|
|
114
|
+
seg.add_lime("Save", "dark")
|
|
115
|
+
seg.add_cyan("/save", "dark")
|
|
116
|
+
seg.add_neutral("file | clipboard | json | md", "mid")
|
|
117
|
+
return [seg.render()]
|
|
118
|
+
|
|
119
|
+
except Exception as e:
|
|
120
|
+
self.logger.error(f"Error getting status content: {e}")
|
|
121
|
+
seg = AgnosterSegment()
|
|
122
|
+
seg.add_neutral("Save: Error", "dark")
|
|
123
|
+
return [seg.render()]
|
|
124
|
+
|
|
78
125
|
def _register_commands(self) -> None:
|
|
79
126
|
"""Register all plugin commands."""
|
|
127
|
+
from core.events.models import SubcommandInfo
|
|
128
|
+
|
|
80
129
|
save_command = CommandDefinition(
|
|
81
130
|
name="save",
|
|
82
131
|
description="Save conversation to file or clipboard",
|
|
@@ -85,7 +134,15 @@ class SaveConversationPlugin:
|
|
|
85
134
|
aliases=["export", "transcript"],
|
|
86
135
|
mode=CommandMode.INSTANT,
|
|
87
136
|
category=CommandCategory.CONVERSATION,
|
|
88
|
-
icon="[SAVE]"
|
|
137
|
+
icon="[SAVE]",
|
|
138
|
+
subcommands=[
|
|
139
|
+
SubcommandInfo("transcript", "[clipboard|both|local]", "Plain text format"),
|
|
140
|
+
SubcommandInfo("markdown", "[clipboard|both|local]", "Markdown format"),
|
|
141
|
+
SubcommandInfo("jsonl", "[clipboard|both|local]", "JSON lines format"),
|
|
142
|
+
SubcommandInfo("clipboard", "", "Copy to clipboard (default format)"),
|
|
143
|
+
SubcommandInfo("both", "", "Save to file and clipboard"),
|
|
144
|
+
SubcommandInfo("local", "", "Save to current directory"),
|
|
145
|
+
]
|
|
89
146
|
)
|
|
90
147
|
|
|
91
148
|
self.command_registry.register_command(save_command)
|
|
@@ -114,18 +171,30 @@ class SaveConversationPlugin:
|
|
|
114
171
|
output_dir = self.config.get("plugins.save_conversation.output_directory", "logs/transcripts")
|
|
115
172
|
|
|
116
173
|
# Parse command arguments
|
|
117
|
-
if
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
save_to = args[1].lower()
|
|
174
|
+
# Smart detection: if first arg is a destination, use default format
|
|
175
|
+
valid_formats = ["transcript", "markdown", "jsonl", "raw"]
|
|
176
|
+
valid_destinations = ["file", "clipboard", "both", "local"]
|
|
121
177
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
178
|
+
if len(args) >= 1:
|
|
179
|
+
first_arg = args[0].lower()
|
|
180
|
+
if first_arg in valid_destinations:
|
|
181
|
+
# First arg is destination, keep default format
|
|
182
|
+
save_to = first_arg
|
|
183
|
+
elif first_arg in valid_formats:
|
|
184
|
+
save_format = first_arg
|
|
185
|
+
if len(args) >= 2:
|
|
186
|
+
save_to = args[1].lower()
|
|
187
|
+
else:
|
|
188
|
+
return f"Error: Invalid argument '{first_arg}'. Use format ({', '.join(valid_formats)}) or destination ({', '.join(valid_destinations)})"
|
|
125
189
|
|
|
126
190
|
# Validate destination
|
|
127
|
-
if save_to not in
|
|
128
|
-
return f"Error: Invalid destination '{save_to}'. Use:
|
|
191
|
+
if save_to not in valid_destinations:
|
|
192
|
+
return f"Error: Invalid destination '{save_to}'. Use: {', '.join(valid_destinations)}"
|
|
193
|
+
|
|
194
|
+
# Local saves to current working directory
|
|
195
|
+
if save_to == "local":
|
|
196
|
+
output_dir = "."
|
|
197
|
+
save_to = "file"
|
|
129
198
|
|
|
130
199
|
# Get conversation content
|
|
131
200
|
if not self.llm_service:
|
|
@@ -324,12 +393,13 @@ class SaveConversationPlugin:
|
|
|
324
393
|
"content": msg.get("content")
|
|
325
394
|
})
|
|
326
395
|
|
|
327
|
-
# Get model info from
|
|
396
|
+
# Get model info from active profile
|
|
328
397
|
model = "unknown"
|
|
329
398
|
temperature = 0.7
|
|
330
|
-
if self.
|
|
331
|
-
|
|
332
|
-
|
|
399
|
+
if self.llm_service and self.llm_service.profile_manager:
|
|
400
|
+
profile = self.llm_service.profile_manager.get_active_profile()
|
|
401
|
+
model = profile.get_model() or "unknown"
|
|
402
|
+
temperature = profile.get_temperature()
|
|
333
403
|
|
|
334
404
|
payload = {
|
|
335
405
|
"model": model,
|
|
@@ -358,13 +428,18 @@ class SaveConversationPlugin:
|
|
|
358
428
|
"""
|
|
359
429
|
# Create output directory
|
|
360
430
|
from core.utils.config_utils import get_config_directory
|
|
361
|
-
config_dir = get_config_directory()
|
|
362
431
|
|
|
363
|
-
# Handle
|
|
364
|
-
if
|
|
365
|
-
|
|
366
|
-
|
|
432
|
+
# Handle paths
|
|
433
|
+
if output_dir == ".":
|
|
434
|
+
# Local: save to current working directory
|
|
435
|
+
save_dir = Path.cwd()
|
|
436
|
+
elif output_dir.startswith('/'):
|
|
437
|
+
# Absolute path
|
|
367
438
|
save_dir = Path(output_dir)
|
|
439
|
+
else:
|
|
440
|
+
# Relative path under config directory
|
|
441
|
+
config_dir = get_config_directory()
|
|
442
|
+
save_dir = config_dir / output_dir
|
|
368
443
|
|
|
369
444
|
save_dir.mkdir(parents=True, exist_ok=True)
|
|
370
445
|
|
|
@@ -475,17 +550,8 @@ class SaveConversationPlugin:
|
|
|
475
550
|
|
|
476
551
|
async def register_hooks(self) -> None:
|
|
477
552
|
"""Register event hooks for the plugin."""
|
|
478
|
-
# This plugin doesn't need hooks, just commands
|
|
479
553
|
pass
|
|
480
554
|
|
|
481
|
-
def get_status_line(self) -> str:
|
|
482
|
-
"""Get status line information for the plugin.
|
|
483
|
-
|
|
484
|
-
Returns:
|
|
485
|
-
Status line string.
|
|
486
|
-
"""
|
|
487
|
-
return "Save: /save"
|
|
488
|
-
|
|
489
555
|
@staticmethod
|
|
490
556
|
def get_default_config() -> Dict[str, Any]:
|
|
491
557
|
"""Get default configuration for save conversation plugin."""
|
|
@@ -1,82 +1,99 @@
|
|
|
1
|
-
"""System commands plugin for core
|
|
1
|
+
"""System commands plugin - provides status view for core system commands."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
-
from typing import Dict, Any
|
|
5
|
-
|
|
4
|
+
from typing import Dict, Any, List
|
|
5
|
+
|
|
6
|
+
from core.io.visual_effects import AgnosterSegment
|
|
6
7
|
|
|
7
8
|
logger = logging.getLogger(__name__)
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class SystemCommandsPlugin:
|
|
11
|
-
"""Plugin
|
|
12
|
+
"""Plugin that provides status view for system commands.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
Note: System commands (/help, /config, /status, etc.) are registered
|
|
15
|
+
by core application in _initialize_slash_commands(). This plugin
|
|
16
|
+
only provides the status view display.
|
|
15
17
|
"""
|
|
16
18
|
|
|
17
|
-
def __init__(self
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
def __init__(self, name: str = "system_commands",
|
|
20
|
+
event_bus=None, renderer=None, config=None) -> None:
|
|
21
|
+
"""Initialize the system commands plugin.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
name: Plugin name.
|
|
25
|
+
event_bus: Event bus (unused).
|
|
26
|
+
renderer: Terminal renderer.
|
|
27
|
+
config: Configuration manager (unused).
|
|
28
|
+
"""
|
|
29
|
+
self.name = name
|
|
20
30
|
self.version = "1.0.0"
|
|
21
|
-
self.description = "
|
|
31
|
+
self.description = "Status view for core system commands"
|
|
22
32
|
self.enabled = True
|
|
23
|
-
self.
|
|
33
|
+
self.renderer = renderer
|
|
24
34
|
self.logger = logger
|
|
25
35
|
|
|
26
36
|
async def initialize(self, event_bus, config, **kwargs) -> None:
|
|
27
|
-
"""Initialize the plugin
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
event_bus: Application event bus.
|
|
31
|
-
config: Configuration manager.
|
|
32
|
-
**kwargs: Additional initialization parameters.
|
|
33
|
-
"""
|
|
37
|
+
"""Initialize the plugin."""
|
|
34
38
|
try:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if not command_registry:
|
|
38
|
-
self.logger.warning("No command registry provided, system commands not registered")
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
# Create and initialize system commands
|
|
42
|
-
self.system_commands = CoreSystemCommandsPlugin(
|
|
43
|
-
command_registry=command_registry,
|
|
44
|
-
event_bus=event_bus,
|
|
45
|
-
config_manager=config
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
# Register all system commands
|
|
49
|
-
self.system_commands.register_commands()
|
|
50
|
-
|
|
39
|
+
self.renderer = kwargs.get('renderer')
|
|
40
|
+
await self._register_status_view()
|
|
51
41
|
self.logger.info("System commands plugin initialized successfully")
|
|
52
|
-
|
|
53
42
|
except Exception as e:
|
|
54
43
|
self.logger.error(f"Error initializing system commands plugin: {e}")
|
|
55
44
|
raise
|
|
56
45
|
|
|
57
|
-
async def
|
|
58
|
-
"""
|
|
46
|
+
async def _register_status_view(self) -> None:
|
|
47
|
+
"""Register system commands status view."""
|
|
59
48
|
try:
|
|
60
|
-
if self.
|
|
61
|
-
|
|
62
|
-
self.
|
|
49
|
+
if (self.renderer and
|
|
50
|
+
hasattr(self.renderer, 'status_renderer') and
|
|
51
|
+
self.renderer.status_renderer and
|
|
52
|
+
hasattr(self.renderer.status_renderer, 'status_registry') and
|
|
53
|
+
self.renderer.status_renderer.status_registry):
|
|
54
|
+
|
|
55
|
+
from core.io.status_renderer import StatusViewConfig, BlockConfig
|
|
56
|
+
|
|
57
|
+
view = StatusViewConfig(
|
|
58
|
+
name="System Commands",
|
|
59
|
+
plugin_source="system_commands",
|
|
60
|
+
priority=400,
|
|
61
|
+
blocks=[BlockConfig(
|
|
62
|
+
width_fraction=1.0,
|
|
63
|
+
content_provider=self._get_status_content,
|
|
64
|
+
title="System Commands",
|
|
65
|
+
priority=100
|
|
66
|
+
)],
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
registry = self.renderer.status_renderer.status_registry
|
|
70
|
+
registry.register_status_view("system_commands", view)
|
|
71
|
+
self.logger.info("Registered 'System Commands' status view")
|
|
63
72
|
|
|
64
73
|
except Exception as e:
|
|
65
|
-
self.logger.error(f"
|
|
74
|
+
self.logger.error(f"Failed to register status view: {e}")
|
|
66
75
|
|
|
67
|
-
def
|
|
68
|
-
"""Get
|
|
76
|
+
def _get_status_content(self) -> List[str]:
|
|
77
|
+
"""Get system commands status (agnoster style)."""
|
|
78
|
+
try:
|
|
79
|
+
seg = AgnosterSegment()
|
|
80
|
+
seg.add_lime("Commands", "dark")
|
|
81
|
+
seg.add_cyan("Active", "dark")
|
|
82
|
+
seg.add_neutral("/help /config /status", "mid")
|
|
83
|
+
return [seg.render()]
|
|
84
|
+
except Exception as e:
|
|
85
|
+
self.logger.error(f"Error getting status content: {e}")
|
|
86
|
+
seg = AgnosterSegment()
|
|
87
|
+
seg.add_neutral("Commands: Error", "dark")
|
|
88
|
+
return [seg.render()]
|
|
69
89
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
""
|
|
73
|
-
if self.system_commands:
|
|
74
|
-
return "System commands active"
|
|
75
|
-
return "System commands inactive"
|
|
90
|
+
async def shutdown(self) -> None:
|
|
91
|
+
"""Shutdown the plugin."""
|
|
92
|
+
self.logger.info("System commands plugin shutdown completed")
|
|
76
93
|
|
|
77
94
|
@staticmethod
|
|
78
95
|
def get_default_config() -> Dict[str, Any]:
|
|
79
|
-
"""Get default configuration
|
|
96
|
+
"""Get default configuration."""
|
|
80
97
|
return {
|
|
81
98
|
"plugins": {
|
|
82
99
|
"system_commands": {
|
|
@@ -84,10 +101,7 @@ class SystemCommandsPlugin:
|
|
|
84
101
|
}
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
|
-
|
|
88
|
-
async def register_hooks(self) -> None:
|
|
89
|
-
"""Register event hooks for the plugin.
|
|
90
104
|
|
|
91
|
-
|
|
92
|
-
"""
|
|
93
|
-
pass
|
|
105
|
+
async def register_hooks(self) -> None:
|
|
106
|
+
"""Register event hooks (none needed)."""
|
|
107
|
+
pass
|