Missed a self-imposed timeout of 15min on finding where Zed, the editor, keeps info about past AI prompts (it must do, it has UI on it!). Those .mdb files do not seem to be it? Nor those .sqlite one? Both in .local/share/zed. Halp? #asknostr
Login to reply
Replies (1)
FWIW:
import sqlite3
import zstandard as zstd
import json
conn = sqlite3.connect('/home/USER/.local/share/zed/threads/threads.db')
cursor = conn.cursor()
with open('zed_prompts.txt', 'w') as outfile:
cursor.execute("SELECT id, data_type, data FROM threads")
for row in cursor:
thread_id, data_type, blob = row
outfile.write(f"\n{'='*60}\n")
outfile.write(f"Thread ID: {thread_id}\n")
outfile.write(f"Data Type: {data_type}\n")
outfile.write(f"{'='*60}\n")
dctx = zstd.ZstdDecompressor()
try:
decompressed = dctx.decompress(blob, max_output_size=100*1024*1024)
try:
data = json.loads(decompressed)
outfile.write(json.dumps(data, indent=2) + "\n")
except:
outfile.write(decompressed.decode('utf-8', errors='ignore') + "\n")
except Exception as e:
outfile.write(f"Error decompressing: {e}\n")
conn.close()
print("Output saved to zed_prompts.txt")
^ This has *all the interaction* with the agent, including tool runs and responses. It's fascinating.