first commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
id("java-library-conventions")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":main-infrastructure"))
|
||||
api(Dependencies.jacksonDatabind)
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package net.bquarkz.ai.gateway.contracts;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Value;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
@Value
|
||||
@Builder
|
||||
public class GatewayContext {
|
||||
Subject subject;
|
||||
ContextData context;
|
||||
|
||||
@Value
|
||||
@Builder
|
||||
public static class Subject {
|
||||
String agentId;
|
||||
Set<String> scopes;
|
||||
}
|
||||
|
||||
@Value
|
||||
@Builder
|
||||
public static class ContextData {
|
||||
String environment;
|
||||
OffsetDateTime timestamp;
|
||||
RateInfo rate;
|
||||
}
|
||||
|
||||
@Value
|
||||
@Builder
|
||||
public static class RateInfo {
|
||||
int current;
|
||||
int limit;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package net.bquarkz.ai.gateway.contracts;
|
||||
|
||||
public enum PolicyDecision {
|
||||
ALLOW,
|
||||
DENY,
|
||||
REQUIRE_APPROVAL
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package net.bquarkz.ai.gateway.contracts;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public record ToolExecutionRequest(String tool, String action, Map<String, Object> arguments) {}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package net.bquarkz.ai.gateway.contracts;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public record ToolExecutionResponse(
|
||||
String requestId,
|
||||
PolicyDecision decision,
|
||||
String reason,
|
||||
String matchedRule,
|
||||
Map<String, Object> result,
|
||||
ApprovalStatus approval
|
||||
) {
|
||||
public record ApprovalStatus(String status, Integer timeoutSeconds) {}
|
||||
}
|
||||
Reference in New Issue
Block a user