Rework content_publish: files live in session_dir, no copying
content_publish now registers existing session files for inline viewing
instead of copying them to navi/content/<uuid>/. This makes files
editable by the agent and immediately visible to the user via the
stable URL /sessions/{id}/files/{filename}.

- content_store.publish() → registers metadata, no shutil.copy2
- content_store.delete_content() → removes DB record only (file stays
  in session_dir; cleaned up by session lifecycle)
- content_store.cleanup_old() → deletes stale DB records
- ContentPublishTool:
  - accepts 'filename' instead of 'path'
  - looks up file in uploads/sessions/<id>/
  - returns clear error if file not found with instructions
  - includes full local path in output for future editing
- Added unique index on (session_id, filename) for idempotent re-publish
- Removed /content static mount from main.py (endpoint still works
  for legacy files; new files use /sessions/{id}/files/)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent b6472b7 commit a8e67d8d80691addbc0b3a94243951cf29077a2c
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 29 Apr
Showing 2 changed files
View
navi/content_store.py
View
navi/tools/content_publish.py