safe-colab-cli 0.13.2__tar.gz → 0.13.4__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 (25) hide show
  1. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/PKG-INFO +1 -1
  2. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/pyproject.toml +1 -1
  3. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/__init__.py +1 -1
  4. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/artifacts.py +11 -1
  5. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/service.py +13 -2
  6. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli.egg-info/PKG-INFO +1 -1
  7. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/README.md +0 -0
  8. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/__main__.py +0 -0
  9. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/auth.py +0 -0
  10. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/cli.py +0 -0
  11. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/dashboard.html +0 -0
  12. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/event_log.py +0 -0
  13. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/guardian.py +0 -0
  14. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/kernel.py +0 -0
  15. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli/sandbox.py +0 -0
  16. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli.egg-info/SOURCES.txt +0 -0
  17. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli.egg-info/dependency_links.txt +0 -0
  18. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli.egg-info/entry_points.txt +0 -0
  19. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli.egg-info/requires.txt +0 -0
  20. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/safe_colab_cli.egg-info/top_level.txt +0 -0
  21. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/setup.cfg +0 -0
  22. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/tests/test_auth.py +0 -0
  23. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/tests/test_e2e.py +0 -0
  24. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/tests/test_kernel.py +0 -0
  25. {safe_colab_cli-0.13.2 → safe_colab_cli-0.13.4}/tests/test_sandbox.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: safe-colab-cli
3
- Version: 0.13.2
3
+ Version: 0.13.4
4
4
  Summary: CLI tool for safe collaboration - sandboxed Jupyter kernel with remote Hypha service access
5
5
  Author: Amun AI AB
6
6
  License: All Rights Reserved
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "safe-colab-cli"
7
- version = "0.13.2"
7
+ version = "0.13.4"
8
8
  description = "CLI tool for safe collaboration - sandboxed Jupyter kernel with remote Hypha service access"
9
9
  readme = "README.md"
10
10
  license = {text = "All Rights Reserved"}
@@ -1,3 +1,3 @@
1
1
  """Safe Colab CLI - Sandboxed Jupyter kernel with remote Hypha service access."""
2
2
 
3
- __version__ = "0.13.2"
3
+ __version__ = "0.13.4"
@@ -109,6 +109,12 @@ class SessionArtifactManager:
109
109
  if remote_path is None:
110
110
  remote_path = os.path.basename(local_path)
111
111
 
112
+ # Re-enter staging mode if already committed (allows multiple uploads)
113
+ try:
114
+ await self._am.edit(artifact_id=self.artifact_id, stage=True)
115
+ except Exception:
116
+ pass # May already be in staging
117
+
112
118
  put_url = await self._am.put_file(self.artifact_id, file_path=remote_path)
113
119
 
114
120
  async with httpx.AsyncClient() as client:
@@ -169,9 +175,13 @@ class SessionArtifactManager:
169
175
  }
170
176
  self._log_buffer.append(entry)
171
177
 
172
- # Write log file periodically (every event for now)
178
+ # Write log file
173
179
  log_content = "\n".join(json.dumps(e) for e in self._log_buffer) + "\n"
174
180
  try:
181
+ try:
182
+ await self._am.edit(artifact_id=self.artifact_id, stage=True)
183
+ except Exception:
184
+ pass
175
185
  put_url = await self._am.put_file(self.artifact_id, file_path="audit_log.jsonl")
176
186
  async with httpx.AsyncClient() as client:
177
187
  await client.put(put_url, content=log_content.encode())
@@ -236,10 +236,10 @@ data. The artifact is publicly readable.
236
236
  ## Environment
237
237
 
238
238
  - **Data directory** (read-only): `{data_dir}`
239
- - **Working directory** (read-write): `{work_dir}`
239
+ - **Working directory** (read-write): `{work_dir}` — write all output files here
240
240
  - Full Python 3 with pip — install via `run_code("import subprocess; subprocess.check_call(['pip', 'install', 'pandas'])")`{' or `execute_command("pip install <pkg>")`' if allow_shell else ''}
241
241
  - Kernel state persists across `run_code` calls (like Jupyter cells)
242
- - Share files via `upload_file()` returns download URL
242
+ - Save files to the working directory, then `upload_file()` to get a permanent view URL
243
243
  - All operations are audited
244
244
 
245
245
  ## Quick Start
@@ -322,6 +322,17 @@ print(f"Dashboard URL: {{server.config.public_base_url}}/{{server.config.workspa
322
322
  - Apps should only serve aggregate statistics, visualizations, and metadata
323
323
  - All app creation is logged in the audit trail
324
324
 
325
+ ## Hypha Platform Reference
326
+
327
+ This session runs on the Hypha platform. For advanced usage (registering APIs,
328
+ creating dynamic services, artifact management, etc.), read the full Hypha guide:
329
+
330
+ curl -s https://hypha.aicell.io/public/apps/agent-skills/get_skill_md
331
+
332
+ **Security warning**: Any services you register are guardian-checked at creation
333
+ time, but live services handle requests directly. Only serve aggregate data.
334
+ Never expose raw records or CONFIDENTIAL columns through registered services.
335
+
325
336
  ## Rules & Compliance
326
337
 
327
338
  - **Strictly follow the sensitivity policy** in the dataset documentation above
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: safe-colab-cli
3
- Version: 0.13.2
3
+ Version: 0.13.4
4
4
  Summary: CLI tool for safe collaboration - sandboxed Jupyter kernel with remote Hypha service access
5
5
  Author: Amun AI AB
6
6
  License: All Rights Reserved