cortad 0.3.11 → 0.4.1

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/lib/replay.mjs CHANGED
@@ -7,13 +7,16 @@ import { SourceMap } from "node:module";
7
7
  import { tmpdir } from "node:os";
8
8
  import { dirname, isAbsolute, join, relative } from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
- import { CODE, TEST } from "./data.mjs";
10
+ import { CODE, TEST } from "./files.mjs";
11
11
  import { canaryOf, doorOf, doorsOf, exchangesOf, isCanary, proofOf, provingOf, sitesOf } from "./proof.mjs";
12
12
 
13
13
  const HERE = dirname(fileURLToPath(import.meta.url));
14
14
  const HOOK = join(HERE, "trace.cjs");
15
15
  const PYHOOK = join(HERE, "pyhook");
16
16
  export const CAPTURED = "captured";
17
+ // The header a run's request carries to speak as one of the app's own callers: the role, never the
18
+ // token, which this machine holds and puts in (local.mjs).
19
+ export const AS_HEADER = "x-cortad-as";
17
20
  // Never replayed: they describe one connection, not the caller.
18
21
  const SECRET_HEADER = /authorization|cookie|token|secret|session|csrf|api-?key/i;
19
22
  const HOP = /^(?:host|content-length|connection|keep-alive|transfer-encoding|upgrade|expect|te|trailer|accept-encoding|x-cortad-as|x-cortad-turn)$/i;
@@ -37,8 +40,6 @@ export function makeCapture({ work, keepSecret, onProof = () => {}, writes = nul
37
40
  let newestTable = null;
38
41
  // Each server a hooked process opened a connection to, by host and port.
39
42
  const conns = new Map();
40
- // The Qdrant collections the hook copied for a run's writes, by server and name (lib/stores.mjs drops them).
41
- const copies = new Map();
42
43
  // The model's last words and status for each of a run's turns on an endpoint the app answers
43
44
  // later, by turn (lib/wire.cjs answeredLater).
44
45
  const answers = new Map();
@@ -50,7 +51,7 @@ export function makeCapture({ work, keepSecret, onProof = () => {}, writes = nul
50
51
  // requires, to one without.
51
52
  const bunHook = /\s/.test(HOOK) ? (() => {
52
53
  const dir = mkdtempSync(join(tmpdir(), "cortad-"));
53
- for (const name of ["trace.cjs", "wire.cjs", "tied.cjs", "qdrant.mjs"]) copyFileSync(join(HERE, name), join(dir, name));
54
+ for (const name of ["trace.cjs", "wire.cjs", "tied.cjs"]) copyFileSync(join(HERE, name), join(dir, name));
54
55
  return join(dir, "trace.cjs");
55
56
  })() : HOOK;
56
57
  // The hooks are handed to whatever is started: a Node app loads the first, a Bun app the same file
@@ -64,9 +65,6 @@ export function makeCapture({ work, keepSecret, onProof = () => {}, writes = nul
64
65
  // The read's tools by name, file and function, written by the run the same way: the hook wraps
65
66
  // those functions so a tool your own code runs is seen even when no model named it.
66
67
  CORTAD_TOOLS_FILE: join(work, "tools.json"),
67
- // The hosts a trial's outbound writes may reach; every other write made inside a trial's turn
68
- // is held in the app and answered there (the person's yes, written by the command).
69
- CORTAD_OUTBOUND_FILE: join(work, "outbound.json"),
70
68
  // While a run is on, the hook records each file the app writes under its own folder, with a
71
69
  // copy from before the first write, and the run's end puts them back (lib/writes.mjs).
72
70
  ...(writes && root ? { CORTAD_WRITES_DIR: writes, CORTAD_APP_ROOT: root } : {}),
@@ -98,7 +96,6 @@ export function makeCapture({ work, keepSecret, onProof = () => {}, writes = nul
98
96
  if (Number.isInteger(row.listen)) { ports.add(row.listen); continue; }
99
97
  if (row.routes) { const t = routeTable(row.routes); if (t) { tables.set(t.port, t); newestTable = t; } continue; }
100
98
  if (row.conn) { const { host, port } = row.conn; if (typeof host === "string" && Number.isInteger(port)) conns.set(`${host}:${port}`, { host, port }); continue; }
101
- if (row.copy) { const { base, collection, clone } = row.copy; if ([base, collection, clone].every((v) => typeof v === "string" && v)) copies.set(`${base}|${collection}`, { base, collection, clone }); continue; }
102
99
  if (row.answer) {
103
100
  const { turn, status, reply } = row.answer;
104
101
  if (TURN.test(turn ?? "")) answers.set(turn, { status: Number.isInteger(status) ? status : 0, reply: typeof reply === "string" ? reply : "" });
@@ -155,14 +152,12 @@ export function makeCapture({ work, keepSecret, onProof = () => {}, writes = nul
155
152
  // What your app spent on its model providers since it started, as the hook saw each call. Null
156
153
  // when no hook is in your app (an app this command did not start): absent, never zero. With a
157
154
  // `turn`, the calls pinned to that turn also say what their model was told.
158
- usage: (turn) => { poll(); return alive ? meter.report(TURN.test(turn ?? "") ? turn : undefined) : null; },
155
+ usage: (turn, totalsOnly = false) => { poll(); return alive ? meter.report(TURN.test(turn ?? "") ? turn : undefined, totalsOnly) : null; },
159
156
  // The app's routes as its framework holds them: the table of the process on `port`, else the
160
157
  // newest any hooked process wrote. Empty when no hook read one.
161
158
  registry: (port) => { poll(); return tables.get(port) ?? newestTable ?? {}; },
162
- // The servers the app has connected to so far (lib/stores.mjs names the ones no setting does).
159
+ // The servers the app has connected to so far: where test conversations write, said on the card.
163
160
  connections: () => { poll(); return [...conns.values()]; },
164
- // The collections the hook copied on a Qdrant server for a run's writes, to be deleted at the end.
165
- copies: () => { poll(); return [...copies.values()]; },
166
161
  // The model's last words for a run's turn on an endpoint the app answers later, once the hook
167
162
  // has written them; null at `until`, or once `signal` aborts. `forget` drops a turn sent again.
168
163
  answered: async (turn, until, signal) => {
@@ -344,14 +339,36 @@ const toldOf = (call) => {
344
339
  // The model's words behind a call, and the lines of the app that wrote the reply of the request it
345
340
  // was made in, go out with the rows pinned to the turn asked about, as what the model was told does.
346
341
  const MODEL_WORDS = 4000, SITES_KEPT = 500;
342
+ function tally(totals, call, count) {
343
+ const host = call.host.slice(0, 253);
344
+ const model = String(call.model ?? "").slice(0, 160);
345
+ const answered = typeof call.answered === "string" && call.answered ? call.answered.slice(0, 160) : undefined;
346
+ const key = `${host}|${model}`;
347
+ const t = totals.get(key) ?? { host, model, calls: 0, promptTokens: 0, cachedTokens: 0, completionTokens: 0, unmetered: 0, answered, mixed: false };
348
+ t.calls += 1;
349
+ // The model that answered for this one, when every call of it was answered by one other model.
350
+ if (t.answered !== answered) t.mixed = true;
351
+ t.promptTokens += count(call.promptTokens);
352
+ t.cachedTokens += count(call.cachedTokens);
353
+ t.completionTokens += count(call.completionTokens);
354
+ // An answered call the provider sent no counts for: it was spent, and what it cost is not known.
355
+ const status = count(call.status);
356
+ if (call.usage !== true && status > 0 && status < 400) t.unmetered += 1;
357
+ totals.set(key, t);
358
+ }
359
+
347
360
  const meter = (() => {
348
361
  const rows = [];
349
362
  const deps = [];
363
+ // What the app has spent since it started, per host and model, kept as it goes: the rows are
364
+ // trimmed to the newest ROWS, and totals summed from them lost every call before those.
365
+ const totals = new Map();
350
366
  const sitesOfEx = new Map();
351
367
  const count = (v) => (Number.isInteger(v) && v > 0 ? v : 0);
352
368
  return {
353
369
  add(call) {
354
370
  if (!call || typeof call.host !== "string" || !call.host) return;
371
+ tally(totals, call, count);
355
372
  rows.push({
356
373
  at: count(call.at), ms: count(call.ms), host: call.host.slice(0, 253), model: String(call.model ?? "").slice(0, 160), ...(typeof call.answered === "string" && call.answered ? { answered: call.answered.slice(0, 160) } : {}), status: count(call.status),
357
374
  promptTokens: count(call.promptTokens), cachedTokens: count(call.cachedTokens), completionTokens: count(call.completionTokens),
@@ -378,24 +395,15 @@ const meter = (() => {
378
395
  },
379
396
  // `turn`: the rows pinned to it carry what their model was told. The instructions go out with the
380
397
  // reply they are read with, never with every call of the run at every turn.
381
- report(turn) {
382
- const totals = new Map();
383
- for (const r of rows) {
384
- const key = `${r.host}|${r.model}`;
385
- const t = totals.get(key) ?? { host: r.host, model: r.model, calls: 0, promptTokens: 0, cachedTokens: 0, completionTokens: 0, unmetered: 0, answered: r.answered };
386
- t.calls += 1;
387
- // The model that answered for this one, when every call of it was answered by one other model.
388
- if (t.answered !== r.answered) t.answered = undefined;
389
- t.promptTokens += r.promptTokens;
390
- t.cachedTokens += r.cachedTokens;
391
- t.completionTokens += r.completionTokens;
392
- // An answered call the provider sent no counts for: it was spent, and what it cost is not known.
393
- if (!r.usage && r.status > 0 && r.status < 400) t.unmetered += 1;
394
- totals.set(key, t);
395
- }
398
+ // `totalsOnly`: the spend alone, for the meter read while a run plays and at its end. The rows
399
+ // carry what each call was handed, and on ulaim's run the whole report was 2.9 MB, past what the
400
+ // server takes, so the bill never arrived.
401
+ report(turn, totalsOnly = false) {
402
+ const spent = [...totals.values()].sort((a, b) => b.calls - a.calls).map(({ answered, mixed, ...t }) => (answered && !mixed ? { ...t, answered } : t));
403
+ if (totalsOnly) return { totals: spent };
396
404
  return {
397
- totals: [...totals.values()].sort((a, b) => b.calls - a.calls).map(({ answered, ...t }) => (answered ? { ...t, answered } : t)),
398
- rows: rows.slice(-REPORTED).reverse().map(({ at, ms, host, model, status, turn: pinned, rules, tools, called, passages, caller, ex, told, said }) => ({ at, ms, host, model, status, ...(pinned ? { turn: pinned } : {}), ...(rules ? { rules } : {}), ...(tools ? { tools } : {}), ...(called ? { called } : {}), ...(passages ? { passages } : {}), ...(caller ? { caller } : {}),
405
+ totals: spent,
406
+ rows: rows.slice(-REPORTED).reverse().map(({ at, ms, host, model, status, turn: pinned, rules, tools, called, passages, caller, ex, told, said }) => ({ at, ms, host, model, status, ...(pinned ? { turn: pinned } : {}), ...(rules ? { rules } : {}), ...(tools ? { tools } : {}), ...(called ? { called } : {}), ...(passages && turn !== undefined && pinned === turn ? { passages } : {}), ...(caller ? { caller } : {}),
399
407
  ...(turn !== undefined && pinned === turn ? { ...told, ...(said !== undefined ? { said } : {}), ...(sitesOfEx.get(ex)?.length ? { sites: sitesOfEx.get(ex) } : {}) } : {}) })),
400
408
  deps: deps.slice(-REPORTED).reverse(),
401
409
  };
package/lib/start.mjs CHANGED
@@ -1,5 +1,6 @@
1
- // How their app is started, and from which folder, worked out from the repository itself so nobody
2
- // is asked. A monorepo root has no app of its own: the app is the workspace that serves the AI.
1
+ // How their app most likely starts, and from which folder, read off the repository: printed as the
2
+ // one suggestion when the person gave no start command (local.mjs), never run on its own. A
3
+ // monorepo root has no app of its own: the app is the workspace that serves the AI.
3
4
  import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
4
5
  import { dirname, join, relative } from "node:path";
5
6
 
@@ -120,7 +121,17 @@ const BOUND_APP = /^(app|application)\s*=\s*[\w.]+\(/m;
120
121
  const IMPORTED_APP = /^from\s+[\w.]+\s+import\s+(?:\(\s*[^)]*?\b(app|application)\b[^)]*\)|[^\n(]*\b(app|application)\b)/m;
121
122
  const KNOWN = ["package.json", "pyproject.toml", "requirements.txt", "manage.py", "Pipfile", "uv.lock"];
122
123
  // A folder whose app the hooks can load into: Node, Bun or Python. Any other is seen through lib/proxy.mjs.
123
- export const hookable = (dir) => KNOWN.some((f) => existsSync(join(dir, f)));
124
+ // Whether the hook can ride into the process the command starts: a Node, Bun or Python process takes it
125
+ // from its environment whatever folder it runs in; a container, a Go or Java binary does not, and is
126
+ // watched from outside (lib/proxy.mjs). Judged by the command when there is one, else by the folder.
127
+ const HOOKED = /^(?:python3?(?:\.\d+)?|node|nodemon|tsx|ts-node|bun|bunx|deno|npm|npx|pnpm|yarn|uvicorn|gunicorn|hypercorn|flask|fastapi|poetry|uv|pipenv)$/;
128
+ // The program a command runs, past any PORT=3000 in front of it, an `env` or `exec` that only sets
129
+ // those, and the quotes or folder around it.
130
+ const runtimeOf = (cmd) => {
131
+ const words = cmd.trim().split(/\s+/).filter((w) => !/^[A-Za-z_][A-Za-z0-9_]*=/.test(w)).map((w) => w.replace(/^["']|["']$/g, "").split("/").pop() ?? "");
132
+ return words.find((w) => w !== "env" && w !== "exec" && !w.startsWith("-")) ?? "";
133
+ };
134
+ export const hookable = (dir, cmd = "") => (cmd ? HOOKED.test(runtimeOf(cmd)) : KNOWN.some((f) => existsSync(join(dir, f))));
124
135
 
125
136
  const startOf = (dir, onPath) => nodeStart(dir, onPath) ?? pythonStart(dir, onPath);
126
137
 
@@ -209,37 +220,6 @@ export function startPlan({ root, typed, onPath }) {
209
220
  return serving ? { ...at(serving), unsure: true } : { cmd: null, cwd: root, noServer: true };
210
221
  }
211
222
 
212
- // What an app says when its dependencies are not installed on this machine, in every runtime we
213
- // start, and the name of the one it named first.
214
- const MISSING = /Cannot find module ['"]?([@\w./-]+)|Cannot find package ['"]?([@\w./-]+)|ModuleNotFoundError: No module named ['"]?([\w.]+)|ImportError: No module named ['"]?([\w.]+)|(?:^|[:/ ])([\w.-]+): (?:command )?not found|command not found: ?([\w.-]+)/m;
215
- export const missingDependency = (said) => MISSING.exec(String(said ?? ""))?.slice(1).find(Boolean) ?? "";
216
-
217
- // One install, with the manager the project locked. Never a global one: a Python project without an
218
- // interpreter of its own gets a virtual environment beside its code, so nothing installed here
219
- // reaches the rest of the machine.
220
- export function installPlan(dir, onPath, root = dir) {
221
- if (json(join(dir, "package.json"))) {
222
- // A workspace member holds no lockfile of its own: the manager, and the install, belong to the
223
- // repository that owns it. novel's apps/web installed with npm here, and npm cannot read the
224
- // `workspace:^` ranges its own packages are pinned with: "Unsupported URL Type".
225
- const at = lockRoot(dir, root);
226
- // The manager the repository locked, fetched for the job when this machine has not got it: npm
227
- // refuses vercel's ai-chatbot outright over a peer range pnpm resolves without a word.
228
- const locked = manager(at);
229
- const where = at === dir ? "" : `cd ${JSON.stringify(at)} && `;
230
- if (locked !== "npm") return `${where}${onPath(locked) ? `${locked} install` : `npx --yes ${locked} install`}`;
231
- return `${where}${existsSync(join(at, "package-lock.json")) ? "npm ci || npm install --legacy-peer-deps" : "npm install || npm install --legacy-peer-deps"}`;
232
- }
233
- if (existsSync(join(dir, "uv.lock")) && onPath("uv")) return "uv sync";
234
- if (existsSync(join(dir, "poetry.lock")) && onPath("poetry")) return "poetry install";
235
- const venv = [".venv/bin/python", "venv/bin/python", "env/bin/python"].map((p) => join(dir, p)).find(existsSync);
236
- const py = venv ? JSON.stringify(venv) : null;
237
- const into = (what) => (py ? `${py} -m pip install ${what}` : `python3 -m venv .venv && .venv/bin/python -m pip install --upgrade pip && .venv/bin/python -m pip install ${what}`);
238
- if (existsSync(join(dir, "requirements.txt"))) return into("-r requirements.txt");
239
- if (existsSync(join(dir, "pyproject.toml"))) return into("-e .");
240
- return null;
241
- }
242
-
243
223
  // The start command as it leaves this machine: a value typed into it (DATABASE_URL=...) stays here
244
224
  // unless it is a plain word, and it is cut to the length the server keeps. A command past that
245
225
  // length was refused whole, as "port is required", with a valid port beside it.
package/lib/switches.mjs CHANGED
@@ -1,83 +1,23 @@
1
- // Switches an app reads to decide who it lets in, set for the app this command started and for
2
- // nothing else. The customer's files are never written, and every name is printed before the app
3
- // starts. A lockout, an attempt counter and a password rule are never touched.
1
+ // Your app's own request limits, raised for the session of the app this command started, and for
2
+ // nothing else: a run asks in twenty minutes what a person asks in a month, and a limiter that fires
3
+ // answers instead of your AI. Only a limit the code reads, by its name; the customer's files are never
4
+ // written, and every name is printed before the app starts. A sign-in switch, a lockout, an attempt
5
+ // counter and a password rule are never touched: who the app lets in is the app's own business.
4
6
  import { readFileSync, statSync } from "node:fs";
5
7
 
6
- const GUARDED = /(AUTH|LOGIN|PASSWORD|BREAKER|LOCKOUT|ATTEMPT|FAIL|BAN|BLOCK)/;
7
8
  const ENV_READ = /(?:process\.env(?:\.|\[\s*['"])|os\.(?:environ\.get|getenv)\(\s*['"]|os\.environ\[\s*['"]|\benv\(\s*['"]|Deno\.env\.get\(\s*['"])([A-Z][A-Z0-9_]*)/g;
8
-
9
- // A switch their own app reads to decide whether a caller has to be signed in at all. morphic's
10
- // chat answers 401 to everyone until ENABLE_GUEST_CHAT is true; open-webui, librechat and a dozen
11
- // others carry the same idea under their own name. Set for the app this command started and for
12
- // nothing else: their files are not touched, and the name is printed before anything starts.
13
- // A lockout, an attempt counter and a password rule carry the same words and are never touched.
14
- const OPENS_AUTH = /^(?:ENABLE|REQUIRE)_AUTH(?:ENTICATION)?$|^AUTH(?:ENTICATION)?_(?:ENABLED|REQUIRED)$|^(?:REQUIRE|ENABLE)_(?:LOGIN|SIGN_?IN)$/;
15
- const CLOSES_AUTH = /^(?:DISABLE|SKIP|NO)_AUTH(?:ENTICATION)?$|^AUTH(?:ENTICATION)?_DISABLED$/;
16
- const OPENS_GUEST = /^(?:ENABLE|ALLOW)_(?:GUEST|ANONYMOUS|PUBLIC)(?:_[A-Z0-9_]+)?$|^(?:GUEST|ANONYMOUS|PUBLIC)_(?:MODE|ACCESS|CHAT|ENABLED|LOGIN)$/;
17
- const CLOSES_GUEST = /^(?:DISABLE|BLOCK)_(?:GUEST|ANONYMOUS|PUBLIC)(?:_[A-Z0-9_]+)?$|^(?:GUEST|ANONYMOUS|PUBLIC)_(?:MODE|ACCESS|CHAT)_DISABLED$/;
18
- const BOOLEAN = /^(?:true|false|1|0|yes|no|on|off)$/i;
19
- export function openSwitches(envFiles, sources = []) {
20
- const out = {};
21
- const open = (name) => {
22
- if (GUARDED.test(name) && !OPENS_AUTH.test(name) && !CLOSES_AUTH.test(name)) return null;
23
- if (OPENS_AUTH.test(name) || CLOSES_GUEST.test(name)) return "false";
24
- if (CLOSES_AUTH.test(name) || OPENS_GUEST.test(name)) return "true";
25
- return null;
26
- };
27
- for (const file of envFiles) {
28
- let text = "";
29
- try { text = readFileSync(file, "utf8"); } catch { continue; }
30
- for (const line of text.split("\n")) {
31
- const m = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(line);
32
- if (!m) continue;
33
- const value = m[2].trim().replace(/^(['"])(.*)\1$/, "$2");
34
- const to = open(m[1]);
35
- // Only a switch: a name of this shape holding a URL or a key is something else entirely.
36
- if (to && (value === "" || BOOLEAN.test(value))) out[m[1]] = to;
37
- }
38
- }
39
- for (const file of sources) {
40
- if (!/\.(?:[cm]?[jt]sx?|py|go|rb|php|rs)$/.test(file)) continue;
41
- let text = "";
42
- try { if (statSync(file).size > 512_000) continue; text = readFileSync(file, "utf8"); } catch { continue; }
43
- for (const m of text.matchAll(ENV_READ)) { const to = open(m[1]); if (to && !(m[1] in out)) out[m[1]] = to; }
44
- }
45
- return out;
46
- }
47
-
48
- // Your app's own request limits, raised for this session only, the way the sandbox raises them:
49
- // a run asks in twenty minutes what a person asks in a month, and a limiter that fires answers
50
- // instead of your AI. Numeric values under a limit-shaped name; switches and guards are left alone.
51
9
  const THROUGHPUT = /(RATE_?LIMIT|DAILY_LIMIT|HOURLY_LIMIT|MINUTE_LIMIT|REQUESTS_PER|TOKEN_BUDGET|MAX_SSE|MAX_CONCURRENT|THROTTLE|_RPM$|_RPS$|_QPS$)/;
10
+ const GUARDED = /(AUTH|LOGIN|PASSWORD|BREAKER|LOCKOUT|ATTEMPT|FAIL|BAN|BLOCK)/;
52
11
  const SWITCH = /_(?:ENABLED|DISABLED|ENABLE|DISABLE)$|^(?:ENABLE|DISABLE)_/;
53
12
  const lifted = (name) => (/(TOKEN_BUDGET|TOKENS)/.test(name) ? "1000000000" : "1000000");
54
13
  const liftable = (name) => THROUGHPUT.test(name) && !GUARDED.test(name) && !SWITCH.test(name);
55
- export function liftedLimits(envFiles, sources = []) {
56
- // Only a limit the code reads is raised: a line in .env that nothing reads is not a limit, and
57
- // naming it as one raised was the tell an engineer caught first.
58
- const read = new Set();
14
+ export function liftedLimits(sources = []) {
15
+ const out = {};
59
16
  for (const file of sources) {
60
17
  if (!/\.(?:[cm]?[jt]sx?|py|go|rb|php|rs)$/.test(file)) continue;
61
18
  let text = "";
62
19
  try { if (statSync(file).size > 512_000) continue; text = readFileSync(file, "utf8"); } catch { continue; }
63
- for (const m of text.matchAll(ENV_READ)) if (liftable(m[1])) read.add(m[1]);
20
+ for (const m of text.matchAll(ENV_READ)) if (liftable(m[1])) out[m[1]] = lifted(m[1]);
64
21
  }
65
- const out = {};
66
- for (const file of envFiles) {
67
- let text = "";
68
- try { text = readFileSync(file, "utf8"); } catch { continue; }
69
- for (const line of text.split("\n")) {
70
- const m = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(line);
71
- if (!m) continue;
72
- const [, name, raw] = m;
73
- const value = raw.trim().replace(/^(['"])(.*)\1$/, "$2");
74
- if (liftable(name) && /^\d+$/.test(value) && (!sources.length || read.has(name))) out[name] = lifted(name);
75
- }
76
- }
77
- for (const name of read) if (!(name in out)) out[name] = lifted(name);
78
22
  return out;
79
23
  }
80
-
81
- // What the app is started with beyond its own env: nothing until the person said yes, in this
82
- // terminal or in the browser (setup.consent.limits). A guard of theirs stays on by default.
83
- export const sessionLifts = (yes, envFiles, sources = []) => (yes ? { ...liftedLimits(envFiles, sources), ...openSwitches(envFiles, sources) } : {});