@linxiraos/pi-utils 1.4.0 → 1.4.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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/types/acp/connection.d.ts +18 -1
- package/dist/types/acp/transport.d.ts +26 -2
- package/dist/types/ar/codecs/gzip.d.ts +3 -0
- package/dist/types/ar/codecs/zstd.d.ts +3 -0
- package/dist/types/ar/limits.d.ts +2 -0
- package/dist/types/ar/source.d.ts +9 -0
- package/dist/types/ar/tar.d.ts +7 -2
- package/dist/types/dirs.d.ts +8 -1
- package/dist/types/env.d.ts +1 -2
- package/dist/types/fs-open.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ports.d.ts +15 -0
- package/dist/types/test-runtime.d.ts +2 -0
- package/package.json +2 -2
- package/src/acp/connection.ts +38 -6
- package/src/acp/transport.ts +101 -4
- package/src/ar/codecs/gzip.ts +6 -0
- package/src/ar/codecs/zstd.ts +6 -0
- package/src/ar/deb.ts +1 -1
- package/src/ar/limits.ts +3 -0
- package/src/ar/registry.ts +59 -20
- package/src/ar/source.ts +40 -0
- package/src/ar/tar.ts +215 -53
- package/src/dirs.ts +28 -2
- package/src/env.ts +2 -9
- package/src/frontmatter.ts +11 -4
- package/src/fs-open.ts +2 -1
- package/src/index.ts +1 -0
- package/src/ports.ts +15 -0
- package/src/test-runtime.ts +8 -0
package/src/index.ts
CHANGED
package/src/ports.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default loopback ports for Zeta's local services.
|
|
3
|
+
*
|
|
4
|
+
* OMP installs on the same machine use 30141/30142/3847, and common developer
|
|
5
|
+
* tools squat on 3000/8080/8787/3847. Zeta therefore owns a dedicated block:
|
|
6
|
+
* three uncommon ports, at least two apart, so a side-by-side OMP install and
|
|
7
|
+
* unrelated services cannot take the gateway or the stats dashboard away.
|
|
8
|
+
*
|
|
9
|
+
* Every default in the repository derives from these constants. The standalone
|
|
10
|
+
* Electron shell (`desktop/src/main.ts`, not a Bun workspace package) carries
|
|
11
|
+
* literals that must match; its serve-discovery test asserts the values.
|
|
12
|
+
*/
|
|
13
|
+
export const ZETA_WEB_PORT = 43141;
|
|
14
|
+
export const ZETA_GATEWAY_PORT = 43143;
|
|
15
|
+
export const ZETA_STATS_PORT = 43147;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const BUN_TEST_ENTRY_PATTERN = /[._](?:test|spec)\.[cm]?[jt]sx?$/;
|
|
2
|
+
|
|
3
|
+
/** True when the process is an explicitly marked test child or Bun is running a test entrypoint. */
|
|
4
|
+
export function isBunTestRuntime(): boolean {
|
|
5
|
+
if (Bun.env.PI_TEST_RUNTIME === "1") return true;
|
|
6
|
+
const hasTestEnvironment = Bun.env.BUN_ENV === "test" || Bun.env.NODE_ENV === "test";
|
|
7
|
+
return hasTestEnvironment && BUN_TEST_ENTRY_PATTERN.test(Bun.main);
|
|
8
|
+
}
|