jvserve 2.1.16__tar.gz → 2.1.17__tar.gz
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.
Potentially problematic release.
This version of jvserve might be problematic. Click here for more details.
- {jvserve-2.1.16 → jvserve-2.1.17}/PKG-INFO +1 -1
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/lib/agent_interface.py +6 -3
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/lib/jac_interface.py +9 -3
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve.egg-info/PKG-INFO +1 -1
- {jvserve-2.1.16 → jvserve-2.1.17}/LICENSE +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/README.md +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/__init__.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/cli.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/lib/__init__.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/lib/agent_pulse.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/lib/file_interface.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve/lib/jvlogger.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve.egg-info/SOURCES.txt +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve.egg-info/dependency_links.txt +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve.egg-info/entry_points.txt +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve.egg-info/requires.txt +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/jvserve.egg-info/top_level.txt +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/setup.cfg +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/setup.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/tests/test_file_interface.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/tests/test_jvlogger.py +0 -0
- {jvserve-2.1.16 → jvserve-2.1.17}/tests/test_jvserve.py +0 -0
|
@@ -15,6 +15,7 @@ class AgentInterface:
|
|
|
15
15
|
|
|
16
16
|
_instance = None
|
|
17
17
|
logger = logging.getLogger(__name__)
|
|
18
|
+
timeout = int(os.environ.get("JIVAS_REQUEST_TIMEOUT", 30))
|
|
18
19
|
|
|
19
20
|
def __init__(self, host: str = "localhost", port: int = 8000) -> None:
|
|
20
21
|
"""Initialize the AgentInterface with JacInterface."""
|
|
@@ -49,8 +50,10 @@ class AgentInterface:
|
|
|
49
50
|
def api_pulse(self, action_label: str, agent_id: str) -> dict:
|
|
50
51
|
"""Synchronous pulse API call"""
|
|
51
52
|
if not self._jac.is_valid():
|
|
52
|
-
self.logger.warning(
|
|
53
|
-
|
|
53
|
+
self.logger.warning(
|
|
54
|
+
"Invalid API state for pulse, attempting to reinstate it..."
|
|
55
|
+
)
|
|
56
|
+
self._jac._authenticate()
|
|
54
57
|
|
|
55
58
|
# Clean parameters
|
|
56
59
|
action_label = action_label.replace("action_label=", "")
|
|
@@ -62,7 +65,7 @@ class AgentInterface:
|
|
|
62
65
|
|
|
63
66
|
try:
|
|
64
67
|
response = requests.post(
|
|
65
|
-
endpoint, json=payload, headers=headers, timeout=
|
|
68
|
+
endpoint, json=payload, headers=headers, timeout=self.timeout
|
|
66
69
|
)
|
|
67
70
|
if response.status_code == 200:
|
|
68
71
|
return response.json().get("reports", {})
|
|
@@ -25,6 +25,8 @@ from jaclang.runtimelib.machine import JacMachine
|
|
|
25
25
|
class JacInterface:
|
|
26
26
|
"""Thread-safe connection and context state provider for Jac Runtime with auto-authentication."""
|
|
27
27
|
|
|
28
|
+
timeout = int(os.environ.get("JIVAS_REQUEST_TIMEOUT", 30))
|
|
29
|
+
|
|
28
30
|
def __init__(self, host: str = "localhost", port: int = 8000) -> None:
|
|
29
31
|
"""Initialize JacInterface with host and port."""
|
|
30
32
|
self.host = host
|
|
@@ -155,7 +157,9 @@ class JacInterface:
|
|
|
155
157
|
try:
|
|
156
158
|
# Try login first
|
|
157
159
|
response = requests.post(
|
|
158
|
-
login_url,
|
|
160
|
+
login_url,
|
|
161
|
+
json={"email": user, "password": password},
|
|
162
|
+
timeout=self.timeout,
|
|
159
163
|
)
|
|
160
164
|
self.logger.info(f"Login response status: {response.status_code}")
|
|
161
165
|
if response.status_code == 200:
|
|
@@ -164,7 +168,9 @@ class JacInterface:
|
|
|
164
168
|
|
|
165
169
|
# Register if login fails
|
|
166
170
|
reg_response = requests.post(
|
|
167
|
-
register_url,
|
|
171
|
+
register_url,
|
|
172
|
+
json={"email": user, "password": password},
|
|
173
|
+
timeout=self.timeout,
|
|
168
174
|
)
|
|
169
175
|
self.logger.info(
|
|
170
176
|
f"Register response status: {reg_response.status_code}"
|
|
@@ -174,7 +180,7 @@ class JacInterface:
|
|
|
174
180
|
login_response = requests.post(
|
|
175
181
|
login_url,
|
|
176
182
|
json={"email": user, "password": password},
|
|
177
|
-
timeout=
|
|
183
|
+
timeout=self.timeout,
|
|
178
184
|
)
|
|
179
185
|
self.logger.info(
|
|
180
186
|
f"Retry login response status: {login_response.status_code}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|