Sign In

@intent-driven/bridge-postgres

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intent-driven/bridge-postgres

Postgres ↔ IDF bridge: CDC mirror (pg_logical → Φ event-log) и gateway-mode (Fold-runtime поверх existing БД)

Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
10
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

@intent-driven/bridge-postgres

Bridge между Postgres БД и IDF Φ event-log: CDC mirror (read-only, БД primary) и gateway-mode (Fold принимает agent calls, валидирует, при confirm пишет в БД).

Status

FeatureStatus
pgoutput decoder (INSERT/UPDATE/DELETE/RELATION/BEGIN/COMMIT)✅ PR 5a
createMirror API с DI stream✅ PR 5a
CDC → Φ effect mapping✅ PR 5a
Real pg_logical subscriber (node-postgres replication mode)планируется PR 5b
Schema-drift detector (ontology vs live БД)планируется PR 5c
Gateway mode (transactional outbox)планируется PR 5d

Mirror API (PR 5a)

import { createMirror } from "@intent-driven/bridge-postgres";

const mirror = createMirror({
  stream: someAsyncIterableOfPgoutputBuffers,
  async onEffect(effect, ctx) {
    // effect: { alpha: "insert"|"replace"|"remove", target, value?, key?, ... }
    // ctx: { transaction: { xid, finalLSN, commitTimestamp }, relation }
    await foldRuntime.proposeEffect(effect);
  },
  async onCommit(info) {
    // commit batch boundary — flush к Φ event-log
  },
});

await mirror.start();
console.log(mirror.stats);
// { decoded: 1234, insert: 100, update: 80, delete: 5, relation: 3, begin: 50, commit: 50 }

В PR 5b будет high-level helper:

const mirror = createPgLogicalMirror({
  connectionString: "postgres://repluser:pass@host/db",
  slotName: "idf_mirror",
  publicationName: "idf_pub",
  onEffect, onCommit,
});

License

MIT.

Keywords

intent-driven

FAQs

Package last updated on 08 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts