MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / set

Method set

core/state.py:161–168  ·  view source on GitHub ↗

Set a value in state.

(self, key: str, value: Any)

Source from the content-addressed store, hash-verified

159 return row["value"] if row else default
160
161 def set(self, key: str, value: Any):
162 """Set a value in state."""
163 with self._lock:
164 self._conn.execute(
165 "INSERT OR REPLACE INTO state (key, value, updated_at) VALUES (?, ?, ?)",
166 (key, str(value), int(time.time())),
167 )
168 self._conn.commit()
169
170 def delete(self, key: str) -> bool:
171 """Delete a key from state. Returns True if deleted, False if not found."""

Callers 6

cancel_taskMethod · 0.95
_main_loopMethod · 0.45
_save_databaseMethod · 0.45
tokens_usedMethod · 0.45
_save_trackerMethod · 0.45
_save_preferencesMethod · 0.45

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected