dtSpark 1.0.5__py3-none-any.whl → 1.0.8__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.0.5
1
+ 1.0.8
@@ -1327,8 +1327,14 @@ class AWSBedrockCLI(AbstractApp):
1327
1327
  # ═══════════════════════════════════════════════════════════════
1328
1328
  # AWS Bedrock Configuration
1329
1329
  # ═══════════════════════════════════════════════════════════════
1330
+ aws_auth_method = "sso"
1330
1331
  aws_profile = "default"
1331
1332
  aws_region = "us-east-1"
1333
+ aws_account_name = ""
1334
+ aws_account_id = ""
1335
+ aws_access_key_id = ""
1336
+ aws_secret_access_key = ""
1337
+ aws_session_token = ""
1332
1338
  enable_cost_tracking = False
1333
1339
 
1334
1340
  if use_aws_bedrock:
@@ -1338,16 +1344,97 @@ class AWSBedrockCLI(AbstractApp):
1338
1344
  cli.print_separator("═")
1339
1345
  cli.console.print()
1340
1346
 
1341
- aws_profile = Prompt.ask(
1342
- "AWS SSO profile name",
1343
- default="default"
1347
+ # Authentication method selection
1348
+ cli.console.print("[bold]Authentication Method[/bold]")
1349
+ cli.console.print()
1350
+ cli.console.print(" [1] SSO Profile - AWS Single Sign-On (recommended for interactive use)")
1351
+ cli.console.print(" [2] IAM Access Keys - Long-lived credentials (recommended for autonomous actions)")
1352
+ cli.console.print(" [3] Session Credentials - Temporary credentials with session token")
1353
+ cli.console.print()
1354
+ cli.console.print("[dim]Note: SSO and session credentials have timeouts which may interrupt[/dim]")
1355
+ cli.console.print("[dim]autonomous actions running on a schedule. IAM access keys are recommended[/dim]")
1356
+ cli.console.print("[dim]for unattended/scheduled operations as they do not expire.[/dim]")
1357
+ cli.console.print()
1358
+
1359
+ auth_method_choices = {
1360
+ "1": "sso",
1361
+ "2": "iam",
1362
+ "3": "session"
1363
+ }
1364
+ auth_method_choice = Prompt.ask(
1365
+ "Select authentication method",
1366
+ choices=["1", "2", "3"],
1367
+ default="1"
1344
1368
  )
1369
+ aws_auth_method = auth_method_choices[auth_method_choice]
1345
1370
 
1371
+ cli.console.print()
1372
+
1373
+ # Region (common to all methods)
1346
1374
  aws_region = Prompt.ask(
1347
1375
  "AWS region",
1348
1376
  default="us-east-1"
1349
1377
  )
1350
1378
 
1379
+ # SSO Profile authentication
1380
+ if aws_auth_method == "sso":
1381
+ cli.console.print()
1382
+ aws_profile = Prompt.ask(
1383
+ "AWS SSO profile name",
1384
+ default="default"
1385
+ )
1386
+
1387
+ # IAM or Session authentication
1388
+ if aws_auth_method in ["iam", "session"]:
1389
+ cli.console.print()
1390
+ cli.console.print("[dim]AWS Account Information (optional, for reference):[/dim]")
1391
+ aws_account_name = Prompt.ask(
1392
+ "AWS account name (friendly name)",
1393
+ default=""
1394
+ )
1395
+ aws_account_id = Prompt.ask(
1396
+ "AWS account ID (12-digit number)",
1397
+ default=""
1398
+ )
1399
+
1400
+ cli.console.print()
1401
+ cli.console.print("[dim]AWS Credentials (stored securely in secrets manager):[/dim]")
1402
+
1403
+ # Access Key ID (not typically considered secret, but mask anyway for consistency)
1404
+ aws_access_key_id_input = Prompt.ask(
1405
+ "AWS access key ID",
1406
+ default=""
1407
+ )
1408
+ if aws_access_key_id_input:
1409
+ secret_manager.set_secret("aws_access_key_id", aws_access_key_id_input)
1410
+ aws_access_key_id = "SEC/aws_access_key_id"
1411
+ cli.print_success("✓ AWS access key ID securely stored in secrets manager")
1412
+
1413
+ # Secret Access Key (sensitive - mask input)
1414
+ aws_secret_access_key_input = Prompt.ask(
1415
+ "AWS secret access key",
1416
+ default="",
1417
+ password=True
1418
+ )
1419
+ if aws_secret_access_key_input:
1420
+ secret_manager.set_secret("aws_secret_access_key", aws_secret_access_key_input)
1421
+ aws_secret_access_key = "SEC/aws_secret_access_key"
1422
+ cli.print_success("✓ AWS secret access key securely stored in secrets manager")
1423
+
1424
+ # Session Token (only for session auth)
1425
+ if aws_auth_method == "session":
1426
+ cli.console.print()
1427
+ aws_session_token_input = Prompt.ask(
1428
+ "AWS session token",
1429
+ default="",
1430
+ password=True
1431
+ )
1432
+ if aws_session_token_input:
1433
+ secret_manager.set_secret("aws_session_token", aws_session_token_input)
1434
+ aws_session_token = "SEC/aws_session_token"
1435
+ cli.print_success("✓ AWS session token securely stored in secrets manager")
1436
+
1437
+ cli.console.print()
1351
1438
  enable_cost_tracking = Confirm.ask(
1352
1439
  "Enable AWS cost tracking?",
1353
1440
  default=False
@@ -1384,7 +1471,8 @@ class AWSBedrockCLI(AbstractApp):
1384
1471
 
1385
1472
  anthropic_api_key_input = Prompt.ask(
1386
1473
  "Anthropic API key (or press Enter to set via environment variable later)",
1387
- default=""
1474
+ default="",
1475
+ password=True
1388
1476
  )
1389
1477
 
1390
1478
  # Store API key in secrets manager if provided
@@ -1459,7 +1547,7 @@ class AWSBedrockCLI(AbstractApp):
1459
1547
  else:
1460
1548
  db_username = "null"
1461
1549
 
1462
- db_password_input = Prompt.ask("Database password (or press Enter for null)", default="")
1550
+ db_password_input = Prompt.ask("Database password (or press Enter for null)", default="", password=True)
1463
1551
 
1464
1552
  # Store database password in secrets manager if provided
1465
1553
  if db_password_input:
@@ -1811,21 +1899,66 @@ class AWSBedrockCLI(AbstractApp):
1811
1899
  )
1812
1900
 
1813
1901
  # AWS settings
1814
- config_content = re.sub(
1815
- r'(sso_profile:\s+)[^\s#]+',
1816
- f'\\g<1>{aws_profile}',
1817
- config_content
1818
- )
1819
- config_content = re.sub(
1820
- r'(region:\s+)[^\s#]+',
1821
- f'\\g<1>{aws_region}',
1822
- config_content
1823
- )
1824
- config_content = re.sub(
1825
- r'(cost_tracking:\s*\n\s+enabled:\s+)(true|false)',
1826
- f'\\g<1>{str(enable_cost_tracking).lower()}',
1827
- config_content
1828
- )
1902
+ if use_aws_bedrock:
1903
+ # Auth method
1904
+ config_content = re.sub(
1905
+ r'(auth_method:\s+)[^\s#]+',
1906
+ f'\\g<1>{aws_auth_method}',
1907
+ config_content
1908
+ )
1909
+ # Region
1910
+ config_content = re.sub(
1911
+ r'(aws_bedrock:\s*\n(?:.*\n)*?\s+region:\s+)[^\s#]+',
1912
+ f'\\g<1>{aws_region}',
1913
+ config_content
1914
+ )
1915
+ # Account name (only if provided)
1916
+ if aws_account_name:
1917
+ config_content = re.sub(
1918
+ r'(account_name:\s+)[^\s#]+',
1919
+ f'\\g<1>{aws_account_name}',
1920
+ config_content
1921
+ )
1922
+ # Account ID (only if provided)
1923
+ if aws_account_id:
1924
+ config_content = re.sub(
1925
+ r'(account_id:\s+)[^\s#]+',
1926
+ f'\\g<1>{aws_account_id}',
1927
+ config_content
1928
+ )
1929
+ # SSO profile
1930
+ config_content = re.sub(
1931
+ r'(sso_profile:\s+)[^\s#]+',
1932
+ f'\\g<1>{aws_profile}',
1933
+ config_content
1934
+ )
1935
+ # Access key ID (only if provided)
1936
+ if aws_access_key_id:
1937
+ config_content = re.sub(
1938
+ r'(access_key_id:\s+)[^\s#]+',
1939
+ f'\\g<1>{aws_access_key_id}',
1940
+ config_content
1941
+ )
1942
+ # Secret access key (only if provided)
1943
+ if aws_secret_access_key:
1944
+ config_content = re.sub(
1945
+ r'(secret_access_key:\s+)[^\s#]+',
1946
+ f'\\g<1>{aws_secret_access_key}',
1947
+ config_content
1948
+ )
1949
+ # Session token (only if provided)
1950
+ if aws_session_token:
1951
+ config_content = re.sub(
1952
+ r'(session_token:\s+)[^\s#]+',
1953
+ f'\\g<1>{aws_session_token}',
1954
+ config_content
1955
+ )
1956
+ # Cost tracking
1957
+ config_content = re.sub(
1958
+ r'(cost_tracking:\s*\n\s+enabled:\s+)(true|false)',
1959
+ f'\\g<1>{str(enable_cost_tracking).lower()}',
1960
+ config_content
1961
+ )
1829
1962
 
1830
1963
  # Ollama settings
1831
1964
  if use_ollama:
@@ -1835,11 +1968,11 @@ class AWSBedrockCLI(AbstractApp):
1835
1968
  config_content
1836
1969
  )
1837
1970
 
1838
- # Anthropic settings
1971
+ # Anthropic settings - update api_key under anthropic section
1839
1972
  if use_anthropic and anthropic_api_key:
1840
1973
  config_content = re.sub(
1841
- r'(api_key:\s+")[^"]*(")',
1842
- f'\\g<1>{anthropic_api_key}\\g<2>',
1974
+ r'(anthropic:\s*\n\s+enabled:\s+(?:true|false)\s*#[^\n]*\n\s+api_key:\s+)[^\s#]+',
1975
+ f'\\g<1>{anthropic_api_key}',
1843
1976
  config_content
1844
1977
  )
1845
1978
 
@@ -1972,6 +2105,13 @@ class AWSBedrockCLI(AbstractApp):
1972
2105
 
1973
2106
  # Display summary of secrets stored
1974
2107
  secrets_stored = []
2108
+ if use_aws_bedrock and aws_auth_method in ["iam", "session"]:
2109
+ if aws_access_key_id.startswith("SEC/"):
2110
+ secrets_stored.append("• AWS access key ID")
2111
+ if aws_secret_access_key.startswith("SEC/"):
2112
+ secrets_stored.append("• AWS secret access key")
2113
+ if aws_session_token.startswith("SEC/"):
2114
+ secrets_stored.append("• AWS session token")
1975
2115
  if use_anthropic and anthropic_api_key.startswith("SEC/"):
1976
2116
  secrets_stored.append("• Anthropic API key")
1977
2117
  if database_type != "sqlite":
@@ -3211,6 +3351,7 @@ class AWSBedrockCLI(AbstractApp):
3211
3351
  self.settings = Settings()
3212
3352
  self.settings.init_settings_readers()
3213
3353
 
3354
+
3214
3355
  # Check if model is locked via configuration
3215
3356
  # Priority 1: Check for mandatory_model (forces model for ALL conversations)
3216
3357
  # Priority 2: Check for bedrock.model_id (legacy configuration)
@@ -83,20 +83,29 @@ llm_providers:
83
83
  enabled: true # Set to false to disable AWS Bedrock
84
84
  region: us-east-1 # AWS region for Bedrock API
85
85
 
86
- # Authentication method: Choose one of the following:
87
- #
88
- # 1. SSO Profile (recommended for interactive use)
86
+ # Authentication method: sso, iam, or session
87
+ # - sso: AWS SSO profile (recommended for interactive use, has session timeout)
88
+ # - iam: IAM access keys (recommended for autonomous actions, no timeout)
89
+ # - session: Temporary session credentials (has session timeout)
90
+ auth_method: sso # Authentication method to use
91
+
92
+ # AWS Account Information (optional, for reference/logging)
93
+ account_name: null # Friendly name for the AWS account
94
+ account_id: null # AWS account ID (12-digit number)
95
+
96
+ # SSO Profile Authentication (used when auth_method: sso)
89
97
  sso_profile: default # AWS SSO profile name
90
- #
91
- # 2. API Keys (for programmatic access, CI/CD, or when SSO is not available)
92
- # Uncomment and set these to use API keys instead of SSO:
93
- # access_key_id: YOUR_ACCESS_KEY_ID
94
- # secret_access_key: YOUR_SECRET_ACCESS_KEY
95
- # session_token: YOUR_SESSION_TOKEN # Optional: for temporary credentials
96
- #
97
- # Note: API keys take precedence over SSO profile if both are configured
98
- #
98
+
99
+ # API Key Authentication (used when auth_method: iam or session)
100
+ # For IAM: Set access_key_id and secret_access_key
101
+ # For Session: Also set session_token
102
+ # Note: Use SEC/<key_name> to reference secrets stored in secrets manager
103
+ access_key_id: null # AWS access key ID
104
+ secret_access_key: null # AWS secret access key (use SEC/aws_secret_access_key)
105
+ session_token: null # Session token for temporary credentials (use SEC/aws_session_token)
106
+
99
107
  # Security Warning: Do NOT commit API keys to version control!
108
+ # Use the setup wizard (--setup) to securely store credentials in secrets manager
100
109
 
101
110
  cost_tracking:
102
111
  enabled: false # Set to true to enable AWS Bedrock cost gathering and display
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dtSpark
3
- Version: 1.0.5
3
+ Version: 1.0.8
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
@@ -4,7 +4,7 @@ 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=jFS_q38a6b0acUjq5B57Co9K03JuDKxw-COi1F255gw,6
7
+ dtSpark/_version.txt,sha256=Mm3V2GQfOZmQ3kLe9QrCnrTJIiYBwKCj_DyUfdO-xl0,6
8
8
  dtSpark/cli_interface.py,sha256=aB-rFAh6o8GOwwecx-rSHEj3W4bmQHp51OPEBtC2CEw,96911
9
9
  dtSpark/conversation_manager.py,sha256=e1aTJpUjxV96G9xrssJl1ujPJMZZwtfufQ8ZDb1WyAI,132270
10
10
  dtSpark/launch.py,sha256=j8XYpmDswWUIzhpMc32E0Fhbhk_qhOQUAwJSpqh37f0,892
@@ -14,7 +14,7 @@ dtSpark/aws/bedrock.py,sha256=j1OknN76LehIMRmoqzx8G3DUSqk2IsO3Fiy5AxQp7Fw,24250
14
14
  dtSpark/aws/costs.py,sha256=eyjigH_Yef7g5cKqhR2QUx_7y4E6-NsLd9-WL52I2vM,11931
15
15
  dtSpark/aws/pricing.py,sha256=pk85e--C5Iz0Y-6iWv_VfENAnrcWQ_9XK0fJQSlk5Xk,23388
16
16
  dtSpark/core/__init__.py,sha256=kORX-9C7L91WxMTMUHXr3Yc09rb6oJNzEH5_KDRdgqM,477
17
- dtSpark/core/application.py,sha256=sPGXH3GNH7VszCaBR8WW8GvSzfQ-7ccAs2U2BT6e15o,154605
17
+ dtSpark/core/application.py,sha256=YJpwCicq-44gvoO7N7pvLgzEL761txRpBho1xaoFybQ,161278
18
18
  dtSpark/core/context_compaction.py,sha256=FWN352EW8n-eWv0MzbOiWIiKcooRxeIAb7611eN-kdY,31898
19
19
  dtSpark/daemon/__init__.py,sha256=xdKEyMsNXgIv6nNerpDcwf94c80n-BFoJFaucWxVF64,3300
20
20
  dtSpark/daemon/__main__.py,sha256=sRNG4RJ-Ejvd-f7OAU5slPOtxVpCoC2OfazdTJro69Q,170
@@ -49,7 +49,7 @@ dtSpark/llm/ollama.py,sha256=r7ePWK1sfSveN6--Ln-Brtrxkli61uJWSrPU0Qy0MZg,20633
49
49
  dtSpark/mcp_integration/__init__.py,sha256=pFw-yTSSJ1yx_ksTe94eq8pBrwDD-5Z-UqSM3VO4deQ,157
50
50
  dtSpark/mcp_integration/manager.py,sha256=b-FfmAas344Ordj6AIdwxCgl0dqPx0WiLIu4Vt4URBA,25149
51
51
  dtSpark/mcp_integration/tool_selector.py,sha256=VYtKXdYEFK_aC22wOWKI0hm9S67DsZtHScI1HpZVnjE,10003
52
- dtSpark/resources/config.yaml.template,sha256=A3goAx9qD9_lqbfB6UqKoIVSDYjo_EZFVP-snqQnwHA,23966
52
+ dtSpark/resources/config.yaml.template,sha256=pp_iPQXUFe4VLgHa6YRE3vIlZpY8SniAGk1o069Nn1c,24578
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=W9xe-HoeQOl4UfGz7xxFm9VldKeoUg79FVd7ZUXQswE,8040
@@ -88,9 +88,9 @@ dtSpark/web/templates/goodbye.html,sha256=4VnUgq6gHCMeJuty51qq8SZuTtpEMMUOsgTBut
88
88
  dtSpark/web/templates/login.html,sha256=OkLf_uzMYhl_o9ER1RQZc8ch6-bCaiOokEhKbeEl8E8,3274
89
89
  dtSpark/web/templates/main_menu.html,sha256=AXVFdEwAUWLFF_hXB7GrutwLTtfCqmuR1Yl5i39y3Co,37871
90
90
  dtSpark/web/templates/new_conversation.html,sha256=hoiQ4Ew3lpFWHTsYza0JiBqqWJs7St7jTusKDnxRR8w,6844
91
- dtspark-1.0.5.dist-info/licenses/LICENSE,sha256=jIuWlmbirwQabTwxfzE7SXT1LpCG-y_GRQ3VnoRTKgo,1101
92
- dtspark-1.0.5.dist-info/METADATA,sha256=JbWx4UUpB2oX3HiBsGS8xvKg0sxil3PQM2Sd_RN478Q,5999
93
- dtspark-1.0.5.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
94
- dtspark-1.0.5.dist-info/entry_points.txt,sha256=IpIwa_a6XY8Z2w7DtgYAhpFHHEbha-zhLkyttWd3zpw,76
95
- dtspark-1.0.5.dist-info/top_level.txt,sha256=x-6lMA6vNuxyDNJGNOKI4dyy7L0kOb9V98I5z46bJVY,8
96
- dtspark-1.0.5.dist-info/RECORD,,
91
+ dtspark-1.0.8.dist-info/licenses/LICENSE,sha256=jIuWlmbirwQabTwxfzE7SXT1LpCG-y_GRQ3VnoRTKgo,1101
92
+ dtspark-1.0.8.dist-info/METADATA,sha256=L5pNPgcWZtKY9m-UTT8PIO2m5r-aVGvrdMhMVN91c4k,5999
93
+ dtspark-1.0.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
94
+ dtspark-1.0.8.dist-info/entry_points.txt,sha256=IpIwa_a6XY8Z2w7DtgYAhpFHHEbha-zhLkyttWd3zpw,76
95
+ dtspark-1.0.8.dist-info/top_level.txt,sha256=x-6lMA6vNuxyDNJGNOKI4dyy7L0kOb9V98I5z46bJVY,8
96
+ dtspark-1.0.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5