@automagik/omni 2.260501.7 → 2.260502.2
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/commands/update.d.ts +13 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/index.js +72 -4
- package/dist/runtime-env.d.ts +15 -5
- package/dist/runtime-env.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/package.json +10 -10
|
@@ -77,5 +77,18 @@ export declare function decideUpdateVerify(args: {
|
|
|
77
77
|
/** Error message strings — exported for tests and documentation. */
|
|
78
78
|
export declare function updateErrorVersionMismatch(cli: string, server: string | null): string;
|
|
79
79
|
export declare const UPDATE_ERROR_AUTH_INVALID = "Auth key invalid after restart. Run: omni doctor --fix";
|
|
80
|
+
/**
|
|
81
|
+
* Halt updates that would cross the phase-2 default-flip cutoff on hosts
|
|
82
|
+
* still running legacy embedded pgserve without the canonical binary
|
|
83
|
+
* available.
|
|
84
|
+
*
|
|
85
|
+
* Returns null when safe to proceed; otherwise an actionable error message.
|
|
86
|
+
*/
|
|
87
|
+
export declare function checkCanonicalPgservePreflight(args: {
|
|
88
|
+
currentVersion: string;
|
|
89
|
+
targetVersion: string;
|
|
90
|
+
useCanonicalPgserve: boolean | undefined;
|
|
91
|
+
pgserveOnPath: boolean;
|
|
92
|
+
}): string | null;
|
|
80
93
|
export declare function createUpdateCommand(): Command;
|
|
81
94
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,MAAM,EAA4C,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA;;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M,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAErF;AAED,eAAO,MAAM,yBAAyB,2DAA2D,CAAC;AA+MlG;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;IACzC,aAAa,EAAE,OAAO,CAAC;CACxB,GAAG,MAAM,GAAG,IAAI,CAkChB;AAuFD,wBAAgB,mBAAmB,IAAI,OAAO,CAoD7C"}
|
package/dist/index.js
CHANGED
|
@@ -114209,7 +114209,7 @@ import { fileURLToPath } from "url";
|
|
|
114209
114209
|
// package.json
|
|
114210
114210
|
var package_default = {
|
|
114211
114211
|
name: "@automagik/omni",
|
|
114212
|
-
version: "2.
|
|
114212
|
+
version: "2.260502.2",
|
|
114213
114213
|
description: "LLM-optimized CLI for Omni",
|
|
114214
114214
|
type: "module",
|
|
114215
114215
|
bin: {
|
|
@@ -115427,14 +115427,14 @@ function resolveDatabaseUrl(serverConfig) {
|
|
|
115427
115427
|
}
|
|
115428
115428
|
function buildRuntimeEnv(serverConfig, cliConfig) {
|
|
115429
115429
|
const pgservePort = resolvePgservePort(serverConfig);
|
|
115430
|
-
const
|
|
115430
|
+
const optOutOfCanonical = serverConfig.useCanonicalPgserve === false;
|
|
115431
115431
|
return {
|
|
115432
115432
|
API_PORT: String(serverConfig.port),
|
|
115433
115433
|
DATABASE_URL: resolveDatabaseUrl(serverConfig),
|
|
115434
115434
|
OMNI_API_KEY: cliConfig.apiKey ?? "",
|
|
115435
115435
|
MEDIA_STORAGE_PATH: join5(serverConfig.dataDir, "media"),
|
|
115436
115436
|
OMNI_PACKAGES_DIR: join5(serverConfig.dataDir, "packages"),
|
|
115437
|
-
PGSERVE_EMBEDDED:
|
|
115437
|
+
PGSERVE_EMBEDDED: optOutOfCanonical ? "true" : "false",
|
|
115438
115438
|
PGSERVE_DATA: join5(serverConfig.dataDir, "pgserve"),
|
|
115439
115439
|
PGSERVE_PORT: String(pgservePort),
|
|
115440
115440
|
NATS_URL: "nats://localhost:4222",
|
|
@@ -126226,6 +126226,61 @@ async function promptConfirm(question) {
|
|
|
126226
126226
|
});
|
|
126227
126227
|
});
|
|
126228
126228
|
}
|
|
126229
|
+
var PHASE_2_CUTOFF_MINOR = 260502;
|
|
126230
|
+
function isAtOrPastPhase2(version2) {
|
|
126231
|
+
const [_major, minorStr] = version2.split(".");
|
|
126232
|
+
const minor = Number.parseInt(minorStr ?? "", 10);
|
|
126233
|
+
if (!Number.isFinite(minor))
|
|
126234
|
+
return false;
|
|
126235
|
+
return minor >= PHASE_2_CUTOFF_MINOR;
|
|
126236
|
+
}
|
|
126237
|
+
function isPgserveOnPath() {
|
|
126238
|
+
try {
|
|
126239
|
+
const result = Bun.spawnSync({
|
|
126240
|
+
cmd: ["pgserve", "port"],
|
|
126241
|
+
stdout: "pipe",
|
|
126242
|
+
stderr: "pipe",
|
|
126243
|
+
timeout: 3000
|
|
126244
|
+
});
|
|
126245
|
+
return result.exitCode === 0;
|
|
126246
|
+
} catch {
|
|
126247
|
+
return false;
|
|
126248
|
+
}
|
|
126249
|
+
}
|
|
126250
|
+
function checkCanonicalPgservePreflight(args) {
|
|
126251
|
+
if (isAtOrPastPhase2(args.currentVersion))
|
|
126252
|
+
return null;
|
|
126253
|
+
if (!isAtOrPastPhase2(args.targetVersion))
|
|
126254
|
+
return null;
|
|
126255
|
+
if (args.useCanonicalPgserve === true)
|
|
126256
|
+
return null;
|
|
126257
|
+
if (args.useCanonicalPgserve === false)
|
|
126258
|
+
return null;
|
|
126259
|
+
if (args.pgserveOnPath)
|
|
126260
|
+
return null;
|
|
126261
|
+
return [
|
|
126262
|
+
"Refusing to upgrade \u2014 this would break omni-api on next restart.",
|
|
126263
|
+
"",
|
|
126264
|
+
` Target version v${args.targetVersion} ships the phase-2 canonical-pgserve default flip`,
|
|
126265
|
+
" (omni#596). Your current install has `useCanonicalPgserve` unset and no `pgserve`",
|
|
126266
|
+
" binary on PATH, so omni-api would boot with PGSERVE_EMBEDDED=false and fail to",
|
|
126267
|
+
" connect to a non-existent canonical pgserve.",
|
|
126268
|
+
"",
|
|
126269
|
+
" Pick one of:",
|
|
126270
|
+
"",
|
|
126271
|
+
" (recommended) Migrate to canonical pgserve:",
|
|
126272
|
+
" bun add -g pgserve@^2.1.0",
|
|
126273
|
+
" omni doctor --fix # automated pg_dump \u2192 install \u2192 restore",
|
|
126274
|
+
" omni update # then re-run",
|
|
126275
|
+
"",
|
|
126276
|
+
" (transitional) Pin embedded explicitly:",
|
|
126277
|
+
" omni config set server.useCanonicalPgserve 'false'",
|
|
126278
|
+
" omni update # then re-run",
|
|
126279
|
+
"",
|
|
126280
|
+
" Bypass this check (NOT recommended) with: omni update --skip-canonical-preflight"
|
|
126281
|
+
].join(`
|
|
126282
|
+
`);
|
|
126283
|
+
}
|
|
126229
126284
|
async function runUpdate(options3) {
|
|
126230
126285
|
const channel2 = resolveChannel(options3);
|
|
126231
126286
|
if (options3.next || options3.stable) {
|
|
@@ -126244,6 +126299,19 @@ async function runUpdate(options3) {
|
|
|
126244
126299
|
success(`Already up to date (v${latest}, channel: ${channel2})`);
|
|
126245
126300
|
process.exit(0);
|
|
126246
126301
|
}
|
|
126302
|
+
if (!options3.skipCanonicalPreflight) {
|
|
126303
|
+
const serverConfig = loadServerConfig();
|
|
126304
|
+
const preflightError = checkCanonicalPgservePreflight({
|
|
126305
|
+
currentVersion: currentClean,
|
|
126306
|
+
targetVersion: latest,
|
|
126307
|
+
useCanonicalPgserve: serverConfig.useCanonicalPgserve,
|
|
126308
|
+
pgserveOnPath: isPgserveOnPath()
|
|
126309
|
+
});
|
|
126310
|
+
if (preflightError !== null) {
|
|
126311
|
+
warn(preflightError);
|
|
126312
|
+
process.exit(1);
|
|
126313
|
+
}
|
|
126314
|
+
}
|
|
126247
126315
|
info(`Update available: v${currentClean} \u2192 v${latest} (${channel2})`);
|
|
126248
126316
|
if (!options3.yes) {
|
|
126249
126317
|
const confirmed = await promptConfirm(`Update from v${currentClean} to v${latest}? [Y/n] `);
|
|
@@ -126269,7 +126337,7 @@ async function runUpdate(options3) {
|
|
|
126269
126337
|
success(`omni updated to v${latest}`);
|
|
126270
126338
|
}
|
|
126271
126339
|
function createUpdateCommand() {
|
|
126272
|
-
return new Command("update").description(`Update ${PACKAGE_NAME} to the latest version (restart only services already running)`).option("-y, --yes", "Skip confirmation prompts (non-interactive)").option("--no-restart", "Update CLI only; skip service restarts and verification").option("--no-sidecar-cleanup", "Skip the legacy nats-reply-sidecar.mjs cleanup step").option("--next", "Switch to dev builds (npm @next tag) and persist as default").option("--stable", "Switch to stable releases (npm @latest tag) and persist as default").addHelpText("after", `
|
|
126340
|
+
return new Command("update").description(`Update ${PACKAGE_NAME} to the latest version (restart only services already running)`).option("-y, --yes", "Skip confirmation prompts (non-interactive)").option("--no-restart", "Update CLI only; skip service restarts and verification").option("--no-sidecar-cleanup", "Skip the legacy nats-reply-sidecar.mjs cleanup step").option("--next", "Switch to dev builds (npm @next tag) and persist as default").option("--stable", "Switch to stable releases (npm @latest tag) and persist as default").option("--skip-canonical-preflight", "Bypass the canonical-pgserve phase-2 pre-flight (NOT recommended; for operators who pre-installed pgserve via a path the auto-detector misses)").addHelpText("after", `
|
|
126273
126341
|
Channels:
|
|
126274
126342
|
- stable (default) \u2014 tracks the npm @latest tag, bumped from main branch releases.
|
|
126275
126343
|
- next (dev builds) \u2014 tracks the npm @next tag, bumped on every CI-green dev merge.
|
package/dist/runtime-env.d.ts
CHANGED
|
@@ -73,11 +73,21 @@ export declare function resolveDatabaseUrl(serverConfig: ServerConfig): string;
|
|
|
73
73
|
*
|
|
74
74
|
* All values come from `serverConfig` / `cliConfig`. No shell env reads.
|
|
75
75
|
*
|
|
76
|
-
* `PGSERVE_EMBEDDED`
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
76
|
+
* `PGSERVE_EMBEDDED` semantics (Phase 2 of canonical-pgserve removal):
|
|
77
|
+
* - serverConfig.useCanonicalPgserve === false → 'true' (embedded — explicit opt-in)
|
|
78
|
+
* - serverConfig.useCanonicalPgserve === true → 'false' (canonical — explicit opt-in)
|
|
79
|
+
* - undefined / missing → 'false' (canonical — NEW DEFAULT)
|
|
80
|
+
*
|
|
81
|
+
* Phase 1 (omni#595, 2026-05-01) added the deprecation warning to
|
|
82
|
+
* `startEmbeddedPgserve`. Phase 2 (this file) flips the default for
|
|
83
|
+
* undefined values: legacy installs that never set the flag now get
|
|
84
|
+
* canonical instead of embedded. Operators on legacy embedded who
|
|
85
|
+
* haven't migrated must explicitly set `useCanonicalPgserve: false` in
|
|
86
|
+
* `~/.omni/config.json` (or run `omni doctor --fix` to migrate to
|
|
87
|
+
* canonical, the supported path).
|
|
88
|
+
*
|
|
89
|
+
* Phase 3 (future) deletes the embedded code entirely + drops the
|
|
90
|
+
* pgserve runtime dep from `packages/api`.
|
|
81
91
|
*/
|
|
82
92
|
export declare function buildRuntimeEnv(serverConfig: ServerConfig, cliConfig: Config): RuntimeEnv;
|
|
83
93
|
//# sourceMappingURL=runtime-env.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-env.d.ts","sourceRoot":"","sources":["../src/runtime-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,Y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,CAMrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAMrE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAoBzF"}
|
package/dist/server/index.js
CHANGED
|
@@ -224686,7 +224686,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
224686
224686
|
var require_package8 = __commonJS((exports, module) => {
|
|
224687
224687
|
module.exports = {
|
|
224688
224688
|
name: "@omni/api",
|
|
224689
|
-
version: "2.
|
|
224689
|
+
version: "2.260502.2",
|
|
224690
224690
|
type: "module",
|
|
224691
224691
|
exports: {
|
|
224692
224692
|
".": {
|
|
@@ -239491,7 +239491,7 @@ import { createRequire as createRequire2 } from "module";
|
|
|
239491
239491
|
import { homedir as homedir2 } from "os";
|
|
239492
239492
|
import { dirname as dirname6, isAbsolute as isAbsolute2, join as join15, resolve as resolve2 } from "path";
|
|
239493
239493
|
function resolvePgserveConfig() {
|
|
239494
|
-
const enabled =
|
|
239494
|
+
const enabled = process.env.PGSERVE_EMBEDDED === "true";
|
|
239495
239495
|
const port = Number.parseInt(process.env.PGSERVE_PORT ?? "8432", 10);
|
|
239496
239496
|
const raw = process.env.PGSERVE_DATA;
|
|
239497
239497
|
const defaultDataDir = join15(homedir2(), ".omni", "data", "pgserve");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automagik/omni",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.260502.2",
|
|
4
4
|
"description": "LLM-optimized CLI for Omni",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
"qrcode-terminal": "^0.12.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@omni/api": "2.
|
|
55
|
-
"@omni/channel-discord": "2.
|
|
56
|
-
"@omni/channel-gupshup": "2.
|
|
57
|
-
"@omni/channel-sdk": "2.
|
|
58
|
-
"@omni/channel-slack": "2.
|
|
59
|
-
"@omni/channel-telegram": "2.
|
|
60
|
-
"@omni/channel-whatsapp": "2.
|
|
61
|
-
"@omni/core": "2.
|
|
62
|
-
"@omni/sdk": "2.
|
|
54
|
+
"@omni/api": "2.260502.1",
|
|
55
|
+
"@omni/channel-discord": "2.260502.1",
|
|
56
|
+
"@omni/channel-gupshup": "2.260502.1",
|
|
57
|
+
"@omni/channel-sdk": "2.260502.1",
|
|
58
|
+
"@omni/channel-slack": "2.260502.1",
|
|
59
|
+
"@omni/channel-telegram": "2.260502.1",
|
|
60
|
+
"@omni/channel-whatsapp": "2.260502.1",
|
|
61
|
+
"@omni/core": "2.260502.1",
|
|
62
|
+
"@omni/sdk": "2.260502.1",
|
|
63
63
|
"@types/node": "^22.10.3",
|
|
64
64
|
"@types/qrcode-terminal": "^0.12.2",
|
|
65
65
|
"typescript": "^5.7.3"
|