Skip to content

Commit 6d583eb

Browse files
committed
feat: surface snapshot state and isolate headless user plugins
1 parent 7f2ef7b commit 6d583eb

3 files changed

Lines changed: 348 additions & 16 deletions

File tree

src/ida_pro_mcp/headless_project_store.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,22 @@ def record_session_close(self, runtime_session_id: str, status: str = 'closed')
357357
(status, now, now, runtime_session_id),
358358
)
359359

360+
def update_session_metadata(self, runtime_session_id: str, metadata: dict[str, Any]) -> None:
361+
current = self.get_session(runtime_session_id)
362+
if current is None:
363+
return
364+
merged = dict(current.get('metadata') or {})
365+
merged.update(metadata)
366+
with self._connect() as conn:
367+
conn.execute(
368+
'''
369+
UPDATE sessions
370+
SET metadata_json = ?, updated_at = ?
371+
WHERE runtime_session_id = ? AND ended_at IS NULL
372+
''',
373+
(json.dumps(merged), utcnow_iso(), runtime_session_id),
374+
)
375+
360376
def list_sessions(self, include_closed: bool = False) -> list[dict[str, Any]]:
361377
where = '' if include_closed else 'WHERE s.ended_at IS NULL'
362378
with self._connect() as conn:

0 commit comments

Comments
 (0)