@automagik/omni 2.260520.19 → 2.260520.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4783,34 +4783,39 @@ function psqlCapture(args) {
4783
4783
  return result.stdout ?? "";
4784
4784
  }
4785
4785
  async function copyTable(table, srcArgs, dstArgs, log) {
4786
- const src = spawn("psql", [...srcArgs, "-c", `\\copy public.${table} TO STDOUT WITH (FORMAT binary)`], {
4787
- stdio: ["ignore", "pipe", "pipe"],
4788
- env: { ...process.env, PGPASSWORD: "postgres" }
4789
- });
4790
- const dst = spawn("psql", [
4791
- ...dstArgs,
4792
- "-c",
4793
- `SET session_replication_role='replica';`,
4794
- "-c",
4795
- `\\copy public.${table} FROM STDIN WITH (FORMAT binary)`
4796
- ], {
4797
- stdio: ["pipe", "pipe", "pipe"],
4798
- env: { ...process.env, PGPASSWORD: "postgres" }
4799
- });
4800
- if (!src.stdout || !dst.stdin)
4801
- throw new Error(`copy stream not available for ${table}`);
4802
- src.stdout.pipe(dst.stdin);
4803
- let dstErr = "";
4804
- dst.stderr?.on("data", (b) => {
4805
- dstErr += b.toString("utf-8");
4806
- });
4807
- const srcExited = new Promise((resolve) => src.once("exit", (code) => resolve(code ?? -1)));
4808
- const dstExited = new Promise((resolve) => dst.once("exit", (code) => resolve(code ?? -1)));
4809
- const [sc, dc] = await Promise.all([srcExited, dstExited]);
4810
- if (sc !== 0 || dc !== 0) {
4811
- throw new Error(`copy ${table} failed (src=${sc} dst=${dc}): ${dstErr.trim()}`);
4786
+ const tmpFile = join11(tmpdir(), `omni-migrate-${table}-${process.pid}.copy`);
4787
+ try {
4788
+ const srcResult = spawnSync2("psql", [...srcArgs, "-c", `\\copy public.${table} TO '${tmpFile}' WITH (FORMAT binary)`], {
4789
+ stdio: ["ignore", "pipe", "pipe"],
4790
+ env: { ...process.env, PGPASSWORD: "postgres" },
4791
+ timeout: 600000,
4792
+ maxBuffer: 16 * 1024 * 1024
4793
+ });
4794
+ if (srcResult.status !== 0) {
4795
+ throw new Error(`dump ${table} failed (psql exit ${srcResult.status}): ${srcResult.stderr?.toString().trim() ?? ""}`);
4796
+ }
4797
+ const dstResult = spawnSync2("psql", [
4798
+ ...dstArgs,
4799
+ "-c",
4800
+ `SET session_replication_role='replica';`,
4801
+ "-c",
4802
+ `\\copy public.${table} FROM '${tmpFile}' WITH (FORMAT binary)`
4803
+ ], {
4804
+ stdio: ["ignore", "pipe", "pipe"],
4805
+ env: { ...process.env, PGPASSWORD: "postgres" },
4806
+ timeout: 600000,
4807
+ maxBuffer: 16 * 1024 * 1024
4808
+ });
4809
+ if (dstResult.status !== 0) {
4810
+ throw new Error(`restore ${table} failed (psql exit ${dstResult.status}): ${dstResult.stderr?.toString().trim() ?? ""}`);
4811
+ }
4812
+ log(` copied ${table}`);
4813
+ } finally {
4814
+ try {
4815
+ const { unlinkSync: unlinkSync2 } = await import("fs");
4816
+ unlinkSync2(tmpFile);
4817
+ } catch {}
4812
4818
  }
4813
- log(` copied ${table}`);
4814
4819
  }
4815
4820
  function resetSequences(dstArgs, log) {
4816
4821
  const script = `
@@ -124349,7 +124354,7 @@ import { fileURLToPath } from "url";
124349
124354
  // package.json
124350
124355
  var package_default = {
124351
124356
  name: "@automagik/omni",
124352
- version: "2.260520.19",
124357
+ version: "2.260520.20",
124353
124358
  description: "LLM-optimized CLI for Omni",
124354
124359
  type: "module",
124355
124360
  bin: {
@@ -1 +1 @@
1
- {"version":3,"file":"embedded-canonical-migration.d.ts","sourceRoot":"","sources":["../../src/lib/embedded-canonical-migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAWH,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,MAAM,EAAE,SAA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,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAmPD;;;;;;;;GAQG;AACH;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAiDxG;AAED,wBAAsB,mCAAmC,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAuF7G;AAED,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,QAAe,CAAC"}
@@ -230137,7 +230137,7 @@ var init_sentry_scrub = __esm(() => {
230137
230137
  var require_package8 = __commonJS((exports, module) => {
230138
230138
  module.exports = {
230139
230139
  name: "@omni/api",
230140
- version: "2.260520.19",
230140
+ version: "2.260520.20",
230141
230141
  type: "module",
230142
230142
  exports: {
230143
230143
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260520.19",
3
+ "version": "2.260520.20",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {