MCPcopy
hub / github.com/cft0808/edict / cmd_shared_memo

Function cmd_shared_memo

scripts/kanban_update.py:798–814  ·  view source on GitHub ↗

写入全局共享记忆(所有 Agent 可读的规则)。

(content, added_by)

Source from the content-addressed store, hash-verified

796
797
798def cmd_shared_memo(content, added_by):
799 """写入全局共享记忆(所有 Agent 可读的规则)。"""
800 entry = {
801 'content': content,
802 'added_by': added_by,
803 'at': now_iso(),
804 }
805
806 def modifier(data):
807 if not data:
808 data = {'rules': []}
809 data.setdefault('rules', []).append(entry)
810 return data
811
812 atomic_json_update(SHARED_MEMORY_FILE, modifier, {})
813 log.info(f'🌐 全局记忆写入: {content[:40]}... (by {added_by})')
814 _append_audit('system', added_by, 'shared_memo', None, None, content)
815
816
817# ── 子 Agent 无状态委派 ──

Callers 1

kanban_update.pyFile · 0.85

Calls 3

now_isoFunction · 0.90
atomic_json_updateFunction · 0.90
_append_auditFunction · 0.85

Tested by

no test coverage detected