@automagik/omni 2.260508.2 → 2.260508.4
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/doctor.d.ts +25 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/requirements.d.ts +30 -0
- package/dist/commands/requirements.d.ts.map +1 -0
- package/dist/commands/update.d.ts +0 -13
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/index.js +483 -196
- package/dist/lib/pgserve-transport.d.ts +113 -0
- package/dist/lib/pgserve-transport.d.ts.map +1 -0
- package/dist/lib/requirements.d.ts +112 -0
- package/dist/lib/requirements.d.ts.map +1 -0
- package/dist/runtime-env.d.ts +43 -17
- package/dist/runtime-env.d.ts.map +1 -1
- package/dist/server/index.js +1533 -8264
- package/package.json +1 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pgserve transport discovery — Unix-socket first, TCP fallback.
|
|
3
|
+
*
|
|
4
|
+
* Mirror of `resolvePgserveTransport()` from
|
|
5
|
+
* `automagik-dev/genie:src/lib/db.ts` — keeps the byte-identical contract
|
|
6
|
+
* documented in `.genie/wishes/pgserve-singleton-no-proxy/SHARED-DESIGN.md`
|
|
7
|
+
* (§4.6 transport-discovery).
|
|
8
|
+
*
|
|
9
|
+
* Why this exists
|
|
10
|
+
* ---------------
|
|
11
|
+
* Phase 2 of the canonical-pgserve cutover (omni#595/#596/#597) flipped
|
|
12
|
+
* `useCanonicalPgserve` to true by default and pointed `DATABASE_URL` at
|
|
13
|
+
* the pm2-supervised pgserve instance on **TCP 8432** (the bun-bridge
|
|
14
|
+
* default). Phase 3 (this wish, `pgserve-singleton-no-proxy`) lands the
|
|
15
|
+
* canonical socket at `$XDG_RUNTIME_DIR/pgserve/.s.PGSQL.5432` and tells
|
|
16
|
+
* every consumer to prefer it, with TCP `localhost:5432` as the fallback.
|
|
17
|
+
*
|
|
18
|
+
* This module provides the discovery primitives. `runtime-env.ts` consumes
|
|
19
|
+
* them to compute the effective `DATABASE_URL` for the omni-api process.
|
|
20
|
+
*
|
|
21
|
+
* Force-flag overrides (matches genie's contract):
|
|
22
|
+
* - `OMNI_PG_FORCE_TCP=1` skips the UDS probe entirely.
|
|
23
|
+
* - `OMNI_PG_FORCE_SOCKET=1` inverts: skip TCP fallback, require UDS.
|
|
24
|
+
* - `OMNI_PG_PORT=<n>` legacy escape hatch — bypasses the
|
|
25
|
+
* `pgserve port` discovery and dials
|
|
26
|
+
* `127.0.0.1:<n>` directly. Pairs with
|
|
27
|
+
* `OMNI_PG_FORCE_TCP=1` for hosts that
|
|
28
|
+
* don't have `pgserve` on PATH.
|
|
29
|
+
*/
|
|
30
|
+
/** Canonical postgres port the postmaster binds when pgserve@>=2.3 runs in singleton mode. */
|
|
31
|
+
export declare const CANONICAL_PG_PORT = 5432;
|
|
32
|
+
/**
|
|
33
|
+
* Discriminated union returned by {@link resolvePgserveTransport}.
|
|
34
|
+
*
|
|
35
|
+
* - `unix`: postgres.js dials the Unix socket at
|
|
36
|
+
* `<socketDir>/.s.PGSQL.<port>`. `host` is the `socketDir`.
|
|
37
|
+
* - `tcp`: postgres.js dials `<host>:<port>` over TCP loopback.
|
|
38
|
+
*/
|
|
39
|
+
export type PgserveTransport = {
|
|
40
|
+
kind: 'unix';
|
|
41
|
+
socketDir: string;
|
|
42
|
+
port: number;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'tcp';
|
|
45
|
+
host: string;
|
|
46
|
+
port: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the directory holding pgserve's libpq-compat socket.
|
|
50
|
+
*
|
|
51
|
+
* Honors `$XDG_RUNTIME_DIR` (systemd / freedesktop convention) and falls
|
|
52
|
+
* back to `/tmp/pgserve` on hosts without XDG. Mirrors `resolveControlSocketDir`
|
|
53
|
+
* in pgserve/src/daemon.js so both ends agree on the path.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolvePgserveSocketDir(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Path to the libpq-compat socket file. Postgres' libpq dials a socket file
|
|
58
|
+
* named `.s.PGSQL.<port>` inside the configured socket directory.
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolvePgserveLibpqSocketPath(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Path to pgserve v2's primary control socket (used by daemon-mode flows
|
|
63
|
+
* that route through SO_PEERCRED). Kept here so a future doctor probe can
|
|
64
|
+
* surface the file's presence without re-implementing the path.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolvePgserveControlSocketPath(): string;
|
|
67
|
+
/**
|
|
68
|
+
* Synchronous probe: does the canonical libpq socket file exist?
|
|
69
|
+
*
|
|
70
|
+
* Used by the synchronous {@link buildRuntimeEnv} path in `runtime-env.ts`
|
|
71
|
+
* to pick UDS vs TCP without paying the cost of an async greet. The greet
|
|
72
|
+
* variant ({@link resolvePgserveTransport}) is reserved for boot-time and
|
|
73
|
+
* doctor flows that can afford the round trip.
|
|
74
|
+
*/
|
|
75
|
+
export declare function probeCanonicalSocketSync(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Build a `postgresql://` URL pointing at the given transport, using the
|
|
78
|
+
* supplied database name. Mirrors the URL shapes documented in
|
|
79
|
+
* SHARED-DESIGN.md §5.3 (omni-side scope).
|
|
80
|
+
*
|
|
81
|
+
* UDS shape: `postgresql://postgres:postgres@/omni?host=/run/user/1000/pgserve&port=5432`
|
|
82
|
+
* TCP shape: `postgresql://postgres:postgres@127.0.0.1:5432/omni`
|
|
83
|
+
*
|
|
84
|
+
* The username/password pair is preserved (not derived from the transport)
|
|
85
|
+
* because omni's pgserve consumer keeps libpq peer-auth via password —
|
|
86
|
+
* pgserve@>=2.3 issues a per-fingerprint role credential and the API
|
|
87
|
+
* stores that credential in `serverConfig.databaseUrl`. When stored, the
|
|
88
|
+
* caller passes their own URL through verbatim and never touches this
|
|
89
|
+
* helper.
|
|
90
|
+
*/
|
|
91
|
+
export declare function buildDatabaseUrlForTransport(transport: PgserveTransport, database: string, options?: {
|
|
92
|
+
username?: string;
|
|
93
|
+
password?: string;
|
|
94
|
+
}): string;
|
|
95
|
+
/**
|
|
96
|
+
* Resolve the active pgserve transport with UDS preference and TCP fallback.
|
|
97
|
+
*
|
|
98
|
+
* Probe order:
|
|
99
|
+
* 1. **Canonical UDS** — `$XDG_RUNTIME_DIR/pgserve/.s.PGSQL.5432`. Confirm
|
|
100
|
+
* liveness by completing a Postgres greet (SSLRequest → server replies
|
|
101
|
+
* 'N' or 'S'). Use it if reachable.
|
|
102
|
+
* 2. **Explicit TCP port** (`OMNI_PG_PORT`) — legacy escape hatch. Bypasses
|
|
103
|
+
* `pgserve port` discovery and dials `127.0.0.1:<port>` directly.
|
|
104
|
+
* 3. **TCP via `pgserve port`** — shells out to the pgserve CLI's published
|
|
105
|
+
* discovery primitive. Emits `127.0.0.1:<discovered-port>`.
|
|
106
|
+
* 4. Throw with a hint that lists every probe attempt.
|
|
107
|
+
*
|
|
108
|
+
* Force-flag overrides:
|
|
109
|
+
* - `OMNI_PG_FORCE_SOCKET=1` skips steps 2 + 3 (UDS-only).
|
|
110
|
+
* - `OMNI_PG_FORCE_TCP=1` skips step 1 (TCP-only).
|
|
111
|
+
*/
|
|
112
|
+
export declare function resolvePgserveTransport(): Promise<PgserveTransport>;
|
|
113
|
+
//# sourceMappingURL=pgserve-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pgserve-transport.d.ts","sourceRoot":"","sources":["../../src/lib/pgserve-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAOH,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,OAAO,CAAC;AActC;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAIhD;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,gBAAgB,EAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GACrD,MAAM,CAYR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CA+BzE"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compile-time peer requirements manifest.
|
|
3
|
+
*
|
|
4
|
+
* Declares the minimum versions of peer CLIs (pgserve, genie) that omni
|
|
5
|
+
* is verified to work with. Consumed by:
|
|
6
|
+
* - `omni requirements [--json]` (this wish, G6)
|
|
7
|
+
* - `omni update` step 4 / `preInstallPeerCheck` (this wish, G4)
|
|
8
|
+
* - `omni doctor` peer-version check (this wish, G5)
|
|
9
|
+
*
|
|
10
|
+
* The contract — see SHARED-DESIGN.md §3.3:
|
|
11
|
+
*
|
|
12
|
+
* > Each binary has `<cli> --requirements --json` returning
|
|
13
|
+
* > `{ pgserve: ">=2.3", genie: ">=5.0" }` etc.
|
|
14
|
+
*
|
|
15
|
+
* Version specs use the npm-style `>=X.Y[.Z]` form. Only the lower bound
|
|
16
|
+
* is enforced; upper bounds are not declared because the peers are
|
|
17
|
+
* cooperating CLIs in the same release train (operator runs
|
|
18
|
+
* `pgserve update` → `genie update` → `omni update`, so peers move
|
|
19
|
+
* forward together). A peer below the lower bound refuses the upgrade
|
|
20
|
+
* with an explicit remediation pointing at `<peer> update`.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Peer requirements declared at compile time.
|
|
24
|
+
*
|
|
25
|
+
* Keys:
|
|
26
|
+
* - `pgserve` — the singleton pgserve CLI. Version `2.3` introduced the
|
|
27
|
+
* canonical UDS + cosign tier surface this wish targets.
|
|
28
|
+
* - `genie` — peer agent runtime that shares the pgserve cluster. omni
|
|
29
|
+
* does not directly invoke genie at runtime, but they coexist on the
|
|
30
|
+
* same host and need to agree on the pgserve role-grant model.
|
|
31
|
+
*
|
|
32
|
+
* Adding a new peer: include both the version range and a `discover`
|
|
33
|
+
* entry in {@link PEER_DISCOVERERS} so `checkPeerVersion()` can shell
|
|
34
|
+
* out to fetch the live version. Discovery functions intentionally
|
|
35
|
+
* shell-out (rather than import the peer) so a missing peer fails
|
|
36
|
+
* gracefully without crashing the parent process.
|
|
37
|
+
*/
|
|
38
|
+
export declare const REQUIREMENTS: Readonly<Record<string, string>>;
|
|
39
|
+
/**
|
|
40
|
+
* Result of a single peer-version probe.
|
|
41
|
+
*
|
|
42
|
+
* - `ok=true` → peer is at or above the required version.
|
|
43
|
+
* - `ok=false` → peer is below the required version OR not installed.
|
|
44
|
+
* `current` is `null` when the peer binary is absent / errored out.
|
|
45
|
+
* - `current` is the raw version string parsed from `<peer> --version`.
|
|
46
|
+
*/
|
|
47
|
+
export interface PeerVersionResult {
|
|
48
|
+
name: string;
|
|
49
|
+
required: string;
|
|
50
|
+
current: string | null;
|
|
51
|
+
ok: boolean;
|
|
52
|
+
/** Human-readable reason when `ok=false`. */
|
|
53
|
+
reason?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Parse a semver-ish version triple from arbitrary CLI version output.
|
|
57
|
+
*
|
|
58
|
+
* Many CLIs emit lines like `pgserve 2.3.1`, `genie v5.0.0-rc.2`, or
|
|
59
|
+
* `omni 2.260507.4`. We extract the first `MAJOR.MINOR[.PATCH]` triple,
|
|
60
|
+
* tolerating leading prefixes (binary name, `v`) and trailing suffixes
|
|
61
|
+
* (`-rc.N`, build metadata, hash). Returns null when no triple matches.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseVersionTriple(raw: string): {
|
|
64
|
+
major: number;
|
|
65
|
+
minor: number;
|
|
66
|
+
patch: number;
|
|
67
|
+
} | null;
|
|
68
|
+
/**
|
|
69
|
+
* Parse a `>=X.Y[.Z]` constraint into a version triple.
|
|
70
|
+
*
|
|
71
|
+
* Throws on malformed input — REQUIREMENTS is compile-time and any
|
|
72
|
+
* malformed entry is a programmer error. Released code never sees a
|
|
73
|
+
* malformed constraint at runtime.
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseConstraint(spec: string): {
|
|
76
|
+
major: number;
|
|
77
|
+
minor: number;
|
|
78
|
+
patch: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Compare two version triples. Returns negative if a<b, 0 if equal,
|
|
82
|
+
* positive if a>b. Stable across major/minor/patch.
|
|
83
|
+
*/
|
|
84
|
+
export declare function compareVersions(a: {
|
|
85
|
+
major: number;
|
|
86
|
+
minor: number;
|
|
87
|
+
patch: number;
|
|
88
|
+
}, b: {
|
|
89
|
+
major: number;
|
|
90
|
+
minor: number;
|
|
91
|
+
patch: number;
|
|
92
|
+
}): number;
|
|
93
|
+
/**
|
|
94
|
+
* Check a single concrete version string against a `>=` constraint.
|
|
95
|
+
* Pure helper — no I/O.
|
|
96
|
+
*/
|
|
97
|
+
export declare function satisfiesConstraint(currentRaw: string, constraint: string): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Probe a single declared peer. Returns a typed result that callers
|
|
100
|
+
* (omni doctor, omni update preInstallPeerCheck) consume to decide
|
|
101
|
+
* whether to proceed.
|
|
102
|
+
*
|
|
103
|
+
* `currentOverride` lets tests inject a known version without spawning
|
|
104
|
+
* a child process. Production callers omit it and pay the shell-out.
|
|
105
|
+
*/
|
|
106
|
+
export declare function checkPeerVersion(name: keyof typeof REQUIREMENTS | string, currentOverride?: string | null): Promise<PeerVersionResult>;
|
|
107
|
+
/**
|
|
108
|
+
* Probe every declared peer. Returned in declaration order so callers
|
|
109
|
+
* surfacing JSON output get stable key ordering.
|
|
110
|
+
*/
|
|
111
|
+
export declare function checkAllPeers(): Promise<PeerVersionResult[]>;
|
|
112
|
+
//# sourceMappingURL=requirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../../src/lib/requirements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGxD,CAAC;AAWH;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAWtG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAY7F;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAClD,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD,MAAM,CAIR;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAKnF;AA8DD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,OAAO,YAAY,GAAG,MAAM,EACxC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CA4C5B;AAED;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAOlE"}
|
package/dist/runtime-env.d.ts
CHANGED
|
@@ -43,14 +43,36 @@ export type RuntimeEnv = {
|
|
|
43
43
|
NODE_ENV: string;
|
|
44
44
|
LOG_LEVEL: string;
|
|
45
45
|
};
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Default pgserve port when none is set explicitly.
|
|
48
|
+
*
|
|
49
|
+
* Phase 2 of the canonical-pgserve cutover (omni#595/#596/#597) used the
|
|
50
|
+
* bun-bridge port `8432`. Phase 3 (`pgserve-singleton-no-proxy`) lands the
|
|
51
|
+
* postmaster directly on **5432** (canonical postgres port) and listens
|
|
52
|
+
* on the canonical UDS at `$XDG_RUNTIME_DIR/pgserve/.s.PGSQL.5432`.
|
|
53
|
+
*
|
|
54
|
+
* Kept as the module-level default for backwards compatibility with the
|
|
55
|
+
* stored `~/.omni/config.json` entries that still record `8432`. Use
|
|
56
|
+
* {@link resolveDatabaseUrl} as the entry point — it prefers the canonical
|
|
57
|
+
* UDS when available and falls back to the legacy port only when the
|
|
58
|
+
* socket is missing AND the operator hasn't migrated their config.
|
|
59
|
+
*/
|
|
47
60
|
export declare const DEFAULT_PGSERVE_PORT = 8432;
|
|
61
|
+
/** Canonical postgres TCP port the postmaster binds in singleton mode. */
|
|
62
|
+
export { CANONICAL_PG_PORT } from './lib/pgserve-transport.js';
|
|
48
63
|
/**
|
|
49
64
|
* Build the canonical embedded-mode `DATABASE_URL` from the configured
|
|
50
65
|
* pgserve port. Used when the stored `server.databaseUrl` is empty or is
|
|
51
66
|
* the legacy 5432 default.
|
|
52
67
|
*/
|
|
53
68
|
export declare function buildEmbeddedDatabaseUrl(pgservePort?: number): string;
|
|
69
|
+
/**
|
|
70
|
+
* Build the canonical UDS-mode `DATABASE_URL`. postgres.js / libpq accept
|
|
71
|
+
* the `host=<dir>&port=<n>` query-param form to dial a Unix socket at
|
|
72
|
+
* `<dir>/.s.PGSQL.<n>`. Used by {@link resolveDatabaseUrl} when the
|
|
73
|
+
* canonical socket file is present at boot.
|
|
74
|
+
*/
|
|
75
|
+
export declare function buildCanonicalSocketDatabaseUrl(): string;
|
|
54
76
|
/**
|
|
55
77
|
* Extract the effective pgserve port. Honors an explicit override on the
|
|
56
78
|
* server config first (`server.pgservePort`, if ever added), then the
|
|
@@ -63,7 +85,16 @@ export declare function resolvePgservePort(serverConfig: ServerConfig): number;
|
|
|
63
85
|
*
|
|
64
86
|
* Precedence:
|
|
65
87
|
* 1. `serverConfig.databaseUrl`, if it's a non-empty, non-legacy value.
|
|
66
|
-
*
|
|
88
|
+
* Operator-provided URLs (external DB, custom port) pass through
|
|
89
|
+
* verbatim.
|
|
90
|
+
* 2. Otherwise, prefer the canonical UDS at
|
|
91
|
+
* `$XDG_RUNTIME_DIR/pgserve/.s.PGSQL.5432` when the socket file is
|
|
92
|
+
* present (synchronous probe — see
|
|
93
|
+
* {@link probeCanonicalSocketSync}). UDS preference matches genie's
|
|
94
|
+
* `resolvePgserveTransport` contract documented in
|
|
95
|
+
* `.genie/wishes/pgserve-singleton-no-proxy/SHARED-DESIGN.md` §4.6.
|
|
96
|
+
* 3. Otherwise, fall back to the configured TCP port (legacy phase-2
|
|
97
|
+
* bridge). Honors `serverConfig.pgservePort` when set.
|
|
67
98
|
*
|
|
68
99
|
* This function never reads `process.env.DATABASE_URL`.
|
|
69
100
|
*/
|
|
@@ -73,21 +104,16 @@ export declare function resolveDatabaseUrl(serverConfig: ServerConfig): string;
|
|
|
73
104
|
*
|
|
74
105
|
* All values come from `serverConfig` / `cliConfig`. No shell env reads.
|
|
75
106
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* `
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
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`.
|
|
107
|
+
* Phase 3 (`pgserve-singleton-no-proxy` G2) deleted the embedded
|
|
108
|
+
* pgserve code path entirely from `packages/api/`. omni-api connects
|
|
109
|
+
* to a peer-supervised pgserve via `DATABASE_URL` only.
|
|
110
|
+
* `PGSERVE_EMBEDDED` and `useCanonicalPgserve` are kept here for
|
|
111
|
+
* back-compat with `~/.omni/config.json` files written by phase-2
|
|
112
|
+
* installers, but the values no longer change runtime behavior:
|
|
113
|
+
* `PGSERVE_EMBEDDED` is always `'false'`, and a legacy
|
|
114
|
+
* `useCanonicalPgserve: false` triggers a one-shot warning surfaced by
|
|
115
|
+
* `omni doctor --fix` (which rewrites the config). The env keys remain
|
|
116
|
+
* in {@link RuntimeEnv} until a future major bumps the env contract.
|
|
91
117
|
*/
|
|
92
118
|
export declare function buildRuntimeEnv(serverConfig: ServerConfig, cliConfig: Config): RuntimeEnv;
|
|
93
119
|
//# 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;
|
|
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;AAQxD;;;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,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAQF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,0EAA0E;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,GAAE,MAA6B,GAAG,MAAM,CAE3F;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CAKxD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAMrE;AAgBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAiBrE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAqBzF"}
|