dtSpark 1.1.0a6__py3-none-any.whl → 1.1.0a7__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 CHANGED
@@ -1 +1 @@
1
- 1.1.0a6
1
+ 1.1.0a7
dtSpark/cli_interface.py CHANGED
@@ -233,6 +233,7 @@ class CLIInterface:
233
233
  self.model_changing_enabled = True # Can be disabled if model is locked via config
234
234
  self.cost_tracking_enabled = False # Can be enabled via config
235
235
  self.actions_enabled = False # Can be enabled via autonomous_actions.enabled config
236
+ self.new_conversations_allowed = True # Can be disabled via predefined_conversations.allow_new_conversations
236
237
  self._active_status_indicator = None # Track active status indicator for pause/resume
237
238
 
238
239
  def print_splash_screen(self, full_name: str, description: str, version: str): # noqa: S1172
@@ -383,12 +384,13 @@ class CLIInterface:
383
384
  choice_map[str(option_num)] = 'costs'
384
385
  option_num += 1
385
386
 
386
- # Start New Conversation
387
- menu_content.append(" ", style="")
388
- menu_content.append(str(option_num), style="cyan")
389
- menu_content.append(". Start New Conversation\n", style="")
390
- choice_map[str(option_num)] = 'new'
391
- option_num += 1
387
+ # Start New Conversation (only when new conversations are allowed)
388
+ if self.new_conversations_allowed:
389
+ menu_content.append(" ", style="")
390
+ menu_content.append(str(option_num), style="cyan")
391
+ menu_content.append(". Start New Conversation\n", style="")
392
+ choice_map[str(option_num)] = 'new'
393
+ option_num += 1
392
394
 
393
395
  # List and Select Conversation
394
396
  menu_content.append(" ", style="")
@@ -386,6 +386,7 @@ class AWSBedrockCLI(AbstractApp):
386
386
  cost_tracking_enabled = self.settings.get(_SETTING_COST_TRACKING, False)
387
387
  self.cli.cost_tracking_enabled = cost_tracking_enabled
388
388
  self.cli.actions_enabled = self._get_nested_setting('autonomous_actions.enabled', False)
389
+ self.cli.new_conversations_allowed = self._get_nested_setting('predefined_conversations.allow_new_conversations', True)
389
390
 
390
391
  progress.update(task_config, advance=100)
391
392
 
@@ -809,6 +810,7 @@ class AWSBedrockCLI(AbstractApp):
809
810
 
810
811
  # Task 7: Initialise autonomous action scheduler (if enabled)
811
812
  self.actions_enabled = self._get_nested_setting('autonomous_actions.enabled', False)
813
+ self.new_conversations_allowed = self._get_nested_setting('predefined_conversations.allow_new_conversations', True)
812
814
  task_scheduler = progress.add_task("[cyan]Initialising action scheduler...", total=100)
813
815
 
814
816
  if not self.actions_enabled:
@@ -420,6 +420,7 @@ aws_comprehend:
420
420
  #
421
421
  predefined_conversations:
422
422
  enabled: false # Set to true to enable predefined conversations
423
+ allow_new_conversations: true # Set to false to restrict users to predefined/existing conversations only
423
424
 
424
425
  conversations:
425
426
  # Example 1: Code Review Assistant with inline instructions
@@ -177,6 +177,13 @@ async def create_conversation(
177
177
  ConversationDetail for the created conversation
178
178
  """
179
179
  try:
180
+ # Check if new conversations are allowed
181
+ if not getattr(request.app.state, 'new_conversations_allowed', True):
182
+ raise HTTPException(
183
+ status_code=403,
184
+ detail="Creating new conversations is disabled by configuration"
185
+ )
186
+
180
187
  app_instance = request.app.state.app_instance
181
188
  database = app_instance.database
182
189
  conversation_manager = app_instance.conversation_manager
dtSpark/web/server.py CHANGED
@@ -305,6 +305,7 @@ def create_app(
305
305
 
306
306
  # Determine feature flags from app instance
307
307
  actions_enabled = getattr(app_instance, 'actions_enabled', False)
308
+ new_conversations_allowed = getattr(app_instance, 'new_conversations_allowed', True)
308
309
 
309
310
  # Read heartbeat configuration
310
311
  from dtPyAppFramework.settings import Settings as _Settings
@@ -319,6 +320,7 @@ def create_app(
319
320
  templates.env.globals['app_description'] = description()
320
321
  templates.env.globals['agent_name'] = agent_name()
321
322
  templates.env.globals['actions_enabled'] = actions_enabled
323
+ templates.env.globals['new_conversations_allowed'] = new_conversations_allowed
322
324
  templates.env.globals['heartbeat_enabled'] = heartbeat_enabled
323
325
  templates.env.globals['heartbeat_interval_ms'] = heartbeat_interval * 1000
324
326
 
@@ -332,6 +334,7 @@ def create_app(
332
334
  app.state.templates = templates
333
335
  app.state.dark_theme = dark_theme
334
336
  app.state.cost_tracking_enabled = cost_tracking_enabled
337
+ app.state.new_conversations_allowed = new_conversations_allowed
335
338
 
336
339
  # Session dependency
337
340
  async def get_session(session_id: Optional[str] = Cookie(default=None)) -> str:
@@ -538,6 +541,8 @@ def create_app(
538
541
  @app.get("/conversations/new", response_class=HTMLResponse)
539
542
  async def new_conversation_page(request: Request, session_id: str = Depends(get_session)):
540
543
  """Display new conversation creation page."""
544
+ if not new_conversations_allowed:
545
+ return RedirectResponse(url="/conversations", status_code=303)
541
546
  return templates.TemplateResponse(
542
547
  "new_conversation.html",
543
548
  {
@@ -48,11 +48,13 @@
48
48
  <i class="bi bi-list-ul"></i> Conversations
49
49
  </a>
50
50
  </li>
51
+ {% if new_conversations_allowed %}
51
52
  <li class="nav-item">
52
53
  <a class="nav-link" href="/conversations/new">
53
54
  <i class="bi bi-plus-circle"></i> New
54
55
  </a>
55
56
  </li>
57
+ {% endif %}
56
58
  {% if actions_enabled %}
57
59
  <li class="nav-item">
58
60
  <a class="nav-link" href="/actions">
@@ -19,9 +19,11 @@
19
19
  <div class="col-12">
20
20
  <h2 class="mb-4">
21
21
  <i class="bi bi-list-ul"></i> Conversations
22
+ {% if new_conversations_allowed %}
22
23
  <button class="btn btn-primary float-end" onclick="showNewConversationModal()">
23
24
  <i class="bi bi-plus-circle-fill"></i> New Conversation
24
25
  </button>
26
+ {% endif %}
25
27
  </h2>
26
28
  </div>
27
29
  </div>
@@ -69,6 +71,7 @@
69
71
  </div>
70
72
  </div>
71
73
 
74
+ {% if new_conversations_allowed %}
72
75
  <!-- New Conversation Modal -->
73
76
  <div class="modal fade" id="newConversationModal" tabindex="-1">
74
77
  <div class="modal-dialog modal-lg">
@@ -141,6 +144,7 @@
141
144
  </div>
142
145
  </div>
143
146
  </div>
147
+ {% endif %}
144
148
  {% endblock %}
145
149
 
146
150
  {% block extra_scripts %}
@@ -239,9 +239,11 @@
239
239
  <div class="col-12">
240
240
  <h5 class="mb-3"><i class="bi bi-lightning-fill"></i> Quick Actions</h5>
241
241
  <div class="d-grid gap-3 d-md-flex">
242
+ {% if new_conversations_allowed %}
242
243
  <a href="/conversations/new" class="btn btn-primary quick-action-btn flex-fill">
243
244
  <i class="bi bi-plus-circle-fill"></i> Start New Conversation
244
245
  </a>
246
+ {% endif %}
245
247
  <a href="/conversations" class="btn btn-outline-primary quick-action-btn flex-fill">
246
248
  <i class="bi bi-list-ul"></i> View Conversations
247
249
  </a>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dtSpark
3
- Version: 1.1.0a6
3
+ Version: 1.1.0a7
4
4
  Summary: Secure Personal AI Research Kit - Multi-provider LLM CLI/Web interface with MCP tool integration
5
5
  Home-page: https://github.com/digital-thought/dtSpark
6
6
  Author: Matthew Westwood-Hill
@@ -42,7 +42,7 @@ Requires-Dist: httpx>=0.24.0
42
42
  Requires-Dist: aiohttp>=3.8.0
43
43
  Requires-Dist: mcp>=0.9.0
44
44
  Requires-Dist: pyyaml>=6.0
45
- Requires-Dist: dtPyAppFramework>=4.1.2
45
+ Requires-Dist: dtPyAppFramework>=4.2.1
46
46
  Requires-Dist: tiktoken>=0.5.0
47
47
  Requires-Dist: ollama>=0.2.0
48
48
  Requires-Dist: cryptography>=41.0.0
@@ -4,8 +4,8 @@ dtSpark/_full_name.txt,sha256=wsMYXtT12WMrY9gT1JHiKdE4k7H59psECS6cSD07giQ,31
4
4
  dtSpark/_licence.txt,sha256=Mvt5wkOkst8VGlk48vwN3CgHwMHLfmplKSPOUEbTfOw,1071
5
5
  dtSpark/_metadata.yaml,sha256=h3PQd2QsY5yUBzS2b6EueTwkmd57svsbAKcwDVVEfIo,188
6
6
  dtSpark/_name.txt,sha256=kDZC5_a3iMKIPOUvtLXl0C9N5DiOfgUCsecwTUnkJhs,7
7
- dtSpark/_version.txt,sha256=gjNl3xINivNOurU564CJITfMDtfS5cMPFUF0a2kFUEM,7
8
- dtSpark/cli_interface.py,sha256=Aae-vQ-aIaOiON-salTw-eDFo2eGI1-f_EJI6wmOYCo,97412
7
+ dtSpark/_version.txt,sha256=IPCpT1ggRHHZbmAfNBVOsWMbPW5eyBS-kaISKoRcAu4,7
8
+ dtSpark/cli_interface.py,sha256=uNcD8s_h65EJA9xXB_waMfiugwmNYVLdntB2qNn8-Rc,97635
9
9
  dtSpark/conversation_manager.py,sha256=VcfZSwrRuuUbVZa8kQVJjHwG4un5HA0nqYuajsUovoI,132593
10
10
  dtSpark/launch.py,sha256=j8XYpmDswWUIzhpMc32E0Fhbhk_qhOQUAwJSpqh37f0,892
11
11
  dtSpark/aws/__init__.py,sha256=tVuUKO69R3ZOkHQNQo81ukGTdU0OAyYVxkH0DgtwaTM,261
@@ -14,7 +14,7 @@ dtSpark/aws/bedrock.py,sha256=CK0fFYeMv1U0pnkkIFmNqIctBCOqhqHiYkJrYdNFqbA,23177
14
14
  dtSpark/aws/costs.py,sha256=D8fnAL1NGCngA40rHqvdarf9g2TbrP5WxmehkIV5-uQ,12066
15
15
  dtSpark/aws/pricing.py,sha256=y0SBRJoFDq1uXr9v0IYPxCnsHVivI77CD2f28i84d1E,23286
16
16
  dtSpark/core/__init__.py,sha256=kORX-9C7L91WxMTMUHXr3Yc09rb6oJNzEH5_KDRdgqM,477
17
- dtSpark/core/application.py,sha256=NBbxrr7RW0Y_jJjXzgPWN6VJIvRpnfh6ePxkyYtbm0E,171801
17
+ dtSpark/core/application.py,sha256=3Ew5efv4_GFpUZ4iDMSXLpN9TAgFty8JMQQDNtYmkUY,172061
18
18
  dtSpark/core/context_compaction.py,sha256=D-2OlnhHReOcgxIRX80Dnc1SPu-RfiyGgQ-2vQ0XneA,31474
19
19
  dtSpark/daemon/__init__.py,sha256=Dw4lvbnKm7GngU_Iy_F_J4CBFDUZFaVZRXb-bAPd8HY,3495
20
20
  dtSpark/daemon/__main__.py,sha256=sRNG4RJ-Ejvd-f7OAU5slPOtxVpCoC2OfazdTJro69Q,170
@@ -49,7 +49,7 @@ dtSpark/llm/ollama.py,sha256=BQOS6j8nRipoHzPv6gxwzpjucdJ-HLQ3ixNvTEPROKM,20897
49
49
  dtSpark/mcp_integration/__init__.py,sha256=pFw-yTSSJ1yx_ksTe94eq8pBrwDD-5Z-UqSM3VO4deQ,157
50
50
  dtSpark/mcp_integration/manager.py,sha256=yfSymFPXAN-80Rl0M5D-Upb3vIvRq_tvGAI5wVR-IdQ,25241
51
51
  dtSpark/mcp_integration/tool_selector.py,sha256=GHH1pEyi5E2QA2JdfrWFGkZlVucuhSIh4jBJOb54TjU,11029
52
- dtSpark/resources/config.yaml.template,sha256=8N3zeXHSafIlU-UO8IGztrYcTbNwZyrkspVqC_PclGM,27346
52
+ dtSpark/resources/config.yaml.template,sha256=e_GNNZ2FAVDcx1dQ-Mc41SMEPE9M0JrRWdFyRYqstMA,27454
53
53
  dtSpark/safety/__init__.py,sha256=fdcZ4qNbYhH7Un9iKLwNe2GDr_doUmpSgtv-oNS8qPE,460
54
54
  dtSpark/safety/llm_service.py,sha256=N2J9_Od-fGGvk9BkddD6CFd81PrJ03sMjSz6egBDYr4,3820
55
55
  dtSpark/safety/patterns.py,sha256=ZeHuLHrtunZhOHIo3ZG0r9b2e1f9Dp9X_FtJMf8gefE,8467
@@ -65,14 +65,14 @@ dtSpark/tools/builtin.py,sha256=oTdOsxK8x4-DR4wDOYZdBNdZZ7MlqgplM5GLV6OaWQQ,8894
65
65
  dtSpark/web/__init__.py,sha256=5OrzA2yIR9NBf9mlTPnrQ0afMJTBuEgnzxq4QmIYe54,428
66
66
  dtSpark/web/auth.py,sha256=uSIHwJOiklkjZSpLcznwOL1pVQktKeWifZygt068M9Y,4384
67
67
  dtSpark/web/dependencies.py,sha256=ku54-Vb8wYvGVQ8Kluzxj8zm2Re3wDgU5LzFJ0NVIsI,874
68
- dtSpark/web/server.py,sha256=J27-tMSRYhB24vf03e56o3wPVhLCo7QFVbLUn88iGdM,23500
68
+ dtSpark/web/server.py,sha256=j980rjeFNdKbpsmMkpkiCDulaZ6Q_ShmFM1SE_lPsHQ,23857
69
69
  dtSpark/web/session.py,sha256=yoz4yKGqUiYtxc5qoKtyBxNH0JrITSUyzgfu5iTo_Lw,4972
70
70
  dtSpark/web/ssl_utils.py,sha256=PcZazlLeZTqIWeLY3N4xrk7CcxBNQXMcDJ6ou4r6-F4,6652
71
71
  dtSpark/web/web_interface.py,sha256=vLGfinZpQqqVq6E8Xfb4GvpQ4lR6c26R9on94tT_LAk,4681
72
72
  dtSpark/web/endpoints/__init__.py,sha256=uOTiOKx6IDZ2kc0-2GS2hqZD2qX6KtwAhMMZQbS7pWc,356
73
73
  dtSpark/web/endpoints/autonomous_actions.py,sha256=U0YY2sjgS9C3OhmUUKg7kaW4aNWCeFq9amGtkXYrO6k,36727
74
74
  dtSpark/web/endpoints/chat.py,sha256=c5MWZE-SY26Hr0X3DIFU_LQ15m1E-fFZ7hnQbmzXd1w,26041
75
- dtSpark/web/endpoints/conversations.py,sha256=ADEsoZlN9roa_uoazvFMSw_w-gFpXHKd6tJyZuxop2w,13248
75
+ dtSpark/web/endpoints/conversations.py,sha256=bIt10Laq1JaFBqB_3E1b3dTdSBxPyKvzgmi_f9QaDc8,13537
76
76
  dtSpark/web/endpoints/main_menu.py,sha256=shAP7F5zREbs2A7BmZAIzt5LpR83tZHrNXiFdWgsmFg,20621
77
77
  dtSpark/web/endpoints/streaming.py,sha256=qo0ugUWYvJJF5QvvLpuIvFIlVWgOpfPyUK59HeoRgdY,14603
78
78
  dtSpark/web/static/css/dark-theme.css,sha256=vMHtvATXuPFYCKlcwexa5ttq15IIffUWiBchxDqxwvo,7673
@@ -81,16 +81,16 @@ dtSpark/web/static/js/chat.js,sha256=JE1v7i-Bn6arcMQbbLvV1u-bzlRrjPoJwkuTXTsa84o
81
81
  dtSpark/web/static/js/main.js,sha256=0JUuRtVlWxpRgCZoHwM4_tRxyBrNKwTPQmN_meKEI4M,16133
82
82
  dtSpark/web/static/js/sse-client.js,sha256=JZnLDar6j8m7TxuHJ9JQDl7E3LqUiWSbQHt6yMaskPI,9104
83
83
  dtSpark/web/templates/actions.html,sha256=08Pk8aqmNEr3uEQTzmnFklETqd1hUcE8PCtUZVMZJso,18875
84
- dtSpark/web/templates/base.html,sha256=Om8MLeJPAB27CGOELUx63I3ZVtKpTlnrEvKaUsZQImU,4221
84
+ dtSpark/web/templates/base.html,sha256=o0cKOXL68ph7iY6dU4ZHCbqCnG8SWZB7LS5en-tpNMc,4308
85
85
  dtSpark/web/templates/chat.html,sha256=QuyIJOrfKbsLgGH7ELGLBJe_JBnuF73_Sx6EFuMflcc,45104
86
- dtSpark/web/templates/conversations.html,sha256=JFDvjDUyRkO60KwRsO-F3Dzvtyb9Q4wOHSxiibakTJE,13997
86
+ dtSpark/web/templates/conversations.html,sha256=VM7p5v70Zj17XpKVo_9qCruMeGfEu2QnwPSebuZFz8E,14115
87
87
  dtSpark/web/templates/goodbye.html,sha256=ZdEzgP9MD4kMPrLHkg_3wAod2Hfr9hSTRyBq9fB9DV4,2817
88
88
  dtSpark/web/templates/login.html,sha256=OkLf_uzMYhl_o9ER1RQZc8ch6-bCaiOokEhKbeEl8E8,3274
89
- dtSpark/web/templates/main_menu.html,sha256=80NUCu-nzvpMLHGz4gvabjLVmdASldesYtKjvm38Hv0,39120
89
+ dtSpark/web/templates/main_menu.html,sha256=pEJTq642BZ8LeeI5jyuJEU3mfGmGiHlMuMMq2XrBu78,39207
90
90
  dtSpark/web/templates/new_conversation.html,sha256=wL9ZZbn3M8ktEoX7H5n4r6XKSEImtO2aXnuNKsB-pEw,8047
91
- dtspark-1.1.0a6.dist-info/licenses/LICENSE,sha256=jIuWlmbirwQabTwxfzE7SXT1LpCG-y_GRQ3VnoRTKgo,1101
92
- dtspark-1.1.0a6.dist-info/METADATA,sha256=t2IBA-ybdErR_JSrTwcM7Gh6fqrnk7r5UZ1EMHdWpC8,7410
93
- dtspark-1.1.0a6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
94
- dtspark-1.1.0a6.dist-info/entry_points.txt,sha256=IpIwa_a6XY8Z2w7DtgYAhpFHHEbha-zhLkyttWd3zpw,76
95
- dtspark-1.1.0a6.dist-info/top_level.txt,sha256=x-6lMA6vNuxyDNJGNOKI4dyy7L0kOb9V98I5z46bJVY,8
96
- dtspark-1.1.0a6.dist-info/RECORD,,
91
+ dtspark-1.1.0a7.dist-info/licenses/LICENSE,sha256=jIuWlmbirwQabTwxfzE7SXT1LpCG-y_GRQ3VnoRTKgo,1101
92
+ dtspark-1.1.0a7.dist-info/METADATA,sha256=bc_OuMg8SoQVITt27Pba7vDDJ4rFfQ71x2Agb9-u-uk,7410
93
+ dtspark-1.1.0a7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
94
+ dtspark-1.1.0a7.dist-info/entry_points.txt,sha256=IpIwa_a6XY8Z2w7DtgYAhpFHHEbha-zhLkyttWd3zpw,76
95
+ dtspark-1.1.0a7.dist-info/top_level.txt,sha256=x-6lMA6vNuxyDNJGNOKI4dyy7L0kOb9V98I5z46bJVY,8
96
+ dtspark-1.1.0a7.dist-info/RECORD,,