modal 1.6.5.dev4__tar.gz → 1.6.5.dev6__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 (258) hide show
  1. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/PKG-INFO +1 -1
  2. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_workspace.py +44 -37
  3. modal-1.6.5.dev6/modal/cli/_audit_logs.py +163 -0
  4. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_logs.py +4 -2
  5. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/image.py +17 -35
  6. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/shell.py +12 -2
  7. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/workspace.py +88 -10
  8. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/client.pyi +2 -2
  9. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_sandbox.py +4 -2
  10. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/sandbox.pyi +8 -4
  11. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/workspace.pyi +63 -57
  12. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/PKG-INFO +1 -1
  13. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/SOURCES.txt +1 -1
  14. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_grpc.py +19 -3
  15. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2.py +582 -535
  16. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2.pyi +210 -4
  17. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2_grpc.py +36 -3
  18. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2_grpc.pyi +12 -2
  19. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/modal_api_grpc.py +1 -0
  20. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_version/__init__.py +1 -1
  21. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/pyproject.toml +3 -9
  22. modal-1.6.5.dev4/modal/experimental/ipython.py +0 -84
  23. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/LICENSE +0 -0
  24. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/README.md +0 -0
  25. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/__init__.py +0 -0
  26. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/__main__.py +0 -0
  27. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/__init__.py +0 -0
  28. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/_rpcs.py +0 -0
  29. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/count.py +0 -0
  30. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/list.py +0 -0
  31. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_billing.py +0 -0
  32. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_cluster.py +0 -0
  33. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_cluster.pyi +0 -0
  34. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_container_entrypoint.py +0 -0
  35. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_environments.py +0 -0
  36. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_function_variants.py +0 -0
  37. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_functions.py +0 -0
  38. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_grpc_client.py +0 -0
  39. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_image.py +0 -0
  40. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_ipython.py +0 -0
  41. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_load_context.py +0 -0
  42. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_location.py +0 -0
  43. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_logs.py +0 -0
  44. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_logs_manager.py +0 -0
  45. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_logs_manager.pyi +0 -0
  46. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_metrics.py +0 -0
  47. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_metrics.pyi +0 -0
  48. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_object.py +0 -0
  49. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_outbound_policy.py +0 -0
  50. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_outbound_policy.pyi +0 -0
  51. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/__init__.py +0 -0
  52. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/manager.py +0 -0
  53. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/pty.py +0 -0
  54. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/rich.py +0 -0
  55. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/status.py +0 -0
  56. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_partial_function.py +0 -0
  57. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_resolver.py +0 -0
  58. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_resources.py +0 -0
  59. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/__init__.py +0 -0
  60. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/asgi.py +0 -0
  61. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/container_io_manager.py +0 -0
  62. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/container_io_manager.pyi +0 -0
  63. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/execution_context.py +0 -0
  64. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/execution_context.pyi +0 -0
  65. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/gpu_memory_snapshot.py +0 -0
  66. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/task_lifecycle_manager.py +0 -0
  67. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
  68. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/telemetry.py +0 -0
  69. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/user_code_event_loop.py +0 -0
  70. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/user_code_imports.py +0 -0
  71. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_serialization.py +0 -0
  72. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_server.py +0 -0
  73. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_server.pyi +0 -0
  74. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_supports_logs.py +0 -0
  75. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_traceback.py +0 -0
  76. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_tunnel.py +0 -0
  77. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_tunnel.pyi +0 -0
  78. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_type_manager.py +0 -0
  79. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/__init__.py +0 -0
  80. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/app_utils.py +0 -0
  81. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/async_utils.py +0 -0
  82. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/auth_token_manager.py +0 -0
  83. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/blob_utils.py +0 -0
  84. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/browser_utils.py +0 -0
  85. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/bytes_io_segment_payload.py +0 -0
  86. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/curl_utils.py +0 -0
  87. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/deprecation.py +0 -0
  88. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/display_utils.py +0 -0
  89. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/docker_utils.py +0 -0
  90. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/function_utils.py +0 -0
  91. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/git_utils.py +0 -0
  92. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/grpc_testing.py +0 -0
  93. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/grpc_utils.py +0 -0
  94. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/hash_utils.py +0 -0
  95. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/http_utils.py +0 -0
  96. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/idle_countdown.py +0 -0
  97. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/jwt_utils.py +0 -0
  98. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/logger.py +0 -0
  99. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/mount_utils.py +0 -0
  100. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/name_utils.py +0 -0
  101. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/oauth.py +0 -0
  102. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/package_utils.py +0 -0
  103. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/pattern_utils.py +0 -0
  104. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/proxy_support.py +0 -0
  105. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/rand_pb_testing.py +0 -0
  106. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/sandbox_fs_utils.py +0 -0
  107. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/shell_utils.py +0 -0
  108. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/time_utils.py +0 -0
  109. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/__init__.py +0 -0
  110. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/a2wsgi_wsgi.py +0 -0
  111. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/cloudpickle.py +0 -0
  112. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/tblib.py +0 -0
  113. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/version.py +0 -0
  114. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_watcher.py +0 -0
  115. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/app.py +0 -0
  116. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/app.pyi +0 -0
  117. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/billing.py +0 -0
  118. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/billing.pyi +0 -0
  119. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2023.12.312.txt +0 -0
  120. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2023.12.txt +0 -0
  121. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2024.04.txt +0 -0
  122. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2024.10.txt +0 -0
  123. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2025.06.txt +0 -0
  124. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2026.10.txt +0 -0
  125. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/PREVIEW.txt +0 -0
  126. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/README.md +0 -0
  127. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/base-images.json +0 -0
  128. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/call_graph.py +0 -0
  129. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/__init__.py +0 -0
  130. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_download.py +0 -0
  131. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_help.py +0 -0
  132. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_stats.py +0 -0
  133. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_suggest.py +0 -0
  134. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_traceback.py +0 -0
  135. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/app.py +0 -0
  136. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/billing.py +0 -0
  137. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/changelog.py +0 -0
  138. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/config.py +0 -0
  139. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/container.py +0 -0
  140. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/curl.py +0 -0
  141. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/dashboard.py +0 -0
  142. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/dict.py +0 -0
  143. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/endpoint.py +0 -0
  144. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/entry_point.py +0 -0
  145. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/environment.py +0 -0
  146. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/function.py +0 -0
  147. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/import_refs.py +0 -0
  148. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/logo.py +0 -0
  149. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/network_file_system.py +0 -0
  150. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/profile.py +0 -0
  151. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/queues.py +0 -0
  152. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/run.py +0 -0
  153. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/secret.py +0 -0
  154. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/selector.py +0 -0
  155. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/server.py +0 -0
  156. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/skills.py +0 -0
  157. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/token.py +0 -0
  158. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/utils.py +0 -0
  159. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/volume.py +0 -0
  160. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/client.py +0 -0
  161. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cloud_bucket_mount.py +0 -0
  162. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cloud_bucket_mount.pyi +0 -0
  163. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cls.py +0 -0
  164. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cls.pyi +0 -0
  165. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cluster.py +0 -0
  166. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cluster.pyi +0 -0
  167. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/config.py +0 -0
  168. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/container_process.py +0 -0
  169. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/container_process.pyi +0 -0
  170. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/dict.py +0 -0
  171. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/dict.pyi +0 -0
  172. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/environments.py +0 -0
  173. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/environments.pyi +0 -0
  174. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/exception.py +0 -0
  175. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/__init__.py +0 -0
  176. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/_flash_container_entry.py +0 -0
  177. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash.py +0 -0
  178. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash.pyi +0 -0
  179. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash_server.py +0 -0
  180. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash_server.pyi +0 -0
  181. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/stream.py +0 -0
  182. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/stream.pyi +0 -0
  183. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/file_pattern_matcher.py +0 -0
  184. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/functions.py +0 -0
  185. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/functions.pyi +0 -0
  186. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/image.py +0 -0
  187. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/image.pyi +0 -0
  188. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/io_streams.py +0 -0
  189. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/io_streams.pyi +0 -0
  190. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/mount.py +0 -0
  191. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/mount.pyi +0 -0
  192. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/network_file_system.py +0 -0
  193. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/network_file_system.pyi +0 -0
  194. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/object.py +0 -0
  195. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/object.pyi +0 -0
  196. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/output.py +0 -0
  197. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/parallel_map.py +0 -0
  198. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/parallel_map.pyi +0 -0
  199. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/partial_function.py +0 -0
  200. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/partial_function.pyi +0 -0
  201. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/proxy.py +0 -0
  202. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/proxy.pyi +0 -0
  203. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/py.typed +0 -0
  204. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/queue.py +0 -0
  205. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/queue.pyi +0 -0
  206. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/retries.py +0 -0
  207. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/runner.py +0 -0
  208. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/runner.pyi +0 -0
  209. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/running_app.py +0 -0
  210. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/__init__.py +0 -0
  211. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_common.py +0 -0
  212. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_filesystem.py +0 -0
  213. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_impl_persistent.py +0 -0
  214. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_impl_v1.py +0 -0
  215. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_impl_v2.py +0 -0
  216. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_sidecar.py +0 -0
  217. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_snapshot.py +0 -0
  218. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_task_command_router_client.py +0 -0
  219. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/sandbox.py +0 -0
  220. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/schedule.py +0 -0
  221. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/scheduler_placement.py +0 -0
  222. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/secret.py +0 -0
  223. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/secret.pyi +0 -0
  224. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/server.py +0 -0
  225. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/server.pyi +0 -0
  226. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/serving.py +0 -0
  227. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/serving.pyi +0 -0
  228. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/skills/modal/SKILL.md +0 -0
  229. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/stream_type.py +0 -0
  230. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/token_flow.py +0 -0
  231. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/token_flow.pyi +0 -0
  232. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/types.py +0 -0
  233. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/volume.py +0 -0
  234. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/volume.pyi +0 -0
  235. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/workspace.py +0 -0
  236. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/dependency_links.txt +0 -0
  237. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/entry_points.txt +0 -0
  238. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/requires.txt +0 -0
  239. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/top_level.txt +0 -0
  240. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/__init__.py +0 -0
  241. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_cli_docs.py +0 -0
  242. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_cli_docs_main.py +0 -0
  243. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_reference_docs.py +0 -0
  244. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_reference_docs_main.py +0 -0
  245. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/__init__.py +0 -0
  246. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/mdmd.py +0 -0
  247. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/signatures.py +0 -0
  248. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/types.py +0 -0
  249. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/reference_intro.md +0 -0
  250. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/__init__.py +0 -0
  251. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/py.typed +0 -0
  252. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_grpc.py +0 -0
  253. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2.py +0 -0
  254. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2.pyi +0 -0
  255. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2_grpc.py +0 -0
  256. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
  257. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_version/__main__.py +0 -0
  258. {modal-1.6.5.dev4 → modal-1.6.5.dev6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.6.5.dev4
3
+ Version: 1.6.5.dev6
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -912,31 +912,6 @@ class _WorkspaceMemberTokenManager:
912
912
  def __init__(self, workspace: _Workspace):
913
913
  self._workspace = workspace
914
914
 
915
- async def list(self) -> list[MemberTokenInfo]:
916
- """List Member Tokens in the specified Workspace.
917
-
918
- If you are a Manager or an Owner of this Workspace, this method will return a list of all the
919
- Member Tokens in the Workspace. Otherwise, this method will only return the Tokens you have
920
- created.
921
-
922
- Returns:
923
- A list of `MemberTokenInfo` dataclasses.
924
-
925
- Examples:
926
-
927
- ```python notest
928
- ws = modal.Workspace.from_context()
929
- for member_token in ws.member_tokens.list():
930
- print(member_token)
931
- ```
932
- """
933
- if not self._workspace._is_hydrated:
934
- await self._workspace.hydrate()
935
-
936
- resp = await self._workspace.client._stub.TokensList(Empty())
937
-
938
- return [MemberTokenInfo._from_proto(token) for token in resp.tokens]
939
-
940
915
  async def disable(self, *token_ids: str) -> None:
941
916
  """Disable member tokens in the specified Workspace.
942
917
 
@@ -993,29 +968,61 @@ class _WorkspaceMemberTokenManager:
993
968
 
994
969
  await self._workspace.client._stub.TokenEnable(api_pb2.TokenEnableRequest(token_ids=list(set(token_ids))))
995
970
 
996
- async def delete(self, token_id: str, *, allow_missing: bool = False) -> None:
997
- """Delete a Member Token in the specified Workspace.
971
+ async def delete(self, *token_ids: str, allow_missing: bool = False) -> "list[str]":
972
+ """Delete member tokens in the specified Workspace.
998
973
 
999
- If you are a Workspace Manager or Owner, you can use this method to delete any Token in the
1000
- Workspace. Otherwise, you can only delete Member Tokens that you have created.
974
+ If you are a Workspace Manager or Owner, you can use this method to delete any token in the
975
+ Workspace. Otherwise, you can only delete member tokens that you have created.
1001
976
 
1002
977
  Args:
1003
- token_id: The ID of the Member Token you would like to delete.
1004
- allow_missing: If `True`, do not throw an exception if the Member Token does not exist.
978
+ *token_ids: The ID(s) of the token(s) you would like to delete.
979
+ allow_missing: If `True`, do not throw an exception if some of the tokens do not exist.
980
+
981
+ Returns:
982
+ A list of the tokens that were successfully deleted.
1005
983
 
1006
984
  Examples:
1007
985
 
1008
986
  ```python notest
1009
987
  ws = modal.Workspace.from_context()
1010
- ws.member_tokens.delete(token_id="ak-0123456789abcdefghijkl")
988
+ ws.member_tokens.delete("ak-0123456789abcdefghijkl", "ak-mnopqrstuvwxyz01234567")
1011
989
  ```
1012
990
  """
1013
991
 
1014
992
  if not self._workspace._is_hydrated:
1015
993
  await self._workspace.hydrate()
1016
994
 
1017
- try:
1018
- await self._workspace.client._stub.TokenDelete(req=api_pb2.TokenDeleteRequest(token_id=token_id))
1019
- except NotFoundError:
1020
- if not allow_missing:
1021
- raise
995
+ resp = await self._workspace.client._stub.TokenDelete(
996
+ req=api_pb2.TokenDeleteRequest(
997
+ token_ids=token_ids,
998
+ allow_missing=allow_missing,
999
+ )
1000
+ )
1001
+
1002
+ return list(resp.deleted_token_ids)
1003
+
1004
+ # .list() must be defined last, as otherwise it masks the builtin `list` type in annotations
1005
+ async def list(self) -> "list[MemberTokenInfo]":
1006
+ """List Member Tokens in the specified Workspace.
1007
+
1008
+ If you are a Manager or an Owner of this Workspace, this method will return a list of all the
1009
+ Member Tokens in the Workspace. Otherwise, this method will only return the Tokens you have
1010
+ created.
1011
+
1012
+ Returns:
1013
+ A list of `MemberTokenInfo` dataclasses.
1014
+
1015
+ Examples:
1016
+
1017
+ ```python notest
1018
+ ws = modal.Workspace.from_context()
1019
+ for member_token in ws.member_tokens.list():
1020
+ print(member_token)
1021
+ ```
1022
+ """
1023
+ if not self._workspace._is_hydrated:
1024
+ await self._workspace.hydrate()
1025
+
1026
+ resp = await self._workspace.client._stub.TokensList(Empty())
1027
+
1028
+ return [MemberTokenInfo._from_proto(token) for token in resp.tokens]
@@ -0,0 +1,163 @@
1
+ # Copyright Modal Labs 2026
2
+ import contextlib
3
+ import csv
4
+ import io
5
+ import json
6
+ import logging
7
+ from collections.abc import Iterable, Iterator
8
+ from datetime import datetime, timezone
9
+
10
+ import click
11
+
12
+ from modal._utils.logger import logger
13
+ from modal._workspace import _AUDIT_LOG_DEFAULT_WINDOW, _WorkspaceAuditLogsManager
14
+ from modal.types import AuditEvent
15
+
16
+ from ._logs import _parse_fetch_range
17
+
18
+ _CSV_COLUMNS = (
19
+ "id",
20
+ "timestamp",
21
+ "action",
22
+ "status",
23
+ "actor_type",
24
+ "actor_id",
25
+ "actor_name",
26
+ "actor_email",
27
+ "target_type",
28
+ "target_id",
29
+ "workspace_id",
30
+ "environment_id",
31
+ "environment_name",
32
+ "source",
33
+ "ip_address",
34
+ "metadata",
35
+ )
36
+
37
+
38
+ def _timestamp(entry: AuditEvent) -> str:
39
+ return entry.timestamp.astimezone(timezone.utc).isoformat(timespec="milliseconds")
40
+
41
+
42
+ def _csv_row(entry: AuditEvent) -> list[str | None]:
43
+ target = entry.targets[0] if entry.targets else None
44
+ return [
45
+ entry.id,
46
+ _timestamp(entry),
47
+ entry.action,
48
+ entry.status,
49
+ entry.actor.type,
50
+ entry.actor.id,
51
+ entry.actor.name,
52
+ entry.actor.email,
53
+ target.type if target else None,
54
+ target.id if target else None,
55
+ entry.context.workspace_id,
56
+ entry.context.environment_id,
57
+ entry.context.environment_name,
58
+ entry.context.source,
59
+ str(entry.context.ip_address) if entry.context.ip_address else None,
60
+ json.dumps(entry.metadata),
61
+ ]
62
+
63
+
64
+ def _format_json(entry: AuditEvent) -> str:
65
+ return json.dumps(
66
+ {
67
+ "id": entry.id,
68
+ "timestamp": _timestamp(entry),
69
+ "action": entry.action,
70
+ "status": entry.status,
71
+ "actor": {
72
+ "type": entry.actor.type,
73
+ "id": entry.actor.id,
74
+ "name": entry.actor.name,
75
+ "email": entry.actor.email,
76
+ },
77
+ "targets": [{"type": target.type, "id": target.id} for target in entry.targets],
78
+ "context": {
79
+ "workspace_id": entry.context.workspace_id,
80
+ "environment_id": entry.context.environment_id,
81
+ "environment_name": entry.context.environment_name,
82
+ "source": entry.context.source,
83
+ "ip_address": str(entry.context.ip_address) if entry.context.ip_address else None,
84
+ },
85
+ "metadata": entry.metadata,
86
+ }
87
+ )
88
+
89
+
90
+ def _print_csv_row(row: Iterable[str | None]) -> None:
91
+ buffer = io.StringIO(newline="")
92
+ csv.writer(buffer, lineterminator="\n").writerow(row)
93
+ click.echo(buffer.getvalue(), nl=False)
94
+
95
+
96
+ async def _print_events(
97
+ manager: _WorkspaceAuditLogsManager,
98
+ *,
99
+ query: str,
100
+ since: datetime | None,
101
+ until: datetime,
102
+ limit: int | None,
103
+ as_csv: bool,
104
+ ) -> None:
105
+ if as_csv:
106
+ _print_csv_row(_CSV_COLUMNS)
107
+ stream = manager.fetch(query, since=since, until=until, limit=limit)
108
+ try:
109
+ async for entry in stream:
110
+ if as_csv:
111
+ _print_csv_row(_csv_row(entry))
112
+ else:
113
+ click.echo(_format_json(entry))
114
+ finally:
115
+ await stream.aclose()
116
+
117
+
118
+ class _DropRateLimitWarnings(logging.Filter):
119
+ def filter(self, record: logging.LogRecord) -> bool:
120
+ message = record.getMessage()
121
+ return not ("/AuditLog" in message and "RESOURCE_EXHAUSTED" in message)
122
+
123
+
124
+ @contextlib.contextmanager
125
+ def _quiet_rate_limit_warnings() -> Iterator[None]:
126
+ """Hides the SDK's per-retry rate limit warnings so they don't interleave with the printed events."""
127
+ log_filter = _DropRateLimitWarnings()
128
+ logger.addFilter(log_filter)
129
+ try:
130
+ yield
131
+ finally:
132
+ logger.removeFilter(log_filter)
133
+
134
+
135
+ async def run_audit_logs_command(
136
+ manager: _WorkspaceAuditLogsManager,
137
+ *,
138
+ query: str,
139
+ since: str | None,
140
+ until: str | None,
141
+ limit: int | None,
142
+ count_only: bool,
143
+ as_csv: bool,
144
+ ) -> None:
145
+ if count_only and as_csv:
146
+ raise click.UsageError("--csv can't be used with --count.")
147
+ if count_only and since is None:
148
+ raise click.UsageError("--since is required with --count.")
149
+ since_dt, until_dt = _parse_fetch_range(since, until, _AUDIT_LOG_DEFAULT_WINDOW)
150
+
151
+ with _quiet_rate_limit_warnings():
152
+ if count_only:
153
+ click.echo(await manager.count(query, since=since_dt, until=until_dt))
154
+ return
155
+
156
+ await _print_events(
157
+ manager,
158
+ query=query,
159
+ since=since_dt if since is not None else None,
160
+ until=until_dt,
161
+ limit=limit,
162
+ as_csv=as_csv,
163
+ )
@@ -53,7 +53,9 @@ def _validate_logs_args(*, follow: bool, since: str | None, until: str | None, t
53
53
  raise UsageError(f"--tail value must not exceed {_FETCH_LIMIT}.")
54
54
 
55
55
 
56
- def _parse_fetch_range(since: str | None, until: str | None) -> tuple[datetime, datetime]:
56
+ def _parse_fetch_range(
57
+ since: str | None, until: str | None, default_window: timedelta = timedelta(hours=1)
58
+ ) -> tuple[datetime, datetime]:
57
59
  now = datetime.now(timezone.utc).replace(microsecond=0)
58
60
 
59
61
  def parse_bound(value: str | None, default: datetime, flag: str) -> datetime:
@@ -70,7 +72,7 @@ def _parse_fetch_range(since: str | None, until: str | None) -> tuple[datetime,
70
72
  return result
71
73
 
72
74
  until_dt = parse_bound(until, now, "--until")
73
- since_dt = parse_bound(since, until_dt - timedelta(hours=1), "--since")
75
+ since_dt = parse_bound(since, until_dt - default_window, "--since")
74
76
  if since_dt >= until_dt:
75
77
  raise UsageError("--since must be before --until.")
76
78
  if since_dt.timestamp() < 0:
@@ -371,31 +371,15 @@ async def _iter_tag_pages(
371
371
  async def _fetch_history_page(
372
372
  client: _Client,
373
373
  name_tag: str,
374
- page_token: str,
375
374
  ) -> api_pb2.ImageTagRevisionsResponse:
376
375
  return await client._stub.ImageTagRevisions(
377
376
  api_pb2.ImageTagRevisionsRequest(
378
377
  tag=name_tag,
379
378
  max_objects=IMAGE_NAMES_HISTORY_PAGE_SIZE,
380
- page_token=page_token,
381
379
  )
382
380
  )
383
381
 
384
382
 
385
- async def _iter_history_pages(
386
- client: _Client, name_tag: str, first_page: api_pb2.ImageTagRevisionsResponse
387
- ) -> AsyncIterator[api_pb2.ImageTagRevisionsResponse]:
388
- response = first_page
389
-
390
- while True:
391
- yield response
392
-
393
- if not response.next_page_token:
394
- return
395
- await asyncio.sleep(IMAGE_NAMES_HISTORY_PAGE_DELAY_SECONDS)
396
- response = await _fetch_history_page(client, name_tag, response.next_page_token)
397
-
398
-
399
383
  image_names_cli = ModalGroup(name="names", help="Manage Modal Image names.")
400
384
  image_cli.add_command(image_names_cli)
401
385
 
@@ -453,34 +437,32 @@ async def history(
453
437
  )
454
438
  client = await _Client.from_env()
455
439
 
456
- first_page = await _fetch_history_page(client, upgraded_image_name, "")
457
- if not first_page.items:
458
- raise click.ClickException(f"No publishing history found for named image {first_page.tag!r}.")
440
+ response = await _fetch_history_page(client, upgraded_image_name)
441
+ if not response.items:
442
+ raise click.ClickException(f"No publishing history found for named image {response.tag!r}.")
459
443
 
460
444
  if json:
461
445
  click.echo("[", nl=False)
462
446
  count = 0
463
- async for response in _iter_history_pages(client, upgraded_image_name, first_page):
464
- for item in response.items:
465
- if count:
466
- click.echo(",", nl=False)
467
- click.echo(json_module.dumps(_history_item_json(item)), nl=False)
468
- count += 1
447
+ for item in response.items:
448
+ if count:
449
+ click.echo(",", nl=False)
450
+ click.echo(json_module.dumps(_history_item_json(item)), nl=False)
451
+ count += 1
469
452
  click.echo("]")
470
453
  return
471
454
 
472
455
  count = 0
473
456
  show_title = True
474
- async for response in _iter_history_pages(client, upgraded_image_name, first_page):
475
- if response.items:
476
- title = f"History for {response.tag}" if show_title else ""
477
- display_table(
478
- ["Image ID", "Published at", "Published by"],
479
- [_history_item_row(item) for item in response.items],
480
- title=title,
481
- )
482
- show_title = False
483
- count += len(response.items)
457
+ if response.items:
458
+ title = f"History for {response.tag}" if show_title else ""
459
+ display_table(
460
+ ["Image ID", "Published at", "Published by"],
461
+ [_history_item_row(item) for item in response.items],
462
+ title=title,
463
+ )
464
+ show_title = False
465
+ count += len(response.items)
484
466
 
485
467
  _print_result_summary(count)
486
468
 
@@ -293,8 +293,18 @@ def _start_shell_from_image(
293
293
  multiple=True,
294
294
  help="Name of a modal.Secret to mount inside the shell (if not using REF). Can be used multiple times.",
295
295
  )
296
- @click.option("--cpu", default=None, type=int, help="Number of CPUs to allocate to the shell (if not using REF).")
297
- @click.option("--memory", default=None, type=int, help="Memory to allocate for the shell, in MiB (if not using REF).")
296
+ @click.option(
297
+ "--cpu",
298
+ default=None,
299
+ type=int,
300
+ help="Number of CPU cores to request for the shell (if not using REF). The shell can burst above this request.",
301
+ )
302
+ @click.option(
303
+ "--memory",
304
+ default=None,
305
+ type=int,
306
+ help="Memory to request for the shell, in MiB (if not using REF). The shell can burst above this request.",
307
+ )
298
308
  @click.option(
299
309
  "--gpu",
300
310
  default=None,
@@ -20,6 +20,7 @@ from modal.output import OutputManager
20
20
  from modal.workspace import Workspace
21
21
  from modal_proto import api_pb2
22
22
 
23
+ from ._audit_logs import run_audit_logs_command
23
24
  from ._help import _MAX_HELP_WIDTH, ModalGroup
24
25
 
25
26
  WORKSPACE_HELP_TEXT = """Interact with the current Modal Workspace.
@@ -55,6 +56,76 @@ def members_list(json: bool = False):
55
56
  display_table(["Name", "Email", "Role", "User ID", "Joined", "Last active"], rows, json=json)
56
57
 
57
58
 
59
+ @workspace_cli.command("audit-logs", short_help="Show Workspace audit logs as JSON (default) or CSV.")
60
+ @click.option(
61
+ "-q",
62
+ "--query",
63
+ default="",
64
+ help="Filter events with the audit log search syntax. See https://modal.com/docs/guide/log-search-syntax",
65
+ )
66
+ @click.option(
67
+ "--since",
68
+ default=None,
69
+ help="Start of time range. Accepts ISO 8601 datetime or relative time, e.g. '1d' (1 day ago), '2h', '30m'.",
70
+ )
71
+ @click.option("--until", default=None, help="End of time range; accepts same argument types as --since.")
72
+ @click.option(
73
+ "-n",
74
+ "--limit",
75
+ type=int,
76
+ default=None,
77
+ help="Show the newest N events in the range.",
78
+ )
79
+ @click.option(
80
+ "--count", "count_only", is_flag=True, default=False, help="Print the number of matching events; requires --since."
81
+ )
82
+ @click.option("--csv", "as_csv", is_flag=True, default=False, help="Output CSV instead of newline-delimited JSON.")
83
+ @synchronizer.create_blocking
84
+ async def audit_logs(
85
+ query: str = "",
86
+ since: str | None = None,
87
+ until: str | None = None,
88
+ limit: int | None = None,
89
+ count_only: bool = False,
90
+ as_csv: bool = False,
91
+ ):
92
+ """Show the audit logs of the current Workspace as newline-delimited JSON (default) or CSV.
93
+
94
+ By default, this command prints the newest 100 events from the last 7 days. With ``--since``, it
95
+ prints every event in the range, oldest first. The range cannot exceed 7 days.
96
+
97
+ Each line contains a full event, including metadata, with a UTC timestamp at millisecond precision.
98
+
99
+ Counting with ``--count`` requires ``--since`` to specify the start of the time range.
100
+
101
+ Examples:
102
+
103
+ ```bash
104
+ # Newest 100 events
105
+ modal workspace audit-logs
106
+
107
+ # Every deploy or stop in the last 2 days
108
+ modal workspace audit-logs -q 'action:(app.deploy OR app.stop)' --since 2d
109
+
110
+ # Every field of each event, one JSON object per line
111
+ modal workspace audit-logs --since 1d
112
+
113
+ # Export every event in the last day as CSV
114
+ modal workspace audit-logs --since 1d --csv > audit.csv
115
+
116
+ # How many secrets were created in the last 7 days
117
+ modal workspace audit-logs -q 'action:secret.create' --since 7d --count
118
+ ```
119
+ """
120
+ if limit is not None and limit < 1:
121
+ raise click.BadParameter("must be at least 1", param_hint="'--limit'")
122
+ ws = _Workspace.from_context()
123
+ await ws.hydrate()
124
+ await run_audit_logs_command(
125
+ ws.audit_logs, query=query, since=since, until=until, limit=limit, count_only=count_only, as_csv=as_csv
126
+ )
127
+
128
+
58
129
  PROXY_TOKENS_HELP_TEXT = """Manage the proxy tokens of the current Workspace.
59
130
 
60
131
  Proxy tokens provide authentication to Modal Endpoints, Servers, and Web Functions.
@@ -726,28 +797,35 @@ def member_tokens_list(json: bool):
726
797
 
727
798
 
728
799
  @member_tokens_cli.command("delete", no_args_is_help=True)
729
- @click.argument("token_id")
730
- @click.option("--allow-missing", is_flag=True, default=False, help="Don't error if the Token doesn't exist.")
800
+ @click.argument("token_ids", nargs=-1)
801
+ @click.option(
802
+ "--allow-missing", is_flag=True, default=False, help="Don't error if any of the specified tokens don't exist."
803
+ )
731
804
  @yes_option
732
- def member_tokens_delete(token_id: str, *, allow_missing: bool, yes: bool):
733
- """Delete a Member Token in this Workspace.
805
+ def member_tokens_delete(token_ids: list[str], *, allow_missing: bool, yes: bool):
806
+ """Delete member tokens in this Workspace.
734
807
 
735
- Note that this action is irreversible. This will immediately invalidate the target token and will
736
- render it unable to authenticate with Modal.
808
+ Note that this action is irreversible. This will immediately invalidate the target tokens and will
809
+ render them unable to authenticate with Modal.
737
810
 
738
811
  ```bash
739
- # Delete the Token with ID `ak-0123456789abcdefghijkl`
812
+ # Delete the token with ID `ak-0123456789abcdefghijkl`
740
813
  modal workspace member-tokens delete ak-0123456789abcdefghijkl
814
+
815
+ # Delete multiple tokens
816
+ modal workspace member-tokens delete ak-0123456789abcdefghijkl ak-mnopqrstuvwxyz01234567
741
817
  ```
742
818
  """
743
819
  if not yes:
744
- confirm_or_suggest_yes(f"Are you sure you want to irrevocably delete the Token '{token_id}'?")
820
+ confirm_or_suggest_yes(f"Are you sure you want to irrevocably delete {len(token_ids)} token(s)?")
745
821
 
746
822
  ws = Workspace.from_context()
747
- ws.member_tokens.delete(token_id, allow_missing=allow_missing)
823
+ deleted_token_ids = ws.member_tokens.delete(*token_ids, allow_missing=allow_missing)
748
824
 
749
825
  output_manager = OutputManager.get()
750
- output_manager.print(f"[green]✓[/green] Deleted Token `{token_id}`.")
826
+ output_manager.print(
827
+ f"[green]✓[/green] Deleted {len(deleted_token_ids)} {'token' if len(deleted_token_ids) == 1 else 'tokens'}."
828
+ )
751
829
 
752
830
 
753
831
  @member_tokens_cli.command("disable", no_args_is_help=True)
@@ -85,7 +85,7 @@ class _Client:
85
85
  server_url: str,
86
86
  client_type: int,
87
87
  credentials: typing.Optional[tuple[str, str]],
88
- version: str = "1.6.5.dev4",
88
+ version: str = "1.6.5.dev6",
89
89
  *,
90
90
  oauth_credentials: typing.Optional[_OAuthCredentials] = None,
91
91
  ):
@@ -310,7 +310,7 @@ class Client:
310
310
  server_url: str,
311
311
  client_type: int,
312
312
  credentials: typing.Optional[tuple[str, str]],
313
- version: str = "1.6.5.dev4",
313
+ version: str = "1.6.5.dev6",
314
314
  *,
315
315
  oauth_credentials: typing.Optional[_OAuthCredentials] = None,
316
316
  ):
@@ -242,10 +242,12 @@ class _Sandbox(_Object, type_prefixes=("sb",)):
242
242
  cpu:
243
243
  Specify, in fractional CPU cores, how many CPU cores to request. Or, pass (request, limit) to
244
244
  additionally specify a hard limit in fractional CPU cores. CPU throttling will prevent a container
245
- from exceeding its specified limit.
245
+ from exceeding its specified limit. Modal Sandboxes support bursting above the CPU request, so most
246
+ users don't need to specify a request.
246
247
  memory:
247
248
  Specify, in MiB, a memory request which is the minimum memory required. Or, pass (request, limit) to
248
- additionally specify a hard limit in MiB.
249
+ additionally specify a hard limit in MiB. Modal Sandboxes support bursting above the memory request,
250
+ so most users don't need to specify a request.
249
251
  runtime:
250
252
  Runtime under which the Sandbox executes, or None to let Modal pick.
251
253
  block_network: Whether to block network access.
@@ -1391,10 +1391,12 @@ class Sandbox(modal.object.Object):
1391
1391
  cpu:
1392
1392
  Specify, in fractional CPU cores, how many CPU cores to request. Or, pass (request, limit) to
1393
1393
  additionally specify a hard limit in fractional CPU cores. CPU throttling will prevent a container
1394
- from exceeding its specified limit.
1394
+ from exceeding its specified limit. Modal Sandboxes support bursting above the CPU request, so most
1395
+ users don't need to specify a request.
1395
1396
  memory:
1396
1397
  Specify, in MiB, a memory request which is the minimum memory required. Or, pass (request, limit) to
1397
- additionally specify a hard limit in MiB.
1398
+ additionally specify a hard limit in MiB. Modal Sandboxes support bursting above the memory request,
1399
+ so most users don't need to specify a request.
1398
1400
  runtime:
1399
1401
  Runtime under which the Sandbox executes, or None to let Modal pick.
1400
1402
  block_network: Whether to block network access.
@@ -1518,10 +1520,12 @@ class Sandbox(modal.object.Object):
1518
1520
  cpu:
1519
1521
  Specify, in fractional CPU cores, how many CPU cores to request. Or, pass (request, limit) to
1520
1522
  additionally specify a hard limit in fractional CPU cores. CPU throttling will prevent a container
1521
- from exceeding its specified limit.
1523
+ from exceeding its specified limit. Modal Sandboxes support bursting above the CPU request, so most
1524
+ users don't need to specify a request.
1522
1525
  memory:
1523
1526
  Specify, in MiB, a memory request which is the minimum memory required. Or, pass (request, limit) to
1524
- additionally specify a hard limit in MiB.
1527
+ additionally specify a hard limit in MiB. Modal Sandboxes support bursting above the memory request,
1528
+ so most users don't need to specify a request.
1525
1529
  runtime:
1526
1530
  Runtime under which the Sandbox executes, or None to let Modal pick.
1527
1531
  block_network: Whether to block network access.