rusticai-api 1.4.0__tar.gz → 1.5.0__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.
Files changed (29) hide show
  1. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/PKG-INFO +16 -12
  2. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/pyproject.toml +33 -21
  3. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/catalog/catalog_store.py +1 -1
  4. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/comms_manager.py +16 -4
  5. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/service.py +2 -2
  6. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/README.md +0 -0
  7. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/__init__.py +0 -0
  8. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/__init__.py +0 -0
  9. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/boards/__init__.py +0 -0
  10. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/boards/board_store.py +0 -0
  11. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/boards/models.py +0 -0
  12. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/boards/router.py +0 -0
  13. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/boards/schema.py +0 -0
  14. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/addons/router.py +0 -0
  15. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/api_dependency_manager.py +0 -0
  16. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/catalog/__init__.py +0 -0
  17. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/catalog/models.py +0 -0
  18. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/catalog/router.py +0 -0
  19. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/__init__.py +0 -0
  20. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/models.py +0 -0
  21. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/router.py +0 -0
  22. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/schema.py +0 -0
  23. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/socket.py +0 -0
  24. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/guilds/system_comms_manager.py +0 -0
  25. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/logging/__init__.py +0 -0
  26. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/logging/config.py +0 -0
  27. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/logging/format.py +0 -0
  28. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/main.py +0 -0
  29. {rusticai_api-1.4.0 → rusticai_api-1.5.0}/src/rustic_ai/api_server/main_debug.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rusticai-api
3
- Version: 1.4.0
3
+ Version: 1.5.0
4
4
  Summary: API Server for Rustic AI
5
5
  License-Expression: Apache-2.0
6
6
  Author: Dragonscale Industries Inc.
@@ -9,18 +9,22 @@ Requires-Python: >=3.13,<3.14
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.13
11
11
  Provides-Extra: test
12
- Requires-Dist: fastapi (>=0.139.2,<0.140.0)
13
- Requires-Dist: griffe (>=2.1.0,<3.0.0)
14
- Requires-Dist: opentelemetry-distro (>=0.65b0,<0.66)
15
- Requires-Dist: psycopg (>=3.3.4,<4.0.0)
12
+ Requires-Dist: fastapi (>=0.165.0,<0.166.0)
13
+ Requires-Dist: griffe (>=2.4.1,<3.0.0)
14
+ Requires-Dist: httpx (>=0.28.1,<0.29.0) ; extra == "test"
15
+ Requires-Dist: opentelemetry-distro (>=0.66b2,<0.67)
16
+ Requires-Dist: psycopg (>=3.3.9,<4.0.0)
16
17
  Requires-Dist: ptvsd (>=4.3.2,<5.0.0)
17
- Requires-Dist: python-json-logger (>=4.1.0,<5.0.0)
18
- Requires-Dist: python-multipart (>=0.0.32,<0.0.33)
19
- Requires-Dist: rusticai-core (>=1.4.0,<1.5.0)
20
- Requires-Dist: rusticai-ray (>=1.4.0,<1.5.0)
21
- Requires-Dist: starlette (>=1.3.1,<2.0.0)
22
- Requires-Dist: uvicorn (>=0.51.0,<0.52.0)
23
- Requires-Dist: websockets (>=16.1.1,<17.0.0)
18
+ Requires-Dist: pytest (>=9.2.0,<10.0.0) ; extra == "test"
19
+ Requires-Dist: pytest-asyncio (>=1.5.0,<2.0.0) ; extra == "test"
20
+ Requires-Dist: python-json-logger (>=4.2.0,<5.0.0)
21
+ Requires-Dist: python-multipart (>=0.0.34,<0.0.35)
22
+ Requires-Dist: rusticai-core (>=1.5.0,<1.6.0)
23
+ Requires-Dist: rusticai-ray (>=1.5.0,<1.6.0)
24
+ Requires-Dist: rusticai-testing (>=1.5.0,<1.6.0) ; extra == "test"
25
+ Requires-Dist: starlette (>=1.10.0,<2.0.0)
26
+ Requires-Dist: uvicorn (>=0.54.0,<0.55.0)
27
+ Requires-Dist: websockets (>=17.4,<18.0)
24
28
  Project-URL: Homepage, https://www.rustic.ai/
25
29
  Project-URL: Repository, https://github.com/rustic-ai/rustic-ai
26
30
  Project-URL: Rustic AI Core, https://pypi.org/project/rusticai-core/
@@ -1,11 +1,11 @@
1
1
  [build-system]
2
- requires = ["poetry-core"]
2
+ requires = ["poetry-core>=2.5.0,<3.0.0"]
3
3
  build-backend = "poetry.core.masonry.api"
4
4
 
5
5
 
6
6
  [project]
7
7
  name = "rusticai-api"
8
- version = "1.4.0"
8
+ version = "1.5.0"
9
9
  description = "API Server for Rustic AI"
10
10
  authors = [{name = "Dragonscale Industries Inc.", email = "dev@dragonscale.ai"}]
11
11
  license = "Apache-2.0"
@@ -19,19 +19,31 @@ urls = { Homepage = "https://www.rustic.ai/", Repository = "https://github.com/r
19
19
  packages = [{ include = "rustic_ai", from = "src" }]
20
20
 
21
21
  [tool.poetry.dependencies]
22
- rusticai-core = { version = "1.4.0"}
23
- rusticai-ray = { version = "1.4.0"}
24
- fastapi = "^0.139.2"
25
- starlette = "^1.3.1"
26
- uvicorn = "^0.51.0"
22
+ rusticai-core = { version = "1.5.0"}
23
+ rusticai-ray = { version = "1.5.0"}
24
+ fastapi = "^0.165.0"
25
+ starlette = "^1.10.0"
26
+ uvicorn = "^0.54.0"
27
27
  ptvsd = "^4.3.2"
28
- python-multipart = "^0.0.32"
29
- opentelemetry-distro = "^0.65b0"
30
- websockets = "^16.1.1"
31
- griffe = "^2.1.0"
32
- psycopg = "^3.3.4"
33
- python-json-logger = "^4.1.0"
28
+ python-multipart = "^0.0.34"
29
+ opentelemetry-distro = "^0.66b2"
30
+ websockets = "^17.4"
31
+ griffe = "^2.4.1"
32
+ psycopg = "^3.3.9"
33
+ python-json-logger = "^4.2.0"
34
+ rusticai-testing = { optional = true, version = "1.5.0"}
34
35
 
36
+ [tool.poetry.dependencies.pytest]
37
+ version = "^9.2.0"
38
+ optional = true
39
+
40
+ [tool.poetry.dependencies.pytest-asyncio]
41
+ version = "^1.5.0"
42
+ optional = true
43
+
44
+ [tool.poetry.dependencies.httpx]
45
+ version = "^0.28.1"
46
+ optional = true
35
47
  [tool.poetry-monorepo.deps]
36
48
 
37
49
 
@@ -39,15 +51,15 @@ python-json-logger = "^4.1.0"
39
51
  optional = true
40
52
 
41
53
  [tool.poetry.group.dev.dependencies]
42
- pytest = "^9.1.1"
43
- black = { version = "^26.5.1", extras = ["jupyter"] }
44
- flake8 = "^7.3.0"
45
- tox = "^4.57.1"
46
- isort = "^8.0.1"
47
- mypy = "^2.3.0"
48
- pytest-asyncio = "^1.4.0"
54
+ pytest = "^9.2.0"
55
+ black = { version = "^26.10.1", extras = ["jupyter"] }
56
+ flake8 = "^7.5.0"
57
+ tox = "^4.67.16"
58
+ isort = "^9.0.2"
59
+ mypy = "^2.4.1"
60
+ pytest-asyncio = "^1.5.0"
49
61
  httpx = "^0.28.1"
50
- rusticai-testing = { version = "1.4.0"}
62
+ rusticai-testing = { version = "1.5.0"}
51
63
 
52
64
  [tool.poetry.extras]
53
65
  test = ["pytest", "pytest-asyncio", "httpx", "rusticai-testing"]
@@ -205,7 +205,7 @@ class CatalogStore:
205
205
  raise HTTPException(status_code=404, detail=f"Blueprint {blueprint_id} not found")
206
206
 
207
207
  # Ensure orginal organization has access when sharing bp with org exposure
208
- if blueprint.exposure == BlueprintExposure.ORGANIZATION:
208
+ if blueprint.exposure == BlueprintExposure.ORGANIZATION and blueprint.organization_id is not None:
209
209
  session.add(
210
210
  BlueprintSharedWithOrganization(
211
211
  organization_id=blueprint.organization_id, blueprint_id=blueprint_id
@@ -23,7 +23,7 @@ from rustic_ai.core.messaging.core.client import Client
23
23
  from rustic_ai.core.messaging.core.message import AgentTag, Message, ProcessEntry
24
24
  from rustic_ai.core.messaging.core.messaging_interface import MessagingInterface
25
25
  from rustic_ai.core.utils.basic_class_utils import get_qualified_class_name
26
- from rustic_ai.core.utils.gemstone_id import GemstoneGenerator
26
+ from rustic_ai.core.utils.gemstone_id import GemstoneGenerator, GemstoneID
27
27
  from rustic_ai.core.utils.priority import Priority
28
28
 
29
29
 
@@ -293,19 +293,31 @@ class GuildCommunicationManager:
293
293
  return result
294
294
 
295
295
  @staticmethod
296
- def historical_message_sort_key(message: Message) -> tuple[int, int, bool, int, int]:
296
+ def historical_message_sort_key(message: Message) -> tuple[float, int, bool, int, int]:
297
297
  """
298
298
  Prefer chronological ordering, but keep messages from the same interaction in causal order.
299
299
 
300
300
  Different agents can generate IDs in the same millisecond with different machine IDs, which can
301
301
  invert user-message/agent-response pairs if we sort purely by message ID.
302
302
  """
303
+ # Notifications and responses travel on separate subjects. A response can
304
+ # arrive before the user's broadcast notification, so use their shared ingress
305
+ # timestamp and routing depth to preserve the order of each interaction.
306
+ interaction_id = next(
307
+ (
308
+ entry.origin
309
+ for entry in reversed(message.message_history)
310
+ if entry.processor == "unwrap_and_forward_message"
311
+ ),
312
+ None,
313
+ )
314
+ timestamp = GemstoneID.from_int(interaction_id).timestamp if interaction_id is not None else message.timestamp
303
315
  # Any message that explicitly responds to an earlier message should come after
304
316
  # the user-originated entry for that interaction, even if it shares the same root.
305
317
  is_follow_up = message.in_response_to is not None
306
318
  return (
307
- message.timestamp,
308
- message.root_thread_id,
319
+ timestamp,
320
+ interaction_id if interaction_id is not None else message.root_thread_id,
309
321
  is_follow_up,
310
322
  len(message.message_history),
311
323
  message.id,
@@ -43,8 +43,8 @@ class GuildService:
43
43
  guild_model.status = GuildStatus.REQUESTED
44
44
  session.add(guild_model)
45
45
  # Add the agents to the Metastore
46
- for guild_agent in guild_spec.agents:
47
- agent_model = AgentModel.from_agent_spec(guild_spec.id, guild_agent)
46
+ for position, guild_agent in enumerate(guild_spec.agents):
47
+ agent_model = AgentModel.from_agent_spec(guild_spec.id, guild_agent, position=position)
48
48
  session.add(agent_model)
49
49
  session.commit()
50
50
 
File without changes