@linxiraos/pi-utils 1.1.8 → 1.1.9
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 +2 -3
- package/README.md +18 -18
- package/package.json +57 -63
- package/src/async.ts +16 -0
- package/src/dirs.ts +15 -10
- package/src/incoming-json.ts +856 -0
- package/src/index.ts +1 -0
- package/src/json-lexer.ts +413 -0
- package/src/json-parse.ts +93 -350
- package/src/tls-fetch.ts +2 -16
- package/THIRD-PARTY-NOTICES.txt +0 -22909
- package/dist/types/abortable.d.ts +0 -32
- package/dist/types/acp/connection.d.ts +0 -118
- package/dist/types/acp/protocol.d.ts +0 -526
- package/dist/types/acp/schema.d.ts +0 -41
- package/dist/types/acp/stream.d.ts +0 -8
- package/dist/types/acp/transport.d.ts +0 -88
- package/dist/types/acp.d.ts +0 -6
- package/dist/types/ar/arj.d.ts +0 -5
- package/dist/types/ar/asar.d.ts +0 -7
- package/dist/types/ar/bytes.d.ts +0 -20
- package/dist/types/ar/cab.d.ts +0 -5
- package/dist/types/ar/checksums.d.ts +0 -10
- package/dist/types/ar/codecs/bzip2.d.ts +0 -4
- package/dist/types/ar/codecs/gzip.d.ts +0 -6
- package/dist/types/ar/codecs/lzma.d.ts +0 -6
- package/dist/types/ar/codecs/lzw.d.ts +0 -4
- package/dist/types/ar/codecs/lzx.d.ts +0 -7
- package/dist/types/ar/codecs/xz.d.ts +0 -4
- package/dist/types/ar/codecs/zstd.d.ts +0 -6
- package/dist/types/ar/cpio.d.ts +0 -7
- package/dist/types/ar/deb.d.ts +0 -5
- package/dist/types/ar/entries.d.ts +0 -22
- package/dist/types/ar/error.d.ts +0 -8
- package/dist/types/ar/index.d.ts +0 -11
- package/dist/types/ar/iso.d.ts +0 -5
- package/dist/types/ar/limits.d.ts +0 -33
- package/dist/types/ar/lzh.d.ts +0 -7
- package/dist/types/ar/open.d.ts +0 -45
- package/dist/types/ar/paths.d.ts +0 -18
- package/dist/types/ar/rar/rar4-decoder.d.ts +0 -6
- package/dist/types/ar/rar/rar5-decoder.d.ts +0 -6
- package/dist/types/ar/rar.d.ts +0 -5
- package/dist/types/ar/reader.d.ts +0 -28
- package/dist/types/ar/registry.d.ts +0 -17
- package/dist/types/ar/rpm.d.ts +0 -5
- package/dist/types/ar/sevenzip/decode.d.ts +0 -33
- package/dist/types/ar/sevenzip.d.ts +0 -5
- package/dist/types/ar/source.d.ts +0 -54
- package/dist/types/ar/tar.d.ts +0 -9
- package/dist/types/ar/types.d.ts +0 -99
- package/dist/types/ar/unix-ar.d.ts +0 -7
- package/dist/types/ar/write.d.ts +0 -10
- package/dist/types/ar/zip.d.ts +0 -10
- package/dist/types/async.d.ts +0 -22
- package/dist/types/binary.d.ts +0 -23
- package/dist/types/browsers.d.ts +0 -68
- package/dist/types/chalk.d.ts +0 -125
- package/dist/types/cli.d.ts +0 -134
- package/dist/types/color.d.ts +0 -136
- package/dist/types/dates.d.ts +0 -7
- package/dist/types/dirs.d.ts +0 -325
- package/dist/types/docx/converter.d.ts +0 -46
- package/dist/types/docx/xml.d.ts +0 -26
- package/dist/types/docx.d.ts +0 -11
- package/dist/types/dom/core.d.ts +0 -431
- package/dist/types/dom/parser.d.ts +0 -7
- package/dist/types/dom/selector.d.ts +0 -5
- package/dist/types/dom.d.ts +0 -5
- package/dist/types/env.d.ts +0 -133
- package/dist/types/fetch-retry.d.ts +0 -98
- package/dist/types/file-lock.d.ts +0 -23
- package/dist/types/format.d.ts +0 -37
- package/dist/types/frontmatter.d.ts +0 -46
- package/dist/types/fs-error.d.ts +0 -31
- package/dist/types/glob.d.ts +0 -28
- package/dist/types/headers.d.ts +0 -34
- package/dist/types/index.d.ts +0 -42
- package/dist/types/json-parse.d.ts +0 -83
- package/dist/types/json.d.ts +0 -20
- package/dist/types/logger/rotating-file.d.ts +0 -18
- package/dist/types/logger.d.ts +0 -96
- package/dist/types/loop-phase.d.ts +0 -10
- package/dist/types/lru.d.ts +0 -46
- package/dist/types/marked/core.d.ts +0 -445
- package/dist/types/marked.d.ts +0 -2
- package/dist/types/materialize-string.d.ts +0 -7
- package/dist/types/math-delimiters.d.ts +0 -45
- package/dist/types/mermaid-ascii.d.ts +0 -11
- package/dist/types/mime.d.ts +0 -29
- package/dist/types/module-timer.d.ts +0 -1
- package/dist/types/path-tree.d.ts +0 -76
- package/dist/types/path.d.ts +0 -4
- package/dist/types/peek-file.d.ts +0 -29
- package/dist/types/postmortem.d.ts +0 -178
- package/dist/types/process-name.d.ts +0 -7
- package/dist/types/procmgr.d.ts +0 -74
- package/dist/types/prompt.d.ts +0 -18
- package/dist/types/ptree.d.ts +0 -124
- package/dist/types/readability/readability.d.ts +0 -9
- package/dist/types/readability/readerable.d.ts +0 -10
- package/dist/types/readability/types.d.ts +0 -70
- package/dist/types/readability.d.ts +0 -4
- package/dist/types/ring.d.ts +0 -93
- package/dist/types/runtime-install.d.ts +0 -85
- package/dist/types/sanitize-text.d.ts +0 -29
- package/dist/types/snowflake.d.ts +0 -25
- package/dist/types/sqlite.d.ts +0 -26
- package/dist/types/stderr-guard.d.ts +0 -22
- package/dist/types/stream.d.ts +0 -75
- package/dist/types/tab-spacing.d.ts +0 -24
- package/dist/types/temp.d.ts +0 -24
- package/dist/types/template.d.ts +0 -62
- package/dist/types/timing-buffer.d.ts +0 -22
- package/dist/types/tls-fetch.d.ts +0 -37
- package/dist/types/turndown/gfm.d.ts +0 -11
- package/dist/types/turndown/html.d.ts +0 -5
- package/dist/types/turndown/service.d.ts +0 -21
- package/dist/types/turndown/types.d.ts +0 -70
- package/dist/types/turndown.d.ts +0 -4
- package/dist/types/type-guards.d.ts +0 -5
- package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +0 -41
- package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +0 -89
- package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +0 -7
- package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +0 -12
- package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +0 -66
- package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +0 -48
- package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +0 -43
- package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +0 -7
- package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +0 -56
- package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +0 -65
- package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +0 -27
- package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +0 -17
- package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +0 -7
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +0 -11
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +0 -34
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +0 -11
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +0 -11
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +0 -26
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +0 -31
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +0 -11
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +0 -59
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +0 -17
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +0 -30
- package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +0 -55
- package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +0 -206
- package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +0 -51
- package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +0 -2
- package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +0 -6
- package/dist/types/vendor/mermaid-ascii/class/types.d.ts +0 -102
- package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +0 -6
- package/dist/types/vendor/mermaid-ascii/er/types.d.ts +0 -76
- package/dist/types/vendor/mermaid-ascii/index.d.ts +0 -1
- package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +0 -9
- package/dist/types/vendor/mermaid-ascii/parser.d.ts +0 -7
- package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +0 -6
- package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +0 -130
- package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +0 -23
- package/dist/types/vendor/mermaid-ascii/types.d.ts +0 -114
- package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +0 -25
- package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +0 -6
- package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +0 -145
- package/dist/types/version.d.ts +0 -18
- package/dist/types/vterm/buffer.d.ts +0 -99
- package/dist/types/vterm/query-responder.d.ts +0 -24
- package/dist/types/vterm/terminal.d.ts +0 -44
- package/dist/types/vterm.d.ts +0 -9
- package/dist/types/which.d.ts +0 -37
- package/dist/types/worker-host.d.ts +0 -51
- package/dist/types/xml.d.ts +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
-
## [1.1.
|
|
5
|
+
## [1.1.9] - 2026-09-05
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- Extended the temp-removal retry window to 7.5s: measured Windows handle-release latency after a child process dies reaches ~5s, and the previous 2s window flaked suites cleaning up trees containing SQLite databases.
|
|
7
|
+
- USER_AGENT constant restored to zeta/<version> (the v18.1.10 merge re-introduced the upstream omp/ UA on every provider request); brand wording in path-resolver docs corrected; profile validation error message Zeta'd.
|
|
9
8
|
|
|
10
9
|
## [1.1.6] - 2026-08-30
|
|
11
10
|
|
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
# @linxiraos/pi-utils
|
|
2
2
|
|
|
3
|
-
Shared utilities for [
|
|
3
|
+
Shared utilities for [oh-my-pi](https://github.com/can1357/oh-my-pi) packages. Zero ceremony, Bun-first.
|
|
4
4
|
|
|
5
5
|
## Notable modules
|
|
6
6
|
|
|
7
|
-
| Module
|
|
8
|
-
|
|
|
9
|
-
| `logger`
|
|
10
|
-
| `prompt`
|
|
11
|
-
| `dirs`
|
|
12
|
-
| `stream`
|
|
13
|
-
| `ptree` / `procmgr`
|
|
14
|
-
| `postmortem`
|
|
15
|
-
| `which`
|
|
16
|
-
| `fetch-retry`
|
|
17
|
-
| `fs-error`
|
|
18
|
-
| `env` / `worker-host`
|
|
19
|
-
| `abortable` / `async`
|
|
20
|
-
| `math-delimiters`
|
|
21
|
-
| `peek-file`
|
|
22
|
-
| `frontmatter`, `glob`, `mime`, `temp`, `format`, `color`, `snowflake`, `tab-spacing`, `path-tree`, `sanitize-text` | Smaller single-purpose helpers
|
|
7
|
+
| Module | Purpose |
|
|
8
|
+
| ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
|
|
9
|
+
| `logger` | Centralized logger writing to `~/.zeta/logs/` with rotation (TUI-safe — never stdout) |
|
|
10
|
+
| `prompt` | Handlebars-based prompt templating and formatting helpers |
|
|
11
|
+
| `dirs` | Path helpers for omp config directories (`~/.zeta`, XDG-aware on Linux) |
|
|
12
|
+
| `stream` | `readStream` / `readLines` helpers over `ReadableStream` |
|
|
13
|
+
| `ptree` / `procmgr` | Process trees, `ChildProcess` wrapper, process lifecycle management |
|
|
14
|
+
| `postmortem` | Cleanup callbacks on exit, signals, and fatal exceptions |
|
|
15
|
+
| `which` | `$which()` binary lookup with caching |
|
|
16
|
+
| `fetch-retry` | `fetch` with retry/backoff policies |
|
|
17
|
+
| `fs-error` | Errno guards (`isEnoent` and friends) |
|
|
18
|
+
| `env` / `worker-host` | Environment plumbing and side-effect-free worker-host entry contract (`workerHostEntry`) |
|
|
19
|
+
| `abortable` / `async` | AbortSignal-aware stream/promise helpers |
|
|
20
|
+
| `math-delimiters` | LaTeX span/block delimiter grammar (offsets only) shared by the TUI and collab-web renderers |
|
|
21
|
+
| `peek-file` | Read the first N bytes of a file with pooled buffers |
|
|
22
|
+
| `frontmatter`, `glob`, `mime`, `temp`, `format`, `color`, `snowflake`, `tab-spacing`, `path-tree`, `sanitize-text` | Smaller single-purpose helpers |
|
|
23
23
|
|
|
24
24
|
Import from the root barrel or per-module subpaths (`@linxiraos/pi-utils/<module>`).
|
|
25
25
|
|
|
@@ -33,5 +33,5 @@ Ships TypeScript source directly (no build step); requires Bun ≥ 1.3.14.
|
|
|
33
33
|
|
|
34
34
|
## References
|
|
35
35
|
|
|
36
|
-
- [Monorepo README](https://github.com/
|
|
36
|
+
- [Monorepo README](https://github.com/can1357/oh-my-pi#readme)
|
|
37
37
|
- [CHANGELOG](./CHANGELOG.md)
|
package/package.json
CHANGED
|
@@ -1,65 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"./*": {
|
|
60
|
-
"types": "./dist/types/*.d.ts",
|
|
61
|
-
"import": "./src/*.ts"
|
|
62
|
-
},
|
|
63
|
-
"./*.js": "./src/*.ts"
|
|
64
|
-
}
|
|
2
|
+
"engines": {
|
|
3
|
+
"bun": ">=1.3.14"
|
|
4
|
+
},
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@types/bun": "^1.3.14"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@linxiraos/pi-natives": "1.1.9"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "bun test --parallel",
|
|
13
|
+
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
14
|
+
"check": "tsgo -p tsconfig.json --noEmit"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
"./*.js": "./src/*.ts",
|
|
18
|
+
"./*": {
|
|
19
|
+
"import": "./src/*.ts",
|
|
20
|
+
"types": "./src/*.ts"
|
|
21
|
+
},
|
|
22
|
+
"./ar": {
|
|
23
|
+
"import": "./src/ar/index.ts",
|
|
24
|
+
"types": "./src/ar/index.ts"
|
|
25
|
+
},
|
|
26
|
+
".": {
|
|
27
|
+
"import": "./src/index.ts",
|
|
28
|
+
"types": "./src/index.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"types": "./src/index.ts",
|
|
32
|
+
"main": "./src/index.ts",
|
|
33
|
+
"type": "module",
|
|
34
|
+
"files": [
|
|
35
|
+
"src",
|
|
36
|
+
"README.md",
|
|
37
|
+
"CHANGELOG.md"
|
|
38
|
+
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"directory": "packages/utils",
|
|
41
|
+
"url": "git+https://github.com/Linxira-OS/linxira-zeta.git",
|
|
42
|
+
"type": "git"
|
|
43
|
+
},
|
|
44
|
+
"author": "Can Boluk",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/Linxira-OS/linxira-zeta/issues"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://linxira-os.github.io/zeta/",
|
|
50
|
+
"keywords": [
|
|
51
|
+
"utilities",
|
|
52
|
+
"cli",
|
|
53
|
+
"logging",
|
|
54
|
+
"streams"
|
|
55
|
+
],
|
|
56
|
+
"description": "Shared utilities for pi packages",
|
|
57
|
+
"version": "1.1.9",
|
|
58
|
+
"name": "@linxiraos/pi-utils"
|
|
65
59
|
}
|
package/src/async.ts
CHANGED
|
@@ -108,3 +108,19 @@ export class AsyncDrain<T> {
|
|
|
108
108
|
return this.#promise;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Runs async operations one at a time in call order. Each `run` starts after
|
|
114
|
+
* the previous operation settles (success or failure) and returns that
|
|
115
|
+
* operation's own promise, so a rejected step never poisons the queue. Used by
|
|
116
|
+
* stateful cursors whose concurrent pulls must not interleave.
|
|
117
|
+
*/
|
|
118
|
+
export class Serial {
|
|
119
|
+
#tail: Promise<unknown> = Promise.resolve();
|
|
120
|
+
|
|
121
|
+
run<T>(op: () => Promise<T>): Promise<T> {
|
|
122
|
+
const result = this.#tail.then(op, op);
|
|
123
|
+
this.#tail = result.catch(() => {});
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
}
|
package/src/dirs.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* variables are set, paths are redirected to XDG-compliant locations under
|
|
9
9
|
* $XDG_*_HOME/zeta/. This requires running `zeta config migrate` first to
|
|
10
10
|
* move data to the new locations. No filesystem existence checks are performed
|
|
11
|
-
* — if the env var is set,
|
|
11
|
+
* — if the env var is set, zeta trusts that the migration has been done.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import * as fs from "node:fs";
|
|
@@ -17,7 +17,7 @@ import * as path from "node:path";
|
|
|
17
17
|
import { engines, version } from "../package.json" with { type: "json" };
|
|
18
18
|
import { isEnoent, isEnotdir } from "./fs-error";
|
|
19
19
|
|
|
20
|
-
/** App name (e.g. "
|
|
20
|
+
/** App name (e.g. "zeta") */
|
|
21
21
|
export const APP_NAME: string = "zeta";
|
|
22
22
|
|
|
23
23
|
/** Config directory name (e.g. ".zeta") */
|
|
@@ -67,7 +67,7 @@ export function normalizeProfileName(profile: string | undefined): string | unde
|
|
|
67
67
|
WINDOWS_RESERVED_BASENAME_RE.test(normalized)
|
|
68
68
|
) {
|
|
69
69
|
throw new Error(
|
|
70
|
-
`Invalid
|
|
70
|
+
`Invalid Zeta profile "${profile}". Profile names must match ${PROFILE_NAME_RE.source}, ` +
|
|
71
71
|
`cannot be "." or "..", cannot end with ".", and cannot be a Windows reserved device name ` +
|
|
72
72
|
`(CON, PRN, AUX, NUL, COM0-9, LPT0-9, or any of those with an extension).`,
|
|
73
73
|
);
|
|
@@ -97,7 +97,7 @@ function getProfileFromEnv(): string | undefined {
|
|
|
97
97
|
* crash a bare `import` of this module with an uncaught stack trace before the
|
|
98
98
|
* CLI's error handling is in scope. The default profile is used instead; the
|
|
99
99
|
* CLI re-validates the env (see `runCli` in coding-agent/src/cli.ts) so the
|
|
100
|
-
* user still gets a clean "Invalid
|
|
100
|
+
* user still gets a clean "Invalid Zeta profile" message.
|
|
101
101
|
*/
|
|
102
102
|
function readProfileFromEnvSafe(): string | undefined {
|
|
103
103
|
try {
|
|
@@ -295,7 +295,7 @@ export function getConfigAgentDirName(): string {
|
|
|
295
295
|
type XdgCategory = "data" | "state" | "cache";
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
* Resolves and caches all
|
|
298
|
+
* Resolves and caches all zeta directory paths. On Linux, when XDG environment
|
|
299
299
|
* variables are set, paths are redirected under $XDG_*_HOME/zeta/. A new
|
|
300
300
|
* instance is created whenever the agent directory changes, which naturally
|
|
301
301
|
* invalidates all cached paths.
|
|
@@ -949,6 +949,11 @@ export function getSecretPlaceholderKeyPath(): string {
|
|
|
949
949
|
return keyPath;
|
|
950
950
|
}
|
|
951
951
|
|
|
952
|
+
/** Directory holding the per-model tiny-worker sockets and logs (~/.zeta/run/tiny; XDG default: $XDG_STATE_HOME/zeta/run/tiny). */
|
|
953
|
+
export function getTinyWorkerRuntimeDir(): string {
|
|
954
|
+
return dirs.rootSubdir(path.join("run", "tiny"), "state");
|
|
955
|
+
}
|
|
956
|
+
|
|
952
957
|
/** Root directory containing every per-project daemon runtime scope (~/.zeta/run/daemons; XDG default: $XDG_STATE_HOME/zeta/run/daemons). */
|
|
953
958
|
export function getDaemonRuntimeRoot(): string {
|
|
954
959
|
return dirs.rootSubdir(path.join("run", "daemons"), "state");
|
|
@@ -1108,11 +1113,6 @@ export function getInstallId(): string {
|
|
|
1108
1113
|
return next;
|
|
1109
1114
|
}
|
|
1110
1115
|
|
|
1111
|
-
/** Test-only: clear cached install id. Never call from production code. */
|
|
1112
|
-
export function __resetInstallIdCacheForTests(): void {
|
|
1113
|
-
cachedInstallId = null;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
1116
|
/** Get the project-level tracking directory (<project>/.zeta/tracking). */
|
|
1117
1117
|
export function getProjectTrackingDir(cwd: string = getProjectDir()): string {
|
|
1118
1118
|
return path.join(getProjectAgentDir(cwd), "tracking");
|
|
@@ -1122,3 +1122,8 @@ export function getProjectTrackingDir(cwd: string = getProjectDir()): string {
|
|
|
1122
1122
|
export function getTrackingIndexPath(agentDir?: string): string {
|
|
1123
1123
|
return path.join(agentDir ?? getAgentDir(), "tracking-index.json");
|
|
1124
1124
|
}
|
|
1125
|
+
|
|
1126
|
+
/** Test-only: clear cached install id. Never call from production code. */
|
|
1127
|
+
export function __resetInstallIdCacheForTests(): void {
|
|
1128
|
+
cachedInstallId = null;
|
|
1129
|
+
}
|