feat: ШАГ 1 — Bridge HTTP-сервер для браузерного расширения

- internal/core/bridge/ — лёгкий HTTP-сервер на 127.0.0.1
  - POST /api/events — приём батча событий от расширения
  - GET /api/ping — healthcheck для расширения
  - X-Verstak-Secret — аутентификация по shared-secret
  - AutoGenPort — случайный порт если 9786 занят
- config.BridgeConfig — порт, секрет, auto_gen_port
- App: интеграция startBridge/stopBridge при open/close vault
- bindings_bridge.go — BridgeInfo(), startBridge(), saveBridgeConfig()
- Тесты: ping, auth, success, empty batch, secret gen, auto-port
This commit is contained in:
2026-06-06 18:23:47 +08:00
parent f88376264d
commit 358c649b42
20 changed files with 1676 additions and 21 deletions
+12
View File
@@ -169,6 +169,18 @@ func (r *Repository) ListRoots(includeDeleted bool) ([]Node, error) {
return scanNodes(rows)
}
// ListAllWithFsPath returns active non-deleted nodes that have a non-empty fs_path.
func (r *Repository) ListAllWithFsPath() ([]Node, error) {
rows, err := r.db.Query(
`SELECT `+nodeColumns+` FROM nodes
WHERE deleted_at IS NULL AND fs_path != '' ORDER BY fs_path`)
if err != nil {
return nil, err
}
defer rows.Close()
return scanNodes(rows)
}
// ListInboxRoots returns active root capture artifacts explicitly marked for inbox.
func (r *Repository) ListInboxRoots(includeDeleted bool) ([]Node, error) {
q := `SELECT ` + nodeColumns + ` FROM nodes