@automagik/omni 2.260512.1 → 2.260520.5
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 +205 -159
- package/dist/lib/canonical-pgserve-binary.d.ts +36 -0
- package/dist/lib/canonical-pgserve-binary.d.ts.map +1 -0
- package/dist/lib/canonical-pgserve.d.ts.map +1 -1
- package/dist/lib/pgserve-transport.d.ts +11 -1
- package/dist/lib/pgserve-transport.d.ts.map +1 -1
- package/dist/server/index.js +111 -111
- package/package.json +1 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical pgserve binary resolver — mirror of the genie-side resolver
|
|
3
|
+
* shipped in genie@4.260520.3 (`src/lib/canonical-pgserve-binary.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Background
|
|
6
|
+
* ----------
|
|
7
|
+
* The autopg-distribution-cutover-finalize wish (autopg repo) renamed the
|
|
8
|
+
* published v3 binary from `pgserve` to `autopg`. Both binaries expose an
|
|
9
|
+
* identical command surface (`install`, `port`, `url`, `status`, `restart`);
|
|
10
|
+
* only the on-disk name differs. Every omni consumer that historically
|
|
11
|
+
* hardcoded `'pgserve'` in a spawn arg now routes through this resolver
|
|
12
|
+
* so v3-only hosts (which have `autopg` on PATH but no `pgserve`) succeed
|
|
13
|
+
* instead of falling out as "binary unavailable".
|
|
14
|
+
*
|
|
15
|
+
* Resolution policy
|
|
16
|
+
* -----------------
|
|
17
|
+
* - Prefer `autopg` (v3 canonical) when present.
|
|
18
|
+
* - Fall back to `pgserve` (v2 legacy) for cutover hosts.
|
|
19
|
+
* - Return null when neither is on PATH — caller surfaces the canonical
|
|
20
|
+
* install hint via {@link canonicalPgserveInstallHint}.
|
|
21
|
+
*
|
|
22
|
+
* Lifecycle
|
|
23
|
+
* ---------
|
|
24
|
+
* - Memoized; cached value persists for the process lifetime.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the canonical pgserve binary on this host. Memoized.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolvePgserveBinary(): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Copy-paste recovery commands for the "binary not found" path. Points
|
|
32
|
+
* at the autopg v3 installer; ordered so the operator runs them
|
|
33
|
+
* top-to-bottom.
|
|
34
|
+
*/
|
|
35
|
+
export declare function canonicalPgserveInstallHint(): string[];
|
|
36
|
+
//# sourceMappingURL=canonical-pgserve-binary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-pgserve-binary.d.ts","sourceRoot":"","sources":["../../src/lib/canonical-pgserve-binary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAsBH;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAYpD;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CAKtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-pgserve.d.ts","sourceRoot":"","sources":["../../src/lib/canonical-pgserve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"canonical-pgserve.d.ts","sourceRoot":"","sources":["../../src/lib/canonical-pgserve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AA6IH;;;;;;GAMG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWpE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iCAAiC,CACrD,WAAW,EAAE,OAAO,EACpB,GAAG,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,OAAO,CAAC,CA6BlB;AAwDD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CASnD;AAuCD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,MAAM,EAAE,uBAAuB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6D5F;AAED;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,kBAAkB,EACxB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoCpE"}
|
|
@@ -78,9 +78,19 @@ export declare function probeCanonicalSocketSync(): boolean;
|
|
|
78
78
|
* supplied database name. Mirrors the URL shapes documented in
|
|
79
79
|
* SHARED-DESIGN.md §5.3 (omni-side scope).
|
|
80
80
|
*
|
|
81
|
-
* UDS shape: `postgresql://postgres:postgres
|
|
81
|
+
* UDS shape: `postgresql://postgres:postgres@localhost/omni?host=/run/user/1000/pgserve&port=5432`
|
|
82
82
|
* TCP shape: `postgresql://postgres:postgres@127.0.0.1:5432/omni`
|
|
83
83
|
*
|
|
84
|
+
* UDS placeholder host (`localhost`) is intentional. The previous form
|
|
85
|
+
* `postgresql://user:pass@/db?host=…` is libpq-valid but rejects when
|
|
86
|
+
* parsed by Node's WHATWG `URL()` constructor with "Invalid URL"
|
|
87
|
+
* (empty authority between `@` and `/`). omni-api's startup pipeline
|
|
88
|
+
* runs `new URL(DATABASE_URL)` for validation/redaction, which
|
|
89
|
+
* crashloops `omni-api` with `TypeError [ERR_INVALID_URL]` whenever
|
|
90
|
+
* the canonical UDS is reachable. libpq still routes to the socket
|
|
91
|
+
* because the `host=` query parameter overrides the URL host —
|
|
92
|
+
* placeholder is never dialed.
|
|
93
|
+
*
|
|
84
94
|
* The username/password pair is preserved (not derived from the transport)
|
|
85
95
|
* because omni's pgserve consumer keeps libpq peer-auth via password —
|
|
86
96
|
* pgserve@>=2.3 issues a per-fingerprint role credential and the API
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pgserve-transport.d.ts","sourceRoot":"","sources":["../../src/lib/pgserve-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;
|
|
1
|
+
{"version":3,"file":"pgserve-transport.d.ts","sourceRoot":"","sources":["../../src/lib/pgserve-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAQH,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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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,CAcR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CA+BzE"}
|