Switch to prefixed IDs and tell agents which Mac a message came from

This commit is contained in:
Ian Gulliver
2026-10-20 23:15:19 -07:00
parent f1296ba13d
commit 59bf17189d
42 changed files with 770 additions and 145 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"time"
"g.fc.run/ai/byre/internal/api"
"g.fc.run/ai/byre/internal/ids"
)
func (s *Store) LeadNotes(ctx context.Context, owner string) ([]api.LeadNote, error) {
@@ -51,7 +52,7 @@ func (s *Store) SaveLeadNote(ctx context.Context, owner, id, projectID, text, ac
}
err := s.write(ctx, func(tx *sql.Tx, emit emitFunc) error {
if id == "" {
n.Id = NewID()
n.Id = ids.New(ids.LeadNote)
_, err := tx.ExecContext(ctx, `INSERT INTO lead_notes (id, owner, text, project_id, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)`,
n.Id, owner, text, projectID, formatTime(at), formatTime(at))
if err != nil {