Skip to content

Commit 01c3e8c

Browse files
authored
Merge pull request #110 from SentriusLLC/updates_1225
Apply features
2 parents cfc1159 + cf7a586 commit 01c3e8c

File tree

192 files changed

+46562
-378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+46562
-378
lines changed

.gcp.env

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
SENTRIUS_VERSION=1.0.48
2-
SENTRIUS_SSH_VERSION=1.0.7
3-
SENTRIUS_KEYCLOAK_VERSION=1.0.10
4-
SENTRIUS_AGENT_VERSION=1.0.19
5-
SENTRIUS_AI_AGENT_VERSION=1.0.0
6-
LLMPROXY_VERSION=1.0.0
7-
LAUNCHER_VERSION=1.0.0
8-
AGENTPROXY_VERSION=1.0.0
9-
SSHPROXY_VERSION=1.0.0
10-
RDPPROXY_VERSION=1.0.0
11-
GITHUB_MCP_VERSION=1.0.0
1+
SENTRIUS_VERSION=1.1.51
2+
SENTRIUS_SSH_VERSION=1.1.10
3+
SENTRIUS_KEYCLOAK_VERSION=1.1.13
4+
SENTRIUS_AGENT_VERSION=1.1.22
5+
SENTRIUS_AI_AGENT_VERSION=1.1.3
6+
LLMPROXY_VERSION=1.1.3
7+
LAUNCHER_VERSION=1.1.3
8+
AGENTPROXY_VERSION=1.1.3
9+
SSHPROXY_VERSION=1.1.3
10+
RDPPROXY_VERSION=1.1.3
11+
GITHUB_MCP_VERSION=1.1.3
12+
PROMPT_ADVISOR_VERSION=1.1.6
13+
MONITORING_AGENT_VERSION=1.1.21

.gcp.env.bak

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
SENTRIUS_VERSION=1.0.47
2-
SENTRIUS_SSH_VERSION=1.0.6
3-
SENTRIUS_KEYCLOAK_VERSION=1.0.9
4-
SENTRIUS_AGENT_VERSION=1.0.18
1+
SENTRIUS_VERSION=1.1.50
2+
SENTRIUS_SSH_VERSION=1.1.9
3+
SENTRIUS_KEYCLOAK_VERSION=1.1.12
4+
SENTRIUS_AGENT_VERSION=1.1.21
5+
SENTRIUS_AI_AGENT_VERSION=1.1.2
6+
LLMPROXY_VERSION=1.1.2
7+
LAUNCHER_VERSION=1.1.2
8+
AGENTPROXY_VERSION=1.1.2
9+
SSHPROXY_VERSION=1.1.2
10+
RDPPROXY_VERSION=1.1.2
11+
GITHUB_MCP_VERSION=1.1.2
12+
PROMPT_ADVISOR_VERSION=1.1.5
13+
MONITORING_AGENT_VERSION=1.1.20

TunerPro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit af0edb508b8d5f69df1ef3530a69b9ed5503bc14

agent-proxy/src/main/resources/java-agents.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ description: >
66
trust_score:
77
minimum: 80
88
marginal_threshold: 50
9+
weightings:
10+
identity: 0.3
11+
provenance: 0.2
12+
runtime: 0.3
13+
behavior: 0.2
914

1015
capabilities:
1116
- id: terminal-log-access

analytics/src/main/java/io/sentrius/agent/analysis/agents/automation/AutomationSuggestionAnalyzer.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class AutomationSuggestionAnalyzer {
4242
private final AutomationSuggestionRepository suggestionRepository;
4343
private final IntegrationSecurityTokenService integrationSecurityTokenService;
4444
private final LLMService llmService;
45+
private final io.sentrius.sso.core.config.SystemOptions systemOptions;
4546

4647
private static final int MIN_PATTERN_FREQUENCY = 3;
4748
private static final int MIN_COMMAND_SEQUENCE_LENGTH = 2;
@@ -186,8 +187,8 @@ private void generateAutomationSuggestion(
186187
int frequency
187188
) throws JsonProcessingException, ZtatException {
188189
var token = integrationSecurityTokenService
189-
.findByConnectionType("openai")
190-
.stream().findFirst().orElse(null);
190+
.selectToken(systemOptions.getDefaultLlmProvider())
191+
.orElse(null);
191192

192193
if (token == null) return;
193194

@@ -218,8 +219,8 @@ private void generateRdpAutomationSuggestion(
218219
int frequency
219220
) throws JsonProcessingException, ZtatException {
220221
var token = integrationSecurityTokenService
221-
.findByConnectionType("openai")
222-
.stream().findFirst().orElse(null);
222+
.selectToken(systemOptions.getDefaultLlmProvider())
223+
.orElse(null);
223224

224225
if (token == null) return;
225226

@@ -448,7 +449,7 @@ private String decodeCommand(String encoded) {
448449

449450
private boolean isLLMAvailable() {
450451
return integrationSecurityTokenService
451-
.findByConnectionType("openai")
452-
.stream().findFirst().isPresent();
452+
.selectToken(systemOptions.getDefaultLlmProvider())
453+
.isPresent();
453454
}
454455
}

analytics/src/main/java/io/sentrius/agent/analysis/agents/sessions/RdpSessionSummarizationAgent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ private String analyzeScreenshots(String sessionId, List<RdpSessionScreenshot> s
194194
private String getLLMAnalysis(List<RdpSessionScreenshot> screenshots) {
195195
try {
196196
// Get a token for LLM service
197-
var token = integrationSecurityTokenService.findByConnectionType("openai")
198-
.stream().findFirst().orElse(null);
197+
var token = integrationSecurityTokenService.selectToken("openai")
198+
.orElse(null);
199199
if (token == null) {
200200
log.debug("No OpenAI token available for vision analysis");
201201
return null;

analytics/src/main/java/io/sentrius/agent/analysis/agents/sessions/SshSessionSummarizationAgent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,8 @@ private void createBasicSummary(SessionLog sessionLog, List<TerminalLogs> termin
230230
*/
231231
private boolean isLLMAvailable() {
232232
try {
233-
var token = integrationSecurityTokenService.findByConnectionType("openai")
234-
.stream().findFirst().orElse(null);
235-
return token != null;
233+
return integrationSecurityTokenService.selectToken("openai")
234+
.isPresent();
236235
} catch (Exception e) {
237236
log.debug("Error checking LLM availability", e);
238237
return false;
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
package io.sentrius.sso.controllers.api;
2+
3+
import io.sentrius.sso.core.annotations.LimitAccess;
4+
import io.sentrius.sso.core.config.SystemOptions;
5+
import io.sentrius.sso.core.config.ThreadSafeDynamicPropertiesService;
6+
import io.sentrius.sso.core.controllers.BaseController;
7+
import io.sentrius.sso.core.model.security.enums.ApplicationAccessEnum;
8+
import io.sentrius.sso.core.services.ErrorOutputService;
9+
import io.sentrius.sso.core.services.UserService;
10+
import lombok.extern.slf4j.Slf4j;
11+
import org.springframework.http.ResponseEntity;
12+
import org.springframework.web.bind.annotation.*;
13+
14+
import java.util.Map;
15+
16+
@Slf4j
17+
@RestController
18+
@RequestMapping("/api/v1/ai")
19+
public class AIServicesApiController extends BaseController {
20+
21+
private final ThreadSafeDynamicPropertiesService dynamicPropertiesService;
22+
23+
public AIServicesApiController(
24+
UserService userService,
25+
SystemOptions systemOptions,
26+
ErrorOutputService errorOutputService,
27+
ThreadSafeDynamicPropertiesService dynamicPropertiesService
28+
) {
29+
super(userService, systemOptions, errorOutputService);
30+
this.dynamicPropertiesService = dynamicPropertiesService;
31+
}
32+
33+
@PostMapping("/llm-provider")
34+
@LimitAccess(applicationAccess = {ApplicationAccessEnum.CAN_MANAGE_APPLICATION})
35+
public ResponseEntity<?> updateLlmProvider(@RequestBody Map<String, String> request) {
36+
try {
37+
String provider = request.get("provider");
38+
if (provider == null || provider.trim().isEmpty()) {
39+
return ResponseEntity.badRequest().body(Map.of("error", "Provider is required"));
40+
}
41+
42+
// Validate provider (openai or claude)
43+
if (!provider.equals("openai") && !provider.equals("claude")) {
44+
return ResponseEntity.badRequest().body(Map.of("error", "Invalid provider. Must be 'openai' or 'claude'"));
45+
}
46+
47+
// Update the system option dynamically
48+
dynamicPropertiesService.updateProperty("defaultLlmProvider", provider);
49+
50+
log.info("Updated default LLM provider to: {}", provider);
51+
52+
return ResponseEntity.ok(Map.of(
53+
"success", true,
54+
"provider", provider,
55+
"message", "LLM provider updated successfully"
56+
));
57+
} catch (Exception e) {
58+
log.error("Error updating LLM provider", e);
59+
return ResponseEntity.internalServerError().body(Map.of("error", e.getMessage()));
60+
}
61+
}
62+
63+
@GetMapping("/llm-provider")
64+
@LimitAccess(applicationAccess = {ApplicationAccessEnum.CAN_MANAGE_APPLICATION})
65+
public ResponseEntity<?> getLlmProvider() {
66+
return ResponseEntity.ok(Map.of(
67+
"provider", systemOptions.getDefaultLlmProvider()
68+
));
69+
}
70+
71+
@PostMapping("/preferred-integration")
72+
@LimitAccess(applicationAccess = {ApplicationAccessEnum.CAN_MANAGE_APPLICATION})
73+
public ResponseEntity<?> updatePreferredIntegration(@RequestBody Map<String, Object> request) {
74+
try {
75+
String provider = (String) request.get("provider");
76+
Object integrationIdObj = request.get("integrationId");
77+
78+
if (provider == null || provider.trim().isEmpty()) {
79+
return ResponseEntity.badRequest().body(Map.of("error", "Provider is required"));
80+
}
81+
82+
// Validate provider (openai or claude)
83+
if (!provider.equals("openai") && !provider.equals("claude")) {
84+
return ResponseEntity.badRequest().body(Map.of("error", "Invalid provider. Must be 'openai' or 'claude'"));
85+
}
86+
87+
// Handle null or empty integrationId - clear the preference
88+
String integrationId = null;
89+
if (integrationIdObj != null) {
90+
String idStr = integrationIdObj.toString().trim();
91+
if (!idStr.isEmpty() && !idStr.equals("null")) {
92+
integrationId = idStr;
93+
}
94+
}
95+
96+
// Store the preferred integration ID for this provider, or delete if null
97+
String propertyKey = "preferredIntegration." + provider;
98+
if (integrationId != null) {
99+
dynamicPropertiesService.updateProperty(propertyKey, integrationId);
100+
log.info("Updated preferred {} integration to ID: {}", provider, integrationId);
101+
} else {
102+
dynamicPropertiesService.updateProperty(propertyKey, "");
103+
log.info("Cleared preferred {} integration, will auto-select", provider);
104+
}
105+
106+
return ResponseEntity.ok(Map.of(
107+
"success", true,
108+
"provider", provider,
109+
"integrationId", integrationId != null ? integrationId : "",
110+
"message", "Preferred integration updated successfully"
111+
));
112+
} catch (Exception e) {
113+
log.error("Error updating preferred integration", e);
114+
return ResponseEntity.internalServerError().body(Map.of("error", e.getMessage()));
115+
}
116+
}
117+
}

0 commit comments

Comments
 (0)