@intentic/constants 1.325.0 → 1.327.0
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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/heavy/heavy-rules.cjs +1 -1
- package/src/memory-room.d.mts +9 -0
- package/src/memory-room.mjs +56 -18
package/dist/index.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ export declare const DAEMON_PORT = 8787;
|
|
|
97
97
|
export declare const PREVIEW_PORT = 5173;
|
|
98
98
|
export declare const LOCAL_PORT = 8788;
|
|
99
99
|
export declare const TRANSLATOR_PORT = 8789;
|
|
100
|
+
export declare const BROKER_PORT = 8790;
|
|
100
101
|
export declare const GOOGLE_CLIENT_ID = "481795963975-cq9msl6higcd91joidrfp8mjlkuq5fk3.apps.googleusercontent.com";
|
|
101
102
|
export declare const GOOGLE_TOKEN_STORAGE_KEY = "intentic.gid.481795963975-cq9msl6higcd91joidrfp8mjlkuq5fk3.apps.googleusercontent.com";
|
|
102
103
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAOnC,eAAO,MAAM,cAAc,UAAU,CAAC;AAGtC,eAAO,MAAM,YAAY,aAAa,CAAC;AAGvC,eAAO,MAAM,SAAS,cAAc,CAAC;AAKrC,eAAO,MAAM,aAAa,SAAS,CAAC;AAGpC,eAAO,MAAM,UAAU,WAAW,CAAC;AAKnC,eAAO,MAAM,WAAW,cAAc,CAAC;AAKvC,eAAO,MAAM,gBAAgB,sCAAsC,CAAC;AAGpE,eAA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,QAAS,aAAa,KAAG,MAA+D,CAAC;AAIvH,eAAO,MAAM,WAAW,OAAO,CAAC;AAChC,eAAO,MAAM,YAAY,OAAO,CAAC;AAGjC,eAAO,MAAM,UAAU,OAAO,CAAC;AAG/B,eAAO,MAAM,eAAe,OAAO,CAAC;AAIpC,eAAO,MAAM,WAAW,OAAO,CAAC;AAGhC,eAAO,MAAM,gBAAgB,6EAA6E,CAAC;AAG3G,eAAO,MAAM,wBAAwB,0FAAqC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export const DAEMON_PORT = 8787;
|
|
|
45
45
|
export const PREVIEW_PORT = 5173;
|
|
46
46
|
export const LOCAL_PORT = 8788;
|
|
47
47
|
export const TRANSLATOR_PORT = 8789;
|
|
48
|
+
export const BROKER_PORT = 8790;
|
|
48
49
|
export const GOOGLE_CLIENT_ID = "481795963975-cq9msl6higcd91joidrfp8mjlkuq5fk3.apps.googleusercontent.com";
|
|
49
50
|
export const GOOGLE_TOKEN_STORAGE_KEY = `intentic.gid.${GOOGLE_CLIENT_ID}`;
|
|
50
51
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAOnC,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAGtC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAGvC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAKrC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AAGpC,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAKnC,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AAKvC,MAAM,CAAC,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AAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAkB,EAAU,EAAE,CAAC,GAAG,mBAAmB,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAIvH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAGjC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAG/B,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAIpC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAGhC,MAAM,CAAC,MAAM,gBAAgB,GAAG,0EAA0E,CAAC;AAG3G,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,gBAAgB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/constants",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.327.0",
|
|
4
4
|
"description": "Shared constants for the intentic packages, ports, paths, and image references the daemon, CLIs and desktop app all agree on",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@intentic/testing": "0.0.0",
|
|
94
94
|
"@intentic/tsconfig": "0.0.0",
|
|
95
95
|
"@types/bun": "1.4.2",
|
|
96
|
-
"@types/node": "24.
|
|
96
|
+
"@types/node": "24.19.1",
|
|
97
97
|
"@typescript/native-preview": "7.0.0-dev.20260707.2"
|
|
98
98
|
},
|
|
99
99
|
"scripts": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Which programs are heavy enough to take turns, and how the queue treats them: the one table the daemon
|
|
2
|
-
// (_sandbox/sandbox/src/
|
|
2
|
+
// (_sandbox/sandbox/src/workload/heavy-commands.ts), the program hook that queues a heavy program as it starts
|
|
3
3
|
// (heavy-hook.cjs, heavy-exec.cjs), queue-run's callers and the repository's own scripts (_tools/scripts/lib/
|
|
4
4
|
// heavy-slot.mjs) all read. CommonJS with no dependencies, so it loads under `node --require` in any project, on any
|
|
5
5
|
// Node an agent's project pins, and ES modules import it by name.
|
package/src/memory-room.d.mts
CHANGED
|
@@ -8,6 +8,8 @@ export const TARGETED_RUN_BYTES: number;
|
|
|
8
8
|
export type RoomSize = "targeted";
|
|
9
9
|
export const TEST_PROCESS_BYTES: Readonly<{ fanOutWorker: number; standaloneWorker: number; typecheck: number; ceiling: number }>;
|
|
10
10
|
export const STALL_PERCENT: number;
|
|
11
|
+
export const STALL_SUSTAINED_PERCENT: number;
|
|
12
|
+
export const SWAP_FULL_SHARE: number;
|
|
11
13
|
export const RESERVATION_MS: number;
|
|
12
14
|
export const ROOM_SOCKET: string;
|
|
13
15
|
export const READING_FILES: readonly string[];
|
|
@@ -19,10 +21,15 @@ export interface MemoryReading {
|
|
|
19
21
|
readonly usedBytes: number | undefined;
|
|
20
22
|
// The swapped part of `usedBytes`; 0 when swap is off or unaccounted.
|
|
21
23
|
readonly swapBytes: number;
|
|
24
|
+
// What swap can hold: memory.swap.max, never more than what is swapped plus the machine's SwapFree; at a root cgroup
|
|
25
|
+
// the machine's SwapTotal. Undefined where nothing bounds it. Past SWAP_FULL_SHARE of it, swap counts as used.
|
|
26
|
+
readonly swapLimitBytes?: number | undefined;
|
|
22
27
|
// The machine's MemAvailable, which free memory never exceeds; absent where the machine does not say.
|
|
23
28
|
readonly availableBytes?: number | undefined;
|
|
24
29
|
// Memory PSI `full avg10`, in percent; 0 when healthy or unreported.
|
|
25
30
|
readonly stallPercent: number;
|
|
31
|
+
// Memory PSI `full avg60`, in percent, from the same file; 0 when healthy or unreported.
|
|
32
|
+
readonly stallSustainedPercent?: number | undefined;
|
|
26
33
|
// memory.events `oom_kill`, cumulative; undefined without a cgroup.
|
|
27
34
|
readonly oomKills: number | undefined;
|
|
28
35
|
}
|
|
@@ -60,6 +67,8 @@ export function judge(
|
|
|
60
67
|
request: { readonly workload: RoomWorkload; readonly attended: boolean; readonly reservedBytes?: number; readonly size?: RoomSize | undefined },
|
|
61
68
|
): RoomJudgement;
|
|
62
69
|
export function freeBytesOf(reading: MemoryReading): number | undefined;
|
|
70
|
+
export function swapFullOf(reading: MemoryReading): boolean;
|
|
71
|
+
export function countedBytesOf(reading: MemoryReading): number | undefined;
|
|
63
72
|
export function askRoom(options?: {
|
|
64
73
|
readonly workload?: RoomWorkload;
|
|
65
74
|
readonly waitSeconds?: number;
|
package/src/memory-room.mjs
CHANGED
|
@@ -15,7 +15,14 @@
|
|
|
15
15
|
// free. Counting them held every heavy command for minutes on a sandbox with 8 GB available (measured
|
|
16
16
|
// 2026-09-26..10-02: 4.2 GiB of idle swap, 17 h of gate waits a week). Swap that is being paged back in shows
|
|
17
17
|
// as stall, below, which holds work whatever the bytes say.
|
|
18
|
-
//
|
|
18
|
+
// Once swap is nearly full (SWAP_FULL_SHARE of memory.swap.max, or of what the machine's swap can still take)
|
|
19
|
+
// that stops being true: nothing more can be parked there, so a page the work touches comes back only by
|
|
20
|
+
// pushing out another, and the swapped pages count against the limit with the resident ones. Measured
|
|
21
|
+
// 2026-10-05: 12 GiB resident + 10 of 10 GiB swapped against a 20 GiB limit, load 38, a third of the time
|
|
22
|
+
// waiting on disk, and the formula still read 2.4 GiB free and started every turn.
|
|
23
|
+
// stall memory PSI `full`: avg10, the share of the last ten seconds in which everything waited on memory, and avg60,
|
|
24
|
+
// the last minute's. A sandbox paging hard flickers around any avg10 threshold (19, 11, 15, 4, 18% in five
|
|
25
|
+
// minutes of the reading above, never 20), so a lower bar on the minute catches what the spikes miss.
|
|
19
26
|
import { spawnSync } from "node:child_process";
|
|
20
27
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
21
28
|
import { request } from "node:http";
|
|
@@ -52,8 +59,9 @@ export const TEST_PROCESS_BYTES = Object.freeze({
|
|
|
52
59
|
// One bun worker on the web package at its peak (measured 2026-09-25: 2.4 to 3.2 GiB over the web suite), the size a
|
|
53
60
|
// lone `suites` run sizes to.
|
|
54
61
|
standaloneWorker: 3 * GIB,
|
|
55
|
-
// One typecheck task: most packages' tsgo or vue-tsc settle under 1 GiB, the web package's vue-tsc may take its
|
|
56
|
-
// heap
|
|
62
|
+
// One typecheck task: most packages' tsgo or vue-tsc settle under 1 GiB, the web package's vue-tsc may take its 6 GiB
|
|
63
|
+
// heap (measured 2026-10-06: 4.8 GiB from no build info, 1 GiB of it vue-i18n's `t` checked against the catalog), and
|
|
64
|
+
// at most one of those runs among the others.
|
|
57
65
|
typecheck: 2 * GIB,
|
|
58
66
|
// Past this one process is a leak, not a suite: twice the largest worker measured. On 2026-09-25 a single bun process
|
|
59
67
|
// reached 14.7 GiB resident plus 31 GiB of swap, twice in one day, and stalled every conversation on the sandbox.
|
|
@@ -64,8 +72,12 @@ export const TEST_PROCESS_BYTES = Object.freeze({
|
|
|
64
72
|
export const PERSON_RESERVE_BYTES = COST_BYTES.agentRuntime;
|
|
65
73
|
// Percent of full avg10 at which the sandbox counts as grinding, whatever its byte count says.
|
|
66
74
|
export const STALL_PERCENT = 20;
|
|
75
|
+
// Percent of full avg60 at which it does: lower than STALL_PERCENT, since a minute's average has smoothed the spikes.
|
|
76
|
+
export const STALL_SUSTAINED_PERCENT = 10;
|
|
77
|
+
// The share of its swap limit past which swap counts as full, and the swapped pages count as used.
|
|
78
|
+
export const SWAP_FULL_SHARE = 0.9;
|
|
67
79
|
export const RESERVATION_MS = 90_000;
|
|
68
|
-
// Where the daemon answers `GET /room`; never the daemon's own socket, which
|
|
80
|
+
// Where the daemon answers `GET /room`; never the daemon's own socket, which netd relays to the internet.
|
|
69
81
|
export const ROOM_SOCKET = process.env.INTENTIC_ROOM_SOCKET ?? "/run/intentic/room.sock";
|
|
70
82
|
|
|
71
83
|
const CGROUP = "/sys/fs/cgroup";
|
|
@@ -76,6 +88,7 @@ export const READING_FILES = Object.freeze([
|
|
|
76
88
|
`${CGROUP}/memory.current`,
|
|
77
89
|
`${CGROUP}/memory.stat`,
|
|
78
90
|
`${CGROUP}/memory.swap.current`,
|
|
91
|
+
`${CGROUP}/memory.swap.max`,
|
|
79
92
|
`${CGROUP}/memory.pressure`,
|
|
80
93
|
`${CGROUP}/memory.events`,
|
|
81
94
|
"/proc/meminfo",
|
|
@@ -97,9 +110,10 @@ const keyed = (text) =>
|
|
|
97
110
|
.map(([key, value]) => [key.replace(/:$/u, ""), Number(value)]),
|
|
98
111
|
);
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
// One average off a PSI file's `full` line: `avg10` or `avg60`.
|
|
114
|
+
const fullAvg = (text, window) => {
|
|
101
115
|
const line = (text ?? "").split("\n").find((entry) => entry.startsWith("full"));
|
|
102
|
-
const value = line?.match(
|
|
116
|
+
const value = line?.match(new RegExp(`${window}=([0-9.]+)`, "u"))?.[1];
|
|
103
117
|
return value === undefined ? undefined : Number(value);
|
|
104
118
|
};
|
|
105
119
|
|
|
@@ -117,24 +131,40 @@ export const readingFrom = (read) => {
|
|
|
117
131
|
const current = numeric(read(`${CGROUP}/memory.current`));
|
|
118
132
|
let usedBytes;
|
|
119
133
|
let swapBytes = 0;
|
|
134
|
+
let swapLimit = Number.POSITIVE_INFINITY;
|
|
120
135
|
if (current !== undefined) {
|
|
121
136
|
// Unaccounted swap (swapaccount off) is none, never unknown: it must not blank a measurable ceiling.
|
|
122
137
|
swapBytes = numeric(read(`${CGROUP}/memory.swap.current`)) ?? 0;
|
|
123
138
|
usedBytes = Math.max(0, current - (keyed(read(`${CGROUP}/memory.stat`)).inactive_file ?? 0)) + swapBytes;
|
|
139
|
+
// The cgroup's own swap ceiling, and never more than what it holds plus what the machine's swap can still take.
|
|
140
|
+
swapLimit = Math.min(numeric(read(`${CGROUP}/memory.swap.max`)) ?? Number.POSITIVE_INFINITY, swapBytes + (kib(meminfo, "SwapFree") ?? Number.POSITIVE_INFINITY));
|
|
124
141
|
} else if (machine !== undefined && kib(meminfo, "MemAvailable") !== undefined) {
|
|
125
142
|
swapBytes = Math.max(0, (kib(meminfo, "SwapTotal") ?? 0) - (kib(meminfo, "SwapFree") ?? 0));
|
|
126
143
|
usedBytes = Math.max(0, machine - (kib(meminfo, "MemAvailable") ?? 0)) + swapBytes;
|
|
144
|
+
swapLimit = kib(meminfo, "SwapTotal") ?? Number.POSITIVE_INFINITY;
|
|
127
145
|
}
|
|
146
|
+
// The cgroup's pressure where it keeps one, else the machine's; avg60 from the same file avg10 came from.
|
|
147
|
+
const pressure = [read(`${CGROUP}/memory.pressure`), read("/proc/pressure/memory")].find((text) => fullAvg(text, "avg10") !== undefined);
|
|
128
148
|
return {
|
|
129
149
|
limitBytes: Number.isFinite(bound) ? bound : undefined,
|
|
130
150
|
usedBytes,
|
|
131
151
|
swapBytes,
|
|
152
|
+
swapLimitBytes: Number.isFinite(swapLimit) ? swapLimit : undefined,
|
|
132
153
|
availableBytes: kib(meminfo, "MemAvailable"),
|
|
133
|
-
stallPercent:
|
|
154
|
+
stallPercent: fullAvg(pressure, "avg10") ?? 0,
|
|
155
|
+
stallSustainedPercent: fullAvg(pressure, "avg60") ?? 0,
|
|
134
156
|
oomKills: keyed(read(`${CGROUP}/memory.events`)).oom_kill,
|
|
135
157
|
};
|
|
136
158
|
};
|
|
137
159
|
|
|
160
|
+
/** Whether swap is nearly full: then the swapped pages count against the limit with the resident ones. */
|
|
161
|
+
export const swapFullOf = (reading) =>
|
|
162
|
+
reading.swapLimitBytes !== undefined && (reading.swapBytes ?? 0) > 0 && reading.swapBytes >= SWAP_FULL_SHARE * reading.swapLimitBytes;
|
|
163
|
+
|
|
164
|
+
/** What counts against the limit: the resident part of used, and the swapped part too once swap is full. */
|
|
165
|
+
export const countedBytesOf = (reading) =>
|
|
166
|
+
reading.usedBytes === undefined ? undefined : swapFullOf(reading) ? reading.usedBytes : reading.usedBytes - (reading.swapBytes ?? 0);
|
|
167
|
+
|
|
138
168
|
const readSync = (path) => {
|
|
139
169
|
try {
|
|
140
170
|
return readFileSync(path, "utf8");
|
|
@@ -163,8 +193,10 @@ export const needBytes = (workload, attended, size) => costBytesOf(workload, siz
|
|
|
163
193
|
export const judge = (reading, { workload, attended, reservedBytes = 0, size }) => {
|
|
164
194
|
const need = needBytes(workload, attended, size);
|
|
165
195
|
const { limitBytes, usedBytes, swapBytes, stallPercent, availableBytes } = reading;
|
|
196
|
+
const stallSustainedPercent = reading.stallSustainedPercent ?? 0;
|
|
166
197
|
const unreserved = freeBytesOf(reading);
|
|
167
|
-
|
|
198
|
+
const counted = countedBytesOf(reading);
|
|
199
|
+
if (limitBytes === undefined || usedBytes === undefined || counted === undefined || unreserved === undefined) {
|
|
168
200
|
return { verdict: "run", needBytes: need, freeBytes: undefined, reservedBytes };
|
|
169
201
|
}
|
|
170
202
|
const freeBytes = Math.max(0, unreserved - reservedBytes);
|
|
@@ -180,33 +212,39 @@ export const judge = (reading, { workload, attended, reservedBytes = 0, size })
|
|
|
180
212
|
if (stallPercent >= STALL_PERCENT) {
|
|
181
213
|
return shortOf(`The sandbox is short of memory: for ${Math.round(stallPercent)}% of the last ten seconds, everything in it was waiting on memory`);
|
|
182
214
|
}
|
|
215
|
+
if (stallSustainedPercent >= STALL_SUSTAINED_PERCENT) {
|
|
216
|
+
return shortOf(`The sandbox is short of memory: for ${Math.round(stallSustainedPercent)}% of the last minute, everything in it was waiting on memory`);
|
|
217
|
+
}
|
|
183
218
|
if (freeBytes >= need) {
|
|
184
219
|
return { verdict: "run", needBytes: need, freeBytes, reservedBytes };
|
|
185
220
|
}
|
|
186
221
|
// The machine, not the sandbox's own limit, is what ran out: saying "9 of 16 GiB used" would read as a wrong refusal.
|
|
187
|
-
if (availableBytes !== undefined && availableBytes < limitBytes -
|
|
222
|
+
if (availableBytes !== undefined && availableBytes < limitBytes - counted) {
|
|
188
223
|
const held = reservedBytes > 0 ? `, and ${gib(reservedBytes)} held for work that just started` : "";
|
|
189
224
|
return shortOf(`Sandbox memory is low: the machine it runs on has ${gib(availableBytes)} available${held}`);
|
|
190
225
|
}
|
|
191
226
|
// Resident and swapped are named apart once paging starts: the limit bounds resident pages only, so their sum can
|
|
192
|
-
// exceed it, and "19.2 GiB of 16.0 GiB used" reads as a bug. Free is counted against the resident part alone
|
|
227
|
+
// exceed it, and "19.2 GiB of 16.0 GiB used" reads as a bug. Free is counted against the resident part alone, until
|
|
228
|
+
// swap is full and the sentence says so, since that is what made the swapped part count.
|
|
193
229
|
const used =
|
|
194
230
|
swapBytes > 0
|
|
195
|
-
? `${gib(usedBytes - swapBytes)} resident + ${gib(swapBytes)} swapped, against ${gib(limitBytes)}`
|
|
231
|
+
? `${gib(usedBytes - swapBytes)} resident + ${gib(swapBytes)} swapped, against ${gib(limitBytes)}${swapFullOf(reading) ? ", with swap full" : ""}`
|
|
196
232
|
: `${gib(usedBytes)} of ${gib(limitBytes)} used`;
|
|
197
233
|
// Named, or a sandbox reading 3 GiB free would seem to refuse work that needs 2.
|
|
198
234
|
const held = reservedBytes > 0 ? `, and ${gib(reservedBytes)} held for work that just started` : "";
|
|
199
235
|
return shortOf(`Sandbox memory is low: ${used}${held}`, { limitBytes, residentBytes: usedBytes - swapBytes, swapBytes });
|
|
200
236
|
};
|
|
201
237
|
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Free memory as the formula counts it (the limit less what counts against it: the resident part, and swap too once swap
|
|
240
|
+
* is full), or undefined where nothing bounds or measures it.
|
|
241
|
+
*/
|
|
242
|
+
export const freeBytesOf = (reading) => {
|
|
243
|
+
const counted = countedBytesOf(reading);
|
|
244
|
+
return reading.limitBytes === undefined || counted === undefined
|
|
205
245
|
? undefined
|
|
206
|
-
: Math.max(
|
|
207
|
-
|
|
208
|
-
Math.min(reading.limitBytes - (reading.usedBytes - (reading.swapBytes ?? 0)), reading.availableBytes ?? Number.POSITIVE_INFINITY),
|
|
209
|
-
);
|
|
246
|
+
: Math.max(0, Math.min(reading.limitBytes - counted, reading.availableBytes ?? Number.POSITIVE_INFINITY));
|
|
247
|
+
};
|
|
210
248
|
|
|
211
249
|
// ---- asking the daemon, with the formula itself as the fallback ----
|
|
212
250
|
|