@automagik/omni 2.260520.18 → 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
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
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 = `
|
|
@@ -4911,19 +4916,24 @@ async function migrateUnmountedEmbeddedToCanonical(opts = {}) {
|
|
|
4911
4916
|
if (tables.length === 0) {
|
|
4912
4917
|
return { status: "skipped", reason: "embedded omni has no public tables" };
|
|
4913
4918
|
}
|
|
4914
|
-
|
|
4915
|
-
const
|
|
4919
|
+
const SKIP_TABLES = new Set(["media_content"]);
|
|
4920
|
+
const filteredTables = tables.filter((t) => !SKIP_TABLES.has(t));
|
|
4921
|
+
const skipped = tables.filter((t) => SKIP_TABLES.has(t));
|
|
4922
|
+
if (skipped.length > 0)
|
|
4923
|
+
log(` skipping ${skipped.length} table(s) (rebuilt at runtime): ${skipped.join(", ")}`);
|
|
4924
|
+
log(` ${filteredTables.length} tables to migrate`);
|
|
4925
|
+
const truncateList = filteredTables.map((t) => `public.${t}`).join(",");
|
|
4916
4926
|
psqlCapture([
|
|
4917
4927
|
...dstBaseArgs,
|
|
4918
4928
|
"-c",
|
|
4919
4929
|
`SET session_replication_role='replica'; TRUNCATE ${truncateList} RESTART IDENTITY CASCADE;`
|
|
4920
4930
|
]);
|
|
4921
4931
|
log(" truncated canonical (CASCADE)");
|
|
4922
|
-
for (const t of
|
|
4932
|
+
for (const t of filteredTables) {
|
|
4923
4933
|
await copyTable(t, srcBaseArgs, dstBaseArgs, log);
|
|
4924
4934
|
}
|
|
4925
4935
|
resetSequences(dstBaseArgs, log);
|
|
4926
|
-
return { status: "migrated", tables:
|
|
4936
|
+
return { status: "migrated", tables: filteredTables.length, durationMs: Date.now() - t0 };
|
|
4927
4937
|
} finally {
|
|
4928
4938
|
await temp.stop();
|
|
4929
4939
|
log(" restarting omni-api");
|
|
@@ -124344,7 +124354,7 @@ import { fileURLToPath } from "url";
|
|
|
124344
124354
|
// package.json
|
|
124345
124355
|
var package_default = {
|
|
124346
124356
|
name: "@automagik/omni",
|
|
124347
|
-
version: "2.260520.
|
|
124357
|
+
version: "2.260520.20",
|
|
124348
124358
|
description: "LLM-optimized CLI for Omni",
|
|
124349
124359
|
type: "module",
|
|
124350
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,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;
|
|
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,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,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"}
|
package/dist/server/index.js
CHANGED
|
@@ -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.
|
|
230140
|
+
version: "2.260520.20",
|
|
230141
230141
|
type: "module",
|
|
230142
230142
|
exports: {
|
|
230143
230143
|
".": {
|