dtSpark 1.1.0a2__py3-none-any.whl → 1.1.0a6__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.
- dtSpark/_version.txt +1 -1
- dtSpark/aws/authentication.py +1 -1
- dtSpark/aws/bedrock.py +238 -239
- dtSpark/aws/costs.py +9 -5
- dtSpark/aws/pricing.py +25 -21
- dtSpark/cli_interface.py +69 -62
- dtSpark/conversation_manager.py +54 -47
- dtSpark/core/application.py +151 -111
- dtSpark/core/context_compaction.py +241 -226
- dtSpark/daemon/__init__.py +36 -22
- dtSpark/daemon/action_monitor.py +46 -17
- dtSpark/daemon/daemon_app.py +126 -104
- dtSpark/daemon/daemon_manager.py +59 -23
- dtSpark/daemon/pid_file.py +3 -2
- dtSpark/database/autonomous_actions.py +3 -0
- dtSpark/database/credential_prompt.py +52 -54
- dtSpark/files/manager.py +6 -12
- dtSpark/limits/__init__.py +1 -1
- dtSpark/limits/tokens.py +2 -2
- dtSpark/llm/anthropic_direct.py +246 -141
- dtSpark/llm/ollama.py +3 -1
- dtSpark/mcp_integration/manager.py +4 -4
- dtSpark/mcp_integration/tool_selector.py +83 -77
- dtSpark/resources/config.yaml.template +10 -0
- dtSpark/safety/patterns.py +45 -46
- dtSpark/safety/prompt_inspector.py +8 -1
- dtSpark/scheduler/creation_tools.py +273 -181
- dtSpark/scheduler/executor.py +503 -221
- dtSpark/tools/builtin.py +70 -53
- dtSpark/web/endpoints/autonomous_actions.py +12 -9
- dtSpark/web/endpoints/chat.py +18 -6
- dtSpark/web/endpoints/conversations.py +57 -17
- dtSpark/web/endpoints/main_menu.py +132 -105
- dtSpark/web/endpoints/streaming.py +2 -2
- dtSpark/web/server.py +65 -5
- dtSpark/web/ssl_utils.py +3 -3
- dtSpark/web/static/css/dark-theme.css +8 -29
- dtSpark/web/static/js/actions.js +2 -1
- dtSpark/web/static/js/chat.js +6 -8
- dtSpark/web/static/js/main.js +8 -8
- dtSpark/web/static/js/sse-client.js +130 -122
- dtSpark/web/templates/actions.html +5 -5
- dtSpark/web/templates/base.html +13 -0
- dtSpark/web/templates/chat.html +52 -50
- dtSpark/web/templates/conversations.html +50 -22
- dtSpark/web/templates/goodbye.html +2 -2
- dtSpark/web/templates/main_menu.html +17 -17
- dtSpark/web/templates/new_conversation.html +51 -20
- dtSpark/web/web_interface.py +2 -2
- {dtspark-1.1.0a2.dist-info → dtspark-1.1.0a6.dist-info}/METADATA +9 -2
- dtspark-1.1.0a6.dist-info/RECORD +96 -0
- dtspark-1.1.0a2.dist-info/RECORD +0 -96
- {dtspark-1.1.0a2.dist-info → dtspark-1.1.0a6.dist-info}/WHEEL +0 -0
- {dtspark-1.1.0a2.dist-info → dtspark-1.1.0a6.dist-info}/entry_points.txt +0 -0
- {dtspark-1.1.0a2.dist-info → dtspark-1.1.0a6.dist-info}/licenses/LICENSE +0 -0
- {dtspark-1.1.0a2.dist-info → dtspark-1.1.0a6.dist-info}/top_level.txt +0 -0
|
@@ -64,6 +64,10 @@ interface:
|
|
|
64
64
|
cert_file: certs/ssl_cert.pem # Path to SSL certificate file
|
|
65
65
|
key_file: certs/ssl_key.pem # Path to SSL private key file
|
|
66
66
|
auto_open_browser: true # Automatically open web browser when server starts
|
|
67
|
+
browser_heartbeat:
|
|
68
|
+
enabled: true # Enable browser heartbeat monitoring (auto-shutdown when browser closes)
|
|
69
|
+
interval_seconds: 15 # How often browser sends heartbeat ping to server
|
|
70
|
+
timeout_seconds: 60 # Shutdown application after this many seconds without a heartbeat
|
|
67
71
|
|
|
68
72
|
# LLM Provider Configuration
|
|
69
73
|
llm_providers:
|
|
@@ -660,6 +664,12 @@ tool_permissions:
|
|
|
660
664
|
# Note: When reverted to false, users will be prompted again for tools
|
|
661
665
|
# that were auto-approved (since permissions weren't stored)
|
|
662
666
|
|
|
667
|
+
# Autonomous Actions Configuration
|
|
668
|
+
# Controls whether autonomous action creation and scheduling is available
|
|
669
|
+
autonomous_actions:
|
|
670
|
+
enabled: false # Set to true to enable autonomous action creation and scheduling
|
|
671
|
+
# When disabled, action-related menus and pages are hidden from both Web UI and CLI
|
|
672
|
+
|
|
663
673
|
# Daemon Configuration
|
|
664
674
|
# Background process for executing autonomous actions independently
|
|
665
675
|
daemon:
|
dtSpark/safety/patterns.py
CHANGED
|
@@ -176,54 +176,53 @@ class PatternMatcher:
|
|
|
176
176
|
'detected_patterns': []
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
179
|
+
self._scan_check(results, config, 'check_prompt_injection', True,
|
|
180
|
+
self.check_prompt_injection, text, 'prompt_injection', 'high')
|
|
181
|
+
self._scan_check(results, config, 'check_jailbreak', True,
|
|
182
|
+
self.check_jailbreak, text, 'jailbreak', 'high')
|
|
183
|
+
self._scan_check(results, config, 'check_code_injection', True,
|
|
184
|
+
self.check_code_injection, text, 'code_injection', 'critical')
|
|
185
|
+
self._scan_check(results, config, 'check_pii', False,
|
|
186
|
+
self.check_pii, text, 'pii_exposure', 'medium')
|
|
187
|
+
self._scan_check_excessive_length(results, config, text)
|
|
188
|
+
self._scan_check_repetition(results, text)
|
|
189
|
+
|
|
190
|
+
return results
|
|
191
|
+
|
|
192
|
+
@staticmethod
|
|
193
|
+
def _escalate_severity(current: str, proposed: str) -> str:
|
|
194
|
+
"""Return the more severe of two severity levels."""
|
|
195
|
+
order = ['none', 'low', 'medium', 'high', 'critical']
|
|
196
|
+
return proposed if order.index(proposed) > order.index(current) else current
|
|
197
|
+
|
|
198
|
+
def _scan_check(self, results: Dict, config: Dict, config_key: str,
|
|
199
|
+
default_enabled: bool, check_fn, text: str,
|
|
200
|
+
violation_name: str, severity: str) -> None:
|
|
201
|
+
"""Run a single pattern check and update results if a violation is detected."""
|
|
202
|
+
if not config.get(config_key, default_enabled):
|
|
203
|
+
return
|
|
204
|
+
detected, pattern = check_fn(text)
|
|
205
|
+
if detected:
|
|
206
|
+
results['violations'].append(violation_name)
|
|
207
|
+
results['detected_patterns'].append(pattern)
|
|
208
|
+
results['severity'] = self._escalate_severity(results['severity'], severity)
|
|
209
|
+
|
|
210
|
+
@staticmethod
|
|
211
|
+
def _scan_check_excessive_length(results: Dict, config: Dict, text: str) -> None:
|
|
212
|
+
"""Check for excessive prompt length and update results."""
|
|
213
|
+
if not config.get('check_excessive_length', True):
|
|
214
|
+
return
|
|
215
|
+
max_length = config.get('max_prompt_length', 50000)
|
|
216
|
+
if len(text) > max_length:
|
|
217
|
+
results['violations'].append('excessive_length')
|
|
218
|
+
results['detected_patterns'].append(f'Length: {len(text)} > {max_length}')
|
|
219
|
+
if results['severity'] == 'none':
|
|
220
|
+
results['severity'] = 'medium'
|
|
221
|
+
|
|
222
|
+
def _scan_check_repetition(self, results: Dict, text: str) -> None:
|
|
223
|
+
"""Check for excessive repetition and update results."""
|
|
223
224
|
if self.check_excessive_repetition(text):
|
|
224
225
|
results['violations'].append('excessive_repetition')
|
|
225
226
|
results['detected_patterns'].append('Detected repetitive pattern')
|
|
226
227
|
if results['severity'] == 'none':
|
|
227
228
|
results['severity'] = 'low'
|
|
228
|
-
|
|
229
|
-
return results
|
|
@@ -126,6 +126,13 @@ class PromptInspector:
|
|
|
126
126
|
|
|
127
127
|
# Log violation if configured
|
|
128
128
|
if self.violation_logger and result.violation_types:
|
|
129
|
+
if result.blocked:
|
|
130
|
+
action_taken = 'blocked'
|
|
131
|
+
elif result.needs_confirmation:
|
|
132
|
+
action_taken = 'warned'
|
|
133
|
+
else:
|
|
134
|
+
action_taken = 'logged'
|
|
135
|
+
|
|
129
136
|
self.violation_logger.log_violation(
|
|
130
137
|
user_guid=user_guid,
|
|
131
138
|
conversation_id=conversation_id,
|
|
@@ -133,7 +140,7 @@ class PromptInspector:
|
|
|
133
140
|
severity=result.severity,
|
|
134
141
|
prompt_snippet=prompt[:500],
|
|
135
142
|
detection_method=result.inspection_method,
|
|
136
|
-
action_taken=
|
|
143
|
+
action_taken=action_taken,
|
|
137
144
|
confidence_score=result.confidence
|
|
138
145
|
)
|
|
139
146
|
|