@linxiraos/pi-utils 1.4.9 → 1.4.11
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/THIRD-PARTY-NOTICES.txt +100 -0
- package/dist/types/env.d.ts +10 -0
- package/package.json +3 -3
- package/src/acp/schema.ts +1 -1
- package/src/env.ts +67 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.4.11] - 2026-11-06
|
|
4
|
+
|
|
5
|
+
- `applyLegacyOmpEnv()` lets a host apply the read-only legacy OMP dotenv files after its settings layer resolves the compatibility switch; the eager `ZETA_OMP_COMPAT` pass is unchanged.
|
|
6
|
+
|
|
7
|
+
## [1.4.10] - 2026-11-05
|
|
8
|
+
|
|
9
|
+
- Legacy OMP dotenv files are no longer loaded by default; set `ZETA_OMP_COMPAT=1` to opt into the read-only fallback. Zeta `.zeta` dotenv files keep precedence.
|
|
10
|
+
|
|
3
11
|
## [1.4.9] - 2026-11-03
|
|
4
12
|
|
|
5
13
|
- Synced with upstream OMP v18.16.0; no package-specific user-visible changes.
|
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -5,6 +5,50 @@ This generated, self-contained aggregate accompanies Zeta release artifacts.
|
|
|
5
5
|
It does not replace package-level license files. First-party licensing grants
|
|
6
6
|
no rights in third-party code, fonts, data, or marks identified below.
|
|
7
7
|
|
|
8
|
+
ZETA IS A FORK AND REDISTRIBUTION
|
|
9
|
+
=================================
|
|
10
|
+
|
|
11
|
+
Zeta is a downstream distribution of oh-my-pi (OMP), and it also contains forks
|
|
12
|
+
of OMP Web, OMP Studio and TermIDE. Upstream copyright notices stay with their
|
|
13
|
+
files and are not restated here. This section states, for every forked or
|
|
14
|
+
vendored application tree, where it came from, what Zeta changed, and why.
|
|
15
|
+
Upstream URLs are the ones configured in `.git/config`; the per-tree deviation
|
|
16
|
+
ledgers are authoritative for details.
|
|
17
|
+
|
|
18
|
+
Forked application trees:
|
|
19
|
+
|
|
20
|
+
| Path | Upstream | Snapshot | License | What Zeta changed |
|
|
21
|
+
|---|---|---|---|---|
|
|
22
|
+
| `packages/ main/ crates/ python/ lsp/ sdk/ types/ skills/` | oh-my-pi (OMP), https://github.com/can1357/oh-my-pi | integrated through tag `v18.15.0` (`document/upstream-sync.md`) | see upstream files | product name, paths, command names and env prefixes; branded assets; internal identifiers renamed to `__zeta*` |
|
|
23
|
+
| `web-ui/` | OMP Web, https://github.com/17380936778/omp-web | frozen snapshot + manual cherry-picks (`document/upstream-sync.md`) | see upstream files | gateway transport, theme token bridge, page routing |
|
|
24
|
+
| `web-app/` (`src/studio`, `src/vendor/*`) | OMP Studio 0.1.17, https://github.com/the-snowpear/omp-studio | `0.1.17`, ported into the product renderer | MIT | maintained by Zeta now: the host contract is reimplemented in `studio-host` (pair/CSRF/query/command/events), the renderer was rebranded (`zeta-studio` wire name, Zeta links/fixtures), and Zeta adds windowed transcripts, precompressed static serving, the plugin registry, and the usage dashboard |
|
|
25
|
+
| `termide/` | TermIDE, https://github.com/termide/termide | tag `0.46.0` = `a027ca788cd4c9d24f060cdcd3195ca2e475617b` | MIT | deviations listed in `termide/VENDOR.md` (28 entries) |
|
|
26
|
+
| `editor/npm/*` (`@linxiraos/editor*`) | TermIDE `panel-editor` | same tree as `termide/` | MIT | built as the editor-only bin `termide-editor` (`editor/npm/editor/VENDOR.md`) |
|
|
27
|
+
| `plugins/official/*` | per plugin | per plugin | per plugin | each directory carries `plugin.json`, README with source, and its license |
|
|
28
|
+
|
|
29
|
+
Why the fork renames things at all: the upstream licenses and the product
|
|
30
|
+
identity both require that a downstream distribution not present itself as the
|
|
31
|
+
upstream. Renames therefore cover the product name, command names
|
|
32
|
+
(`zetawork` / `zetacode` / `zetaide`), the `zeta://` scheme, the npm scope
|
|
33
|
+
`@linxiraos/*`, and release asset names (`zeta-cli-*`). User-visible
|
|
34
|
+
configuration keeps accepting the legacy names during the transition, so an
|
|
35
|
+
existing installation does not silently break.
|
|
36
|
+
|
|
37
|
+
Brand and assets:
|
|
38
|
+
|
|
39
|
+
* Product marks — name, logos, app icons, wordmarks, splash art — are Zeta's own
|
|
40
|
+
and are not redistributed from any upstream. Upstream marks are not shipped.
|
|
41
|
+
* Assets that do come from an upstream are enumerated in the per-tree ledgers
|
|
42
|
+
above; each keeps its upstream license notice in place.
|
|
43
|
+
|
|
44
|
+
Frozen counterpart constants (interoperability, not branding):
|
|
45
|
+
|
|
46
|
+
* Stencil OIDC `client-id "omp"`, its issuer and scopes; `catalog.stencil.so`;
|
|
47
|
+
`docs.stencil.so/tern/protocol/`; `my.omp.sh` as the collaboration relay
|
|
48
|
+
constant; the `__omp_judgment_images` upload key. These are wire-compatible
|
|
49
|
+
identifiers Zeta must keep, listed here so that a brand sweep does not break
|
|
50
|
+
them.
|
|
51
|
+
|
|
8
52
|
PYTHON DEPENDENCY DISTRIBUTION ROLE
|
|
9
53
|
===================================
|
|
10
54
|
|
|
@@ -385,6 +429,62 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
385
429
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
386
430
|
SOFTWARE.
|
|
387
431
|
|
|
432
|
+
-------------------------------------------------------------------------------
|
|
433
|
+
web-app/src/studio + web-app/src/vendor/* + web-ui/components/studio +
|
|
434
|
+
web-ui/styles/studio + web-ui/lib/studio-protocol
|
|
435
|
+
|
|
436
|
+
Ported UI surface and protocol types from OMP Studio 0.1.17 (MIT).
|
|
437
|
+
|
|
438
|
+
- `web-ui/components/studio/` and `web-ui/styles/studio/` are derived from the
|
|
439
|
+
OMP Studio renderer (`apps/renderer/src`).
|
|
440
|
+
- `web-ui/lib/studio-protocol/` vendors the type and validation surface of
|
|
441
|
+
`@omp-studio/client-contract` and `@omp-studio/studio-protocol` (78 files, no
|
|
442
|
+
runtime dependency), so the ported renderer keeps its own read models.
|
|
443
|
+
- `web-ui/lib/studio-client/` is Zeta's own implementation of the
|
|
444
|
+
`StudioClient` interface over the Zeta gateway; it is not derived from
|
|
445
|
+
`@omp-studio/client`.
|
|
446
|
+
|
|
447
|
+
The data plumbing, transport and packaging are Zeta's own and are not part of
|
|
448
|
+
that derivation.
|
|
449
|
+
|
|
450
|
+
Copyright (c) 2026 snowpear and OMP Studio contributors
|
|
451
|
+
Copyright (c) 2026 Linxira-OS and Zeta contributors (Zeta modifications and additions)
|
|
452
|
+
|
|
453
|
+
Local modifications: the product renderer moved to `web-app/` (Vite 7) with
|
|
454
|
+
its own node project, and the host contract is Zeta's `studio-host` rather than
|
|
455
|
+
Studio's server. `@omp-studio/client-contract` and
|
|
456
|
+
`@omp-studio/studio-protocol` imports were rewritten to the vendored copies in
|
|
457
|
+
both trees; `@omp-studio/client` is replaced by `web-ui/lib/studio-client` (the
|
|
458
|
+
frozen snapshot) and by the host-backed transport in `web-app/`. The wire
|
|
459
|
+
protocol name is `zeta-studio`, the desktop bridge global is
|
|
460
|
+
`zetaStudioChrome`, Studio's design tokens were rebound to Zeta's theme alias
|
|
461
|
+
layer (`--studio-*` → `--zeta-alias-*`), and surfaces with no Zeta backend were
|
|
462
|
+
dropped rather than ported. Zeta-only additions: windowed transcript
|
|
463
|
+
pagination, precompressed static assets, the real plugin registry, the usage
|
|
464
|
+
dashboard, and the brand sweep. The MIT notice above covers the unmodified
|
|
465
|
+
upstream portions; Zeta's changes are additionally under
|
|
466
|
+
`Copyright (c) 2026 Linxira-OS and Zeta contributors`.
|
|
467
|
+
|
|
468
|
+
MIT License
|
|
469
|
+
|
|
470
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
471
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
472
|
+
in the Software without restriction, including without limitation the rights
|
|
473
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
474
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
475
|
+
furnished to do so, subject to the following conditions:
|
|
476
|
+
|
|
477
|
+
The above copyright notice and this permission notice shall be included in all
|
|
478
|
+
copies or substantial portions of the Software.
|
|
479
|
+
|
|
480
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
481
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
482
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
483
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
484
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
485
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
486
|
+
SOFTWARE.
|
|
487
|
+
|
|
388
488
|
-------------------------------------------------------------------------------
|
|
389
489
|
packages/coding-agent/src/export/html/vendor/NOTICE
|
|
390
490
|
|
package/dist/types/env.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ export declare function getDotenvEnvValues(cwd?: string, env?: Record<string, st
|
|
|
44
44
|
* only shell-identifier names and spawn-safe values.
|
|
45
45
|
*/
|
|
46
46
|
export declare function parseEnvFile(filePath: string): Record<string, string>;
|
|
47
|
+
export declare function isOmpCompatEnabled(env?: Record<string, string | undefined>): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Apply the legacy OMP dotenv files on demand.
|
|
50
|
+
*
|
|
51
|
+
* The eager pass above only sees `ZETA_OMP_COMPAT` from the shell or a Zeta
|
|
52
|
+
* dotenv file. A host that resolves the persisted `compat.importLegacyOmp`
|
|
53
|
+
* setting calls this once its settings layer is loaded. Idempotent, and it
|
|
54
|
+
* never overwrites a name the process already has.
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyLegacyOmpEnv(): void;
|
|
47
57
|
/**
|
|
48
58
|
* Intentional re-export of Bun.env.
|
|
49
59
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxiraos/pi-utils",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11",
|
|
4
4
|
"description": "Shared utilities for pi packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"utilities",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@linxiraos/pi-natives": "1.4.
|
|
58
|
-
"@linxiraos/
|
|
57
|
+
"@linxiraos/pi-natives": "1.4.11",
|
|
58
|
+
"@linxiraos/zeta-schema": "1.4.11"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/bun": "1.4.4"
|
package/src/acp/schema.ts
CHANGED
package/src/env.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import * as os from "node:os";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { parseEnv } from "node:util";
|
|
5
|
-
import { getAgentDir, getConfigRootDir, getProjectDir, refreshDirsFromEnv } from "./dirs";
|
|
5
|
+
import { getActiveProfile, getAgentDir, getConfigRootDir, getProjectDir, refreshDirsFromEnv } from "./dirs";
|
|
6
6
|
import { isBunTestRuntime } from "./test-runtime";
|
|
7
7
|
|
|
8
8
|
export * from "./test-runtime";
|
|
@@ -278,11 +278,56 @@ export function parseEnvFile(filePath: string): Record<string, string> {
|
|
|
278
278
|
return result;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
// Read-only compatibility with the old OMP agent directory. Off by default:
|
|
282
|
+
// external OMP configuration must be explicitly imported. Set
|
|
283
|
+
// ZETA_OMP_COMPAT=1 in the shell or a Zeta dotenv file to enable both the
|
|
284
|
+
// legacy dotenv fallback and the models.yml/agent.db overlay.
|
|
285
|
+
export function isOmpCompatEnabled(env: Record<string, string | undefined> = Bun.env): boolean {
|
|
286
|
+
const value = env.ZETA_OMP_COMPAT;
|
|
287
|
+
if (!value) return false;
|
|
288
|
+
const normalized = value.toLowerCase();
|
|
289
|
+
return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on";
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function loadLegacyOmpEnv(): Record<string, string> {
|
|
293
|
+
const home = os.homedir();
|
|
294
|
+
const project = getProjectDir();
|
|
295
|
+
const profile = getActiveProfile();
|
|
296
|
+
const files = [
|
|
297
|
+
{ file: path.join(home, ".omp", ".env"), project: false },
|
|
298
|
+
{ file: path.join(home, ".omp", "agent", ".env"), project: false },
|
|
299
|
+
...(profile ? [{ file: path.join(home, ".omp", "profiles", profile, "agent", ".env"), project: false }] : []),
|
|
300
|
+
{ file: path.join(project, ".omp", ".env"), project: true },
|
|
301
|
+
{ file: path.join(project, ".omp", "agent", ".env"), project: true },
|
|
302
|
+
];
|
|
303
|
+
const merged: Record<string, string> = {};
|
|
304
|
+
const seen = new Set<string>();
|
|
305
|
+
for (const { file, project: projectFile } of files) {
|
|
306
|
+
if (seen.has(file)) continue;
|
|
307
|
+
seen.add(file);
|
|
308
|
+
for (const [key, value] of Object.entries(parseEnvFile(file))) {
|
|
309
|
+
merged[key] = value;
|
|
310
|
+
if (projectFile) projectEnvNamesLoadedByOmp.add(key);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return merged;
|
|
314
|
+
}
|
|
315
|
+
|
|
281
316
|
// Eagerly parse the user's $HOME/.env and the current project's .env (from cwd)
|
|
282
317
|
const homeEnv = parseEnvFile(path.join(os.homedir(), ".env"));
|
|
283
318
|
const piEnv = parseEnvFile(path.join(getConfigRootDir(), ".env"));
|
|
284
319
|
const agentEnv = parseEnvFile(path.join(getAgentDir(), ".env"));
|
|
285
320
|
const projectEnv = parseEnvFile(path.join(getProjectDir(), ".env"));
|
|
321
|
+
// The switch itself may come from the shell or any Zeta dotenv file. Check the
|
|
322
|
+
// same precedence before touching legacy OMP files; do not read them by default.
|
|
323
|
+
const ompCompatValue =
|
|
324
|
+
Bun.env.ZETA_OMP_COMPAT ??
|
|
325
|
+
projectEnv.ZETA_OMP_COMPAT ??
|
|
326
|
+
agentEnv.ZETA_OMP_COMPAT ??
|
|
327
|
+
piEnv.ZETA_OMP_COMPAT ??
|
|
328
|
+
homeEnv.ZETA_OMP_COMPAT;
|
|
329
|
+
const legacyOmpEnabled = isOmpCompatEnabled({ ZETA_OMP_COMPAT: ompCompatValue });
|
|
330
|
+
const legacyOmpEnv = legacyOmpEnabled ? loadLegacyOmpEnv() : {};
|
|
286
331
|
|
|
287
332
|
for (const key of Object.keys(Bun.env)) {
|
|
288
333
|
const value = Bun.env[key];
|
|
@@ -291,7 +336,8 @@ for (const key of Object.keys(Bun.env)) {
|
|
|
291
336
|
}
|
|
292
337
|
}
|
|
293
338
|
|
|
294
|
-
|
|
339
|
+
/** Copy one dotenv file into the process environment; an already-set name wins. */
|
|
340
|
+
function mergeDotenvIntoProcess(file: Record<string, string>): void {
|
|
295
341
|
for (const key in file) {
|
|
296
342
|
if (!isMacosMallocStackLoggingEnvName(key) && !Bun.env[key]) {
|
|
297
343
|
Bun.env[key] = file[key];
|
|
@@ -300,6 +346,8 @@ for (const file of [projectEnv, agentEnv, piEnv, homeEnv]) {
|
|
|
300
346
|
}
|
|
301
347
|
}
|
|
302
348
|
|
|
349
|
+
for (const file of [projectEnv, agentEnv, piEnv, homeEnv, legacyOmpEnv]) mergeDotenvIntoProcess(file);
|
|
350
|
+
|
|
303
351
|
// Directory-affecting keys (XDG_*_HOME, and in default mode ZETA_CODING_AGENT_DIR)
|
|
304
352
|
// may have just arrived from the profile/agent `.env` applied above. The dirs
|
|
305
353
|
// resolver cached its paths at module load — before this file ran — so rebuild
|
|
@@ -307,6 +355,23 @@ for (const file of [projectEnv, agentEnv, piEnv, homeEnv]) {
|
|
|
307
355
|
// the profile name + home, so this re-reads only the directory vars.
|
|
308
356
|
refreshDirsFromEnv();
|
|
309
357
|
|
|
358
|
+
let legacyOmpEnvApplied = legacyOmpEnabled;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Apply the legacy OMP dotenv files on demand.
|
|
362
|
+
*
|
|
363
|
+
* The eager pass above only sees `ZETA_OMP_COMPAT` from the shell or a Zeta
|
|
364
|
+
* dotenv file. A host that resolves the persisted `compat.importLegacyOmp`
|
|
365
|
+
* setting calls this once its settings layer is loaded. Idempotent, and it
|
|
366
|
+
* never overwrites a name the process already has.
|
|
367
|
+
*/
|
|
368
|
+
export function applyLegacyOmpEnv(): void {
|
|
369
|
+
if (legacyOmpEnvApplied) return;
|
|
370
|
+
legacyOmpEnvApplied = true;
|
|
371
|
+
mergeDotenvIntoProcess(loadLegacyOmpEnv());
|
|
372
|
+
refreshDirsFromEnv();
|
|
373
|
+
}
|
|
374
|
+
|
|
310
375
|
/**
|
|
311
376
|
* Intentional re-export of Bun.env.
|
|
312
377
|
*
|