soliplex 0.90.1__tar.gz → 0.91__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 (128) hide show
  1. {soliplex-0.90.1/src/soliplex.egg-info → soliplex-0.91}/PKG-INFO +2 -2
  2. {soliplex-0.90.1 → soliplex-0.91}/example/skills/bare-bones/SKILL.md +1 -0
  3. {soliplex-0.90.1 → soliplex-0.91}/pyproject.toml +2 -2
  4. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/installation.py +0 -111
  5. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/models.py +4 -7
  6. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/skills/bwrap_sandbox/__init__.py +26 -14
  7. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tui/main.py +5 -3
  8. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/util.py +41 -0
  9. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/room_file_uploads.py +13 -15
  10. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/sandbox_workdirs.py +14 -13
  11. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/thread_file_uploads.py +14 -16
  12. {soliplex-0.90.1 → soliplex-0.91/src/soliplex.egg-info}/PKG-INFO +2 -2
  13. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex.egg-info/requires.txt +1 -1
  14. {soliplex-0.90.1 → soliplex-0.91}/LICENSE +0 -0
  15. {soliplex-0.90.1 → soliplex-0.91}/MANIFEST.in +0 -0
  16. {soliplex-0.90.1 → soliplex-0.91}/README.md +0 -0
  17. {soliplex-0.90.1 → soliplex-0.91}/example/skills/stanzas/SKILL.md +0 -0
  18. {soliplex-0.90.1 → soliplex-0.91}/setup.cfg +0 -0
  19. {soliplex-0.90.1 → soliplex-0.91}/skills/soliplex-docs/SKILL.md +0 -0
  20. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agents.py +0 -0
  21. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agui/__init__.py +0 -0
  22. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agui/parser.py +0 -0
  23. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agui/persistence.py +0 -0
  24. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agui/schema.py +0 -0
  25. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agui/sse_delivery.py +0 -0
  26. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/agui/util.py +0 -0
  27. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/__init__.py +0 -0
  28. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/env.py +0 -0
  29. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/216d48e1e2e5_soliplex_v0_53.py +0 -0
  30. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/4b63e5f3f39e_soliplex_v0_51_1.py +0 -0
  31. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/63edaa5987f6_soliplex_v0_67.py +0 -0
  32. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/a1c7d3e90b42_soliplex_v0_80.py +0 -0
  33. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/b7e2f41c9d05_soliplex_v0_82.py +0 -0
  34. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/d5009d4f9874_soliplex_v0_44.py +0 -0
  35. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/alembic_migrations/versions/f13fea6c1953_soliplex_v0_86.py +0 -0
  36. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/authn.py +0 -0
  37. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/authz/__init__.py +0 -0
  38. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/authz/persistence.py +0 -0
  39. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/authz/schema.py +0 -0
  40. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/capabilities/filesystem.py +0 -0
  41. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/capabilities/rag_audit.py +0 -0
  42. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/admin_users.py +0 -0
  43. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/ask.py +0 -0
  44. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/__init__.py +0 -0
  45. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/_common.py +0 -0
  46. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/admin_users.py +0 -0
  47. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/completions.py +0 -0
  48. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/databases.py +0 -0
  49. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/environment.py +0 -0
  50. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/installation.py +0 -0
  51. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/interpolation.py +0 -0
  52. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/logfire.py +0 -0
  53. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/logging.py +0 -0
  54. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/oidc.py +0 -0
  55. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/ollama.py +0 -0
  56. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/quizzes.py +0 -0
  57. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/room_authz.py +0 -0
  58. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/rooms.py +0 -0
  59. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/secrets.py +0 -0
  60. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/audit/skills.py +0 -0
  61. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/cli_util.py +0 -0
  62. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/database.py +0 -0
  63. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/main.py +0 -0
  64. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/ollama.py +0 -0
  65. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/room_authz.py +0 -0
  66. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/serve.py +0 -0
  67. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/service_token.py +0 -0
  68. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/cli/types.py +0 -0
  69. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/completions.py +0 -0
  70. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/__init__.py +0 -0
  71. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/_utils.py +0 -0
  72. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/agents.py +0 -0
  73. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/agui.py +0 -0
  74. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/authsystem.py +0 -0
  75. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/completions.py +0 -0
  76. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/exceptions.py +0 -0
  77. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/interpolation.py +0 -0
  78. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/logfire.py +0 -0
  79. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/meta.py +0 -0
  80. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/middleware.py +0 -0
  81. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/quizzes.py +0 -0
  82. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/rag.py +0 -0
  83. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/rooms.py +0 -0
  84. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/routing.py +0 -0
  85. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/secrets.py +0 -0
  86. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/skills.py +0 -0
  87. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/sse_delivery.py +0 -0
  88. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/config/tools.py +0 -0
  89. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/examples.py +0 -0
  90. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/installation.py +0 -0
  91. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/log_ingest.py +0 -0
  92. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/loggers.py +0 -0
  93. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/main.py +0 -0
  94. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/mcp_auth.py +0 -0
  95. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/mcp_client.py +0 -0
  96. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/mcp_server.py +0 -0
  97. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/ollama.py +0 -0
  98. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/quizzes.py +0 -0
  99. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/rag_audit.py +0 -0
  100. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/sandbox_audit.py +0 -0
  101. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/secrets.py +0 -0
  102. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/skills/bwrap_sandbox/SKILL.md +0 -0
  103. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/titles.py +0 -0
  104. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/token_mint.py +0 -0
  105. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tools/__init__.py +0 -0
  106. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tools/agui_run_feedback.py +0 -0
  107. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tools/file_uploads.py +0 -0
  108. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tools/rag.py +0 -0
  109. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tui/cli.py +0 -0
  110. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tui/rest_api.py +0 -0
  111. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/tui/serve.py +0 -0
  112. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/__init__.py +0 -0
  113. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/agui.py +0 -0
  114. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/authn.py +0 -0
  115. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/authz.py +0 -0
  116. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/completions.py +0 -0
  117. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/installation.py +0 -0
  118. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/log_ingest.py +0 -0
  119. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/quizzes.py +0 -0
  120. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/rooms.py +0 -0
  121. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/stats.py +0 -0
  122. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/streaming.py +0 -0
  123. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/templates/consent.html.mako +0 -0
  124. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex/views/templates/cookie-too-large.html.mako +0 -0
  125. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex.egg-info/SOURCES.txt +0 -0
  126. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex.egg-info/dependency_links.txt +0 -0
  127. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex.egg-info/entry_points.txt +0 -0
  128. {soliplex-0.90.1 → soliplex-0.91}/src/soliplex.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soliplex
3
- Version: 0.90.1
3
+ Version: 0.91
4
4
  Summary: An AI-powered Retrieval-Augmented Generation (RAG) system with a modern web interface.
5
5
  Author-email: Enfold <info@enfoldsystems.net>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -20,7 +20,7 @@ Requires-Dist: fakeredis!=2.35.0
20
20
  Requires-Dist: fastapi
21
21
  Requires-Dist: fastmcp<5.0,>=4.1.2
22
22
  Requires-Dist: greenlet
23
- Requires-Dist: haiku.rag-slim<0.106,>=0.105.0
23
+ Requires-Dist: haiku.rag-slim<0.109,>=0.108.0
24
24
  Requires-Dist: idna>=3.15
25
25
  Requires-Dist: itsdangerous
26
26
  Requires-Dist: joserfc<1.8,>=1.7.5
@@ -2,3 +2,4 @@
2
2
  name: bare-bones
3
3
  description: Wheedle for more resources
4
4
  ---
5
+ Do nothing 'til you hear from me.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "soliplex"
7
- version = "0.90.1"
7
+ version = "0.91"
8
8
  description = "An AI-powered Retrieval-Augmented Generation (RAG) system with a modern web interface."
9
9
  authors = [{ name = "Enfold", email = "info@enfoldsystems.net" }]
10
10
  readme = "README.md"
@@ -26,7 +26,7 @@ dependencies = [
26
26
  "fastapi",
27
27
  "fastmcp >= 4.1.2, < 5.0",
28
28
  "greenlet",
29
- "haiku.rag-slim >= 0.105.0, < 0.106",
29
+ "haiku.rag-slim >= 0.108.0, < 0.109",
30
30
  "idna >= 3.15",
31
31
  "itsdangerous",
32
32
  "joserfc >= 1.7.5, < 1.8", # CVE-2026-11928{3,4}
@@ -7,7 +7,6 @@ import itertools
7
7
  import os
8
8
  import pathlib
9
9
  import typing
10
- import warnings
11
10
 
12
11
  import dotenv
13
12
  import yaml
@@ -365,20 +364,6 @@ class SandboxConfig:
365
364
  return None
366
365
 
367
366
 
368
- MULTI_DBURI_DEPRECATION = """\
369
- The '{stem}_dburi' installation configuration stanza is deprecated,
370
- and will be removed after soliplex v0.84 (configured in {config_path}).
371
- Use instead '{stem}_db', with sub-keys 'sync_dburi' and 'async_dburi'.
372
- """
373
-
374
-
375
- TYPE_SFX_DBURI_DEPRECATION = """\
376
- The '{stem}_dburi_{type_}' installation configuration property is deprecated,
377
- and will be removed after soliplex v0.84 (configured in {config_path}).
378
- Use instead '{stem}_{type_}_dburi'.
379
- """
380
-
381
-
382
367
  class MigrationPolicy(enum.StrEnum):
383
368
  EXPLICIT = "explicit"
384
369
  DISABLED = "disabled"
@@ -895,33 +880,6 @@ class InstallationConfig:
895
880
  )
896
881
  )
897
882
 
898
- # Deprecated aliases: remove after v0.84
899
- @property
900
- def thread_persistence_dburi_sync(self) -> str:
901
- warnings.warn(
902
- TYPE_SFX_DBURI_DEPRECATION.format(
903
- stem="thread_persistence",
904
- type_="sync",
905
- config_path=str(self._config_path),
906
- ),
907
- category=DeprecationWarning,
908
- stacklevel=2,
909
- )
910
- return self.thread_persistence_sync_dburi
911
-
912
- @property
913
- def thread_persistence_dburi_async(self) -> str:
914
- warnings.warn(
915
- TYPE_SFX_DBURI_DEPRECATION.format(
916
- stem="thread_persistence",
917
- type_="async",
918
- config_path=str(self._config_path),
919
- ),
920
- category=DeprecationWarning,
921
- stacklevel=2,
922
- )
923
- return self.thread_persistence_async_dburi
924
-
925
883
  #
926
884
  # Authorization DB
927
885
  #
@@ -978,33 +936,6 @@ class InstallationConfig:
978
936
  )
979
937
  )
980
938
 
981
- # Deprecated aliases: remove after v0.84
982
- @property
983
- def authorization_dburi_sync(self) -> str:
984
- warnings.warn(
985
- TYPE_SFX_DBURI_DEPRECATION.format(
986
- stem="authorization",
987
- type_="sync",
988
- config_path=str(self._config_path),
989
- ),
990
- category=DeprecationWarning,
991
- stacklevel=2,
992
- )
993
- return self.authorization_sync_dburi
994
-
995
- @property
996
- def authorization_dburi_async(self) -> str:
997
- warnings.warn(
998
- TYPE_SFX_DBURI_DEPRECATION.format(
999
- stem="authorization",
1000
- type_="async",
1001
- config_path=str(self._config_path),
1002
- ),
1003
- category=DeprecationWarning,
1004
- stacklevel=2,
1005
- )
1006
- return self.authorization_async_dburi
1007
-
1008
939
  # Set by `from_yaml` factory
1009
940
  _config_path: pathlib.Path = None
1010
941
 
@@ -1129,27 +1060,6 @@ class InstallationConfig:
1129
1060
 
1130
1061
  config_dict["logfire_config"] = logfire_cfg
1131
1062
 
1132
- # Deprecated spellings: remove after v0.84.
1133
- depr_tbd = config_dict.pop("thread_persistence_dburi", None)
1134
-
1135
- if depr_tbd is not None:
1136
- warnings.warn(
1137
- MULTI_DBURI_DEPRECATION.format(
1138
- stem="thread_persistence",
1139
- config_path=str(config_path),
1140
- ),
1141
- category=DeprecationWarning,
1142
- stacklevel=2,
1143
- )
1144
- tp_db_already = "thread_persistence_db" in config_dict
1145
-
1146
- if not tp_db_already: # pragma NO COVER new one wins
1147
- # Re-write to the new spelling
1148
- config_dict["thread_persistence_db"] = {
1149
- "sync_dburi": depr_tbd.get("sync"),
1150
- "async_dburi": depr_tbd.get("async"),
1151
- }
1152
-
1153
1063
  tp_db = config_dict.pop("thread_persistence_db", {})
1154
1064
  config_dict["_thread_persistence_sync_dburi"] = tp_db.get(
1155
1065
  "sync_dburi"
@@ -1164,27 +1074,6 @@ class InstallationConfig:
1164
1074
  "migration_policy"
1165
1075
  )
1166
1076
 
1167
- # Deprecated spellings: remove after v0.84.
1168
- depr_adb = config_dict.pop("authorization_dburi", None)
1169
-
1170
- if depr_adb is not None:
1171
- warnings.warn(
1172
- MULTI_DBURI_DEPRECATION.format(
1173
- stem="authorization",
1174
- config_path=str(config_path),
1175
- ),
1176
- category=DeprecationWarning,
1177
- stacklevel=2,
1178
- )
1179
- az_db_already = "authorization_db" in config_dict
1180
-
1181
- if not az_db_already: # pragma NO COVER new one wins
1182
- # Re-write to the new spelling
1183
- config_dict["authorization_db"] = {
1184
- "sync_dburi": depr_adb.get("sync"),
1185
- "async_dburi": depr_adb.get("async"),
1186
- }
1187
-
1188
1077
  az_db = config_dict.pop("authorization_db", {})
1189
1078
  config_dict["_authorization_sync_dburi"] = az_db.get("sync_dburi")
1190
1079
  config_dict["_authorization_async_dburi"] = az_db.get(
@@ -516,10 +516,6 @@ class Installation(pydantic.BaseModel):
516
516
  logging_headers_map: dict[str, str] | None = {}
517
517
  logging_claims_map: dict[str, str] | None = {}
518
518
 
519
- # Deprecated: will be removed after v0.84
520
- thread_persistence_dburi_sync: str | None = None
521
- thread_persistence_dburi_async: str | None = None
522
-
523
519
  @classmethod
524
520
  def from_config(
525
521
  cls, installation_config: config_installation.InstallationConfig
@@ -570,9 +566,6 @@ class Installation(pydantic.BaseModel):
570
566
  logging_config_file=installation_config._logging_config_file,
571
567
  logging_headers_map=installation_config.logging_headers_map,
572
568
  logging_claims_map=installation_config.logging_claims_map,
573
- # Deprecated: return dummy values until after v0.84.
574
- thread_persistence_dburi_sync=DUMMY_TP_DBURI,
575
- thread_persistence_dburi_async=DUMMY_TP_DBURI,
576
569
  )
577
570
 
578
571
 
@@ -731,6 +724,8 @@ class RoomRAGDocuments(pydantic.BaseModel):
731
724
  class FileUpload(pydantic.BaseModel):
732
725
  filename: str
733
726
  url: pydantic.HttpUrl
727
+ modified_at: datetime.datetime | None # null outside years 1 to 9999
728
+ size_bytes: int
734
729
 
735
730
 
736
731
  class RoomUploads(pydantic.BaseModel):
@@ -747,6 +742,8 @@ class ThreadUploads(pydantic.BaseModel):
747
742
  class WorkdirFile(pydantic.BaseModel):
748
743
  filename: str
749
744
  url: pydantic.HttpUrl
745
+ modified_at: datetime.datetime | None # null outside years 1 to 9999
746
+ size_bytes: int
750
747
 
751
748
 
752
749
  class ThreadWorkdirFiles(pydantic.BaseModel):
@@ -686,14 +686,22 @@ MAX_WALK_DEPTH = 64
686
686
  def _add_downloadable_files(
687
687
  dir_fd: int,
688
688
  relative: pathlib.PurePosixPath,
689
- found: list[str],
689
+ found: dict[str, os.stat_result],
690
690
  ) -> None:
691
- """Add the files the workdir endpoint serves beneath 'dir_fd' to 'found'.
692
-
693
- Each entry's type comes from the scan of the open directory, without
694
- following symlinks, and each subdirectory is opened relative to it
695
- with 'O_NOFOLLOW': nothing is reached through a symlink, and no
696
- symlink's target is looked up.
691
+ """Map each file the workdir endpoint serves beneath 'dir_fd' to its
692
+ stat, in 'found'.
693
+
694
+ Each entry is typed without following symlinks, by the scan of the
695
+ open directory or, where the scan gives no type, by an lstat relative
696
+ to 'dir_fd'; each subdirectory is opened relative to 'dir_fd' with
697
+ 'O_NOFOLLOW': nothing is reached through a symlink, and no symlink's
698
+ target is looked up.
699
+
700
+ Each file's stat is taken relative to 'dir_fd', without following a
701
+ symlink, while 'dir_fd' is open: a 'DirEntry' keeps only the
702
+ descriptor's number, which may name another directory once closed.
703
+ A file is kept only if that stat is of a regular file: sandboxed code
704
+ may have replaced it since it was typed.
697
705
  """
698
706
  sub_dirs = []
699
707
 
@@ -703,8 +711,11 @@ def _add_downloadable_files(
703
711
  if entry.is_dir(follow_symlinks=False):
704
712
  sub_dirs.append(entry.name)
705
713
  elif is_downloadable(entry):
706
- found.append((relative / entry.name).as_posix())
707
- except OSError: # no type from the scan, and none readable
714
+ stat_result = entry.stat(follow_symlinks=False)
715
+
716
+ if stat.S_ISREG(stat_result.st_mode):
717
+ found[(relative / entry.name).as_posix()] = stat_result
718
+ except OSError: # removed, or no type or stat readable
708
719
  continue
709
720
 
710
721
  if len(relative.parts) >= MAX_WALK_DEPTH:
@@ -730,8 +741,9 @@ def _add_downloadable_files(
730
741
  os.close(sub_fd)
731
742
 
732
743
 
733
- def downloadable_files(directory: pathlib.Path) -> list[str]:
734
- """Return the paths, relative to 'directory', the workdir endpoint serves.
744
+ def downloadable_files(directory: pathlib.Path) -> dict[str, os.stat_result]:
745
+ """Map each path the workdir endpoint serves, relative to 'directory',
746
+ to its stat, sorted by path string.
735
747
 
736
748
  Sandboxed code may change the tree while the walk runs, so the walk
737
749
  holds each directory open and works relative to it (see
@@ -747,16 +759,16 @@ def downloadable_files(directory: pathlib.Path) -> list[str]:
747
759
  # Missing (a thread's workspace does not exist until a command
748
760
  # runs) or unreadable, which sandboxed code can make it: either
749
761
  # way, nothing is served from it.
750
- return []
762
+ return {}
751
763
 
752
- found = []
764
+ found = {}
753
765
 
754
766
  try:
755
767
  _add_downloadable_files(root_fd, pathlib.PurePosixPath(), found)
756
768
  finally:
757
769
  os.close(root_fd)
758
770
 
759
- return sorted(found)
771
+ return dict(sorted(found.items()))
760
772
 
761
773
 
762
774
  def _downloadable_count(directory: pathlib.Path | None) -> int:
@@ -356,7 +356,7 @@ class RunMessageWidget(t_widget.Widget):
356
356
  yield t_widgets.Label(f"{role.capitalize()}:")
357
357
 
358
358
  if content is not None:
359
- yield t_widgets.Static(content)
359
+ yield t_widgets.Static(content, markup=False)
360
360
 
361
361
 
362
362
  class RunEventWidget(t_widget.Widget):
@@ -394,7 +394,7 @@ class RunEventWidget(t_widget.Widget):
394
394
 
395
395
  def compose(self) -> t_app.ComposeResult:
396
396
  yield t_widgets.Label(self.event_type)
397
- yield t_widgets.Static(self.event_content)
397
+ yield t_widgets.Static(self.event_content, markup=False)
398
398
 
399
399
 
400
400
  class StateViewModal(t_screen.ModalScreen):
@@ -518,7 +518,9 @@ class RunView(t_screen.Screen):
518
518
 
519
519
  with RunLabeledWidget():
520
520
  yield t_widgets.Label("Label:")
521
- yield t_widgets.Static(self.label_text, id="run-label")
521
+ yield t_widgets.Static(
522
+ self.label_text, id="run-label", markup=False
523
+ )
522
524
 
523
525
  with RunLabeledWidget():
524
526
  yield t_widgets.Label("Messages:")
@@ -4,8 +4,10 @@ import datetime
4
4
  import functools
5
5
  import json
6
6
  import logging
7
+ import os
7
8
  import pathlib
8
9
  import re
10
+ import stat
9
11
  import subprocess
10
12
  import typing
11
13
 
@@ -183,6 +185,45 @@ def strip_default_port(url: datastructures.URL) -> datastructures.URL:
183
185
  return url
184
186
 
185
187
 
188
+ UNIX_EPOCH = datetime.datetime(1970, 1, 1, tzinfo=datetime.UTC)
189
+
190
+
191
+ def modified_at(stat_result: os.stat_result) -> datetime.datetime | None:
192
+ """Return the modification time in 'stat_result', in UTC.
193
+
194
+ 'None' when a 'datetime' cannot hold it (outside years 1 to 9999):
195
+ whoever writes the file can set any time, and a filesystem may store
196
+ it as set. Adding to the epoch, unlike 'fromtimestamp', fails only
197
+ with 'OverflowError', and the same way on every platform.
198
+ """
199
+ try:
200
+ return UNIX_EPOCH + datetime.timedelta(seconds=stat_result.st_mtime)
201
+ except OverflowError:
202
+ return None
203
+
204
+
205
+ def upload_files(directory: pathlib.Path) -> dict[str, os.stat_result]:
206
+ """Map each file in the uploads 'directory' to its stat.
207
+
208
+ Symlinks are followed, as the download views follow them: the
209
+ operator may link a shared file in. A missing 'directory' has no
210
+ files. One stat decides each entry, so an entry which is not a
211
+ regular file when stat'd, or cannot be stat'd, is left out.
212
+ """
213
+ files = {}
214
+
215
+ for file_or_sub in directory.glob("*"):
216
+ try:
217
+ stat_result = file_or_sub.stat()
218
+ except OSError: # removed, a dangling or looping link, access denied
219
+ continue
220
+
221
+ if stat.S_ISREG(stat_result.st_mode):
222
+ files[file_or_sub.name] = stat_result
223
+
224
+ return files
225
+
226
+
186
227
  @contextlib.contextmanager
187
228
  def noop(*arg, **kw):
188
229
  yield
@@ -101,27 +101,25 @@ async def get_uploads_room(
101
101
  )
102
102
 
103
103
  room_dir = pathlib.Path(uploads_path) / room_id
104
- filename_urls = {}
105
-
106
- if room_dir.is_dir():
107
- for file_or_sub in room_dir.glob("*"):
108
- if file_or_sub.is_file():
109
- filename = file_or_sub.name
110
- filename_urls[filename] = request.url_for(
111
- # View function name, not the route path.
112
- "get_uploads_room_filename",
113
- room_id=room_id,
114
- filename=filename,
115
- )
104
+ files = views_util.upload_files(room_dir)
116
105
 
117
106
  return models.RoomUploads(
118
107
  room_id=room_id,
119
108
  uploads=[
120
109
  models.FileUpload(
121
- filename=key,
122
- url=str(value), # The two URL types are not compatible
110
+ filename=filename,
111
+ url=str( # The two URL types are not compatible
112
+ request.url_for(
113
+ # View function name, not the route path.
114
+ "get_uploads_room_filename",
115
+ room_id=room_id,
116
+ filename=filename,
117
+ )
118
+ ),
119
+ modified_at=views_util.modified_at(stat_result),
120
+ size_bytes=stat_result.st_size,
123
121
  )
124
- for key, value in filename_urls.items()
122
+ for filename, stat_result in files.items()
125
123
  ],
126
124
  )
127
125
 
@@ -72,26 +72,27 @@ async def get_workdirs_room_thread(
72
72
  )
73
73
 
74
74
  thread_dir = pathlib.Path(workdirs_path) / room_id / thread_id
75
- filename_urls = {}
76
-
77
- for filename in skills_bwrap_sandbox.downloadable_files(thread_dir):
78
- filename_urls[filename] = request.url_for(
79
- # View function name, not the route path.
80
- "get_workdirs_room_thread_filename",
81
- room_id=room_id,
82
- thread_id=thread_id,
83
- filename=filename,
84
- )
75
+ files = skills_bwrap_sandbox.downloadable_files(thread_dir)
85
76
 
86
77
  return models.ThreadWorkdirFiles(
87
78
  room_id=room_id,
88
79
  thread_id=thread_id,
89
80
  files=[
90
81
  models.WorkdirFile(
91
- filename=key,
92
- url=str(value), # The two URL types are not compatible
82
+ filename=filename,
83
+ url=str( # The two URL types are not compatible
84
+ request.url_for(
85
+ # View function name, not the route path.
86
+ "get_workdirs_room_thread_filename",
87
+ room_id=room_id,
88
+ thread_id=thread_id,
89
+ filename=filename,
90
+ )
91
+ ),
92
+ modified_at=soliplex_views_util.modified_at(stat_result),
93
+ size_bytes=stat_result.st_size,
93
94
  )
94
- for key, value in filename_urls.items()
95
+ for filename, stat_result in files.items()
95
96
  ],
96
97
  )
97
98
 
@@ -61,29 +61,27 @@ async def get_uploads_room_id_thread_thread_id(
61
61
  )
62
62
 
63
63
  thread_dir = pathlib.Path(uploads_path) / thread_id
64
- filename_urls = {}
65
-
66
- if thread_dir.is_dir():
67
- for file_or_sub in thread_dir.glob("*"):
68
- if file_or_sub.is_file():
69
- filename = file_or_sub.name
70
- filename_urls[filename] = request.url_for(
71
- # View function name, not the route path.
72
- "get_uploads_room_id_thread_thread_id_filename",
73
- room_id=room_id,
74
- thread_id=thread_id,
75
- filename=filename,
76
- )
64
+ files = soliplex_views_util.upload_files(thread_dir)
77
65
 
78
66
  return models.ThreadUploads(
79
67
  room_id=room_id,
80
68
  thread_id=thread_id,
81
69
  uploads=[
82
70
  models.FileUpload(
83
- filename=key,
84
- url=str(value), # The two URL types are not compatible
71
+ filename=filename,
72
+ url=str( # The two URL types are not compatible
73
+ request.url_for(
74
+ # View function name, not the route path.
75
+ "get_uploads_room_id_thread_thread_id_filename",
76
+ room_id=room_id,
77
+ thread_id=thread_id,
78
+ filename=filename,
79
+ )
80
+ ),
81
+ modified_at=soliplex_views_util.modified_at(stat_result),
82
+ size_bytes=stat_result.st_size,
85
83
  )
86
- for key, value in filename_urls.items()
84
+ for filename, stat_result in files.items()
87
85
  ],
88
86
  )
89
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: soliplex
3
- Version: 0.90.1
3
+ Version: 0.91
4
4
  Summary: An AI-powered Retrieval-Augmented Generation (RAG) system with a modern web interface.
5
5
  Author-email: Enfold <info@enfoldsystems.net>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -20,7 +20,7 @@ Requires-Dist: fakeredis!=2.35.0
20
20
  Requires-Dist: fastapi
21
21
  Requires-Dist: fastmcp<5.0,>=4.1.2
22
22
  Requires-Dist: greenlet
23
- Requires-Dist: haiku.rag-slim<0.106,>=0.105.0
23
+ Requires-Dist: haiku.rag-slim<0.109,>=0.108.0
24
24
  Requires-Dist: idna>=3.15
25
25
  Requires-Dist: itsdangerous
26
26
  Requires-Dist: joserfc<1.8,>=1.7.5
@@ -10,7 +10,7 @@ fakeredis!=2.35.0
10
10
  fastapi
11
11
  fastmcp<5.0,>=4.1.2
12
12
  greenlet
13
- haiku.rag-slim<0.106,>=0.105.0
13
+ haiku.rag-slim<0.109,>=0.108.0
14
14
  idna>=3.15
15
15
  itsdangerous
16
16
  joserfc<1.8,>=1.7.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes