feat(identity): add browser setup and user accounts

This commit is contained in:
sam committed 2026-10-16 02:41:24 +11:00
1 parent cf3455ef2e
commit aa012a7c6e
91 files changed
+6823 -636

No files matched your search

@@ -558,6 +558,11 @@ ON CONFLICT (session_id) DO UPDATE SET
created_at = EXCLUDED.created_at,
last_active_at = EXCLUDED.last_active_at
WHERE sessions.org_id = EXCLUDED.org_id
AND (
(sessions.platform = '' AND sessions.bot_user = '' AND sessions.channel_id = '' AND sessions.thread_id = '')
OR (sessions.platform = EXCLUDED.platform AND sessions.bot_user = EXCLUDED.bot_user
AND sessions.channel_id = EXCLUDED.channel_id AND sessions.thread_id = EXCLUDED.thread_id)
)
`
type SaveSessionParams struct {
@@ -577,8 +582,9 @@ type SaveSessionParams struct {
// Gateway conversation queries: sessions, messages, turns, full-text search.
// These back internal/gateway's PostgreSQL SessionStore.
// ── Sessions ────────────────────────────────────────────────────────────────
// Updates only a session the writing org owns: another org's session of the
// same id is left untouched and the zero row count refuses the write.
// A saved session keeps its organization and conversation identity. Empty
// placeholder rows may be completed; an existing conversation cannot be claimed
// by overwriting its source with another person's thread.
func (q *Queries) SaveSession(ctx context.Context, arg SaveSessionParams) (int64, error) {
result, err := q.db.Exec(ctx, saveSession,
arg.SessionID,