@cortexkit/pi-magic-context 0.39.0 → 0.40.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.
@@ -8283,11 +8283,380 @@ function migrateMagicContextConfigLocations(directory, logger) {
8283
8283
  return warnings;
8284
8284
  }
8285
8285
 
8286
+ // ../plugin/src/shared/redaction.ts
8287
+ import { homedir as homedir2, userInfo } from "node:os";
8288
+ function escapeRegex(value) {
8289
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
8290
+ }
8291
+ var SECRET_WORDS = [
8292
+ "key",
8293
+ "token",
8294
+ "secret",
8295
+ "password",
8296
+ "auth",
8297
+ "authorization",
8298
+ "bearer",
8299
+ "credential"
8300
+ ];
8301
+ var SECRET_SEGMENT_PATTERN = new RegExp(`^(?:${SECRET_WORDS.map((w) => `${w}s?`).join("|")})$`, "i");
8302
+ var TRAILING_DESCRIPTORS = new Set(["id", "ids", "value", "values", "header", "headers"]);
8303
+ function redactionTypeForKey(key) {
8304
+ const normalized = key.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g, "_");
8305
+ const suffix = normalized.split(".").filter(Boolean).at(-1) ?? normalized;
8306
+ return suffix || "secret";
8307
+ }
8308
+ function isNonSecretScalarValue(value) {
8309
+ const v = value.trim();
8310
+ if (v === "true" || v === "false" || v === "null" || v === "undefined")
8311
+ return true;
8312
+ return /^[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(v);
8313
+ }
8314
+ var SECRET_QUALIFIERS = new Set([
8315
+ "api",
8316
+ "access",
8317
+ "private",
8318
+ "client",
8319
+ "auth",
8320
+ "authorization",
8321
+ "secret",
8322
+ "bearer",
8323
+ "session",
8324
+ "refresh",
8325
+ "service",
8326
+ "x",
8327
+ "openai",
8328
+ "anthropic",
8329
+ "google",
8330
+ "github",
8331
+ "huggingface",
8332
+ "aws",
8333
+ "azure"
8334
+ ]);
8335
+ function sanitizePathString(value) {
8336
+ const home = homedir2();
8337
+ const username = userInfo().username;
8338
+ let sanitized = value;
8339
+ if (home) {
8340
+ sanitized = sanitized.replace(new RegExp(escapeRegex(home), "g"), "~");
8341
+ }
8342
+ sanitized = sanitized.replace(/\/Users\/[^/]+\//g, "/Users/<USER>/");
8343
+ sanitized = sanitized.replace(/\/home\/[^/]+\//g, "/home/<USER>/");
8344
+ sanitized = sanitized.replace(/C:\\Users\\[^\\]+\\/g, "C:\\Users\\<USER>\\");
8345
+ if (username) {
8346
+ sanitized = sanitized.replace(new RegExp(escapeRegex(username), "g"), "<USER>");
8347
+ }
8348
+ return sanitized;
8349
+ }
8350
+ var SECRET_TEXT_PATTERNS = [
8351
+ {
8352
+ pattern: /\bsk-ant-(?:api03-)?[A-Za-z0-9_-]{32,}/g,
8353
+ replacement: "<ANTHROPIC_API_KEY_REDACTED>"
8354
+ },
8355
+ {
8356
+ pattern: /\bsk-(?:proj-)?[A-Za-z0-9_-]{32,}/g,
8357
+ replacement: "<OPENAI_API_KEY_REDACTED>"
8358
+ },
8359
+ {
8360
+ pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g,
8361
+ replacement: "<GITHUB_PAT_REDACTED>"
8362
+ },
8363
+ {
8364
+ pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9]{30,}/g,
8365
+ replacement: "<GITHUB_TOKEN_REDACTED>"
8366
+ },
8367
+ {
8368
+ pattern: /\bhf_[A-Za-z0-9]{30,}/g,
8369
+ replacement: "<HUGGINGFACE_TOKEN_REDACTED>"
8370
+ },
8371
+ {
8372
+ pattern: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
8373
+ replacement: "<AWS_ACCESS_KEY_ID_REDACTED>"
8374
+ },
8375
+ {
8376
+ pattern: /\bxox[abprsuvc]-[A-Za-z0-9-]{10,}/g,
8377
+ replacement: "<SLACK_TOKEN_REDACTED>"
8378
+ },
8379
+ {
8380
+ pattern: /\bAIza[A-Za-z0-9_-]{35}\b/g,
8381
+ replacement: "<GOOGLE_API_KEY_REDACTED>"
8382
+ },
8383
+ {
8384
+ pattern: /\b(Authorization\s*:\s*Bearer\s+)([A-Za-z0-9._~+/=-]{8,})/gi,
8385
+ replacement: (_full, prefix) => `${prefix}<REDACTED:bearer>`
8386
+ },
8387
+ {
8388
+ pattern: /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
8389
+ replacement: "<JWT_REDACTED>"
8390
+ },
8391
+ {
8392
+ pattern: /(["'])([^"']*(?:key|token|secret|password|auth|bearer|credential)[^"']*)\1(\s*:\s*)(["'])([^"']*)\4/gi,
8393
+ replacement: (full, quote, key, separator, valueQuote, value) => isNonSecretScalarValue(value) ? full : `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
8394
+ },
8395
+ {
8396
+ pattern: /\b([A-Za-z0-9_.-]*(?:key|token|secret|password|auth|bearer|credential)[A-Za-z0-9_.-]*)\s*=\s*([^\s'"`]+)/gi,
8397
+ replacement: (full, key, value) => isNonSecretScalarValue(value) ? full : `${key}=<REDACTED:${redactionTypeForKey(key)}>`
8398
+ }
8399
+ ];
8400
+ function redactSecretText(value) {
8401
+ let redacted = value;
8402
+ for (const { pattern, replacement } of SECRET_TEXT_PATTERNS) {
8403
+ if (typeof replacement === "string") {
8404
+ redacted = redacted.replace(pattern, replacement);
8405
+ } else {
8406
+ redacted = redacted.replace(pattern, replacement);
8407
+ }
8408
+ }
8409
+ return redacted;
8410
+ }
8411
+ function sanitizeDiagnosticText(value) {
8412
+ return redactSecretText(sanitizePathString(value));
8413
+ }
8414
+ var SHAREABILITY_SENSITIVE_PATTERNS = [
8415
+ /\bC:\/Users\/[^/\s]+/i,
8416
+ /(?:^|\s)~\/[^\s]+/,
8417
+ /\b(?:api[_-]?key|secret|token|password|passwd|pwd|client[_-]?secret|access[_-]?key)\b\s*[:=]\s*\S+/i,
8418
+ /\b(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?::\d+)?\b/i,
8419
+ /\b(?:10|127)\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/,
8420
+ /\b192\.168\.\d{1,3}\.\d{1,3}\b/,
8421
+ /\b172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}\b/
8422
+ ];
8423
+ function hasShareabilitySensitiveText(text) {
8424
+ try {
8425
+ if (sanitizeDiagnosticText(text) !== text)
8426
+ return true;
8427
+ return SHAREABILITY_SENSITIVE_PATTERNS.some((pattern) => pattern.test(text));
8428
+ } catch {
8429
+ return true;
8430
+ }
8431
+ }
8432
+
8433
+ // ../plugin/src/features/magic-context/fail-closed-block.ts
8434
+ var FAIL_CLOSED_DOCTOR_COMMAND = "npx @cortexkit/magic-context@latest doctor";
8435
+ var FAIL_CLOSED_REPROBE_EVERY_N = 5;
8436
+ function attachFailClosedBlockingProcessEvidence(process2, evidence) {
8437
+ Object.defineProperties(process2, {
8438
+ startTime: { configurable: true, value: evidence.startTime },
8439
+ commandLine: { configurable: true, value: evidence.commandLine }
8440
+ });
8441
+ return process2;
8442
+ }
8443
+
8444
+ class FailClosedBlockingError extends Error {
8445
+ code = "FAIL_CLOSED_BLOCKING";
8446
+ reason;
8447
+ constructor(message, reason, options) {
8448
+ super(message, options);
8449
+ this.name = "FailClosedBlockingError";
8450
+ this.reason = reason;
8451
+ }
8452
+ }
8453
+ var OPENCODE_INTERNAL_AGENT_NAMES = new Set(["title", "summary", "compaction"]);
8454
+ function isMagicContextHiddenAgentName(agent) {
8455
+ if (agent === "sidekick" || agent === "smart-note-compiler" || agent.startsWith("smart-note-")) {
8456
+ return true;
8457
+ }
8458
+ if (agent === "historian" || agent.startsWith("historian-"))
8459
+ return true;
8460
+ if (agent === "dreamer" || agent.startsWith("dreamer-"))
8461
+ return true;
8462
+ return false;
8463
+ }
8464
+ var MAX_FORMATTED_BLOCKING_PROCESSES = 8;
8465
+ var MAX_FORMATTED_COMMAND_LINE_LENGTH = 80;
8466
+ function normalizeFailClosedProcessKind(process2) {
8467
+ switch (process2.kind) {
8468
+ case "OpenCode server":
8469
+ case "OpenCode instance (TUI/CLI)":
8470
+ case "Pi":
8471
+ case "process":
8472
+ return process2.kind;
8473
+ }
8474
+ switch (process2.harness?.trim().toLowerCase()) {
8475
+ case "opencode server":
8476
+ return "OpenCode server";
8477
+ case "opencode instance (tui/cli)":
8478
+ case "opencode instance":
8479
+ return "OpenCode instance (TUI/CLI)";
8480
+ case "pi":
8481
+ case "pi harness":
8482
+ case "omp":
8483
+ return "Pi";
8484
+ default:
8485
+ return "process";
8486
+ }
8487
+ }
8488
+ function formatFailClosedProcessStartTime(startTime) {
8489
+ if (!Number.isFinite(startTime) || startTime <= 0)
8490
+ return "unverified";
8491
+ try {
8492
+ const parts = new Intl.DateTimeFormat("en-US", {
8493
+ day: "numeric",
8494
+ hour: "2-digit",
8495
+ minute: "2-digit",
8496
+ month: "short",
8497
+ hour12: false
8498
+ }).formatToParts(new Date(startTime));
8499
+ const values = Object.fromEntries(parts.map(({ type, value }) => [type, value]));
8500
+ if (!values.month || !values.day || !values.hour || !values.minute)
8501
+ return "unverified";
8502
+ return `${values.month} ${values.day} ${values.hour}:${values.minute}`;
8503
+ } catch {
8504
+ return "unverified";
8505
+ }
8506
+ }
8507
+ function formatFailClosedCommandLine(commandLine) {
8508
+ if (typeof commandLine !== "string" || commandLine.trim().length === 0)
8509
+ return "unverified";
8510
+ try {
8511
+ const normalized = commandLine.replaceAll("\x00", " ").replace(/\s+/g, " ").trim();
8512
+ if (normalized.length === 0)
8513
+ return "unverified";
8514
+ const sanitized = sanitizeDiagnosticText(normalized).trim();
8515
+ if (sanitized.length === 0)
8516
+ return "unverified";
8517
+ return sanitized.length > MAX_FORMATTED_COMMAND_LINE_LENGTH ? `${sanitized.slice(0, MAX_FORMATTED_COMMAND_LINE_LENGTH - 3)}...` : sanitized;
8518
+ } catch {
8519
+ return "unverified";
8520
+ }
8521
+ }
8522
+ function formatFailClosedBlockingProcesses(processes) {
8523
+ const uniqueProcesses = new Map;
8524
+ for (const process2 of processes) {
8525
+ if (!Number.isInteger(process2.pid) || process2.pid <= 0)
8526
+ continue;
8527
+ const candidate = {
8528
+ kind: normalizeFailClosedProcessKind(process2),
8529
+ pid: process2.pid,
8530
+ startTime: process2.startTime,
8531
+ commandLine: process2.commandLine
8532
+ };
8533
+ const previous = uniqueProcesses.get(process2.pid);
8534
+ if (!previous || previous.kind === "process" && candidate.kind !== "process") {
8535
+ uniqueProcesses.set(process2.pid, candidate);
8536
+ } else {
8537
+ uniqueProcesses.set(process2.pid, {
8538
+ ...previous,
8539
+ startTime: previous.startTime ?? candidate.startTime,
8540
+ commandLine: previous.commandLine ?? candidate.commandLine
8541
+ });
8542
+ }
8543
+ }
8544
+ const entries = [...uniqueProcesses.values()];
8545
+ const visible = entries.slice(0, MAX_FORMATTED_BLOCKING_PROCESSES);
8546
+ const rendered = visible.map(({ kind, pid }) => `${kind} (PID ${pid})`);
8547
+ const omitted = entries.length - visible.length;
8548
+ if (omitted > 0)
8549
+ rendered.push(`${omitted} more blocking process(es)`);
8550
+ if (rendered.length === 0)
8551
+ return "a live process";
8552
+ const summary = rendered.length === 1 ? rendered[0] : `${rendered.slice(0, -1).join(", ")}, and ${rendered.at(-1)}`;
8553
+ const evidence = entries.map(({ kind, pid, startTime, commandLine }) => `- PID ${pid}: ${kind}, started ${formatFailClosedProcessStartTime(startTime)}, cmd: ${formatFailClosedCommandLine(commandLine)}`).join(`
8554
+ `);
8555
+ return `${summary}
8556
+ Blocking process evidence:
8557
+ ${evidence}`;
8558
+ }
8559
+ function formatFailClosedBlockingMessage(reason) {
8560
+ if (reason.kind === "migration_guard") {
8561
+ if (reason.unreadableFile) {
8562
+ const arm = reason.unreadableArm ?? "io";
8563
+ const recovery = arm === "io" ? `If none of these processes are running, it is safe to delete ${reason.unreadableFile} and retry.` : `The file may be a recent incomplete write; retry after the file is older than the ten-minute grace window, or stop the relevant process before deleting it.`;
8564
+ return [
8565
+ `Magic Context cannot migrate the shared database because RPC discovery file ${reason.unreadableFile} is uncertain (${arm} arm), so the absence of a live process cannot be proven.`,
8566
+ recovery,
8567
+ `Recovery: ${FAIL_CLOSED_DOCTOR_COMMAND}`
8568
+ ].join(" ");
8569
+ }
8570
+ return [
8571
+ `Magic Context cannot migrate the shared database because ${formatFailClosedBlockingProcesses(reason.blockingProcesses)} may be running an older Magic Context build that would fail against the migrated database.`,
8572
+ "Restart the blocking process (it will pick up the new build and migrate on start), or shut it down and retry.",
8573
+ `Recovery: ${FAIL_CLOSED_DOCTOR_COMMAND}`
8574
+ ].join(" ");
8575
+ }
8576
+ if (reason.kind === "schema_fence") {
8577
+ return [
8578
+ `Magic Context cannot operate: this Magic Context build is older than the database; upgrade/restart this harness (upstream migration lane v${reason.persistedVersion}, build supports through v${reason.supportedVersion}).`,
8579
+ `Recovery: ${FAIL_CLOSED_DOCTOR_COMMAND}`
8580
+ ].join(" ");
8581
+ }
8582
+ const cause = reason.cause.trim().length > 0 ? reason.cause.trim() : "unknown storage error";
8583
+ return [
8584
+ `Magic Context cannot operate: persistent storage failed (${cause}).`,
8585
+ "The plugin will not silently degrade to native compaction while enabled.",
8586
+ `Recovery: ${FAIL_CLOSED_DOCTOR_COMMAND}`
8587
+ ].join(" ");
8588
+ }
8589
+ function createFailClosedBlockingError(reason, options) {
8590
+ return new FailClosedBlockingError(formatFailClosedBlockingMessage(reason), reason, options);
8591
+ }
8592
+ function isFailClosedBlockingError(error) {
8593
+ return error instanceof FailClosedBlockingError || typeof error === "object" && error !== null && error.name === "FailClosedBlockingError" && error.code === "FAIL_CLOSED_BLOCKING";
8594
+ }
8595
+ function shouldBypassFailClosedBlock(input) {
8596
+ if (input.isPiSubagentEnv === true)
8597
+ return true;
8598
+ if (input.isInternalChildSession === true)
8599
+ return true;
8600
+ const agent = typeof input.agent === "string" ? input.agent.trim() : "";
8601
+ if (agent.length === 0)
8602
+ return false;
8603
+ if (OPENCODE_INTERNAL_AGENT_NAMES.has(agent))
8604
+ return true;
8605
+ if (isMagicContextHiddenAgentName(agent))
8606
+ return true;
8607
+ return false;
8608
+ }
8609
+ function createFailClosedController(options) {
8610
+ const reprobeEveryN = Math.max(1, options?.reprobeEveryN ?? FAIL_CLOSED_REPROBE_EVERY_N);
8611
+ let reason = null;
8612
+ let blockedPassCount = 0;
8613
+ return {
8614
+ arm(next) {
8615
+ reason = next;
8616
+ blockedPassCount = 0;
8617
+ },
8618
+ clear() {
8619
+ reason = null;
8620
+ blockedPassCount = 0;
8621
+ },
8622
+ isArmed() {
8623
+ return reason !== null;
8624
+ },
8625
+ getReason() {
8626
+ return reason;
8627
+ },
8628
+ async enforce(input) {
8629
+ if (!reason)
8630
+ return;
8631
+ if (!input.blockingEnabled)
8632
+ return;
8633
+ if (input.exempt)
8634
+ return;
8635
+ blockedPassCount += 1;
8636
+ const shouldReprobe = typeof input.tryReopen === "function" && (blockedPassCount === 1 || blockedPassCount % reprobeEveryN === 0);
8637
+ if (shouldReprobe) {
8638
+ try {
8639
+ const healed = await input.tryReopen?.();
8640
+ if (healed) {
8641
+ reason = null;
8642
+ blockedPassCount = 0;
8643
+ return;
8644
+ }
8645
+ } catch {}
8646
+ }
8647
+ const blockedReason = reason;
8648
+ if (!blockedReason)
8649
+ return;
8650
+ throw createFailClosedBlockingError(blockedReason);
8651
+ }
8652
+ };
8653
+ }
8654
+
8286
8655
  // ../plugin/src/features/magic-context/memory/project-identity.ts
8287
8656
  import { execFileSync } from "node:child_process";
8288
8657
  import { createHash } from "node:crypto";
8289
8658
  import { existsSync as existsSync2, realpathSync, statSync as statSync2 } from "node:fs";
8290
- import { homedir as homedir2 } from "node:os";
8659
+ import { homedir as homedir3 } from "node:os";
8291
8660
  import path from "node:path";
8292
8661
  var GIT_TIMEOUT_MS = 5000;
8293
8662
  var TRANSIENT_FAILURE_COOLDOWN_MS = 5 * 60 * 1000;
@@ -8301,7 +8670,7 @@ var dubiousOwnershipLoggedDirectories = new Set;
8301
8670
  var dubiousOwnershipWarnedDirectories = new Set;
8302
8671
  var transientGitIdentityReuseLoggedDirectories = new Set;
8303
8672
  var execFileSyncForIdentity = execFileSync;
8304
- var userHomeDirectoryForIdentity = () => homedir2();
8673
+ var userHomeDirectoryForIdentity = () => homedir3();
8305
8674
  var nowMs = () => Date.now();
8306
8675
 
8307
8676
  class ProjectIdentityError extends Error {
@@ -8657,7 +9026,7 @@ function scheduleAfterBootQuiet(task, additionalDelayMs = 0) {
8657
9026
  // ../plugin/src/hooks/magic-context/read-session-formatting.ts
8658
9027
  import { existsSync as existsSync3, readFileSync as readFileSync2, realpathSync as realpathSync2 } from "node:fs";
8659
9028
  import { createRequire } from "node:module";
8660
- import { homedir as homedir3 } from "node:os";
9029
+ import { homedir as homedir4 } from "node:os";
8661
9030
  import { dirname as dirname2, join as join2, resolve } from "node:path";
8662
9031
  import { pathToFileURL } from "node:url";
8663
9032
 
@@ -8774,7 +9143,7 @@ var tokenizerLoadPromise;
8774
9143
  var tokenizerWarningSent = false;
8775
9144
  function tokenizerPackageRoots() {
8776
9145
  const cwd = process.cwd();
8777
- const openCodeCache = join2(process.env.XDG_CACHE_HOME ?? join2(homedir3(), ".cache"), "opencode");
9146
+ const openCodeCache = join2(process.env.XDG_CACHE_HOME ?? join2(homedir4(), ".cache"), "opencode");
8778
9147
  const roots = [cwd, openCodeCache];
8779
9148
  const candidates = [];
8780
9149
  for (const root of roots) {
@@ -9173,6 +9542,17 @@ function readPsProcessStartTime(pid) {
9173
9542
  return null;
9174
9543
  }
9175
9544
  }
9545
+ function readProcessStartTime(pid) {
9546
+ if (!Number.isInteger(pid) || pid <= 0)
9547
+ return null;
9548
+ return rpcIdentityPlatform === "linux" ? readLinuxProcessStartTime(pid) : rpcIdentityPlatform === "win32" ? null : readPsProcessStartTime(pid);
9549
+ }
9550
+ function readProcessProbeEvidence(pid) {
9551
+ return {
9552
+ startTime: readProcessStartTime(pid),
9553
+ commandLine: readProcessCommand(pid)
9554
+ };
9555
+ }
9176
9556
  function parseCsvLine(line) {
9177
9557
  const fields = [];
9178
9558
  let field = "";
@@ -9305,16 +9685,16 @@ function commandLooksLikeOpenCode(command) {
9305
9685
  const normalized = command.toLowerCase();
9306
9686
  return OPEN_CODE_COMMAND_MARKERS.some((marker) => normalized.includes(marker));
9307
9687
  }
9308
- function isPidIdentityPlausible(record) {
9688
+ function isPidIdentityPlausible(record, evidence) {
9309
9689
  if (!Number.isInteger(record.pid) || record.pid <= 0)
9310
9690
  return "implausible";
9311
9691
  if (Number.isFinite(record.started_at) && record.started_at > 0) {
9312
- const processStartTime = rpcIdentityPlatform === "linux" ? readLinuxProcessStartTime(record.pid) : rpcIdentityPlatform === "win32" ? null : readPsProcessStartTime(record.pid);
9692
+ const processStartTime = evidence ? evidence.startTime : readProcessStartTime(record.pid);
9313
9693
  if (processStartTime === null)
9314
9694
  return "inconclusive";
9315
9695
  return processStartTime <= record.started_at + RPC_IDENTITY_SKEW_TOLERANCE_MS ? "plausible" : "implausible";
9316
9696
  }
9317
- const command = rpcIdentityPlatform === "linux" ? readLinuxProcessCommand(record.pid) : rpcIdentityPlatform === "win32" ? readWindowsProcess(record.pid).command ?? null : readPsProcessCommand(record.pid);
9697
+ const command = evidence ? evidence.commandLine : rpcIdentityPlatform === "linux" ? readLinuxProcessCommand(record.pid) : rpcIdentityPlatform === "win32" ? readWindowsProcess(record.pid).command ?? null : readPsProcessCommand(record.pid);
9318
9698
  if (command === null)
9319
9699
  return "inconclusive";
9320
9700
  return commandLooksLikeOpenCode(command) ? "plausible" : "implausible";
@@ -12929,8 +13309,8 @@ function classifyDiscoveryRecordKind(record) {
12929
13309
  }
12930
13310
  return null;
12931
13311
  }
12932
- function classifyRpcProcess(record) {
12933
- return classifyDiscoveryRecordKind(record) ?? classifyProcessKind(readProcessCommand(record.pid));
13312
+ function classifyRpcProcess(record, commandLine) {
13313
+ return classifyDiscoveryRecordKind(record) ?? classifyProcessKind(commandLine === undefined ? readProcessProbeEvidence(record.pid).commandLine : commandLine);
12934
13314
  }
12935
13315
  function classifyJunkDiscovery(portFile, raw, staleFiles) {
12936
13316
  let mtimeMs;
@@ -13007,18 +13387,23 @@ function inspectRpcServerDiscovery(storageDir) {
13007
13387
  continue;
13008
13388
  }
13009
13389
  const liveness = isPidAlive(record.pid);
13010
- const identity = liveness === "dead" ? "implausible" : isPidIdentityPlausible(record);
13011
- if (liveness === "alive" && identity === "plausible") {
13390
+ if (liveness === "dead") {
13391
+ staleFiles.push(portFile);
13392
+ continue;
13393
+ }
13394
+ const evidence = readProcessProbeEvidence(record.pid);
13395
+ const identity = isPidIdentityPlausible(record, evidence);
13396
+ if (identity === "plausible") {
13012
13397
  pids.add(record.pid);
13013
- const detected = {
13014
- kind: classifyRpcProcess(record),
13398
+ const detected = attachFailClosedBlockingProcessEvidence({
13399
+ kind: classifyRpcProcess(record, evidence.commandLine),
13015
13400
  pid: record.pid
13016
- };
13401
+ }, evidence);
13017
13402
  const previous = processByPid.get(record.pid);
13018
13403
  if (!previous || previous.kind === "process" && detected.kind !== "process") {
13019
13404
  processByPid.set(record.pid, detected);
13020
13405
  }
13021
- } else if (liveness === "dead" || identity === "implausible") {
13406
+ } else if (identity === "implausible") {
13022
13407
  staleFiles.push(portFile);
13023
13408
  } else {
13024
13409
  inconclusivePids.add(record.pid);
@@ -13051,6 +13436,9 @@ function inspectRpcServerDiscovery(storageDir) {
13051
13436
  }
13052
13437
  return { state: "stale", serverPids: [], staleFiles };
13053
13438
  }
13439
+ function createPiBlockingProcess(pid) {
13440
+ return attachFailClosedBlockingProcessEvidence({ kind: "Pi", pid }, readProcessProbeEvidence(pid));
13441
+ }
13054
13442
  function formatInconclusiveOpenCodeMigrationWarning(dbPath, pids) {
13055
13443
  return `[magic-context] storage warning: continuing migration for ${dbPath}; OpenCode server PID ${pids.join(", ")} was not confirmed because its liveness or identity check could not run. This commonly means an OS sandbox denied kill(0) or ps. No live OpenCode server was confirmed.`;
13056
13444
  }
@@ -13092,10 +13480,7 @@ function enforceMigrationOnOpenGuard(db, dbPath, dbDir, latestSupportedVersion)
13092
13480
  const piDiscovery = inspectLivePiProcesses();
13093
13481
  const piPids = migrationBlockingPiPids(dbPath, discovery, piDiscovery.processIds);
13094
13482
  const serverProcesses = discovery.serverProcesses ?? (discovery.state === "live" ? discovery.serverPids.map((pid) => ({ kind: "process", pid })) : []);
13095
- const blockingProcesses = [
13096
- ...serverProcesses,
13097
- ...piPids.map((pid) => ({ kind: "Pi", pid }))
13098
- ];
13483
+ const blockingProcesses = [...serverProcesses, ...piPids.map(createPiBlockingProcess)];
13099
13484
  if ((discovery.state === "absent" || discovery.state === "stale" || discovery.state === "inconclusive") && piPids.length === 0) {
13100
13485
  lastMigrationOnOpenRefusal = null;
13101
13486
  logInconclusiveMigrationProbes(dbPath, discovery, piDiscovery.state);
@@ -13700,8 +14085,6 @@ CREATE INDEX IF NOT EXISTS idx_dream_queue_pending ON dream_queue(started_at, en
13700
14085
  updated_at INTEGER NOT NULL,
13701
14086
  harness TEXT NOT NULL DEFAULT 'opencode'
13702
14087
  );
13703
- CREATE INDEX IF NOT EXISTS idx_message_history_index_orphan_sweep
13704
- ON message_history_index(harness, session_id, updated_at);
13705
14088
 
13706
14089
  CREATE TABLE IF NOT EXISTS message_history_source (
13707
14090
  session_id TEXT NOT NULL,
@@ -14288,6 +14671,10 @@ CREATE INDEX IF NOT EXISTS idx_dream_queue_pending ON dream_queue(started_at, en
14288
14671
  ensureColumn(db, "recomp_compartments", "harness", "TEXT NOT NULL DEFAULT 'opencode'");
14289
14672
  ensureColumn(db, "recomp_facts", "harness", "TEXT NOT NULL DEFAULT 'opencode'");
14290
14673
  ensureColumn(db, "message_history_index", "harness", "TEXT NOT NULL DEFAULT 'opencode'");
14674
+ db.exec(`
14675
+ CREATE INDEX IF NOT EXISTS idx_message_history_index_orphan_sweep
14676
+ ON message_history_index(harness, session_id, updated_at);
14677
+ `);
14291
14678
  ensureColumn(db, "workspaces", "share_categories", `TEXT NOT NULL DEFAULT '["CONSTRAINTS"]'`);
14292
14679
  }
14293
14680
  var CHANNEL2_CLAIM_TTL_MS = 10 * 60000;
@@ -21398,7 +21785,7 @@ function migrateLegacyExperimental(rawConfig, warnings) {
21398
21785
  }
21399
21786
 
21400
21787
  // ../plugin/src/config/schema/magic-context.ts
21401
- import { homedir as homedir4 } from "node:os";
21788
+ import { homedir as homedir5 } from "node:os";
21402
21789
 
21403
21790
  // ../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
21404
21791
  var exports_external = {};
@@ -22025,7 +22412,7 @@ __export(exports_util, {
22025
22412
  createTransparentProxy: () => createTransparentProxy,
22026
22413
  defineLazy: () => defineLazy,
22027
22414
  esc: () => esc,
22028
- escapeRegex: () => escapeRegex,
22415
+ escapeRegex: () => escapeRegex2,
22029
22416
  explicitlyAborted: () => explicitlyAborted,
22030
22417
  extend: () => extend,
22031
22418
  finalizeIssue: () => finalizeIssue,
@@ -22302,7 +22689,7 @@ var primitiveTypes = /* @__PURE__ */ new Set([
22302
22689
  "symbol",
22303
22690
  "undefined"
22304
22691
  ]);
22305
- function escapeRegex(str) {
22692
+ function escapeRegex2(str) {
22306
22693
  return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
22307
22694
  }
22308
22695
  function clone(inst, def, params) {
@@ -23012,7 +23399,7 @@ function emoji() {
23012
23399
  var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
23013
23400
  var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
23014
23401
  var mac = (delimiter) => {
23015
- const escapedDelim = escapeRegex(delimiter ?? ":");
23402
+ const escapedDelim = escapeRegex2(delimiter ?? ":");
23016
23403
  return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
23017
23404
  };
23018
23405
  var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
@@ -23513,7 +23900,7 @@ var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (ins
23513
23900
  });
23514
23901
  var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
23515
23902
  $ZodCheck.init(inst, def);
23516
- const escapedRegex = escapeRegex(def.includes);
23903
+ const escapedRegex = escapeRegex2(def.includes);
23517
23904
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
23518
23905
  def.pattern = pattern;
23519
23906
  inst._zod.onattach.push((inst2) => {
@@ -23537,7 +23924,7 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
23537
23924
  });
23538
23925
  var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
23539
23926
  $ZodCheck.init(inst, def);
23540
- const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
23927
+ const pattern = new RegExp(`^${escapeRegex2(def.prefix)}.*`);
23541
23928
  def.pattern ?? (def.pattern = pattern);
23542
23929
  inst._zod.onattach.push((inst2) => {
23543
23930
  const bag = inst2._zod.bag;
@@ -23560,7 +23947,7 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
23560
23947
  });
23561
23948
  var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
23562
23949
  $ZodCheck.init(inst, def);
23563
- const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
23950
+ const pattern = new RegExp(`.*${escapeRegex2(def.suffix)}$`);
23564
23951
  def.pattern ?? (def.pattern = pattern);
23565
23952
  inst._zod.onattach.push((inst2) => {
23566
23953
  const bag = inst2._zod.bag;
@@ -25207,7 +25594,7 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
25207
25594
  const values = getEnumValues(def.entries);
25208
25595
  const valuesSet = new Set(values);
25209
25596
  inst._zod.values = valuesSet;
25210
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
25597
+ inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex2(o) : o.toString()).join("|")})$`);
25211
25598
  inst._zod.parse = (payload, _ctx) => {
25212
25599
  const input = payload.value;
25213
25600
  if (valuesSet.has(input)) {
@@ -25229,7 +25616,7 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
25229
25616
  }
25230
25617
  const values = new Set(def.values);
25231
25618
  inst._zod.values = values;
25232
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
25619
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex2(o) : o ? escapeRegex2(o.toString()) : String(o)).join("|")})$`);
25233
25620
  inst._zod.parse = (payload, _ctx) => {
25234
25621
  const input = payload.value;
25235
25622
  if (values.has(input)) {
@@ -25594,7 +25981,7 @@ var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (i
25594
25981
  const end = source.endsWith("$") ? source.length - 1 : source.length;
25595
25982
  regexParts.push(source.slice(start, end));
25596
25983
  } else if (part === null || primitiveTypes.has(typeof part)) {
25597
- regexParts.push(escapeRegex(`${part}`));
25984
+ regexParts.push(escapeRegex2(`${part}`));
25598
25985
  } else {
25599
25986
  throw new Error(`Invalid template literal part: ${part}`);
25600
25987
  }
@@ -36052,6 +36439,37 @@ var DreamerPiHarnessBlockSchema = exports_external.object({
36052
36439
  thinking_level: PiThinkingLevelSchema.describe("Pi thinking level for the primary entry when it declares none. Fallback entries declare thinking levels per-entry."),
36053
36440
  tasks: exports_external.record(exports_external.string(), PiTaskExecutionSchema).optional().describe("Pi task execution overrides. Each named task accepts only model, fallback_models, thinking_level, and timeout_minutes.")
36054
36441
  }).strict().describe("Strict Pi dreamer model-resolution block. It accepts no OpenCode vocabulary.");
36442
+ var ProfileOpenCodeModelBlockSchema = exports_external.object({
36443
+ model: OcEntrySchema.optional().describe("Primary OpenCode model entry."),
36444
+ fallback_models: exports_external.array(OcEntrySchema).optional().describe("Ordered fallback OpenCode model entries."),
36445
+ variant: exports_external.string().optional().describe("OpenCode reasoning variant for the primary model entry.")
36446
+ }).strict().describe("Strict profile-only OpenCode model-selection block.");
36447
+ var ProfilePiModelBlockSchema = exports_external.object({
36448
+ model: PiEntrySchema.optional().describe("Primary Pi model entry."),
36449
+ fallback_models: exports_external.array(PiEntrySchema).optional().describe("Ordered fallback Pi model entries."),
36450
+ thinking_level: PiThinkingLevelSchema.describe("Pi thinking level for the primary model entry.")
36451
+ }).strict().describe("Strict profile-only Pi model-selection block.");
36452
+ var ProfileHistorianSchema = exports_external.object({
36453
+ opencode: ProfileOpenCodeModelBlockSchema.optional(),
36454
+ pi: ProfilePiModelBlockSchema.optional()
36455
+ }).strict();
36456
+ var ProfileDreamerSchema = exports_external.object({
36457
+ opencode: ProfileOpenCodeModelBlockSchema.optional(),
36458
+ pi: ProfilePiModelBlockSchema.optional()
36459
+ }).strict();
36460
+ var ProfileSidekickSchema = AgentOverrideConfigSchema.pick({
36461
+ model: true,
36462
+ fallback_models: true,
36463
+ variant: true
36464
+ }).extend({
36465
+ thinking_level: PiThinkingLevelSchema.describe("Pi thinking level for the sidekick model selection.")
36466
+ }).strict();
36467
+ var ConfigProfileSchema = exports_external.object({
36468
+ historian: ProfileHistorianSchema.optional(),
36469
+ dreamer: ProfileDreamerSchema.optional(),
36470
+ sidekick: ProfileSidekickSchema.optional()
36471
+ }).strict().describe("User-owned model-selection overlay. Only historian/dreamer harness model blocks and sidekick model-selection fields are allowed.");
36472
+ var ConfigProfilesSchema = exports_external.record(exports_external.string().trim().min(1, "Profile names must not be empty or whitespace-only."), ConfigProfileSchema);
36055
36473
  var CronScheduleSchema = exports_external.string().refine((s) => s.trim() === "" || isValidCron(s), {
36056
36474
  message: 'Invalid schedule: use a 5-field cron expression (e.g. "0 3 * * *" for 3am daily, "0 3 * * 0" for Sunday 3am, "0 */6 * * *" every 6h) or "" to disable.'
36057
36475
  }).describe('5-field cron schedule (e.g. "0 3 * * *"), or "" to disable this task.');
@@ -36139,9 +36557,9 @@ var EmbeddingFallbackProviderSchema = exports_external.enum(["local", "openai-co
36139
36557
  function expandConfigPath(value) {
36140
36558
  const trimmed = value.trim();
36141
36559
  if (trimmed === "~")
36142
- return homedir4();
36560
+ return homedir5();
36143
36561
  if (trimmed.startsWith("~/"))
36144
- return `${homedir4()}/${trimmed.slice(2)}`;
36562
+ return `${homedir5()}/${trimmed.slice(2)}`;
36145
36563
  return trimmed;
36146
36564
  }
36147
36565
  var BaseEmbeddingConfigSchema = exports_external.object({
@@ -36242,6 +36660,8 @@ var MagicContextConfigSchema = exports_external.object({
36242
36660
  transform_mode: exports_external.enum(["ts", "rust"]).default("ts").describe('Experimental: routes the entire Magic Context runtime for the project through the ck-mc Rust module over subc (requires user-level `subc` config); "ts" is the current TypeScript pipeline.'),
36243
36661
  auto_update: exports_external.boolean().optional().describe("Enable automatic npm self-update checks for the OpenCode plugin. Security: USER-only in config loader, so hostile project configs cannot suppress updates."),
36244
36662
  language: exports_external.string().trim().toLowerCase().refine((s) => isValidLanguageCode(s), 'language must be a 2-letter ISO 639-1 code (e.g. "tr", "es", "de")').optional().describe("Output language for Magic Context's generated content and guidance, as a " + '2-letter ISO 639-1 code (e.g. "tr", "es", "de", "ja", "pt"). When set, the ' + "historian, dreamer, sidekick, and the agent-guidance block instruct the model to " + "write its PROSE in this language while keeping all structural tokens (XML tags, " + "the five memory category names, code identifiers, file paths) in English. " + "USER-LEVEL ONLY (ignored in project config for security). Unset = today's " + "behavior (model mirrors the conversation; English scaffolding). Changing it " + "triggers one cache re-materialization; existing compartments/memories keep their " + "original language until naturally rewritten."),
36663
+ profile: exports_external.string().trim().min(1).optional().describe("Select a named user-owned model profile. A valid project name overrides this user default; an empty string, null, or other non-string project value is ignored with a warning so the user selection still applies. Unknown names warn and use the base configuration."),
36664
+ profiles: ConfigProfilesSchema.optional().describe("User-level named model profiles. A profile may contain only historian/dreamer model, fallback_models, OpenCode variant, and Pi thinking_level fields plus sidekick model-selection fields; task execution policy (including timeout_minutes) is excluded. Project configs may select a name but cannot define profiles."),
36245
36665
  historian: HistorianConfigSchema.describe("Historian metadata plus independent strict OpenCode and Pi execution blocks. Retained metadata stays at historian; model, fallback_models, variant, and thinking_level belong only in historian.opencode or historian.pi."),
36246
36666
  dreamer: DreamerConfigSchema.optional().describe("Dreamer metadata and scheduling plus independent strict OpenCode and Pi execution blocks. schedule and promotion_threshold stay at dreamer.tasks; model, fallback_models, variant, thinking_level, and timeout_minutes belong only in the matching harness block."),
36247
36667
  smart_notes: exports_external.object({
@@ -36343,6 +36763,69 @@ var MagicContextConfigSchema = exports_external.object({
36343
36763
  };
36344
36764
  });
36345
36765
 
36766
+ // ../plugin/src/config/profiles.ts
36767
+ function withoutProfileFields(raw) {
36768
+ const copy = { ...raw };
36769
+ delete copy.profile;
36770
+ delete copy.profiles;
36771
+ return copy;
36772
+ }
36773
+ function readProfileSelection(raw) {
36774
+ if (!Object.hasOwn(raw, "profile"))
36775
+ return { declared: false };
36776
+ const value = raw.profile;
36777
+ if (typeof value !== "string")
36778
+ return { declared: true };
36779
+ const name = value.trim();
36780
+ return name.length > 0 ? { declared: true, name } : { declared: true };
36781
+ }
36782
+ function resolveConfigProfile(args) {
36783
+ const warnings = [];
36784
+ const userSelection = readProfileSelection(args.userRaw);
36785
+ const projectSelection = readProfileSelection(args.projectRaw);
36786
+ const selection = projectSelection.name ? { name: projectSelection.name, source: "project" } : userSelection.name ? { name: userSelection.name, source: "user" } : undefined;
36787
+ if (projectSelection.declared && !projectSelection.name) {
36788
+ warnings.push("Ignoring invalid profile selection from project config; expected a non-empty string.");
36789
+ }
36790
+ if (!projectSelection.declared && userSelection.declared && !userSelection.name) {
36791
+ warnings.push("Ignoring invalid profile selection from user config; expected a non-empty string.");
36792
+ }
36793
+ let profiles = {};
36794
+ if (Object.hasOwn(args.userRaw, "profiles")) {
36795
+ const parsed = ConfigProfilesSchema.safeParse(args.userRaw.profiles);
36796
+ if (parsed.success) {
36797
+ profiles = parsed.data;
36798
+ } else {
36799
+ warnings.push("Ignoring profiles from user config: invalid profile configuration; profiles may contain only historian/dreamer harness model blocks and sidekick model-selection fields.");
36800
+ }
36801
+ }
36802
+ if (!selection) {
36803
+ return {
36804
+ userBase: withoutProfileFields(args.userRaw),
36805
+ projectBase: withoutProfileFields(args.projectRaw),
36806
+ overlay: {},
36807
+ warnings
36808
+ };
36809
+ }
36810
+ if (!Object.hasOwn(profiles, selection.name)) {
36811
+ warnings.push(`Unknown profile "${selection.name}" selected by ${selection.source} config; using base config without a profile.`);
36812
+ return {
36813
+ userBase: withoutProfileFields(args.userRaw),
36814
+ projectBase: withoutProfileFields(args.projectRaw),
36815
+ overlay: {},
36816
+ warnings
36817
+ };
36818
+ }
36819
+ const overlay = profiles[selection.name];
36820
+ return {
36821
+ userBase: withoutProfileFields(args.userRaw),
36822
+ projectBase: withoutProfileFields(args.projectRaw),
36823
+ overlay,
36824
+ activeProfile: selection.name,
36825
+ warnings
36826
+ };
36827
+ }
36828
+
36346
36829
  // ../plugin/src/config/project-security.ts
36347
36830
  var HIDDEN_AGENT_KEYS = ["historian", "dreamer", "sidekick"];
36348
36831
  var HARNESS_KEYS = ["opencode", "pi"];
@@ -36481,6 +36964,10 @@ function makeProjectThresholdWarning(field, reason) {
36481
36964
  }
36482
36965
  function stripUnsafeProjectConfigFields(projectRaw) {
36483
36966
  const warnings = [];
36967
+ if ("profiles" in projectRaw) {
36968
+ delete projectRaw.profiles;
36969
+ warnings.push("Ignoring profiles from project config (security: profile definitions are user-level only; a repository may select a named user profile with profile).");
36970
+ }
36484
36971
  if ("auto_update" in projectRaw) {
36485
36972
  delete projectRaw.auto_update;
36486
36973
  warnings.push("Ignoring auto_update from project config (security: this setting only honors user-level config).");
@@ -38513,12 +39000,12 @@ function loadRawConfigFile(options) {
38513
39000
 
38514
39001
  // ../plugin/src/config/variable.ts
38515
39002
  import { existsSync as existsSync10, readFileSync as readFileSync9 } from "node:fs";
38516
- import { homedir as homedir5 } from "node:os";
39003
+ import { homedir as homedir6 } from "node:os";
38517
39004
  import { dirname as dirname6, isAbsolute as isAbsolute3, resolve as resolve4 } from "node:path";
38518
39005
  var ENV_PATTERN = /\{env:([^}]+)\}/g;
38519
39006
  var FILE_PATTERN = /\{file:([^}]+)\}/g;
38520
39007
  function sensitiveFilePathReason(resolvedPath) {
38521
- const home = homedir5();
39008
+ const home = homedir6();
38522
39009
  const sensitiveDirs = [
38523
39010
  { dir: resolve4(home, ".ssh"), label: "SSH keys" },
38524
39011
  { dir: resolve4(home, ".aws"), label: "AWS credentials" },
@@ -38581,7 +39068,7 @@ function substituteConfigVariables(input) {
38581
39068
  }
38582
39069
  let filePath = rawPath.trim();
38583
39070
  if (filePath.startsWith("~/")) {
38584
- filePath = resolve4(homedir5(), filePath.slice(2));
39071
+ filePath = resolve4(homedir6(), filePath.slice(2));
38585
39072
  } else if (!isAbsolute3(filePath)) {
38586
39073
  filePath = resolve4(configDir, filePath);
38587
39074
  }
@@ -39375,38 +39862,45 @@ function loadPiConfig(opts = {}) {
39375
39862
  } else if (legacyProjectUnmigrated) {
39376
39863
  warnings.push("[project config] legacy Magic Context config exists but the shared CortexKit config is absent; embedding registration is paused until config migration completes.");
39377
39864
  }
39378
- let rawConfig = {};
39379
39865
  const mergeFiles = [...loadedFiles].sort((a, b) => {
39380
39866
  if (a.scope === b.scope)
39381
39867
  return 0;
39382
39868
  return a.scope === "user" ? -1 : 1;
39383
39869
  });
39384
- const userRaw = mergeFiles.find((f) => f.scope === "user")?.config;
39385
- const trustedBaseConfig = parsePiConfig(userRaw ?? {}).config;
39870
+ const userRaw = mergeFiles.find((f) => f.scope === "user")?.config ?? {};
39871
+ const projectLoaded = mergeFiles.find((f) => f.scope === "project");
39872
+ let projectRaw = {};
39386
39873
  for (const loaded of mergeFiles) {
39387
39874
  const prefix = loaded.scope === "user" ? "[user config]" : "[project config]";
39388
39875
  warnings.push(...loaded.warnings.map((warning) => `${prefix} ${warning}`));
39389
- if (loaded.scope === "project") {
39390
- const projectRaw = { ...loaded.config };
39391
- for (const warning of stripUnsafeProjectConfigFields(projectRaw)) {
39392
- warnings.push(`${prefix} ${warning}`);
39393
- }
39394
- rawConfig = mergeRawConfigs(rawConfig, projectRaw);
39395
- for (const warning of dropInheritedEmbeddingKeyOnRedirect(projectRaw, rawConfig, userRaw)) {
39396
- warnings.push(`${prefix} ${warning}`);
39397
- }
39398
- for (const warning of constrainProjectThresholdOverrides({
39399
- mergedRaw: rawConfig,
39400
- projectRaw,
39401
- trustedBaseConfig
39402
- })) {
39403
- warnings.push(`${prefix} ${warning}`);
39404
- }
39405
- } else {
39406
- rawConfig = mergeRawConfigs(rawConfig, loaded.config);
39876
+ if (loaded.scope !== "project")
39877
+ continue;
39878
+ projectRaw = { ...loaded.config };
39879
+ for (const warning of stripUnsafeProjectConfigFields(projectRaw)) {
39880
+ warnings.push(`${prefix} ${warning}`);
39881
+ }
39882
+ }
39883
+ const profileResolution = resolveConfigProfile({ userRaw, projectRaw });
39884
+ warnings.push(...profileResolution.warnings.map((warning) => `[config] ${warning}`));
39885
+ const trustedProfiledRaw = mergeRawConfigs(profileResolution.userBase, profileResolution.overlay);
39886
+ let rawConfig = trustedProfiledRaw;
39887
+ const trustedBaseConfig = parsePiConfig(trustedProfiledRaw).config;
39888
+ if (projectLoaded) {
39889
+ rawConfig = mergeRawConfigs(rawConfig, profileResolution.projectBase);
39890
+ for (const warning of dropInheritedEmbeddingKeyOnRedirect(projectRaw, rawConfig, profileResolution.userBase)) {
39891
+ warnings.push(`[project config] ${warning}`);
39892
+ }
39893
+ for (const warning of constrainProjectThresholdOverrides({
39894
+ mergedRaw: rawConfig,
39895
+ projectRaw: profileResolution.projectBase,
39896
+ trustedBaseConfig
39897
+ })) {
39898
+ warnings.push(`[project config] ${warning}`);
39407
39899
  }
39408
39900
  }
39409
39901
  const parsed = parsePiConfig(rawConfig);
39902
+ if (profileResolution.activeProfile)
39903
+ parsed.config.profile = profileResolution.activeProfile;
39410
39904
  setOutputReserveConfig(parsed.config.output_reserve);
39411
39905
  setWindowOverlayPath(parsed.config.models?.window_overlay_path);
39412
39906
  warnings.push(...parsed.warnings.map((warning) => `[merged config] ${warning}`));
@@ -39496,39 +39990,46 @@ function loadPiConfigDetailed(opts = {}) {
39496
39990
  } else if (legacyProjectUnmigrated) {
39497
39991
  warnings.push("[project config] legacy Magic Context config exists but the shared CortexKit config is absent; embedding registration is paused until config migration completes.");
39498
39992
  }
39499
- let rawConfig = {};
39500
39993
  const mergeFiles = [...loadedFiles].sort((a, b) => {
39501
39994
  if (a.scope === b.scope)
39502
39995
  return 0;
39503
39996
  return a.scope === "user" ? -1 : 1;
39504
39997
  });
39505
- const userRaw = mergeFiles.find((f) => f.scope === "user")?.config;
39506
- const trustedBaseConfig = parsePiConfig(userRaw ?? {}).config;
39998
+ const userRaw = mergeFiles.find((f) => f.scope === "user")?.config ?? {};
39999
+ const projectLayer = mergeFiles.find((f) => f.scope === "project");
40000
+ let projectRaw = {};
39507
40001
  for (const loaded of mergeFiles) {
39508
40002
  const prefix = loaded.scope === "user" ? "[user config]" : "[project config]";
39509
40003
  warnings.push(...loaded.warnings.map((warning) => `${prefix} ${warning}`));
39510
- if (loaded.scope === "project") {
39511
- const projectRaw = { ...loaded.config };
39512
- for (const warning of stripUnsafeProjectConfigFields(projectRaw)) {
39513
- warnings.push(`${prefix} ${warning}`);
39514
- }
39515
- rawConfig = mergeRawConfigs(rawConfig, projectRaw);
39516
- for (const warning of dropInheritedEmbeddingKeyOnRedirect(projectRaw, rawConfig, userRaw)) {
39517
- warnings.push(`${prefix} ${warning}`);
39518
- }
39519
- for (const warning of constrainProjectThresholdOverrides({
39520
- mergedRaw: rawConfig,
39521
- projectRaw,
39522
- trustedBaseConfig
39523
- })) {
39524
- warnings.push(`${prefix} ${warning}`);
39525
- }
39526
- } else {
39527
- rawConfig = mergeRawConfigs(rawConfig, loaded.config);
40004
+ if (loaded.scope !== "project")
40005
+ continue;
40006
+ projectRaw = { ...loaded.config };
40007
+ for (const warning of stripUnsafeProjectConfigFields(projectRaw)) {
40008
+ warnings.push(`${prefix} ${warning}`);
40009
+ }
40010
+ }
40011
+ const profileResolution = resolveConfigProfile({ userRaw, projectRaw });
40012
+ warnings.push(...profileResolution.warnings.map((warning) => `[config] ${warning}`));
40013
+ const trustedProfiledRaw = mergeRawConfigs(profileResolution.userBase, profileResolution.overlay);
40014
+ let rawConfig = trustedProfiledRaw;
40015
+ const trustedBaseConfig = parsePiConfig(trustedProfiledRaw).config;
40016
+ if (projectLayer) {
40017
+ rawConfig = mergeRawConfigs(rawConfig, profileResolution.projectBase);
40018
+ for (const warning of dropInheritedEmbeddingKeyOnRedirect(projectRaw, rawConfig, profileResolution.userBase)) {
40019
+ warnings.push(`[project config] ${warning}`);
40020
+ }
40021
+ for (const warning of constrainProjectThresholdOverrides({
40022
+ mergedRaw: rawConfig,
40023
+ projectRaw: profileResolution.projectBase,
40024
+ trustedBaseConfig
40025
+ })) {
40026
+ warnings.push(`[project config] ${warning}`);
39528
40027
  }
39529
40028
  }
39530
40029
  const recoveredTopLevelKeys = [];
39531
40030
  const parsed = parsePiConfig(rawConfig, recoveredTopLevelKeys);
40031
+ if (profileResolution.activeProfile)
40032
+ parsed.config.profile = profileResolution.activeProfile;
39532
40033
  setOutputReserveConfig(parsed.config.output_reserve);
39533
40034
  setWindowOverlayPath(parsed.config.models?.window_overlay_path);
39534
40035
  warnings.push(...parsed.warnings.map((warning) => `[merged config] ${warning}`));
@@ -42209,33 +42710,123 @@ function startLockHeartbeat(lockPath) {
42209
42710
  timer.unref?.();
42210
42711
  return () => clearInterval(timer);
42211
42712
  }
42212
- async function injectWasmOrtForElectron() {
42213
- if (typeof process === "undefined" || !process.versions?.electron) {
42713
+ var localEmbeddingRuntimeMode = "native";
42714
+ var wasmRuntimeInjected = false;
42715
+ var isElectronForRuntime = () => typeof process !== "undefined" && Boolean(process.versions?.electron);
42716
+ var importWasmOrtForRuntime = async () => {
42717
+ const ortWebSpec = `onnxruntime-${"web"}`;
42718
+ return await import(ortWebSpec);
42719
+ };
42720
+ var importTransformersForRuntime = async () => {
42721
+ const transformersSpec = "@huggingface/transformers";
42722
+ return await import(transformersSpec);
42723
+ };
42724
+ var importTransformersWasmFallbackForRuntime = async () => {
42725
+ const { createRequire: createRequireFn } = await import("node:module");
42726
+ const requireFn = createRequireFn(import.meta.url);
42727
+ const nodeEntry = requireFn.resolve("@huggingface/transformers");
42728
+ const webEntry = pathToFileURL2(join9(dirname7(nodeEntry), "transformers.web.js")).href;
42729
+ return await import(webEntry);
42730
+ };
42731
+ var modelCacheDirForRuntime = () => join9(getMagicContextStorageDir(), "models");
42732
+ var logForRuntime = log;
42733
+ var injectWasmOrtForRuntime = injectWasmOrt;
42734
+ async function ensureWasmOrtInjected() {
42735
+ if (wasmRuntimeInjected)
42736
+ return true;
42737
+ if (!await injectWasmOrtForRuntime())
42214
42738
  return false;
42215
- }
42739
+ wasmRuntimeInjected = true;
42740
+ return true;
42741
+ }
42742
+ async function injectWasmOrt() {
42743
+ if (wasmRuntimeInjected)
42744
+ return true;
42216
42745
  try {
42217
- const ortWebSpec = `onnxruntime-${"web"}`;
42218
- const ortWeb = await import(ortWebSpec);
42746
+ const ortWeb = await importWasmOrtForRuntime();
42219
42747
  try {
42220
42748
  const { createRequire: createRequireFn } = await import("node:module");
42221
42749
  const requireFn = createRequireFn(import.meta.url);
42222
42750
  const mainEntry = requireFn.resolve("onnxruntime-web");
42223
42751
  const distDir = dirname7(mainEntry);
42224
- const wasmPathsPrefix = `${pathToFileURL2(distDir).href}/`;
42225
42752
  if (ortWeb.env?.wasm) {
42226
- ortWeb.env.wasm.wasmPaths = wasmPathsPrefix;
42753
+ ortWeb.env.wasm.wasmPaths = `${pathToFileURL2(distDir).href}/`;
42227
42754
  }
42228
42755
  } catch (pathError) {
42229
42756
  log("[magic-context] could not resolve local onnxruntime-web/dist, falling back to default WASM paths:", pathError instanceof Error ? pathError.message : String(pathError));
42230
42757
  }
42231
42758
  globalThis[Symbol.for("onnxruntime")] = ortWeb;
42232
- log("[magic-context] Electron detected — using onnxruntime-web (WASM) for embeddings (bypasses onnxruntime-node native load)");
42759
+ wasmRuntimeInjected = true;
42233
42760
  return true;
42234
42761
  } catch (error51) {
42235
- log("[magic-context] failed to inject onnxruntime-web for Electron — letting transformers fall back to native:", error51 instanceof Error ? error51.message : String(error51));
42762
+ log("[magic-context] failed to inject onnxruntime-web:", error51 instanceof Error ? error51.message : String(error51));
42236
42763
  return false;
42237
42764
  }
42238
42765
  }
42766
+ function likelyMuslHint() {
42767
+ if (process.platform !== "linux" || typeof process.report?.getReport !== "function")
42768
+ return "";
42769
+ try {
42770
+ const report = process.report.getReport();
42771
+ return typeof report.header?.glibcVersionRuntime === "string" ? "" : " Linux process report has no glibc runtime version (musl likely).";
42772
+ } catch {
42773
+ return "";
42774
+ }
42775
+ }
42776
+ function localEmbeddingRuntimeIsDisabled() {
42777
+ return localEmbeddingRuntimeMode === "disabled";
42778
+ }
42779
+ function disableLocalEmbeddingsAfterRuntimeFailure(detail) {
42780
+ localEmbeddingRuntimeMode = "disabled";
42781
+ logForRuntime(`[magic-context] local embeddings are disabled because both the onnxruntime-node native binding and the onnxruntime-web (WASM) fallback failed to load. Native failure: ${detail}. Run \`npx @cortexkit/magic-context@latest doctor\` for repair guidance (use \`doctor --force\` to reinstall cached plugin packages), or configure an \`openai-compatible\` embedding HTTP endpoint. Existing memories are unaffected.`);
42782
+ }
42783
+ async function loadTransformersForLocalEmbedding() {
42784
+ if (localEmbeddingRuntimeMode === "disabled") {
42785
+ throw new Error("local embedding runtime is disabled");
42786
+ }
42787
+ if (localEmbeddingRuntimeMode === "wasm") {
42788
+ if (!await ensureWasmOrtInjected()) {
42789
+ disableLocalEmbeddingsAfterRuntimeFailure("the previously selected WASM runtime is unavailable");
42790
+ throw new Error("onnxruntime-web failed to load");
42791
+ }
42792
+ try {
42793
+ return { module: await importTransformersWasmFallbackForRuntime(), usesWasm: true };
42794
+ } catch (wasmError) {
42795
+ disableLocalEmbeddingsAfterRuntimeFailure("the previously selected WASM runtime failed to load");
42796
+ throw wasmError;
42797
+ }
42798
+ }
42799
+ const electron = isElectronForRuntime();
42800
+ if (electron) {
42801
+ const wasInjected = wasmRuntimeInjected;
42802
+ if (await ensureWasmOrtInjected()) {
42803
+ if (!wasInjected) {
42804
+ logForRuntime("[magic-context] Electron detected — using onnxruntime-web (WASM) for embeddings (bypasses onnxruntime-node native load)");
42805
+ }
42806
+ return { module: await importTransformersForRuntime(), usesWasm: true };
42807
+ }
42808
+ }
42809
+ try {
42810
+ return { module: await importTransformersForRuntime(), usesWasm: false };
42811
+ } catch (nativeError) {
42812
+ if (!isNativeRuntimeMissingError(nativeError) || electron) {
42813
+ throw nativeError;
42814
+ }
42815
+ if (!await ensureWasmOrtInjected()) {
42816
+ disableLocalEmbeddingsAfterRuntimeFailure(nativeError instanceof Error ? nativeError.message : String(nativeError));
42817
+ throw nativeError;
42818
+ }
42819
+ localEmbeddingRuntimeMode = "wasm";
42820
+ try {
42821
+ const module = await importTransformersWasmFallbackForRuntime();
42822
+ logForRuntime("[magic-context] onnxruntime-node failed to load; using onnxruntime-web (WASM) for local embeddings. WASM inference is slower than native; a remote `openai-compatible` provider may be faster." + likelyMuslHint());
42823
+ return { module, usesWasm: true };
42824
+ } catch (wasmError) {
42825
+ disableLocalEmbeddingsAfterRuntimeFailure(nativeError instanceof Error ? nativeError.message : String(nativeError));
42826
+ throw wasmError;
42827
+ }
42828
+ }
42829
+ }
42239
42830
  var DEFAULT_LOCAL_DTYPE = "fp32";
42240
42831
  async function withQuietConsole(fn) {
42241
42832
  const origWarn = console.warn;
@@ -42253,7 +42844,6 @@ async function withQuietConsole(fn) {
42253
42844
  console.error = origError;
42254
42845
  }
42255
42846
  }
42256
- var nativeRuntimeMissing = false;
42257
42847
  function isNativeRuntimeMissingError(error51) {
42258
42848
  const message = error51 instanceof Error ? error51.message : String(error51 ?? "");
42259
42849
  const lower = message.toLowerCase();
@@ -42337,7 +42927,7 @@ class LocalEmbeddingProvider {
42337
42927
  if (this.pipeline) {
42338
42928
  return true;
42339
42929
  }
42340
- if (nativeRuntimeMissing) {
42930
+ if (localEmbeddingRuntimeMode === "disabled") {
42341
42931
  return false;
42342
42932
  }
42343
42933
  if (this.initPromise) {
@@ -42349,15 +42939,13 @@ class LocalEmbeddingProvider {
42349
42939
  if (this.disposing) {
42350
42940
  return;
42351
42941
  }
42352
- const injectedWasmOrt = await injectWasmOrtForElectron();
42353
- const transformersSpec = "@huggingface/transformers";
42354
- const transformersModule = await import(transformersSpec);
42942
+ const { module: transformersModule, usesWasm } = await loadTransformersForLocalEmbedding();
42355
42943
  const env = transformersModule.env;
42356
42944
  const LogLevel = transformersModule.LogLevel;
42357
42945
  if (LogLevel && "ERROR" in LogLevel) {
42358
42946
  env.logLevel = LogLevel.ERROR;
42359
42947
  }
42360
- const modelCacheDir = join9(getMagicContextStorageDir(), "models");
42948
+ const modelCacheDir = modelCacheDirForRuntime();
42361
42949
  try {
42362
42950
  if (shouldEnforcePrivateStoragePermissions()) {
42363
42951
  mkdirSync4(modelCacheDir, { recursive: true, mode: 448 });
@@ -42384,7 +42972,7 @@ class LocalEmbeddingProvider {
42384
42972
  try {
42385
42973
  const pipeline = await withQuietConsole(() => createPipeline("feature-extraction", this.model, {
42386
42974
  dtype: this.dtype,
42387
- ...injectedWasmOrt ? { device: "auto" } : {}
42975
+ ...usesWasm ? { device: "auto" } : {}
42388
42976
  }));
42389
42977
  if (this.disposing) {
42390
42978
  await pipeline.dispose?.();
@@ -42416,10 +43004,9 @@ class LocalEmbeddingProvider {
42416
43004
  await releaseLock();
42417
43005
  }
42418
43006
  } catch (error51) {
42419
- if (isNativeRuntimeMissingError(error51)) {
42420
- nativeRuntimeMissing = true;
42421
- log("[magic-context] local embeddings are disabled because the onnxruntime-node native binding is missing or failed to load. Run `npx @cortexkit/magic-context@latest doctor` for repair guidance (use `doctor --force` to reinstall cached plugin packages), or configure an `openai-compatible` embedding HTTP endpoint. Existing memories are unaffected.");
42422
- } else {
43007
+ if (!localEmbeddingRuntimeIsDisabled() && isNativeRuntimeMissingError(error51)) {
43008
+ disableLocalEmbeddingsAfterRuntimeFailure(error51 instanceof Error ? error51.message : String(error51));
43009
+ } else if (!localEmbeddingRuntimeIsDisabled()) {
42423
43010
  log("[magic-context] embedding model failed to load:", error51);
42424
43011
  }
42425
43012
  this.pipeline = null;
@@ -42640,6 +43227,7 @@ class OpenAICompatibleEmbeddingProvider {
42640
43227
  circuitOpenUntil = 0;
42641
43228
  openLogged = false;
42642
43229
  modelMismatchLogged = false;
43230
+ lastFailureReason = null;
42643
43231
  halfOpenProbeInFlight = false;
42644
43232
  constructor(options) {
42645
43233
  this.endpoint = normalizeEndpoint3(options.endpoint);
@@ -42729,41 +43317,59 @@ class OpenAICompatibleEmbeddingProvider {
42729
43317
  signal: internalController.signal
42730
43318
  });
42731
43319
  if (!response.ok) {
42732
- log(`[magic-context] openai-compatible embedding request failed: ${response.status} ${response.statusText}`);
42733
- this.recordFailure(isProbe);
43320
+ const excerpt = await response.text().catch(() => "");
43321
+ const failure = this.failure("http_error", `HTTP ${response.status} from endpoint${this.bodyExcerpt(excerpt)}`, response.status >= 500 || response.status === 408 || response.status === 429);
43322
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43323
+ this.recordFailure(isProbe, failure);
42734
43324
  return Array.from({ length: texts.length }, () => null);
42735
43325
  }
42736
43326
  const rawBody = await response.text();
42737
43327
  if (rawBody.trim().length === 0) {
42738
- log(`[magic-context] openai-compatible embedding request returned empty body (status=${response.status}, content-type=${response.headers.get("content-type") ?? "none"})`);
42739
- this.recordFailure(isProbe);
43328
+ const failure = this.failure("invalid_envelope", "response body was empty", false);
43329
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43330
+ this.recordFailure(isProbe, failure);
42740
43331
  return Array.from({ length: texts.length }, () => null);
42741
43332
  }
42742
43333
  let body;
42743
43334
  try {
42744
43335
  body = JSON.parse(rawBody);
42745
- } catch (parseError) {
42746
- const snippet = rawBody.slice(0, 200).replace(/\s+/g, " ");
42747
- log(`[magic-context] openai-compatible embedding response was not JSON (status=${response.status}, ${rawBody.length}B body, snippet="${snippet}"):`, parseError instanceof Error ? parseError.message : parseError);
42748
- this.recordFailure(isProbe);
43336
+ } catch {
43337
+ const failure = this.failure("invalid_envelope", `response body was not valid JSON${this.bodyExcerpt(rawBody)}`, false);
43338
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43339
+ this.recordFailure(isProbe, failure);
42749
43340
  return Array.from({ length: texts.length }, () => null);
42750
43341
  }
42751
43342
  const servedModel = typeof body.model === "string" ? body.model : "";
42752
43343
  if (this.model && servedModel && !embeddingModelsMatch(servedModel, this.model)) {
42753
43344
  if (!this.modelMismatchLogged) {
42754
- log(`[magic-context] embedding endpoint served a DIFFERENT model than requested — refusing the substituted vectors (they have the wrong dimensions/space). requested="${this.model}" served="${servedModel}". Check that the endpoint serves the requested model; variant suffixes and vendor prefixes are matched automatically.`);
43345
+ log(`[magic-context] embedding endpoint served a DIFFERENT model than requested — refusing the substituted vectors (they have the wrong dimensions/space). requested="${sanitizeDiagnosticText(this.model)}" served="${sanitizeDiagnosticText(servedModel)}". Check that the endpoint serves the requested model; variant suffixes and vendor prefixes are matched automatically.`);
42755
43346
  this.modelMismatchLogged = true;
42756
43347
  }
42757
- this.recordFailure(isProbe);
43348
+ this.recordFailure(isProbe, this.failure("substitution_rejected", `served model '${sanitizeDiagnosticText(servedModel)}' does not match requested '${sanitizeDiagnosticText(this.model)}' (substitution guard)`, false));
42758
43349
  return Array.from({ length: texts.length }, () => null);
42759
43350
  }
42760
- const items = Array.isArray(body.data) ? body.data : [];
43351
+ const responseKeys = Object.keys(body).sort();
43352
+ if (!Array.isArray(body.data)) {
43353
+ const failure = this.failure("invalid_envelope", `response had keys [${responseKeys.join(", ")}] but data[] was absent`, false);
43354
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43355
+ this.recordFailure(isProbe, failure);
43356
+ return Array.from({ length: texts.length }, () => null);
43357
+ }
43358
+ if (body.data.length === 0) {
43359
+ const failure = this.failure("empty_result", "response data[] was empty", true);
43360
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43361
+ this.recordFailure(isProbe, failure);
43362
+ return Array.from({ length: texts.length }, () => null);
43363
+ }
43364
+ const items = body.data;
42761
43365
  const results = Array.from({ length: texts.length }, (_, index) => {
42762
43366
  const embedding = items[index]?.embedding;
42763
43367
  return Array.isArray(embedding) ? Float32Array.from(embedding) : null;
42764
43368
  });
42765
43369
  if (results.every((r) => r === null)) {
42766
- this.recordFailure(isProbe);
43370
+ const failure = this.failure("invalid_envelope", `response had keys [${responseKeys.join(", ")}] but data[].embedding was absent`, false);
43371
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43372
+ this.recordFailure(isProbe, failure);
42767
43373
  } else {
42768
43374
  this.recordSuccess();
42769
43375
  }
@@ -42773,11 +43379,14 @@ class OpenAICompatibleEmbeddingProvider {
42773
43379
  if (isAbort) {
42774
43380
  if (signal?.aborted) {} else {
42775
43381
  log(`[magic-context] openai-compatible embedding request timed out after ${FETCH_TIMEOUT_MS}ms`);
42776
- this.recordFailure(isProbe);
43382
+ const failure = this.failure("transport_error", `request timed out after ${FETCH_TIMEOUT_MS}ms`, true);
43383
+ this.recordFailure(isProbe, failure);
42777
43384
  }
42778
43385
  } else {
42779
- log("[magic-context] openai-compatible embedding request failed:", error51);
42780
- this.recordFailure(isProbe);
43386
+ const detail = error51 instanceof Error ? error51.message : String(error51);
43387
+ const failure = this.failure("transport_error", `transport error: ${sanitizeDiagnosticText(detail)}`, true);
43388
+ log(`[magic-context] openai-compatible embedding request failed: ${failure.reason}`);
43389
+ this.recordFailure(isProbe, failure);
42781
43390
  }
42782
43391
  return Array.from({ length: texts.length }, () => null);
42783
43392
  } finally {
@@ -42809,14 +43418,23 @@ class OpenAICompatibleEmbeddingProvider {
42809
43418
  return "short_circuit";
42810
43419
  }
42811
43420
  this.halfOpenProbeInFlight = true;
42812
- log("[magic-context] openai-compatible embedding: circuit half-open, probing endpoint");
43421
+ log(`[magic-context] openai-compatible embedding: circuit half-open, probing endpoint after ${this.lastFailureReason?.reason ?? "unknown failure"}`);
42813
43422
  return "probe";
42814
43423
  }
42815
- recordFailure(isProbe) {
43424
+ failure(failureClass, reason, retryable) {
43425
+ return { class: failureClass, reason, retryable };
43426
+ }
43427
+ bodyExcerpt(body) {
43428
+ const excerpt = sanitizeDiagnosticText(body).replace(/\s+/g, " ").trim().slice(0, 200);
43429
+ return excerpt ? `: ${excerpt}` : "";
43430
+ }
43431
+ recordFailure(isProbe, failure) {
43432
+ if (failure)
43433
+ this.lastFailureReason = failure;
42816
43434
  if (isProbe) {
42817
43435
  this.circuitOpenUntil = Date.now() + OPEN_DURATION_MS;
42818
43436
  if (!this.openLogged) {
42819
- log(`[magic-context] openai-compatible embedding: probe failed, re-opening circuit for ${OPEN_DURATION_MS / 60000}min`);
43437
+ log(`[magic-context] openai-compatible embedding: probe failed (${failure?.reason ?? this.lastFailureReason?.reason ?? "unknown failure"}), re-opening circuit for ${OPEN_DURATION_MS / 60000}min`);
42820
43438
  this.openLogged = true;
42821
43439
  }
42822
43440
  this.failureTimes = [];
@@ -42829,7 +43447,7 @@ class OpenAICompatibleEmbeddingProvider {
42829
43447
  if (this.failureTimes.length >= FAILURE_THRESHOLD) {
42830
43448
  this.circuitOpenUntil = now + OPEN_DURATION_MS;
42831
43449
  if (!this.openLogged) {
42832
- log(`[magic-context] openai-compatible embedding: opening circuit for ${OPEN_DURATION_MS / 60000}min after ${this.failureTimes.length} failures in ${FAILURE_WINDOW_MS / 1000}s`);
43450
+ log(`[magic-context] openai-compatible embedding: opening circuit for ${OPEN_DURATION_MS / 60000}min after ${this.failureTimes.length} failures in ${FAILURE_WINDOW_MS / 1000}s (${failure?.reason ?? this.lastFailureReason?.reason ?? "unknown failure"})`);
42833
43451
  this.openLogged = true;
42834
43452
  }
42835
43453
  this.failureTimes = [];
@@ -42842,6 +43460,10 @@ class OpenAICompatibleEmbeddingProvider {
42842
43460
  this.failureTimes = [];
42843
43461
  this.circuitOpenUntil = 0;
42844
43462
  this.openLogged = false;
43463
+ this.lastFailureReason = null;
43464
+ }
43465
+ getLastFailureReason() {
43466
+ return this.lastFailureReason;
42845
43467
  }
42846
43468
  _getCircuitState() {
42847
43469
  if (this.circuitOpenUntil === 0)
@@ -42859,6 +43481,7 @@ class OpenAICompatibleEmbeddingProvider {
42859
43481
  this.circuitOpenUntil = 0;
42860
43482
  this.openLogged = false;
42861
43483
  this.halfOpenProbeInFlight = false;
43484
+ this.lastFailureReason = null;
42862
43485
  }
42863
43486
  }
42864
43487
 
@@ -43315,6 +43938,25 @@ function invalidateMemory(projectPath, memoryId) {
43315
43938
  }
43316
43939
  }
43317
43940
 
43941
+ // ../plugin/src/features/magic-context/memory/embedding-failure.ts
43942
+ function dominantEmbeddingFailure(failures) {
43943
+ const counts = new Map;
43944
+ for (const failure of failures) {
43945
+ const key = `${failure.class}\x00${failure.reason}`;
43946
+ const current = counts.get(key);
43947
+ if (current)
43948
+ current.count += 1;
43949
+ else
43950
+ counts.set(key, { failure, count: 1 });
43951
+ }
43952
+ let dominant;
43953
+ for (const candidate of counts.values()) {
43954
+ if (!dominant || candidate.count > dominant.count)
43955
+ dominant = candidate;
43956
+ }
43957
+ return dominant?.failure;
43958
+ }
43959
+
43318
43960
  // ../plugin/src/features/magic-context/session-project-storage.ts
43319
43961
  var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;
43320
43962
  var upsertSessionProjectStatements = new WeakMap;
@@ -44426,11 +45068,16 @@ async function drainCommitBacklogForProject(db, projectIdentity, deadline) {
44426
45068
  }
44427
45069
  return total;
44428
45070
  }
45071
+ function getLastEmbeddingFailureForProject(projectIdentity) {
45072
+ const registration = projectRegistrations.get(projectIdentity);
45073
+ return registration?.provider?.getLastFailureReason?.() ?? null;
45074
+ }
44429
45075
  async function embedCandidateChunkBatch(db, projectIdentity, modelId, candidates, signal) {
44430
45076
  const noWork = [];
44431
45077
  const failed = [];
45078
+ const failureReasons = [];
44432
45079
  if (candidates.length === 0)
44433
- return { embedded: 0, noWork, failed };
45080
+ return { embedded: 0, noWork, failed, failureReasons };
44434
45081
  const maxInputTokens = getProjectEmbeddingMaxInputTokens(projectIdentity);
44435
45082
  const prepared = [];
44436
45083
  for (const candidate of candidates) {
@@ -44447,7 +45094,7 @@ async function embedCandidateChunkBatch(db, projectIdentity, modelId, candidates
44447
45094
  prepared.push({ candidate, windows });
44448
45095
  }
44449
45096
  if (prepared.length === 0)
44450
- return { embedded: 0, noWork, failed };
45097
+ return { embedded: 0, noWork, failed, failureReasons };
44451
45098
  let embedded = 0;
44452
45099
  let i = 0;
44453
45100
  while (i < prepared.length) {
@@ -44479,6 +45126,11 @@ async function embedCandidateChunkBatch(db, projectIdentity, modelId, candidates
44479
45126
  }
44480
45127
  if (signal?.aborted)
44481
45128
  break;
45129
+ if (!result || result.vectors.size === 0) {
45130
+ const failure = getLastEmbeddingFailureForProject(projectIdentity);
45131
+ if (failure)
45132
+ failureReasons.push(failure);
45133
+ }
44482
45134
  if (result) {
44483
45135
  for (const item of slice) {
44484
45136
  if (persistedIds.has(item.candidate.id))
@@ -44520,7 +45172,7 @@ async function embedCandidateChunkBatch(db, projectIdentity, modelId, candidates
44520
45172
  }
44521
45173
  }
44522
45174
  }
44523
- return { embedded, noWork, failed };
45175
+ return { embedded, noWork, failed, failureReasons };
44524
45176
  }
44525
45177
  async function embedSessionCompartmentChunks(db, projectIdentity, sessionId, options) {
44526
45178
  const snapshot = getProjectEmbeddingSnapshot(projectIdentity);
@@ -44558,6 +45210,7 @@ async function embedSessionCompartmentChunks(db, projectIdentity, sessionId, opt
44558
45210
  let aborted2 = false;
44559
45211
  let providerDown = false;
44560
45212
  let consecutiveFailedBatches = 0;
45213
+ const failureReasons = [];
44561
45214
  try {
44562
45215
  options?.onProgress?.({ embedded, total });
44563
45216
  for (;; ) {
@@ -44571,7 +45224,8 @@ async function embedSessionCompartmentChunks(db, projectIdentity, sessionId, opt
44571
45224
  const {
44572
45225
  embedded: n,
44573
45226
  noWork,
44574
- failed
45227
+ failed,
45228
+ failureReasons: batchFailureReasons
44575
45229
  } = await embedCandidateChunkBatch(db, projectIdentity, snapshot.chunkModelId, candidates, drainAbort.signal);
44576
45230
  if (leaseLost || !renewGitSweepLease(db, projectIdentity, holderId)) {
44577
45231
  leaseLost = true;
@@ -44579,6 +45233,7 @@ async function embedSessionCompartmentChunks(db, projectIdentity, sessionId, opt
44579
45233
  aborted2 = true;
44580
45234
  break;
44581
45235
  }
45236
+ failureReasons.push(...batchFailureReasons);
44582
45237
  for (const id of noWork)
44583
45238
  skipIds.push(id);
44584
45239
  for (const id of failed)
@@ -44610,7 +45265,14 @@ async function embedSessionCompartmentChunks(db, projectIdentity, sessionId, opt
44610
45265
  if (providerDown || failedIds.length > 0) {
44611
45266
  const remaining = Math.max(0, countUnembeddedSessionCompartments(db, projectIdentity, sessionId, snapshot.chunkModelId) - skipIds.length);
44612
45267
  if (remaining > 0) {
44613
- return { status: "stalled", embedded, total, remaining, failed: failedIds.length };
45268
+ return {
45269
+ status: "stalled",
45270
+ embedded,
45271
+ total,
45272
+ remaining,
45273
+ failed: failedIds.length,
45274
+ failure: dominantEmbeddingFailure(failureReasons)
45275
+ };
44614
45276
  }
44615
45277
  }
44616
45278
  return { status: "done", embedded, total, failed: failedIds.length };
@@ -45561,7 +46223,7 @@ function unwrapImitatedReducedArgs(args, primaryFields, schema) {
45561
46223
  return args;
45562
46224
  }
45563
46225
 
45564
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/memory.mjs
46226
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/memory.mjs
45565
46227
  var exports_memory = {};
45566
46228
  __export(exports_memory, {
45567
46229
  Assign: () => Assign,
@@ -45572,7 +46234,7 @@ __export(exports_memory, {
45572
46234
  Update: () => Update
45573
46235
  });
45574
46236
 
45575
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/metrics.mjs
46237
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/metrics.mjs
45576
46238
  var Metrics = {
45577
46239
  assign: 0,
45578
46240
  create: 0,
@@ -45581,12 +46243,12 @@ var Metrics = {
45581
46243
  update: 0
45582
46244
  };
45583
46245
 
45584
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/assign.mjs
46246
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/assign.mjs
45585
46247
  function Assign(left, right) {
45586
46248
  Metrics.assign += 1;
45587
46249
  return { ...left, ...right };
45588
46250
  }
45589
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/guard.mjs
46251
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/guard/guard.mjs
45590
46252
  var exports_guard = {};
45591
46253
  __export(exports_guard, {
45592
46254
  Entries: () => Entries,
@@ -45626,10 +46288,16 @@ __export(exports_guard, {
45626
46288
  Values: () => Values
45627
46289
  });
45628
46290
 
45629
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/string.mjs
46291
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/guard/string.mjs
45630
46292
  function IsBetween(value, min, max) {
45631
46293
  return value >= min && value <= max;
45632
46294
  }
46295
+ function IsZeroWidthJoiner(value) {
46296
+ return value === 8205;
46297
+ }
46298
+ function IsHighSurrogate(value) {
46299
+ return IsBetween(value, 55296, 56319);
46300
+ }
45633
46301
  function IsRegionalIndicator(value) {
45634
46302
  return IsBetween(value, 127462, 127487);
45635
46303
  }
@@ -45668,7 +46336,7 @@ function NextGraphemeClusterIndex(value, clusterStart) {
45668
46336
  return clusterEnd;
45669
46337
  }
45670
46338
  function IsGraphemeCodePoint(value) {
45671
- return IsBetween(value, 55296, 56319) || IsBetween(value, 768, 879) || value === 8205;
46339
+ return IsHighSurrogate(value) || IsCombiningMark(value) || IsVariationSelector(value) || IsZeroWidthJoiner(value);
45672
46340
  }
45673
46341
  function GraphemeCount(value) {
45674
46342
  let count = 0;
@@ -45730,7 +46398,7 @@ function IsMaxLengthFast(value, maxLength) {
45730
46398
  return true;
45731
46399
  }
45732
46400
 
45733
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/guard.mjs
46401
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/guard/guard.mjs
45734
46402
  function IsArray(value) {
45735
46403
  return Array.isArray(value);
45736
46404
  }
@@ -45802,7 +46470,7 @@ function IsMultipleOf(dividend, divisor) {
45802
46470
  if (IsInteger(dividend) && 1 / divisor % 1 === 0)
45803
46471
  return true;
45804
46472
  const mod = dividend % divisor;
45805
- return Math.min(Math.abs(mod), Math.abs(mod - divisor)) < tolerance;
46473
+ return Math.min(Math.abs(mod), Math.abs(mod - divisor), Math.abs(mod + divisor)) < tolerance;
45806
46474
  }
45807
46475
  function IsClassInstance(value) {
45808
46476
  if (!IsObject(value))
@@ -45875,7 +46543,7 @@ function DeepEqualArray(left, right) {
45875
46543
  function IsDeepEqual(left, right) {
45876
46544
  return IsArray(left) ? DeepEqualArray(left, right) : IsObject(left) ? DeepEqualObject(left, right) : IsEqual(left, right);
45877
46545
  }
45878
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/globals.mjs
46546
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/guard/globals.mjs
45879
46547
  var exports_globals = {};
45880
46548
  __export(exports_globals, {
45881
46549
  IsBigInt64Array: () => IsBigInt64Array,
@@ -45955,7 +46623,7 @@ function IsSet(value) {
45955
46623
  function IsMap(value) {
45956
46624
  return value instanceof globalThis.Map;
45957
46625
  }
45958
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/clone.mjs
46626
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/clone.mjs
45959
46627
  function FromClassInstance(value) {
45960
46628
  return value;
45961
46629
  }
@@ -46012,7 +46680,7 @@ function Clone(value) {
46012
46680
  Metrics.clone += 1;
46013
46681
  return FromValue(value);
46014
46682
  }
46015
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/settings/settings.mjs
46683
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/settings/settings.mjs
46016
46684
  var exports_settings = {};
46017
46685
  __export(exports_settings, {
46018
46686
  Get: () => Get,
@@ -46048,7 +46716,7 @@ function Set2(options) {
46048
46716
  function Get() {
46049
46717
  return settings;
46050
46718
  }
46051
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/create.mjs
46719
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/create.mjs
46052
46720
  function MergeHidden(left, right) {
46053
46721
  for (const key of Object.keys(right)) {
46054
46722
  Object.defineProperty(left, key, {
@@ -46070,7 +46738,7 @@ function Create(hidden, enumerable, options = {}) {
46070
46738
  const withHidden = settings2.enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
46071
46739
  return settings2.immutableTypes ? Object.freeze(withHidden) : withHidden;
46072
46740
  }
46073
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/discard.mjs
46741
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/discard.mjs
46074
46742
  function Discard(value, propertyKeys) {
46075
46743
  Metrics.discard += 1;
46076
46744
  const result = {};
@@ -46083,7 +46751,7 @@ function Discard(value, propertyKeys) {
46083
46751
  }
46084
46752
  return result;
46085
46753
  }
46086
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/update.mjs
46754
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/memory/update.mjs
46087
46755
  function Update(current, hidden, enumerable) {
46088
46756
  Metrics.update += 1;
46089
46757
  const settings2 = exports_settings.Get();
@@ -46106,7 +46774,7 @@ function Update(current, hidden, enumerable) {
46106
46774
  }
46107
46775
  return result;
46108
46776
  }
46109
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/schema.mjs
46777
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/schema.mjs
46110
46778
  function IsKind(value, kind) {
46111
46779
  return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~kind") && exports_guard.IsEqual(value["~kind"], kind);
46112
46780
  }
@@ -46114,7 +46782,7 @@ function IsSchema(value) {
46114
46782
  return exports_guard.IsObject(value);
46115
46783
  }
46116
46784
 
46117
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/deferred.mjs
46785
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/deferred.mjs
46118
46786
  function Deferred(action, parameters, options) {
46119
46787
  return exports_memory.Create({ "~kind": "Deferred" }, { type: "deferred", action, parameters, options }, {});
46120
46788
  }
@@ -46122,7 +46790,7 @@ function IsDeferred(value) {
46122
46790
  return IsKind(value, "Deferred");
46123
46791
  }
46124
46792
 
46125
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs
46793
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs
46126
46794
  function AddReadonlyOperation(type) {
46127
46795
  return exports_memory.Update(type, { "~readonly": true }, {});
46128
46796
  }
@@ -46135,7 +46803,7 @@ function AddReadonlyInstantiate(context, state, type, options) {
46135
46803
  return AddReadonlyAction(instantiatedType, options);
46136
46804
  }
46137
46805
 
46138
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs
46806
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs
46139
46807
  function AddOptionalOperation(type) {
46140
46808
  return exports_memory.Update(type, { "~optional": true }, {});
46141
46809
  }
@@ -46148,7 +46816,7 @@ function AddOptionalInstantiate(context, state, type, options) {
46148
46816
  return AddOptionalAction(instantiatedType, options);
46149
46817
  }
46150
46818
 
46151
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/array.mjs
46819
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/array.mjs
46152
46820
  function _Array_(items, options) {
46153
46821
  return exports_memory.Create({ "~kind": "Array" }, { type: "array", items }, options);
46154
46822
  }
@@ -46159,7 +46827,7 @@ function ArrayOptions(type) {
46159
46827
  return exports_memory.Discard(type, ["~kind", "type", "items"]);
46160
46828
  }
46161
46829
 
46162
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/constructor.mjs
46830
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/constructor.mjs
46163
46831
  function Constructor(parameters, instanceType, options = {}) {
46164
46832
  return exports_memory.Create({ "~kind": "Constructor" }, { type: "constructor", parameters, instanceType }, options);
46165
46833
  }
@@ -46170,7 +46838,7 @@ function ConstructorOptions(type) {
46170
46838
  return exports_memory.Discard(type, ["~kind", "type", "parameters", "instanceType"]);
46171
46839
  }
46172
46840
 
46173
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/function.mjs
46841
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/function.mjs
46174
46842
  function _Function_(parameters, returnType, options = {}) {
46175
46843
  return exports_memory.Create({ ["~kind"]: "Function" }, { type: "function", parameters, returnType }, options);
46176
46844
  }
@@ -46181,7 +46849,7 @@ function FunctionOptions(type) {
46181
46849
  return exports_memory.Discard(type, ["~kind", "type", "parameters", "returnType"]);
46182
46850
  }
46183
46851
 
46184
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/ref.mjs
46852
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/ref.mjs
46185
46853
  function Ref(ref, options) {
46186
46854
  return exports_memory.Create({ ["~kind"]: "Ref" }, { $ref: ref }, options);
46187
46855
  }
@@ -46189,7 +46857,7 @@ function IsRef(value) {
46189
46857
  return IsKind(value, "Ref");
46190
46858
  }
46191
46859
 
46192
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/generic.mjs
46860
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/generic.mjs
46193
46861
  function Generic(parameters, expression) {
46194
46862
  return exports_memory.Create({ "~kind": "Generic" }, { type: "generic", parameters, expression });
46195
46863
  }
@@ -46197,7 +46865,7 @@ function IsGeneric(value) {
46197
46865
  return IsKind(value, "Generic");
46198
46866
  }
46199
46867
 
46200
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/any.mjs
46868
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/any.mjs
46201
46869
  function Any(options) {
46202
46870
  return exports_memory.Create({ ["~kind"]: "Any" }, {}, options);
46203
46871
  }
@@ -46205,7 +46873,7 @@ function IsAny(value) {
46205
46873
  return IsKind(value, "Any");
46206
46874
  }
46207
46875
 
46208
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/never.mjs
46876
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/never.mjs
46209
46877
  var NeverPattern = "(?!)";
46210
46878
  function Never(options) {
46211
46879
  return exports_memory.Create({ "~kind": "Never" }, { not: {} }, options);
@@ -46214,7 +46882,7 @@ function IsNever(value) {
46214
46882
  return IsKind(value, "Never");
46215
46883
  }
46216
46884
 
46217
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_add_optional.mjs
46885
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/_add_optional.mjs
46218
46886
  function AddOptionalDeferred(type, options = {}) {
46219
46887
  return Deferred("AddOptional", [type], options);
46220
46888
  }
@@ -46222,7 +46890,7 @@ function AddOptional(type, options = {}) {
46222
46890
  return AddOptionalAction(type, options);
46223
46891
  }
46224
46892
 
46225
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_optional.mjs
46893
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/_optional.mjs
46226
46894
  function Optional(type) {
46227
46895
  return AddOptional(type);
46228
46896
  }
@@ -46230,7 +46898,7 @@ function IsOptional(value) {
46230
46898
  return IsSchema(value) && exports_guard.HasPropertyKey(value, "~optional");
46231
46899
  }
46232
46900
 
46233
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/properties.mjs
46901
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/properties.mjs
46234
46902
  function RequiredArray(properties) {
46235
46903
  return exports_guard.Keys(properties).filter((key) => !IsOptional(properties[key]));
46236
46904
  }
@@ -46241,7 +46909,7 @@ function PropertyValues(properties) {
46241
46909
  return exports_guard.Values(properties);
46242
46910
  }
46243
46911
 
46244
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/object.mjs
46912
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/object.mjs
46245
46913
  function _Object_(properties, options = {}) {
46246
46914
  const requiredKeys = RequiredArray(properties);
46247
46915
  const required2 = requiredKeys.length > 0 ? { required: requiredKeys } : {};
@@ -46254,7 +46922,7 @@ function ObjectOptions(type) {
46254
46922
  return exports_memory.Discard(type, ["~kind", "type", "properties", "required"]);
46255
46923
  }
46256
46924
 
46257
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/unknown.mjs
46925
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/unknown.mjs
46258
46926
  function Unknown(options) {
46259
46927
  return exports_memory.Create({ ["~kind"]: "Unknown" }, {}, options);
46260
46928
  }
@@ -46262,7 +46930,7 @@ function IsUnknown(value) {
46262
46930
  return IsKind(value, "Unknown");
46263
46931
  }
46264
46932
 
46265
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/cyclic.mjs
46933
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/cyclic.mjs
46266
46934
  function Cyclic($defs, $ref, options) {
46267
46935
  const defs = exports_guard.Keys($defs).reduce((result, key) => {
46268
46936
  return { ...result, [key]: exports_memory.Update($defs[key], {}, { $id: key }) };
@@ -46273,7 +46941,7 @@ function IsCyclic(value) {
46273
46941
  return IsKind(value, "Cyclic");
46274
46942
  }
46275
46943
 
46276
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/unsafe.mjs
46944
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/unsafe.mjs
46277
46945
  function Unsafe(schema) {
46278
46946
  return exports_memory.Update(schema, { ["~unsafe"]: null }, {});
46279
46947
  }
@@ -46281,7 +46949,7 @@ function IsUnsafe(value) {
46281
46949
  return exports_guard.IsObjectNotArray(value) && exports_guard.HasPropertyKey(value, "~unsafe") && exports_guard.IsNull(value["~unsafe"]);
46282
46950
  }
46283
46951
 
46284
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/arguments/arguments.mjs
46952
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/arguments/arguments.mjs
46285
46953
  var exports_arguments = {};
46286
46954
  __export(exports_arguments, {
46287
46955
  Match: () => Match
@@ -46291,7 +46959,7 @@ function Match(args, match) {
46291
46959
  throw Error("Invalid Arguments");
46292
46960
  })();
46293
46961
  }
46294
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/infer.mjs
46962
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/infer.mjs
46295
46963
  function Infer(...args) {
46296
46964
  const [name, extends_] = exports_arguments.Match(args, {
46297
46965
  2: (name2, extends_2) => [name2, extends_2, extends_2],
@@ -46303,7 +46971,7 @@ function IsInfer(value) {
46303
46971
  return IsKind(value, "Infer");
46304
46972
  }
46305
46973
 
46306
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/dependent.mjs
46974
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/dependent.mjs
46307
46975
  function Dependent(if_, then_, else_, options = {}) {
46308
46976
  return exports_memory.Create({ "~kind": "Dependent" }, { if: if_, then: then_, else: else_ }, options);
46309
46977
  }
@@ -46314,7 +46982,7 @@ function DependentOptions(type) {
46314
46982
  return exports_memory.Discard(type, ["~kind", "if", "then", "else"]);
46315
46983
  }
46316
46984
 
46317
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs
46985
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs
46318
46986
  function IsTypeScriptEnumLike(value) {
46319
46987
  return exports_guard.IsObjectNotArray(value);
46320
46988
  }
@@ -46323,7 +46991,10 @@ function TypeScriptEnumToEnumValues(type) {
46323
46991
  return keys.reduce((result, key) => [...result, type[key]], []);
46324
46992
  }
46325
46993
 
46326
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/enum.mjs
46994
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/enum.mjs
46995
+ function IsEnumValue(value) {
46996
+ return exports_guard.IsString(value) || exports_guard.IsNumber(value);
46997
+ }
46327
46998
  function Enum(value, options) {
46328
46999
  const values = IsTypeScriptEnumLike(value) ? TypeScriptEnumToEnumValues(value) : value;
46329
47000
  return exports_memory.Create({ "~kind": "Enum" }, { enum: values }, options);
@@ -46332,7 +47003,7 @@ function IsEnum(value) {
46332
47003
  return IsKind(value, "Enum");
46333
47004
  }
46334
47005
 
46335
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/intersect.mjs
47006
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/intersect.mjs
46336
47007
  function Intersect(types, options = {}) {
46337
47008
  return exports_memory.Create({ "~kind": "Intersect" }, { allOf: types }, options);
46338
47009
  }
@@ -46342,11 +47013,11 @@ function IsIntersect(value) {
46342
47013
  function IntersectOptions(type) {
46343
47014
  return exports_memory.Discard(type, ["~kind", "allOf"]);
46344
47015
  }
46345
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/unreachable/unreachable.mjs
47016
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/unreachable/unreachable.mjs
46346
47017
  function Unreachable() {
46347
47018
  throw new Error("Unreachable");
46348
47019
  }
46349
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/hashing/hash.mjs
47020
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/system/hashing/hash.mjs
46350
47021
  var ByteMarker;
46351
47022
  (function(ByteMarker2) {
46352
47023
  ByteMarker2[ByteMarker2["Array"] = 0] = "Array";
@@ -46371,7 +47042,7 @@ var F64 = new Float64Array(1);
46371
47042
  var F64In = new DataView(F64.buffer);
46372
47043
  var F64Out = new Uint8Array(F64.buffer);
46373
47044
  var encoder2 = new TextEncoder;
46374
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_codec.mjs
47045
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/_codec.mjs
46375
47046
  class EncodeBuilder {
46376
47047
  constructor(type, decode3) {
46377
47048
  this.type = type;
@@ -46410,14 +47081,14 @@ function Encode(type, callback) {
46410
47081
  function IsCodec(value) {
46411
47082
  return IsSchema(value) && exports_guard.HasPropertyKey(value, "~codec") && exports_guard.IsObject(value["~codec"]) && exports_guard.HasPropertyKey(value["~codec"], "encode") && exports_guard.HasPropertyKey(value["~codec"], "decode");
46412
47083
  }
46413
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_immutable.mjs
47084
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/_immutable.mjs
46414
47085
  function Immutable(type) {
46415
47086
  return AddImmutable(type);
46416
47087
  }
46417
47088
  function IsImmutable(value) {
46418
47089
  return IsSchema(value) && exports_guard.HasPropertyKey(value, "~immutable");
46419
47090
  }
46420
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_add_readonly.mjs
47091
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/_add_readonly.mjs
46421
47092
  function AddReadonlyDeferred(type, options = {}) {
46422
47093
  return Deferred("AddReadonly", [type], options);
46423
47094
  }
@@ -46425,14 +47096,14 @@ function AddReadonly(type, options = {}) {
46425
47096
  return AddReadonlyAction(type, options);
46426
47097
  }
46427
47098
 
46428
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_readonly.mjs
47099
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/_readonly.mjs
46429
47100
  function Readonly(type) {
46430
47101
  return AddReadonly(type);
46431
47102
  }
46432
47103
  function IsReadonly(value) {
46433
47104
  return IsSchema(value) && exports_guard.HasPropertyKey(value, "~readonly");
46434
47105
  }
46435
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_refine.mjs
47106
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/_refine.mjs
46436
47107
  function RefineAdd(type, refinement) {
46437
47108
  const refinements = IsRefine(type) ? [...type["~refine"], refinement] : [refinement];
46438
47109
  return exports_memory.Update(type, { "~refine": refinements }, {});
@@ -46450,7 +47121,7 @@ function IsRefinement(value) {
46450
47121
  function IsRefine(value) {
46451
47122
  return IsSchema(value) && exports_guard.HasPropertyKey(value, "~refine") && exports_guard.IsArray(value["~refine"]) && exports_guard.Every(value["~refine"], 0, (value2) => IsRefinement(value2));
46452
47123
  }
46453
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/bigint.mjs
47124
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/bigint.mjs
46454
47125
  var BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
46455
47126
  function BigInt2(options) {
46456
47127
  return exports_memory.Create({ "~kind": "BigInt" }, { type: "bigint" }, options);
@@ -46458,21 +47129,21 @@ function BigInt2(options) {
46458
47129
  function IsBigInt2(value) {
46459
47130
  return IsKind(value, "BigInt");
46460
47131
  }
46461
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/boolean.mjs
47132
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/boolean.mjs
46462
47133
  function Boolean2(options) {
46463
47134
  return exports_memory.Create({ "~kind": "Boolean" }, { type: "boolean" }, options);
46464
47135
  }
46465
47136
  function IsBoolean3(value) {
46466
47137
  return IsKind(value, "Boolean");
46467
47138
  }
46468
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/identifier.mjs
47139
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/identifier.mjs
46469
47140
  function Identifier(name) {
46470
47141
  return exports_memory.Create({ "~kind": "Identifier" }, { name });
46471
47142
  }
46472
47143
  function IsIdentifier(value) {
46473
47144
  return IsKind(value, "Identifier");
46474
47145
  }
46475
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/integer.mjs
47146
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/integer.mjs
46476
47147
  var IntegerPattern = "-?(?:0|[1-9][0-9]*)";
46477
47148
  function Integer(options) {
46478
47149
  return exports_memory.Create({ "~kind": "Integer" }, { type: "integer" }, options);
@@ -46480,7 +47151,7 @@ function Integer(options) {
46480
47151
  function IsInteger2(value) {
46481
47152
  return IsKind(value, "Integer");
46482
47153
  }
46483
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/literal.mjs
47154
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/literal.mjs
46484
47155
  class InvalidLiteralValue extends Error {
46485
47156
  constructor(value) {
46486
47157
  super(`Invalid Literal value`);
@@ -46512,14 +47183,14 @@ function IsLiteralString(value) {
46512
47183
  function IsLiteral(value) {
46513
47184
  return IsKind(value, "Literal");
46514
47185
  }
46515
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/null.mjs
47186
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/null.mjs
46516
47187
  function Null(options) {
46517
47188
  return exports_memory.Create({ "~kind": "Null" }, { type: "null" }, options);
46518
47189
  }
46519
47190
  function IsNull2(value) {
46520
47191
  return IsKind(value, "Null");
46521
47192
  }
46522
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/number.mjs
47193
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/number.mjs
46523
47194
  var NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
46524
47195
  function Number2(options) {
46525
47196
  return exports_memory.Create({ "~kind": "Number" }, { type: "number" }, options);
@@ -46527,14 +47198,14 @@ function Number2(options) {
46527
47198
  function IsNumber3(value) {
46528
47199
  return IsKind(value, "Number");
46529
47200
  }
46530
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/symbol.mjs
47201
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/symbol.mjs
46531
47202
  function Symbol2(options) {
46532
47203
  return exports_memory.Create({ "~kind": "Symbol" }, { type: "symbol" }, options);
46533
47204
  }
46534
47205
  function IsSymbol2(value) {
46535
47206
  return IsKind(value, "Symbol");
46536
47207
  }
46537
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/parameter.mjs
47208
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/parameter.mjs
46538
47209
  function Parameter(...args) {
46539
47210
  const [name, extends_, equals] = exports_arguments.Match(args, {
46540
47211
  3: (name2, extends_2, equals2) => [name2, extends_2, equals2],
@@ -46546,7 +47217,7 @@ function Parameter(...args) {
46546
47217
  function IsParameter(value) {
46547
47218
  return IsKind(value, "Parameter");
46548
47219
  }
46549
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/string.mjs
47220
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/string.mjs
46550
47221
  var StringPattern = ".*";
46551
47222
  function String2(options) {
46552
47223
  return exports_memory.Create({ "~kind": "String" }, { type: "string" }, options);
@@ -46555,7 +47226,7 @@ function IsString3(value) {
46555
47226
  return IsKind(value, "String");
46556
47227
  }
46557
47228
 
46558
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/union.mjs
47229
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/union.mjs
46559
47230
  function Union(anyOf, options = {}) {
46560
47231
  return exports_memory.Create({ "~kind": "Union" }, { anyOf }, options);
46561
47232
  }
@@ -46566,14 +47237,14 @@ function UnionOptions(type) {
46566
47237
  return exports_memory.Discard(type, ["~kind", "anyOf"]);
46567
47238
  }
46568
47239
 
46569
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/patterns/pattern.mjs
47240
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/patterns/pattern.mjs
46570
47241
  function ParsePatternIntoTypes(pattern) {
46571
47242
  const parsed = Pattern(pattern);
46572
47243
  const result = exports_guard.IsEqual(parsed.length, 2) ? parsed[0] : [];
46573
47244
  return result;
46574
47245
  }
46575
47246
 
46576
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
47247
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
46577
47248
  function FromLiteral(_value) {
46578
47249
  return true;
46579
47250
  }
@@ -46592,12 +47263,12 @@ function IsTemplateLiteralFinite(types) {
46592
47263
  return result;
46593
47264
  }
46594
47265
 
46595
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/create.mjs
47266
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/template_literal/create.mjs
46596
47267
  function TemplateLiteralCreate(pattern) {
46597
47268
  return exports_memory.Create({ ["~kind"]: "TemplateLiteral" }, { type: "string", pattern }, {});
46598
47269
  }
46599
47270
 
46600
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/decode.mjs
47271
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/template_literal/decode.mjs
46601
47272
  function FromLiteralPush(variants, value, result = []) {
46602
47273
  return exports_guard.ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
46603
47274
  }
@@ -46637,24 +47308,24 @@ function TemplateLiteralDecode(pattern) {
46637
47308
  return result;
46638
47309
  }
46639
47310
 
46640
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/record_create.mjs
47311
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/record_create.mjs
46641
47312
  function CreateRecord(key, value) {
46642
47313
  const type = "object";
46643
47314
  const patternProperties = { [key]: value };
46644
47315
  return exports_memory.Create({ ["~kind"]: "Record" }, { type, patternProperties });
46645
47316
  }
46646
47317
 
46647
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_any.mjs
47318
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_any.mjs
46648
47319
  function FromAnyKey(value) {
46649
47320
  return CreateRecord(StringKey, value);
46650
47321
  }
46651
47322
 
46652
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
47323
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
46653
47324
  function FromBooleanKey(value) {
46654
47325
  return _Object_({ true: value, false: value });
46655
47326
  }
46656
47327
 
46657
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/tuple.mjs
47328
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/tuple.mjs
46658
47329
  function Tuple(types, options = {}) {
46659
47330
  const [items, minItems, additionalItems] = [types, types.length, false];
46660
47331
  return exports_memory.Create({ ["~kind"]: "Tuple" }, { type: "array", additionalItems, items, minItems }, options);
@@ -46666,7 +47337,7 @@ function TupleOptions(type) {
46666
47337
  return exports_memory.Discard(type, ["~kind", "type", "items", "minItems", "additionalItems"]);
46667
47338
  }
46668
47339
 
46669
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs
47340
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs
46670
47341
  function RemoveReadonlyOperation(type) {
46671
47342
  return exports_memory.Discard(type, ["~readonly"]);
46672
47343
  }
@@ -46679,7 +47350,7 @@ function RemoveReadonlyInstantiate(context, state, type, options) {
46679
47350
  return RemoveReadonlyAction(instantiatedType, options);
46680
47351
  }
46681
47352
 
46682
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_remove_readonly.mjs
47353
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/_remove_readonly.mjs
46683
47354
  function RemoveReadonlyDeferred(type, options = {}) {
46684
47355
  return Deferred("RemoveReadonly", [type], options);
46685
47356
  }
@@ -46687,7 +47358,7 @@ function RemoveReadonly(type, options = {}) {
46687
47358
  return RemoveReadonlyAction(type, options);
46688
47359
  }
46689
47360
 
46690
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs
47361
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs
46691
47362
  function RemoveOptionalOperation(type) {
46692
47363
  return exports_memory.Discard(type, ["~optional"]);
46693
47364
  }
@@ -46700,7 +47371,7 @@ function RemoveOptionalInstantiate(context, state, type, options) {
46700
47371
  return RemoveOptionalAction(instantiatedType, options);
46701
47372
  }
46702
47373
 
46703
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_remove_optional.mjs
47374
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/_remove_optional.mjs
46704
47375
  function RemoveOptionalDeferred(type, options = {}) {
46705
47376
  return Deferred("RemoveOptional", [type], options);
46706
47377
  }
@@ -46708,7 +47379,7 @@ function RemoveOptional(type, options = {}) {
46708
47379
  return RemoveOptionalAction(type, options);
46709
47380
  }
46710
47381
 
46711
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/tuple/to_object.mjs
47382
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/tuple/to_object.mjs
46712
47383
  function TupleElementsToProperties(types) {
46713
47384
  const result = types.reduceRight((result2, right, index) => {
46714
47385
  return { [index]: right, ...result2 };
@@ -46721,7 +47392,7 @@ function TupleToObject(type) {
46721
47392
  return result;
46722
47393
  }
46723
47394
 
46724
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/composite.mjs
47395
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/composite.mjs
46725
47396
  function IsReadonlyProperty(left, right) {
46726
47397
  return IsReadonly(left) ? IsReadonly(right) ? true : false : false;
46727
47398
  }
@@ -46755,13 +47426,13 @@ function Composite(left, right) {
46755
47426
  return _Object_(properties);
46756
47427
  }
46757
47428
 
46758
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
47429
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
46759
47430
  function Narrow(left, right) {
46760
47431
  const result = Compare(left, right);
46761
47432
  return exports_guard.IsEqual(result, ResultLeftInside) ? left : exports_guard.IsEqual(result, ResultRightInside) ? right : exports_guard.IsEqual(result, ResultEqual) ? right : Never();
46762
47433
  }
46763
47434
 
46764
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
47435
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
46765
47436
  function IsObjectLike(type) {
46766
47437
  return IsObject2(type) || IsTuple(type);
46767
47438
  }
@@ -46790,7 +47461,7 @@ function Distribute(types, result = []) {
46790
47461
  return exports_guard.ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute(right, DistributeUnion(left.anyOf, result)) : Distribute(right, DistributeType(left, result)), () => result);
46791
47462
  }
46792
47463
 
46793
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/exclude/operation.mjs
47464
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/exclude/operation.mjs
46794
47465
  function ExcludeType(left, right) {
46795
47466
  const check2 = Extends({}, left, right);
46796
47467
  const result = exports_result.IsExtendsTrueLike(check2) ? [] : [left];
@@ -46809,7 +47480,7 @@ function ExcludeOperation(left, right) {
46809
47480
  return result;
46810
47481
  }
46811
47482
 
46812
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
47483
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
46813
47484
  function EvaluateDependent(if_, then_, else_) {
46814
47485
  const intersect = Intersect([if_, then_]);
46815
47486
  const excluded = ExcludeOperation(else_, if_);
@@ -46844,43 +47515,43 @@ function EvaluateUnionFast(types) {
46844
47515
  return result;
46845
47516
  }
46846
47517
 
46847
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
47518
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
46848
47519
  function FromEnumKey(values, value) {
46849
47520
  const unionKey = EvaluateEnum(values);
46850
47521
  const result = FromKey(unionKey, value);
46851
47522
  return result;
46852
47523
  }
46853
47524
 
46854
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
47525
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
46855
47526
  function FromIntegerKey(_key, value) {
46856
47527
  const result = CreateRecord(IntegerKey, value);
46857
47528
  return result;
46858
47529
  }
46859
47530
 
46860
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
47531
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
46861
47532
  function FromIntersectKey(types, value) {
46862
47533
  const evaluatedKey = EvaluateIntersect(types);
46863
47534
  const result = FromKey(evaluatedKey, value);
46864
47535
  return result;
46865
47536
  }
46866
47537
 
46867
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
47538
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
46868
47539
  function FromLiteralKey(key, value) {
46869
47540
  return exports_guard.IsString(key) || exports_guard.IsNumber(key) ? _Object_({ [key]: value }) : exports_guard.IsEqual(key, false) ? _Object_({ false: value }) : exports_guard.IsEqual(key, true) ? _Object_({ true: value }) : _Object_({});
46870
47541
  }
46871
47542
 
46872
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_number.mjs
47543
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_number.mjs
46873
47544
  function FromNumberKey(_key, value) {
46874
47545
  const result = CreateRecord(NumberKey, value);
46875
47546
  return result;
46876
47547
  }
46877
47548
 
46878
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_string.mjs
47549
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_string.mjs
46879
47550
  function FromStringKey(key, value) {
46880
47551
  return exports_guard.HasPropertyKey(key, "pattern") && (exports_guard.IsString(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
46881
47552
  }
46882
47553
 
46883
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
47554
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
46884
47555
  function FromTemplateKey(pattern, value) {
46885
47556
  const types = ParsePatternIntoTypes(pattern);
46886
47557
  const finite = IsTemplateLiteralFinite(types);
@@ -46888,7 +47559,7 @@ function FromTemplateKey(pattern, value) {
46888
47559
  return result;
46889
47560
  }
46890
47561
 
46891
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
47562
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
46892
47563
  function FlattenType(type) {
46893
47564
  const result = IsUnion(type) ? Flatten(type.anyOf) : [type];
46894
47565
  return result;
@@ -46899,7 +47570,7 @@ function Flatten(types) {
46899
47570
  }, []);
46900
47571
  }
46901
47572
 
46902
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_union.mjs
47573
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key_union.mjs
46903
47574
  function StringOrNumberCheck(types) {
46904
47575
  return types.some((type) => IsString3(type) || IsNumber3(type) || IsInteger2(type));
46905
47576
  }
@@ -46922,13 +47593,13 @@ function FromUnionKey(types, value) {
46922
47593
  return IsSchema(record2) ? record2 : CreateObject(flattened, value);
46923
47594
  }
46924
47595
 
46925
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key.mjs
47596
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/from_key.mjs
46926
47597
  function FromKey(key, value) {
46927
47598
  const result = IsAny(key) ? FromAnyKey(value) : IsBoolean3(key) ? FromBooleanKey(value) : IsEnum(key) ? FromEnumKey(key.enum, value) : IsInteger2(key) ? FromIntegerKey(key, value) : IsIntersect(key) ? FromIntersectKey(key.allOf, value) : IsLiteral(key) ? FromLiteralKey(key.const, value) : IsNumber3(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString3(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_({});
46928
47599
  return result;
46929
47600
  }
46930
47601
 
46931
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/instantiate.mjs
47602
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/record/instantiate.mjs
46932
47603
  function RecordAction(key, value, options) {
46933
47604
  const result = CanInstantiate([key]) ? exports_memory.Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
46934
47605
  return result;
@@ -46939,7 +47610,7 @@ function RecordInstantiate(context, state, key, value, options) {
46939
47610
  return RecordAction(instantiatedKey, instantiatedValue, options);
46940
47611
  }
46941
47612
 
46942
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/record.mjs
47613
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/record.mjs
46943
47614
  var IntegerKey = `^${IntegerPattern}$`;
46944
47615
  var NumberKey = `^${NumberPattern}$`;
46945
47616
  var StringKey = `^${StringPattern}$`;
@@ -46970,35 +47641,35 @@ function RecordValue(type) {
46970
47641
  function IsRecord(value) {
46971
47642
  return IsKind(value, "Record");
46972
47643
  }
46973
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/rest.mjs
47644
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/rest.mjs
46974
47645
  function Rest(type) {
46975
47646
  return exports_memory.Create({ "~kind": "Rest" }, { type: "rest", items: type }, {});
46976
47647
  }
46977
47648
  function IsRest(value) {
46978
47649
  return IsKind(value, "Rest");
46979
47650
  }
46980
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/this.mjs
47651
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/this.mjs
46981
47652
  function This(options) {
46982
47653
  return exports_memory.Create({ ["~kind"]: "This" }, { $ref: "#" }, options);
46983
47654
  }
46984
47655
  function IsThis(value) {
46985
47656
  return IsKind(value, "This");
46986
47657
  }
46987
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/undefined.mjs
47658
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/undefined.mjs
46988
47659
  function Undefined(options) {
46989
47660
  return exports_memory.Create({ "~kind": "Undefined" }, { type: "undefined" }, options);
46990
47661
  }
46991
47662
  function IsUndefined2(value) {
46992
47663
  return IsKind(value, "Undefined");
46993
47664
  }
46994
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/void.mjs
47665
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/void.mjs
46995
47666
  function Void(options) {
46996
47667
  return exports_memory.Create({ "~kind": "Void" }, { type: "void" }, options);
46997
47668
  }
46998
47669
  function IsVoid(value) {
46999
47670
  return IsKind(value, "Void");
47000
47671
  }
47001
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/mapping.mjs
47672
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/mapping.mjs
47002
47673
  function IntrinsicOrCall(ref2, parameters) {
47003
47674
  return exports_guard.IsEqual(ref2, "Array") ? _Array_(parameters[0]) : exports_guard.IsEqual(ref2, "Capitalize") ? CapitalizeDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "ConstructorParameters") ? ConstructorParametersDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Evaluate") ? EvaluateDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Exclude") ? ExcludeDeferred(parameters[0], parameters[1]) : exports_guard.IsEqual(ref2, "Extract") ? ExtractDeferred(parameters[0], parameters[1]) : exports_guard.IsEqual(ref2, "Index") ? IndexDeferred(parameters[0], parameters[1]) : exports_guard.IsEqual(ref2, "InstanceType") ? InstanceTypeDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Lowercase") ? LowercaseDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "NonNullable") ? NonNullableDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Omit") ? OmitDeferred(parameters[0], parameters[1]) : exports_guard.IsEqual(ref2, "Parameters") ? ParametersDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Partial") ? PartialDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Pick") ? PickDeferred(parameters[0], parameters[1]) : exports_guard.IsEqual(ref2, "Readonly") ? ReadonlyObjectDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "KeyOf") ? KeyOfDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Record") ? RecordDeferred(parameters[0], parameters[1]) : exports_guard.IsEqual(ref2, "Required") ? RequiredDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "ReturnType") ? ReturnTypeDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Uncapitalize") ? UncapitalizeDeferred(parameters[0]) : exports_guard.IsEqual(ref2, "Uppercase") ? UppercaseDeferred(parameters[0]) : CallConstruct(Ref(ref2), parameters);
47004
47675
  }
@@ -47435,7 +48106,7 @@ function ModuleMapping(input) {
47435
48106
  function ScriptMapping(input) {
47436
48107
  return input;
47437
48108
  }
47438
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/match.mjs
48109
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/internal/match.mjs
47439
48110
  function IsMatch(value) {
47440
48111
  return IsEqual(value.length, 2);
47441
48112
  }
@@ -47443,7 +48114,7 @@ function Match2(input, ok, fail) {
47443
48114
  return IsMatch(input) ? ok(input[0], input[1]) : fail();
47444
48115
  }
47445
48116
 
47446
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/take.mjs
48117
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/internal/take.mjs
47447
48118
  function TakeVariant(variant, input) {
47448
48119
  return IsEqual(input.indexOf(variant), 0) ? [variant, input.slice(variant.length)] : [];
47449
48120
  }
@@ -47456,7 +48127,7 @@ function Take(variants, input) {
47456
48127
  return [];
47457
48128
  }
47458
48129
 
47459
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/char.mjs
48130
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/internal/char.mjs
47460
48131
  function Range(start, end) {
47461
48132
  return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
47462
48133
  }
@@ -47475,7 +48146,7 @@ var Dot = ".";
47475
48146
  var DollarSign = "$";
47476
48147
  var Hyphen = "-";
47477
48148
 
47478
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/trim.mjs
48149
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/internal/trim.mjs
47479
48150
  var LineComment = "//";
47480
48151
  var OpenComment = "/*";
47481
48152
  var CloseComment = "*/";
@@ -47501,12 +48172,12 @@ function Trim(input) {
47501
48172
  return trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) : trimmed;
47502
48173
  }
47503
48174
 
47504
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/optional.mjs
48175
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/internal/optional.mjs
47505
48176
  function Optional2(value, input) {
47506
48177
  return Match2(Take([value], input), (Optional3, Rest2) => [Optional3, Rest2], () => ["", input]);
47507
48178
  }
47508
48179
 
47509
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/many.mjs
48180
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/internal/many.mjs
47510
48181
  function IsDiscard(discard2, input) {
47511
48182
  return discard2.includes(input);
47512
48183
  }
@@ -47514,7 +48185,7 @@ function Many(allowed, discard2, input, result = "") {
47514
48185
  return Match2(Take(allowed, input), (Char, Rest2) => IsDiscard(discard2, Char) ? Many(allowed, discard2, Rest2, result) : Many(allowed, discard2, Rest2, `${result}${Char}`), () => [result, input]);
47515
48186
  }
47516
48187
 
47517
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/unsigned_integer.mjs
48188
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/unsigned_integer.mjs
47518
48189
  function TakeNonZero(input) {
47519
48190
  return Take(NonZero, input);
47520
48191
  }
@@ -47529,7 +48200,7 @@ function UnsignedInteger(input) {
47529
48200
  return TakeUnsignedInteger(Trim(input));
47530
48201
  }
47531
48202
 
47532
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/integer.mjs
48203
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/integer.mjs
47533
48204
  function TakeSign(input) {
47534
48205
  return Optional2(Hyphen, input);
47535
48206
  }
@@ -47540,21 +48211,21 @@ function Integer2(input) {
47540
48211
  return TakeSignedInteger(Trim(input));
47541
48212
  }
47542
48213
 
47543
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/bigint.mjs
48214
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/bigint.mjs
47544
48215
  function TakeBigInt(input) {
47545
48216
  return Match2(Integer2(input), (Integer3, IntegerRest) => Match2(Take(["n"], IntegerRest), (_N, NRest) => [`${Integer3}`, NRest], () => []), () => []);
47546
48217
  }
47547
48218
  function BigInt3(input) {
47548
48219
  return TakeBigInt(input);
47549
48220
  }
47550
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/const.mjs
48221
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/const.mjs
47551
48222
  function TakeConst(const_, input) {
47552
48223
  return Take([const_], input);
47553
48224
  }
47554
48225
  function Const(const_, input) {
47555
48226
  return IsEqual(const_, "") ? ["", input] : const_.startsWith(NewLine) ? TakeConst(const_, TrimWhitespace(input)) : const_.startsWith(WhiteSpace) ? TakeConst(const_, input) : TakeConst(const_, Trim(input));
47556
48227
  }
47557
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/ident.mjs
48228
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/ident.mjs
47558
48229
  var Initial = [...Alpha, UnderScore, DollarSign];
47559
48230
  function TakeInitial(input) {
47560
48231
  return Take(Initial, input);
@@ -47569,7 +48240,7 @@ function TakeIdent(input) {
47569
48240
  function Ident(input) {
47570
48241
  return TakeIdent(Trim(input));
47571
48242
  }
47572
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/unsigned_number.mjs
48243
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/unsigned_number.mjs
47573
48244
  var AllowedDigits2 = [...Digit, UnderScore];
47574
48245
  function IsLeadingDot(input) {
47575
48246
  return IsMatch(Take([Dot], input));
@@ -47590,7 +48261,7 @@ function UnsignedNumber(input) {
47590
48261
  return TakeUnsignedNumber(Trim(input));
47591
48262
  }
47592
48263
 
47593
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/number.mjs
48264
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/number.mjs
47594
48265
  function TakeSign2(input) {
47595
48266
  return Optional2(Hyphen, input);
47596
48267
  }
@@ -47600,7 +48271,7 @@ function TakeSignedNumber(input) {
47600
48271
  function Number3(input) {
47601
48272
  return TakeSignedNumber(Trim(input));
47602
48273
  }
47603
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/until.mjs
48274
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/until.mjs
47604
48275
  function TakeOne(input) {
47605
48276
  const result = IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
47606
48277
  return result;
@@ -47612,7 +48283,7 @@ function Until(end, input, result = "") {
47612
48283
  return Match2(TakeOne(input), (One, Rest2) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest2, `${result}${One}`), () => []);
47613
48284
  }
47614
48285
 
47615
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/span.mjs
48286
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/span.mjs
47616
48287
  function MultiLine(start, end, input) {
47617
48288
  return Match2(Take([start], input), (_, Rest2) => Match2(Until([end], Rest2), (Until2, UntilRest) => Match2(Take([end], UntilRest), (_2, Rest3) => [`${Until2}`, Rest3], () => []), () => []), () => []);
47618
48289
  }
@@ -47622,7 +48293,7 @@ function SingleLine(start, end, input) {
47622
48293
  function Span(start, end, multiLine, input) {
47623
48294
  return multiLine ? MultiLine(start, end, Trim(input)) : SingleLine(start, end, Trim(input));
47624
48295
  }
47625
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/string.mjs
48296
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/string.mjs
47626
48297
  function TakeInitial2(quotes, input) {
47627
48298
  return Take(quotes, input);
47628
48299
  }
@@ -47635,11 +48306,11 @@ function TakeString(quotes, input) {
47635
48306
  function String3(quotes, input) {
47636
48307
  return TakeString(quotes, Trim(input));
47637
48308
  }
47638
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/until_1.mjs
48309
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/token/until_1.mjs
47639
48310
  function Until_1(end, input) {
47640
48311
  return Match2(Until(end, input), (Until2, UntilRest) => IsEqual(Until2, "") ? [] : [Until2, UntilRest], () => []);
47641
48312
  }
47642
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/parser.mjs
48313
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/parser.mjs
47643
48314
  var If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
47644
48315
  var GenericParameterExtendsEquals = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("extends", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => If(Const("=", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [GenericParameterExtendsEqualsMapping(_0), input2]);
47645
48316
  var GenericParameterExtends = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("extends", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [GenericParameterExtendsMapping(_0), input2]);
@@ -47777,14 +48448,14 @@ var ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input2]) =>
47777
48448
  var Module = (input) => If(If(ModuleDeclaration(input), ([_0, input2]) => If(ModuleDeclarationList(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ModuleMapping(_0), input2]);
47778
48449
  var Script = (input) => If(If(Module(input), ([_0, input2]) => [_0, input2], () => If(GenericType(input), ([_0, input2]) => [_0, input2], () => If(Type(input), ([_0, input2]) => [_0, input2], () => []))), ([_0, input2]) => [ScriptMapping(_0), input2]);
47779
48450
 
47780
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/patterns/template.mjs
48451
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/patterns/template.mjs
47781
48452
  function ParseTemplateIntoTypes(template) {
47782
48453
  const parsed = TemplateLiteralTypes(`\`${template}\``);
47783
48454
  const result = exports_guard.IsEqual(parsed.length, 2) ? parsed[0] : Unreachable();
47784
48455
  return result;
47785
48456
  }
47786
48457
 
47787
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/encode.mjs
48458
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/template_literal/encode.mjs
47788
48459
  function JoinString(input) {
47789
48460
  return input.join("|");
47790
48461
  }
@@ -47841,7 +48512,7 @@ function TemplateLiteralEncode(types) {
47841
48512
  return result;
47842
48513
  }
47843
48514
 
47844
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
48515
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
47845
48516
  function TemplateLiteralAction(types, options) {
47846
48517
  const result = CanInstantiate(types) ? exports_memory.Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
47847
48518
  return result;
@@ -47851,7 +48522,7 @@ function TemplateLiteralInstantiate(context, state, types, options) {
47851
48522
  return TemplateLiteralAction(instantiatedTypes, options);
47852
48523
  }
47853
48524
 
47854
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/template_literal.mjs
48525
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/template_literal.mjs
47855
48526
  function TemplateLiteralDeferred(types, options = {}) {
47856
48527
  return Deferred("TemplateLiteral", [types], options);
47857
48528
  }
@@ -47873,7 +48544,7 @@ function IsTemplateLiteral(value) {
47873
48544
  return IsKind(value, "TemplateLiteral");
47874
48545
  }
47875
48546
 
47876
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/result.mjs
48547
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/result.mjs
47877
48548
  var exports_result = {};
47878
48549
  __export(exports_result, {
47879
48550
  ExtendsFalse: () => ExtendsFalse,
@@ -47910,7 +48581,7 @@ function Match3(result, true_, false_) {
47910
48581
  return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
47911
48582
  }
47912
48583
 
47913
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/extends_right.mjs
48584
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/extends_right.mjs
47914
48585
  function ExtendsRightInfer(inferred, name, left, right) {
47915
48586
  return Match3(ExtendsLeft(inferred, left, right), (checkInferred) => ExtendsTrue(exports_memory.Assign(exports_memory.Assign(inferred, checkInferred), { [name]: left })), () => ExtendsFalse());
47916
48587
  }
@@ -47938,12 +48609,12 @@ function ExtendsRight(inferred, left, right) {
47938
48609
  return IsAny(right) ? ExtendsRightAny(inferred, left) : IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) : IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) : IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) : IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) : IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) : IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
47939
48610
  }
47940
48611
 
47941
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/any.mjs
48612
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/any.mjs
47942
48613
  function ExtendsAny(inferred, left, right) {
47943
48614
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion(inferred);
47944
48615
  }
47945
48616
 
47946
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/array.mjs
48617
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/array.mjs
47947
48618
  function ExtendsImmutable(left, right) {
47948
48619
  const isImmutableLeft = IsImmutable(left);
47949
48620
  const isImmutableRight = IsImmutable(right);
@@ -47953,17 +48624,17 @@ function ExtendsArray(inferred, arrayLeft, left, right) {
47953
48624
  return IsArray2(right) ? ExtendsImmutable(arrayLeft, right) ? ExtendsLeft(inferred, left, right.items) : ExtendsFalse() : ExtendsRight(inferred, arrayLeft, right);
47954
48625
  }
47955
48626
 
47956
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/bigint.mjs
48627
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/bigint.mjs
47957
48628
  function ExtendsBigInt(inferred, left, right) {
47958
48629
  return IsBigInt2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
47959
48630
  }
47960
48631
 
47961
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/boolean.mjs
48632
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/boolean.mjs
47962
48633
  function ExtendsBoolean(inferred, left, right) {
47963
48634
  return IsBoolean3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
47964
48635
  }
47965
48636
 
47966
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/parameters.mjs
48637
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/parameters.mjs
47967
48638
  function ParameterCompare(inferred, left, leftRest, right, rightRest) {
47968
48639
  const checkLeft = IsInfer(right) ? left : right;
47969
48640
  const checkRight = IsInfer(right) ? right : left;
@@ -47981,44 +48652,44 @@ function ExtendsParameters(inferred, left, right) {
47981
48652
  return ParametersLeft(inferred, left, right);
47982
48653
  }
47983
48654
 
47984
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/return_type.mjs
48655
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/return_type.mjs
47985
48656
  function ExtendsReturnType(inferred, left, right) {
47986
48657
  return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsLeft(inferred, left, right);
47987
48658
  }
47988
48659
 
47989
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/constructor.mjs
48660
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/constructor.mjs
47990
48661
  function ExtendsConstructor(inferred, parameters, returnType, right) {
47991
48662
  return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsConstructor2(right) ? Match3(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred2) => ExtendsReturnType(inferred2, returnType, right["instanceType"]), () => ExtendsFalse()) : ExtendsFalse();
47992
48663
  }
47993
48664
 
47994
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/dependent.mjs
48665
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/dependent.mjs
47995
48666
  function ExtendsDependent(inferred, if_, then_, else_, right) {
47996
48667
  return Match3(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));
47997
48668
  }
47998
48669
 
47999
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/enum.mjs
48670
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/enum.mjs
48000
48671
  function ExtendsEnum(inferred, left, right) {
48001
48672
  const evaluated = EvaluateEnum(left);
48002
48673
  return ExtendsLeft(inferred, evaluated, right);
48003
48674
  }
48004
48675
 
48005
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/function.mjs
48676
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/function.mjs
48006
48677
  function ExtendsFunction(inferred, parameters, returnType, right) {
48007
48678
  return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsFunction2(right) ? Match3(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred2) => ExtendsReturnType(inferred2, returnType, right["returnType"]), () => ExtendsFalse()) : ExtendsFalse();
48008
48679
  }
48009
48680
 
48010
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/integer.mjs
48681
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/integer.mjs
48011
48682
  function ExtendsInteger(inferred, left, right) {
48012
48683
  return IsInteger2(right) ? ExtendsTrue(inferred) : IsNumber3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48013
48684
  }
48014
48685
 
48015
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/intersect.mjs
48686
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/intersect.mjs
48016
48687
  function ExtendsIntersect(inferred, left, right) {
48017
48688
  const evaluated = EvaluateIntersect(left);
48018
48689
  return ExtendsLeft(inferred, evaluated, right);
48019
48690
  }
48020
48691
 
48021
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/literal.mjs
48692
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/literal.mjs
48022
48693
  function ExtendsLiteralValue(inferred, left, right) {
48023
48694
  return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
48024
48695
  }
@@ -48038,22 +48709,22 @@ function ExtendsLiteral(inferred, left, right) {
48038
48709
  return exports_guard.IsBigInt(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) : exports_guard.IsBoolean(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) : exports_guard.IsNumber(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) : exports_guard.IsString(left.const) ? ExtendsLiteralString(inferred, left.const, right) : Unreachable();
48039
48710
  }
48040
48711
 
48041
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/never.mjs
48712
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/never.mjs
48042
48713
  function ExtendsNever(inferred, left, right) {
48043
48714
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : ExtendsTrue(inferred);
48044
48715
  }
48045
48716
 
48046
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/null.mjs
48717
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/null.mjs
48047
48718
  function ExtendsNull(inferred, left, right) {
48048
48719
  return IsNull2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48049
48720
  }
48050
48721
 
48051
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/number.mjs
48722
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/number.mjs
48052
48723
  function ExtendsNumber(inferred, left, right) {
48053
48724
  return IsNumber3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48054
48725
  }
48055
48726
 
48056
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/object.mjs
48727
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/object.mjs
48057
48728
  function ExtendsPropertyOptional(inferred, left, right) {
48058
48729
  return IsOptional(left) ? IsOptional(right) ? ExtendsTrue(inferred) : ExtendsFalse() : ExtendsTrue(inferred);
48059
48730
  }
@@ -48101,7 +48772,7 @@ function ExtendsObject(inferred, left, right) {
48101
48772
  return IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) : IsObject2(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_(left), right);
48102
48773
  }
48103
48774
 
48104
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/record.mjs
48775
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/record.mjs
48105
48776
  function FromObject2(inferred, properties2) {
48106
48777
  return exports_guard.IsEqual(exports_guard.Keys(properties2).length, 0) ? ExtendsTrue(inferred) : ExtendsFalse();
48107
48778
  }
@@ -48112,23 +48783,23 @@ function ExtendsRecord(inferred, leftPattern, leftValue, right) {
48112
48783
  return IsRecord(right) ? FromRecord(inferred, RecordPatternToType(leftPattern), leftValue, RecordPatternToType(RecordPattern(right)), RecordValue(right)) : IsObject2(right) ? FromObject2(inferred, right.properties) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
48113
48784
  }
48114
48785
 
48115
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/string.mjs
48786
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/string.mjs
48116
48787
  function ExtendsString(inferred, left, right) {
48117
48788
  return IsString3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48118
48789
  }
48119
48790
 
48120
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/symbol.mjs
48791
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/symbol.mjs
48121
48792
  function ExtendsSymbol(inferred, left, right) {
48122
48793
  return IsSymbol2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48123
48794
  }
48124
48795
 
48125
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/template_literal.mjs
48796
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/template_literal.mjs
48126
48797
  function ExtendsTemplateLiteral(inferred, left, right) {
48127
48798
  const evaluated = EvaluateTemplateLiteral(left);
48128
48799
  return ExtendsLeft(inferred, evaluated, right);
48129
48800
  }
48130
48801
 
48131
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/inference.mjs
48802
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/inference.mjs
48132
48803
  function Inferrable(name, type) {
48133
48804
  return exports_memory.Create({ "~kind": "Inferrable" }, { name, type }, {});
48134
48805
  }
@@ -48155,7 +48826,7 @@ function InferUnionResult(inferred, name, left, right) {
48155
48826
  return exports_guard.IsArray(results) ? ExtendsTrue(exports_memory.Assign(inferred, { [name]: Union(results) })) : ExtendsFalse();
48156
48827
  }
48157
48828
 
48158
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/tuple.mjs
48829
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/tuple.mjs
48159
48830
  function Reverse(types) {
48160
48831
  return [...types].reverse();
48161
48832
  }
@@ -48194,12 +48865,12 @@ function ExtendsTuple(inferred, left, right) {
48194
48865
  return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray2(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
48195
48866
  }
48196
48867
 
48197
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/undefined.mjs
48868
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/undefined.mjs
48198
48869
  function ExtendsUndefined(inferred, left, right) {
48199
48870
  return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48200
48871
  }
48201
48872
 
48202
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/union.mjs
48873
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/union.mjs
48203
48874
  function ExtendsUnionSome(inferred, type, unionTypes) {
48204
48875
  return exports_guard.ShiftLeft(unionTypes, (head, tail) => Match3(ExtendsLeft(inferred, type, head), (inferred2) => ExtendsTrue(inferred2), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
48205
48876
  }
@@ -48211,22 +48882,22 @@ function ExtendsUnion2(inferred, left, right) {
48211
48882
  return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable.name, left, inferrable.type) : IsUnion(right) ? ExtendsUnionLeft(inferred, left, right.anyOf) : ExtendsUnionLeft(inferred, left, [right]);
48212
48883
  }
48213
48884
 
48214
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/unknown.mjs
48885
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/unknown.mjs
48215
48886
  function ExtendsUnknown(inferred, left, right) {
48216
48887
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
48217
48888
  }
48218
48889
 
48219
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/void.mjs
48890
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/void.mjs
48220
48891
  function ExtendsVoid(inferred, left, right) {
48221
48892
  return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
48222
48893
  }
48223
48894
 
48224
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/extends_left.mjs
48895
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/extends_left.mjs
48225
48896
  function ExtendsLeft(inferred, left, right) {
48226
48897
  return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray2(left) ? ExtendsArray(inferred, left, left.items, right) : IsBigInt2(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean3(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor2(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) : IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) : IsFunction2(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger2(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull2(left) ? ExtendsNull(inferred, left, right) : IsNumber3(left) ? ExtendsNumber(inferred, left, right) : IsObject2(left) ? ExtendsObject(inferred, left.properties, right) : IsRecord(left) ? ExtendsRecord(inferred, RecordPattern(left), RecordValue(left), right) : IsString3(left) ? ExtendsString(inferred, left, right) : IsSymbol2(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined2(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion2(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
48227
48898
  }
48228
48899
 
48229
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/interface/instantiate.mjs
48900
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/interface/instantiate.mjs
48230
48901
  function InterfaceOperation(heritage, properties2) {
48231
48902
  const result = EvaluateIntersect([...heritage, _Object_(properties2)]);
48232
48903
  return result;
@@ -48241,7 +48912,7 @@ function InterfaceInstantiate(context, state, heritage, properties2, options) {
48241
48912
  return InterfaceAction(instantiatedHeritage, instantiatedProperties, options);
48242
48913
  }
48243
48914
 
48244
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/interface.mjs
48915
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/interface.mjs
48245
48916
  function InterfaceDeferred(heritage, properties2, options = {}) {
48246
48917
  return Deferred("Interface", [heritage, properties2], options);
48247
48918
  }
@@ -48252,7 +48923,7 @@ function Interface(heritage, properties2, options = {}) {
48252
48923
  return InterfaceAction(heritage, properties2, options);
48253
48924
  }
48254
48925
 
48255
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/check.mjs
48926
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/cyclic/check.mjs
48256
48927
  function FromRef(stack, context, ref2) {
48257
48928
  return stack.includes(ref2) ? true : FromType3([...stack, ref2], context, context[ref2]);
48258
48929
  }
@@ -48271,7 +48942,7 @@ function CyclicCheck(stack, context, type) {
48271
48942
  return result;
48272
48943
  }
48273
48944
 
48274
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
48945
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
48275
48946
  function ResolveCandidateKeys(context, keys) {
48276
48947
  return keys.reduce((result, left) => {
48277
48948
  return CyclicCheck([left], context, context[left]) ? [...result, left] : result;
@@ -48282,7 +48953,7 @@ function CyclicCandidates(context) {
48282
48953
  const result = ResolveCandidateKeys(context, keys);
48283
48954
  return result;
48284
48955
  }
48285
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
48956
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
48286
48957
  function FromRef2(context, ref2, result) {
48287
48958
  return result.includes(ref2) ? result : (ref2 in context) ? FromType4(context, context[ref2], [...result, ref2]) : Unreachable();
48288
48959
  }
@@ -48302,7 +48973,7 @@ function CyclicDependencies(context, key, type) {
48302
48973
  const result = FromType4(context, type, [key]);
48303
48974
  return result;
48304
48975
  }
48305
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/extends.mjs
48976
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/cyclic/extends.mjs
48306
48977
  function FromRef3(_ref) {
48307
48978
  return Any();
48308
48979
  }
@@ -48325,7 +48996,7 @@ function CyclicAnyFromParameters(defs, ref2) {
48325
48996
  function CyclicExtends(type) {
48326
48997
  return CyclicAnyFromParameters(type.$defs, type.$ref);
48327
48998
  }
48328
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
48999
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
48329
49000
  function CyclicInterface(context, heritage, properties2) {
48330
49001
  const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
48331
49002
  const instantiatedProperties = InstantiateProperties({}, State([], []), properties2);
@@ -48346,7 +49017,7 @@ function InstantiateCyclic(context, ref2, type) {
48346
49017
  const result = Cyclic(definitions, ref2);
48347
49018
  return result;
48348
49019
  }
48349
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/target.mjs
49020
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/cyclic/target.mjs
48350
49021
  function Resolve(defs, ref2) {
48351
49022
  return ref2 in defs ? IsRef(defs[ref2]) ? Resolve(defs, defs[ref2].$ref) : defs[ref2] : Never();
48352
49023
  }
@@ -48354,7 +49025,7 @@ function CyclicTarget(defs, ref2) {
48354
49025
  const result = Resolve(defs, ref2);
48355
49026
  return result;
48356
49027
  }
48357
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/extends.mjs
49028
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/extends/extends.mjs
48358
49029
  function Canonical(type) {
48359
49030
  return IsCyclic(type) ? CyclicExtends(type) : IsUnsafe(type) ? Unknown() : type;
48360
49031
  }
@@ -48363,7 +49034,7 @@ function Extends(inferred, left, right) {
48363
49034
  const canonicalRight = Canonical(right);
48364
49035
  return ExtendsLeft(inferred, canonicalLeft, canonicalRight);
48365
49036
  }
48366
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/compare.mjs
49037
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/compare.mjs
48367
49038
  var ResultEqual = "equal";
48368
49039
  var ResultDisjoint = "disjoint";
48369
49040
  var ResultLeftInside = "left-inside";
@@ -48376,7 +49047,7 @@ function Compare(left, right) {
48376
49047
  return exports_result.IsExtendsTrueLike(extendsCheck[0]) && exports_result.IsExtendsTrueLike(extendsCheck[1]) ? ResultEqual : exports_result.IsExtendsTrueLike(extendsCheck[0]) && exports_result.IsExtendsFalse(extendsCheck[1]) ? ResultLeftInside : exports_result.IsExtendsFalse(extendsCheck[0]) && exports_result.IsExtendsTrueLike(extendsCheck[1]) ? ResultRightInside : ResultDisjoint;
48377
49048
  }
48378
49049
 
48379
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
49050
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
48380
49051
  function BroadFilter(type, types) {
48381
49052
  return types.filter((left) => {
48382
49053
  return Compare(type, left) === ResultRightInside ? false : true;
@@ -48403,7 +49074,7 @@ function Broaden(types) {
48403
49074
  const flattened = Flatten(broadened);
48404
49075
  return flattened;
48405
49076
  }
48406
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
49077
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
48407
49078
  function EvaluateAction(type, options) {
48408
49079
  const result = exports_memory.Update(EvaluateType(type), {}, options);
48409
49080
  return result;
@@ -48412,7 +49083,7 @@ function EvaluateInstantiate(context, state, type, options) {
48412
49083
  const instantiatedType = InstantiateType(context, state, type);
48413
49084
  return EvaluateAction(instantiatedType, options);
48414
49085
  }
48415
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
49086
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
48416
49087
  function CollectDistributionNames(expression, result = []) {
48417
49088
  return IsDeferred(expression) && exports_guard.IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result)) : IsDeferred(expression) && exports_guard.IsEqual(expression.action, "Mapped") ? IsDeferred(expression.parameters[1]) && exports_guard.IsEqual(expression.parameters[1].action, "KeyOf") && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]["$ref"]] : result : result;
48418
49089
  }
@@ -48445,7 +49116,7 @@ function DistributeArguments(parameters, arguments_, expression) {
48445
49116
  return IsDeferred(expression) && exports_guard.IsEqual(expression.action, "Conditional") ? Distribute2(zippedArguments) : IsDeferred(expression) && exports_guard.IsEqual(expression.action, "Mapped") ? Distribute2(zippedArguments) : [arguments_];
48446
49117
  }
48447
49118
 
48448
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/resolve_target.mjs
49119
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/call/resolve_target.mjs
48449
49120
  function FromNotResolvable() {
48450
49121
  return ["(not-resolvable)", Never()];
48451
49122
  }
@@ -48465,7 +49136,7 @@ function ResolveTarget(context, target2, arguments_) {
48465
49136
  return FromType6(context, "(anonymous)", target2, arguments_);
48466
49137
  }
48467
49138
 
48468
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
49139
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
48469
49140
  function AssertArgumentExtends(name, type, extends_) {
48470
49141
  if (IsInfer(type) || IsCall(type) || exports_result.IsExtendsTrueLike(Extends({}, type, extends_)))
48471
49142
  return;
@@ -48489,7 +49160,7 @@ function ResolveArgumentsContext(context, state, parameters, arguments_) {
48489
49160
  return BindParameters(context, state, parameters, arguments_);
48490
49161
  }
48491
49162
 
48492
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/instantiate.mjs
49163
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/call/instantiate.mjs
48493
49164
  function Peek(state) {
48494
49165
  const result = exports_guard.IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
48495
49166
  return result;
@@ -48521,7 +49192,7 @@ function CallInstantiate(context, state, target2, arguments_) {
48521
49192
  return result;
48522
49193
  }
48523
49194
 
48524
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/call.mjs
49195
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/types/call.mjs
48525
49196
  function CallConstruct(target2, arguments_) {
48526
49197
  return exports_memory.Create({ ["~kind"]: "Call" }, { type: "call", target: target2, arguments: arguments_ }, {});
48527
49198
  }
@@ -48532,7 +49203,7 @@ function IsCall(value) {
48532
49203
  return IsKind(value, "Call");
48533
49204
  }
48534
49205
 
48535
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
49206
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
48536
49207
  function RemoveImmutableOperation(type) {
48537
49208
  return exports_memory.Discard(type, ["~immutable"]);
48538
49209
  }
@@ -48545,35 +49216,35 @@ function RemoveImmutableInstantiate(context, state, type, options) {
48545
49216
  return RemoveImmutableAction(instantiatedType, options);
48546
49217
  }
48547
49218
 
48548
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
49219
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
48549
49220
  function ApplyMapping(mapping, value) {
48550
49221
  return mapping(value);
48551
49222
  }
48552
49223
 
48553
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
49224
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
48554
49225
  function FromLiteral3(mapping, value) {
48555
49226
  return exports_guard.IsString(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
48556
49227
  }
48557
49228
 
48558
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
49229
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
48559
49230
  function FromTemplateLiteral(mapping, pattern) {
48560
49231
  const evaluated = EvaluateTemplateLiteral(pattern);
48561
49232
  const result = FromType7(mapping, evaluated);
48562
49233
  return result;
48563
49234
  }
48564
49235
 
48565
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
49236
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
48566
49237
  function FromUnion2(mapping, types) {
48567
49238
  const result = types.map((type) => FromType7(mapping, type));
48568
49239
  return Union(result);
48569
49240
  }
48570
49241
 
48571
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
49242
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
48572
49243
  function FromType7(mapping, type) {
48573
49244
  return IsLiteral(type) ? FromLiteral3(mapping, type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(mapping, type.pattern) : IsUnion(type) ? FromUnion2(mapping, type.anyOf) : type;
48574
49245
  }
48575
49246
 
48576
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/capitalize.mjs
49247
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/capitalize.mjs
48577
49248
  function CapitalizeDeferred(type, options = {}) {
48578
49249
  return Deferred("Capitalize", [type], options);
48579
49250
  }
@@ -48581,7 +49252,7 @@ function Capitalize(type, options = {}) {
48581
49252
  return CapitalizeAction(type, options);
48582
49253
  }
48583
49254
 
48584
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/lowercase.mjs
49255
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/lowercase.mjs
48585
49256
  function LowercaseDeferred(type, options = {}) {
48586
49257
  return Deferred("Lowercase", [type], options);
48587
49258
  }
@@ -48589,7 +49260,7 @@ function Lowercase(type, options = {}) {
48589
49260
  return LowercaseAction(type, options);
48590
49261
  }
48591
49262
 
48592
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/uncapitalize.mjs
49263
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/uncapitalize.mjs
48593
49264
  function UncapitalizeDeferred(type, options = {}) {
48594
49265
  return Deferred("Uncapitalize", [type], options);
48595
49266
  }
@@ -48597,7 +49268,7 @@ function Uncapitalize(type, options = {}) {
48597
49268
  return UncapitalizeAction(type, options);
48598
49269
  }
48599
49270
 
48600
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/uppercase.mjs
49271
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/uppercase.mjs
48601
49272
  function UppercaseDeferred(type, options = {}) {
48602
49273
  return Deferred("Uppercase", [type], options);
48603
49274
  }
@@ -48605,7 +49276,7 @@ function Uppercase(type, options = {}) {
48605
49276
  return UppercaseAction(type, options);
48606
49277
  }
48607
49278
 
48608
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
49279
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
48609
49280
  var CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);
48610
49281
  var LowercaseMapping = (input) => input.toLowerCase();
48611
49282
  var UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);
@@ -48643,7 +49314,7 @@ function UppercaseInstantiate(context, state, type, options) {
48643
49314
  return UppercaseAction(instantiatedType, options);
48644
49315
  }
48645
49316
 
48646
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/conditional.mjs
49317
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/conditional.mjs
48647
49318
  function ConditionalDeferred(left, right, true_, false_, options = {}) {
48648
49319
  return Deferred("Conditional", [left, right, true_, false_], options);
48649
49320
  }
@@ -48651,7 +49322,7 @@ function Conditional(left, right, true_, false_, options = {}) {
48651
49322
  return ConditionalAction({}, State([], []), left, right, true_, false_, options);
48652
49323
  }
48653
49324
 
48654
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
49325
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
48655
49326
  function ConditionalOperation(context, state, left, right, true_, false_) {
48656
49327
  const extendsResult = Extends(context, left, right);
48657
49328
  return exports_result.IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) : exports_result.IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) : InstantiateType(context, state, false_);
@@ -48665,7 +49336,7 @@ function ConditionalInstantiate(context, state, left, right, true_, false_, opti
48665
49336
  const instantiatedRight = InstantiateType(context, state, right);
48666
49337
  return ConditionalAction(context, state, instantiatedLeft, instantiatedRight, true_, false_, options);
48667
49338
  }
48668
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/constructor_parameters.mjs
49339
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/constructor_parameters.mjs
48669
49340
  function ConstructorParametersDeferred(type, options = {}) {
48670
49341
  return Deferred("ConstructorParameters", [type], options);
48671
49342
  }
@@ -48673,7 +49344,7 @@ function ConstructorParameters(type, options = {}) {
48673
49344
  return ConstructorParametersAction(type, options);
48674
49345
  }
48675
49346
 
48676
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
49347
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
48677
49348
  function ConstructorParametersOperation(type) {
48678
49349
  const parameters = IsConstructor2(type) ? type["parameters"] : [];
48679
49350
  const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
@@ -48689,7 +49360,7 @@ function ConstructorParametersInstantiate(context, state, type, options) {
48689
49360
  return ConstructorParametersAction(instantiatedType, options);
48690
49361
  }
48691
49362
 
48692
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/exclude.mjs
49363
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/exclude.mjs
48693
49364
  function ExcludeDeferred(left, right, options = {}) {
48694
49365
  return Deferred("Exclude", [left, right], options);
48695
49366
  }
@@ -48697,7 +49368,7 @@ function Exclude(left, right, options = {}) {
48697
49368
  return ExcludeAction(left, right, options);
48698
49369
  }
48699
49370
 
48700
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
49371
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
48701
49372
  function ExcludeAction(left, right, options) {
48702
49373
  const result = CanInstantiate([left, right]) ? exports_memory.Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
48703
49374
  return result;
@@ -48708,7 +49379,7 @@ function ExcludeInstantiate(context, state, left, right, options) {
48708
49379
  return ExcludeAction(instantiatedLeft, instantiatedRight, options);
48709
49380
  }
48710
49381
 
48711
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/extract.mjs
49382
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/extract.mjs
48712
49383
  function ExtractDeferred(left, right, options = {}) {
48713
49384
  return Deferred("Extract", [left, right], options);
48714
49385
  }
@@ -48716,7 +49387,7 @@ function Extract(left, right, options = {}) {
48716
49387
  return ExtractAction(left, right, options);
48717
49388
  }
48718
49389
 
48719
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/extract/operation.mjs
49390
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/extract/operation.mjs
48720
49391
  function ExtractType(left, right) {
48721
49392
  const check3 = Extends({}, left, right);
48722
49393
  const result = exports_result.IsExtendsTrueLike(check3) ? [left] : [];
@@ -48735,7 +49406,7 @@ function ExtractOperation(left, right) {
48735
49406
  return result;
48736
49407
  }
48737
49408
 
48738
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/extract/instantiate.mjs
49409
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/extract/instantiate.mjs
48739
49410
  function ExtractAction(left, right, options) {
48740
49411
  const result = CanInstantiate([left, right]) ? exports_memory.Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
48741
49412
  return result;
@@ -48746,7 +49417,7 @@ function ExtractInstantiate(context, state, left, right, options) {
48746
49417
  return ExtractAction(instantiatedLeft, instantiatedRight, options);
48747
49418
  }
48748
49419
 
48749
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
49420
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
48750
49421
  function KeysToLiterals(keys) {
48751
49422
  return keys.reduce((result, left) => {
48752
49423
  return IsLiteralValue(left) ? [...result, Literal(left)] : result;
@@ -48758,7 +49429,7 @@ function KeysToIndexer(keys) {
48758
49429
  return result;
48759
49430
  }
48760
49431
 
48761
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/indexed.mjs
49432
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/indexed.mjs
48762
49433
  function IndexDeferred(type, indexer, options = {}) {
48763
49434
  return Deferred("Index", [type, indexer], options);
48764
49435
  }
@@ -48767,21 +49438,21 @@ function Index(type, indexer_or_keys, options = {}) {
48767
49438
  return IndexAction(type, indexer, options);
48768
49439
  }
48769
49440
 
48770
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
49441
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
48771
49442
  function FromCyclic(defs, ref2) {
48772
49443
  const target2 = CyclicTarget(defs, ref2);
48773
49444
  const result = FromType8(target2);
48774
49445
  return result;
48775
49446
  }
48776
49447
 
48777
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_dependent.mjs
49448
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_dependent.mjs
48778
49449
  function FromDependent(if_, then_, else_) {
48779
49450
  const evaluated = EvaluateDependent(if_, then_, else_);
48780
49451
  const result = FromType8(evaluated);
48781
49452
  return result;
48782
49453
  }
48783
49454
 
48784
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_intersect.mjs
49455
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_intersect.mjs
48785
49456
  function CollapseIntersectProperties(left, right) {
48786
49457
  const leftKeys = exports_guard.Keys(left).filter((key) => !exports_guard.HasPropertyKey(right, key));
48787
49458
  const rightKeys = exports_guard.Keys(right).filter((key) => !exports_guard.HasPropertyKey(left, key));
@@ -48799,19 +49470,19 @@ function FromIntersect(types) {
48799
49470
  }, {});
48800
49471
  }
48801
49472
 
48802
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_object.mjs
49473
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_object.mjs
48803
49474
  function FromObject3(properties2) {
48804
49475
  return properties2;
48805
49476
  }
48806
49477
 
48807
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_tuple.mjs
49478
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_tuple.mjs
48808
49479
  function FromTuple(types) {
48809
49480
  const object3 = TupleToObject(Tuple(types));
48810
49481
  const result = FromType8(object3);
48811
49482
  return result;
48812
49483
  }
48813
49484
 
48814
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_union.mjs
49485
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_union.mjs
48815
49486
  function CollapseUnionProperties(left, right) {
48816
49487
  const sharedKeys = exports_guard.Keys(left).filter((key) => (key in right));
48817
49488
  const result = sharedKeys.reduce((result2, key) => {
@@ -48826,25 +49497,25 @@ function FromUnion3(types) {
48826
49497
  return exports_guard.ShiftLeft(types, (left, right) => ReduceVariants(right, FromType8(left)), () => Unreachable());
48827
49498
  }
48828
49499
 
48829
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_type.mjs
49500
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/from_type.mjs
48830
49501
  function FromType8(type) {
48831
49502
  return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsDependent(type) ? FromDependent(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion3(type.anyOf) : IsTuple(type) ? FromTuple(type.items) : IsObject2(type) ? FromObject3(type.properties) : {};
48832
49503
  }
48833
49504
 
48834
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/collapse.mjs
49505
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/object/collapse.mjs
48835
49506
  function CollapseToObject(type) {
48836
49507
  const properties2 = FromType8(type);
48837
49508
  const result = _Object_(properties2);
48838
49509
  return result;
48839
49510
  }
48840
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/helpers/keys.mjs
49511
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/helpers/keys.mjs
48841
49512
  var integerKeyPattern = new RegExp("^(?:0|[1-9][0-9]*)$");
48842
49513
  function ConvertToIntegerKey(value) {
48843
49514
  const normal = `${value}`;
48844
49515
  return integerKeyPattern.test(normal) ? parseInt(normal) : value;
48845
49516
  }
48846
49517
 
48847
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_array.mjs
49518
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexed/from_array.mjs
48848
49519
  function NormalizeLiteral(value) {
48849
49520
  return Literal(ConvertToIntegerKey(value));
48850
49521
  }
@@ -48861,66 +49532,66 @@ function FromArray2(type, indexer) {
48861
49532
  return result;
48862
49533
  }
48863
49534
 
48864
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
49535
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
48865
49536
  function FromCyclic2(defs, ref2) {
48866
49537
  const target2 = CyclicTarget(defs, ref2);
48867
49538
  const result = FromType9(target2);
48868
49539
  return result;
48869
49540
  }
48870
49541
 
48871
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
49542
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
48872
49543
  function FromDependent2(if_, then_, else_) {
48873
49544
  const evaluated = EvaluateDependent(if_, then_, else_);
48874
49545
  const result = FromType9(evaluated);
48875
49546
  return result;
48876
49547
  }
48877
49548
 
48878
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
49549
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
48879
49550
  function FromEnum(values) {
48880
49551
  const evaluated = EvaluateEnum(values);
48881
49552
  const result = FromType9(evaluated);
48882
49553
  return result;
48883
49554
  }
48884
49555
 
48885
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
49556
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
48886
49557
  function FromIntersect2(types) {
48887
49558
  const evaluated = EvaluateIntersect(types);
48888
49559
  const result = FromType9(evaluated);
48889
49560
  return result;
48890
49561
  }
48891
49562
 
48892
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
49563
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
48893
49564
  function FromLiteral4(value) {
48894
49565
  const result = [`${value}`];
48895
49566
  return result;
48896
49567
  }
48897
49568
 
48898
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
49569
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
48899
49570
  function FromTemplateLiteral2(pattern) {
48900
49571
  const evaluated = EvaluateTemplateLiteral(pattern);
48901
49572
  const result = FromType9(evaluated);
48902
49573
  return result;
48903
49574
  }
48904
49575
 
48905
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_union.mjs
49576
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_union.mjs
48906
49577
  function FromUnion4(types) {
48907
49578
  return types.reduce((result, left) => {
48908
49579
  return [...result, ...FromType9(left)];
48909
49580
  }, []);
48910
49581
  }
48911
49582
 
48912
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_type.mjs
49583
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/from_type.mjs
48913
49584
  function FromType9(type) {
48914
49585
  return IsCyclic(type) ? FromCyclic2(type.$defs, type.$ref) : IsDependent(type) ? FromDependent2(type.if, type.then, type.else) : IsEnum(type) ? FromEnum(type.enum) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsLiteral(type) ? FromLiteral4(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral2(type.pattern) : IsUnion(type) ? FromUnion4(type.anyOf) : [];
48915
49586
  }
48916
49587
 
48917
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
49588
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
48918
49589
  function ToIndexableKeys(type) {
48919
49590
  const result = FromType9(type);
48920
49591
  return result;
48921
49592
  }
48922
49593
 
48923
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/this/expand_this.mjs
49594
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/this/expand_this.mjs
48924
49595
  function FromTypes5(properties2, types) {
48925
49596
  return types.map((type) => FromType10(properties2, type));
48926
49597
  }
@@ -48932,7 +49603,7 @@ function ExpandThis(properties2, type) {
48932
49603
  return result;
48933
49604
  }
48934
49605
 
48935
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_object.mjs
49606
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexed/from_object.mjs
48936
49607
  function IndexProperty(properties2, key) {
48937
49608
  const selectedType = key in properties2 ? properties2[key] : Never();
48938
49609
  const result = ExpandThis(properties2, selectedType);
@@ -48966,7 +49637,7 @@ function FromObject4(properties2, indexer) {
48966
49637
  return result;
48967
49638
  }
48968
49639
 
48969
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
49640
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
48970
49641
  function ConvertLiteral(value) {
48971
49642
  return Literal(ConvertToIntegerKey(value));
48972
49643
  }
@@ -48977,7 +49648,7 @@ function FormatArrayIndexer(type) {
48977
49648
  return IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) : IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) : IsLiteral(type) ? ConvertLiteral(type.const) : type;
48978
49649
  }
48979
49650
 
48980
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
49651
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
48981
49652
  function IndexElementsWithIndexer(types, indexer) {
48982
49653
  return types.reduceRight((result, right, index) => {
48983
49654
  const check3 = Extends({}, Literal(index), indexer);
@@ -48996,12 +49667,12 @@ function FromTuple2(types, indexer) {
48996
49667
  return IsLiteral(indexer) && exports_guard.IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber3(indexer) || IsInteger2(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
48997
49668
  }
48998
49669
 
48999
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_type.mjs
49670
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexed/from_type.mjs
49000
49671
  function FromType11(type, indexer) {
49001
49672
  return IsArray2(type) ? FromArray2(type.items, indexer) : IsObject2(type) ? FromObject4(type.properties, indexer) : IsTuple(type) ? FromTuple2(type.items, indexer) : Never();
49002
49673
  }
49003
49674
 
49004
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
49675
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
49005
49676
  function NormalizeType(type) {
49006
49677
  const result = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
49007
49678
  return result;
@@ -49016,7 +49687,7 @@ function IndexInstantiate(context, state, type, indexer, options) {
49016
49687
  return IndexAction(instantiatedType, instantiatedIndexer, options);
49017
49688
  }
49018
49689
 
49019
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/instance_type.mjs
49690
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/instance_type.mjs
49020
49691
  function InstanceTypeDeferred(type, options = {}) {
49021
49692
  return Deferred("InstanceType", [type], options);
49022
49693
  }
@@ -49024,7 +49695,7 @@ function InstanceType(type, options = {}) {
49024
49695
  return InstanceTypeAction(type, options);
49025
49696
  }
49026
49697
 
49027
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
49698
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
49028
49699
  function InstanceTypeOperation(type) {
49029
49700
  return IsConstructor2(type) ? type["instanceType"] : Never();
49030
49701
  }
@@ -49037,7 +49708,7 @@ function InstanceTypeInstantiate(context, state, type, options = {}) {
49037
49708
  return InstanceTypeAction(instantiatedType, options);
49038
49709
  }
49039
49710
 
49040
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/keyof.mjs
49711
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/keyof.mjs
49041
49712
  function KeyOfDeferred(type, options = {}) {
49042
49713
  return Deferred("KeyOf", [type], options);
49043
49714
  }
@@ -49045,17 +49716,17 @@ function KeyOf2(type, options = {}) {
49045
49716
  return KeyOfAction(type, options);
49046
49717
  }
49047
49718
 
49048
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_any.mjs
49719
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/from_any.mjs
49049
49720
  function FromAny() {
49050
49721
  return Union([Number2(), String2(), Symbol2()]);
49051
49722
  }
49052
49723
 
49053
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_array.mjs
49724
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/from_array.mjs
49054
49725
  function FromArray3(_type) {
49055
49726
  return Number2();
49056
49727
  }
49057
49728
 
49058
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_object.mjs
49729
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/from_object.mjs
49059
49730
  function FromPropertyKeys(keys) {
49060
49731
  const result = keys.reduce((result2, left) => {
49061
49732
  return IsLiteralValue(left) ? [...result2, Literal(ConvertToIntegerKey(left))] : Unreachable();
@@ -49069,23 +49740,23 @@ function FromObject5(properties2) {
49069
49740
  return result;
49070
49741
  }
49071
49742
 
49072
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_record.mjs
49743
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/from_record.mjs
49073
49744
  function FromRecord2(type) {
49074
49745
  return RecordKey(type);
49075
49746
  }
49076
49747
 
49077
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
49748
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
49078
49749
  function FromTuple3(types) {
49079
49750
  const result = types.map((_, index) => Literal(index));
49080
49751
  return EvaluateUnionFast(result);
49081
49752
  }
49082
49753
 
49083
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_type.mjs
49754
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/from_type.mjs
49084
49755
  function FromType12(type) {
49085
49756
  return IsAny(type) ? FromAny() : IsArray2(type) ? FromArray3(type.items) : IsObject2(type) ? FromObject5(type.properties) : IsRecord(type) ? FromRecord2(type) : IsTuple(type) ? FromTuple3(type.items) : Never();
49086
49757
  }
49087
49758
 
49088
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
49759
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
49089
49760
  function NormalizeType2(type) {
49090
49761
  const result = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
49091
49762
  return result;
@@ -49098,7 +49769,7 @@ function KeyOfInstantiate(context, state, type, options) {
49098
49769
  return KeyOfAction(instantiatedType, options);
49099
49770
  }
49100
49771
 
49101
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/mapped.mjs
49772
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/mapped.mjs
49102
49773
  function MappedDeferred(identifier2, type, as, property, options = {}) {
49103
49774
  return Deferred("Mapped", [identifier2, type, as, property], options);
49104
49775
  }
@@ -49106,7 +49777,7 @@ function Mapped(identifier2, type, as, property, options = {}) {
49106
49777
  return MappedAction({}, State([], []), identifier2, type, as, property, options);
49107
49778
  }
49108
49779
 
49109
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
49780
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
49110
49781
  function FromTemplateLiteral3(pattern) {
49111
49782
  const evaluated = EvaluateTemplateLiteral(pattern);
49112
49783
  const result = FromType13(evaluated);
@@ -49135,7 +49806,7 @@ function MappedVariants(type) {
49135
49806
  return result;
49136
49807
  }
49137
49808
 
49138
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
49809
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
49139
49810
  function CanonicalAs(instantiatedAs) {
49140
49811
  const result = IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
49141
49812
  return result;
@@ -49165,7 +49836,7 @@ function MappedOperation(context, state, identifier2, type, as, property) {
49165
49836
  return result;
49166
49837
  }
49167
49838
 
49168
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
49839
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
49169
49840
  function MappedAction(context, state, identifier2, type, as, property, options) {
49170
49841
  const result = CanInstantiate([type]) ? exports_memory.Update(MappedOperation(context, state, identifier2, type, as, property), {}, options) : MappedDeferred(identifier2, type, as, property, options);
49171
49842
  return result;
@@ -49175,7 +49846,7 @@ function MappedInstantiate(context, state, identifier2, type, as, property, opti
49175
49846
  return MappedAction(context, state, identifier2, instantiatedType, as, property, options);
49176
49847
  }
49177
49848
 
49178
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/module/instantiate.mjs
49849
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/module/instantiate.mjs
49179
49850
  function InstantiateCyclics(context, declarations, cyclicKeys) {
49180
49851
  const declarationContext = exports_memory.Assign(context, declarations);
49181
49852
  const declarationKeys = exports_guard.Keys(declarations).filter((key) => cyclicKeys.includes(key));
@@ -49202,7 +49873,7 @@ function ModuleInstantiate(context, _state, declarations, options) {
49202
49873
  return instantiatedModule;
49203
49874
  }
49204
49875
 
49205
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/non_nullable.mjs
49876
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/non_nullable.mjs
49206
49877
  function NonNullableDeferred(type, options = {}) {
49207
49878
  return Deferred("NonNullable", [type], options);
49208
49879
  }
@@ -49210,7 +49881,7 @@ function NonNullable(type, options = {}) {
49210
49881
  return NonNullableAction(type, options);
49211
49882
  }
49212
49883
 
49213
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
49884
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
49214
49885
  function NonNullableOperation(type) {
49215
49886
  const excluded = Union([Null(), Undefined()]);
49216
49887
  return ExcludeAction(type, excluded, {});
@@ -49224,7 +49895,7 @@ function NonNullableInstantiate(context, state, type, options) {
49224
49895
  return NonNullableAction(instantiatedType, options);
49225
49896
  }
49226
49897
 
49227
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/omit.mjs
49898
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/omit.mjs
49228
49899
  function OmitDeferred(type, indexer, options = {}) {
49229
49900
  return Deferred("Omit", [type, indexer], options);
49230
49901
  }
@@ -49233,14 +49904,14 @@ function Omit(type, indexer_or_keys, options = {}) {
49233
49904
  return OmitAction(type, indexer, options);
49234
49905
  }
49235
49906
 
49236
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
49907
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
49237
49908
  function ToIndexable(type) {
49238
49909
  const collapsed = CollapseToObject(type);
49239
49910
  const result = IsObject2(collapsed) ? collapsed.properties : Unreachable();
49240
49911
  return result;
49241
49912
  }
49242
49913
 
49243
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/omit/from_type.mjs
49914
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/omit/from_type.mjs
49244
49915
  function FromKeys(properties2, keys) {
49245
49916
  const result = exports_guard.Keys(properties2).reduce((result2, key) => {
49246
49917
  return keys.includes(key) ? result2 : { ...result2, [key]: properties2[key] };
@@ -49255,7 +49926,7 @@ function FromType14(type, indexer) {
49255
49926
  return result;
49256
49927
  }
49257
49928
 
49258
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/omit/instantiate.mjs
49929
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/omit/instantiate.mjs
49259
49930
  function OmitAction(type, indexer, options) {
49260
49931
  const result = CanInstantiate([type, indexer]) ? exports_memory.Update(FromType14(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
49261
49932
  return result;
@@ -49266,7 +49937,7 @@ function OmitInstantiate(context, state, type, indexer, options) {
49266
49937
  return OmitAction(instantiatedType, instantiatedIndexer, options);
49267
49938
  }
49268
49939
 
49269
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/parameters.mjs
49940
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/parameters.mjs
49270
49941
  function ParametersDeferred(type, options = {}) {
49271
49942
  return Deferred("Parameters", [type], options);
49272
49943
  }
@@ -49274,7 +49945,7 @@ function Parameters(type, options = {}) {
49274
49945
  return ParametersAction(type, options);
49275
49946
  }
49276
49947
 
49277
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
49948
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
49278
49949
  function ParametersOperation(type) {
49279
49950
  const parameters = IsFunction2(type) ? type["parameters"] : [];
49280
49951
  const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
@@ -49290,7 +49961,7 @@ function ParametersInstantiate(context, state, type, options) {
49290
49961
  return ParametersAction(instantiatedType, options);
49291
49962
  }
49292
49963
 
49293
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/partial.mjs
49964
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/partial.mjs
49294
49965
  function PartialDeferred(type, options = {}) {
49295
49966
  return Deferred("Partial", [type], options);
49296
49967
  }
@@ -49298,7 +49969,7 @@ function Partial(type, options = {}) {
49298
49969
  return PartialAction(type, options);
49299
49970
  }
49300
49971
 
49301
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
49972
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
49302
49973
  function FromCyclic3(defs, ref2) {
49303
49974
  const target2 = CyclicTarget(defs, ref2);
49304
49975
  const partial2 = FromType15(target2);
@@ -49306,27 +49977,27 @@ function FromCyclic3(defs, ref2) {
49306
49977
  return result;
49307
49978
  }
49308
49979
 
49309
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
49980
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
49310
49981
  function FromDependent3(if_, then_, else_) {
49311
49982
  const evaluated = EvaluateDependent(if_, then_, else_);
49312
49983
  const result = FromType15(evaluated);
49313
49984
  return result;
49314
49985
  }
49315
49986
 
49316
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
49987
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
49317
49988
  function FromIntersect3(types) {
49318
49989
  const evaluated = EvaluateIntersect(types);
49319
49990
  const result = FromType15(evaluated);
49320
49991
  return result;
49321
49992
  }
49322
49993
 
49323
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_union.mjs
49994
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/from_union.mjs
49324
49995
  function FromUnion6(types) {
49325
49996
  const result = types.map((type) => FromType15(type));
49326
49997
  return Union(result);
49327
49998
  }
49328
49999
 
49329
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_object.mjs
50000
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/from_object.mjs
49330
50001
  function FromObject6(properties2) {
49331
50002
  const mapped = exports_guard.Keys(properties2).reduce((result2, left) => {
49332
50003
  return { ...result2, [left]: AddOptional(properties2[left]) };
@@ -49335,12 +50006,12 @@ function FromObject6(properties2) {
49335
50006
  return result;
49336
50007
  }
49337
50008
 
49338
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_type.mjs
50009
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/from_type.mjs
49339
50010
  function FromType15(type) {
49340
50011
  return IsCyclic(type) ? FromCyclic3(type.$defs, type.$ref) : IsDependent(type) ? FromDependent3(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion6(type.anyOf) : IsObject2(type) ? FromObject6(type.properties) : _Object_({});
49341
50012
  }
49342
50013
 
49343
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/instantiate.mjs
50014
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/partial/instantiate.mjs
49344
50015
  function PartialAction(type, options) {
49345
50016
  const result = CanInstantiate([type]) ? exports_memory.Update(FromType15(type), {}, options) : PartialDeferred(type, options);
49346
50017
  return result;
@@ -49350,7 +50021,7 @@ function PartialInstantiate(context, state, type, options) {
49350
50021
  return PartialAction(instantiatedType, options);
49351
50022
  }
49352
50023
 
49353
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/pick.mjs
50024
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/pick.mjs
49354
50025
  function PickDeferred(type, indexer, options = {}) {
49355
50026
  return Deferred("Pick", [type, indexer], options);
49356
50027
  }
@@ -49359,7 +50030,7 @@ function Pick(type, indexer_or_keys, options = {}) {
49359
50030
  return PickAction(type, indexer, options);
49360
50031
  }
49361
50032
 
49362
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/pick/from_type.mjs
50033
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/pick/from_type.mjs
49363
50034
  function FromKeys2(properties2, keys) {
49364
50035
  const result = exports_guard.Keys(properties2).reduce((result2, key) => {
49365
50036
  return keys.includes(key) ? exports_memory.Assign(result2, { [key]: properties2[key] }) : result2;
@@ -49374,7 +50045,7 @@ function FromType16(type, indexer) {
49374
50045
  return result;
49375
50046
  }
49376
50047
 
49377
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/pick/instantiate.mjs
50048
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/pick/instantiate.mjs
49378
50049
  function PickAction(type, indexer, options) {
49379
50050
  const result = CanInstantiate([type, indexer]) ? exports_memory.Update(FromType16(type, indexer), {}, options) : PickDeferred(type, indexer, options);
49380
50051
  return result;
@@ -49385,21 +50056,22 @@ function PickInstantiate(context, state, type, indexer, options) {
49385
50056
  return PickAction(instantiatedType, instantiatedIndexer, options);
49386
50057
  }
49387
50058
 
49388
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/readonly_object.mjs
50059
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/readonly_object.mjs
49389
50060
  function ReadonlyObjectDeferred(type, options = {}) {
49390
50061
  return Deferred("ReadonlyObject", [type], options);
49391
50062
  }
49392
50063
  function ReadonlyObject(type, options = {}) {
49393
50064
  return ReadonlyObjectAction(type, options);
49394
50065
  }
50066
+ var ReadonlyType = ReadonlyObject;
49395
50067
 
49396
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
50068
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
49397
50069
  function FromArray4(type) {
49398
50070
  const result = AddImmutable(_Array_(type));
49399
50071
  return result;
49400
50072
  }
49401
50073
 
49402
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
50074
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
49403
50075
  function FromCyclic4(defs, ref2) {
49404
50076
  const target2 = CyclicTarget(defs, ref2);
49405
50077
  const partial2 = FromType17(target2);
@@ -49407,21 +50079,21 @@ function FromCyclic4(defs, ref2) {
49407
50079
  return result;
49408
50080
  }
49409
50081
 
49410
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
50082
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
49411
50083
  function FromDependent4(if_, then_, else_) {
49412
50084
  const evaluated = EvaluateDependent(if_, then_, else_);
49413
50085
  const result = FromType17(evaluated);
49414
50086
  return result;
49415
50087
  }
49416
50088
 
49417
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
50089
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
49418
50090
  function FromIntersect4(types) {
49419
50091
  const evaluated = EvaluateIntersect(types);
49420
50092
  const result = FromType17(evaluated);
49421
50093
  return result;
49422
50094
  }
49423
50095
 
49424
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
50096
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
49425
50097
  function FromObject7(properties2) {
49426
50098
  const mapped = exports_guard.Keys(properties2).reduce((result2, left) => {
49427
50099
  return { ...result2, [left]: AddReadonly(properties2[left]) };
@@ -49430,24 +50102,24 @@ function FromObject7(properties2) {
49430
50102
  return result;
49431
50103
  }
49432
50104
 
49433
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
50105
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
49434
50106
  function FromTuple4(types) {
49435
50107
  const result = AddImmutable(Tuple(types));
49436
50108
  return result;
49437
50109
  }
49438
50110
 
49439
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
50111
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
49440
50112
  function FromUnion7(types) {
49441
50113
  const result = types.map((type) => FromType17(type));
49442
50114
  return Union(result);
49443
50115
  }
49444
50116
 
49445
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
50117
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
49446
50118
  function FromType17(type) {
49447
50119
  return IsArray2(type) ? FromArray4(type.items) : IsCyclic(type) ? FromCyclic4(type.$defs, type.$ref) : IsDependent(type) ? FromDependent4(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect4(type.allOf) : IsObject2(type) ? FromObject7(type.properties) : IsTuple(type) ? FromTuple4(type.items) : IsUnion(type) ? FromUnion7(type.anyOf) : type;
49448
50120
  }
49449
50121
 
49450
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
50122
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
49451
50123
  function ReadonlyObjectAction(type, options) {
49452
50124
  const result = CanInstantiate([type]) ? exports_memory.Update(FromType17(type), {}, options) : ReadonlyObjectDeferred(type);
49453
50125
  return result;
@@ -49457,12 +50129,12 @@ function ReadonlyObjectInstantiate(context, state, type, options) {
49457
50129
  return ReadonlyObjectAction(instantiatedType, options);
49458
50130
  }
49459
50131
 
49460
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/ref/instantiate.mjs
50132
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/ref/instantiate.mjs
49461
50133
  function RefInstantiate(context, state, type, ref2) {
49462
50134
  return state.visited.includes(ref2) ? type : (ref2 in context) ? InstantiateType(context, State(state["callstack"], [...state["visited"], ref2]), context[ref2]) : type;
49463
50135
  }
49464
50136
 
49465
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
50137
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
49466
50138
  function FromCyclic5(defs, ref2) {
49467
50139
  const target2 = CyclicTarget(defs, ref2);
49468
50140
  const partial2 = FromType18(target2);
@@ -49470,27 +50142,27 @@ function FromCyclic5(defs, ref2) {
49470
50142
  return result;
49471
50143
  }
49472
50144
 
49473
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_dependent.mjs
50145
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/from_dependent.mjs
49474
50146
  function FromDependent5(if_, then_, else_) {
49475
50147
  const evaluated = EvaluateDependent(if_, then_, else_);
49476
50148
  const result = FromType18(evaluated);
49477
50149
  return result;
49478
50150
  }
49479
50151
 
49480
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_intersect.mjs
50152
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/from_intersect.mjs
49481
50153
  function FromIntersect5(types) {
49482
50154
  const evaluated = EvaluateIntersect(types);
49483
50155
  const result = FromType18(evaluated);
49484
50156
  return result;
49485
50157
  }
49486
50158
 
49487
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_union.mjs
50159
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/from_union.mjs
49488
50160
  function FromUnion8(types) {
49489
50161
  const result = types.map((type) => FromType18(type));
49490
50162
  return Union(result);
49491
50163
  }
49492
50164
 
49493
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_object.mjs
50165
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/from_object.mjs
49494
50166
  function FromObject8(properties2) {
49495
50167
  const mapped = exports_guard.Keys(properties2).reduce((result2, left) => {
49496
50168
  return { ...result2, [left]: RemoveOptional(properties2[left]) };
@@ -49499,12 +50171,12 @@ function FromObject8(properties2) {
49499
50171
  return result;
49500
50172
  }
49501
50173
 
49502
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_type.mjs
50174
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/from_type.mjs
49503
50175
  function FromType18(type) {
49504
50176
  return IsCyclic(type) ? FromCyclic5(type.$defs, type.$ref) : IsDependent(type) ? FromDependent5(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect5(type.allOf) : IsUnion(type) ? FromUnion8(type.anyOf) : IsObject2(type) ? FromObject8(type.properties) : _Object_({});
49505
50177
  }
49506
50178
 
49507
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/required.mjs
50179
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/required.mjs
49508
50180
  function RequiredDeferred(type, options = {}) {
49509
50181
  return Deferred("Required", [type], options);
49510
50182
  }
@@ -49512,7 +50184,7 @@ function Required(type, options = {}) {
49512
50184
  return RequiredAction(type, options);
49513
50185
  }
49514
50186
 
49515
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/instantiate.mjs
50187
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/required/instantiate.mjs
49516
50188
  function RequiredAction(type, options) {
49517
50189
  const result = CanInstantiate([type]) ? exports_memory.Update(FromType18(type), {}, options) : RequiredDeferred(type, options);
49518
50190
  return result;
@@ -49522,7 +50194,7 @@ function RequiredInstantiate(context, state, type, options) {
49522
50194
  return RequiredAction(instaniatedType, options);
49523
50195
  }
49524
50196
 
49525
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/return_type.mjs
50197
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/return_type.mjs
49526
50198
  function ReturnTypeDeferred(type, options = {}) {
49527
50199
  return Deferred("ReturnType", [type], options);
49528
50200
  }
@@ -49530,7 +50202,7 @@ function ReturnType(type, options = {}) {
49530
50202
  return ReturnTypeAction(type, options);
49531
50203
  }
49532
50204
 
49533
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
50205
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
49534
50206
  function ReturnTypeOperation(type) {
49535
50207
  return IsFunction2(type) ? type["returnType"] : Never();
49536
50208
  }
@@ -49543,7 +50215,7 @@ function ReturnTypeInstantiate(context, state, type, options = {}) {
49543
50215
  return ReturnTypeAction(instantiatedType, options);
49544
50216
  }
49545
50217
 
49546
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/with.mjs
50218
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/with.mjs
49547
50219
  function WithDeferred(type, options) {
49548
50220
  return Deferred("With", [type, options], {});
49549
50221
  }
@@ -49551,7 +50223,7 @@ function With2(type, options) {
49551
50223
  return WithAction(type, options);
49552
50224
  }
49553
50225
 
49554
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/with/instantiate.mjs
50226
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/with/instantiate.mjs
49555
50227
  function WithAction(type, options) {
49556
50228
  const result = CanInstantiate([type]) ? exports_memory.Update(type, {}, options) : WithDeferred(type, options);
49557
50229
  return result;
@@ -49561,7 +50233,7 @@ function WithInstantiate(context, state, type, options) {
49561
50233
  return WithAction(instaniatedType, options);
49562
50234
  }
49563
50235
 
49564
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/rest/spread.mjs
50236
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/rest/spread.mjs
49565
50237
  function SpreadElement(type) {
49566
50238
  const result = IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
49567
50239
  return result;
@@ -49572,7 +50244,7 @@ function RestSpread(types) {
49572
50244
  }, []);
49573
50245
  return result;
49574
50246
  }
49575
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/instantiate.mjs
50247
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/instantiate.mjs
49576
50248
  function State(callstack, visited) {
49577
50249
  return { callstack, visited };
49578
50250
  }
@@ -49614,7 +50286,7 @@ function Instantiate(context, type) {
49614
50286
  return InstantiateType(context, State([], []), type);
49615
50287
  }
49616
50288
 
49617
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
50289
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
49618
50290
  function AddImmutableOperation(type) {
49619
50291
  return exports_memory.Update(type, { "~immutable": true }, {});
49620
50292
  }
@@ -49627,28 +50299,28 @@ function AddImmutableInstantiate(context, state, type, options) {
49627
50299
  return AddImmutableAction(instantiatedType, options);
49628
50300
  }
49629
50301
 
49630
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_add_immutable.mjs
50302
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/_add_immutable.mjs
49631
50303
  function AddImmutableDeferred(type, options = {}) {
49632
50304
  return Deferred("AddImmutable", [type], options);
49633
50305
  }
49634
50306
  function AddImmutable(type, options = {}) {
49635
50307
  return AddImmutableAction(type, options);
49636
50308
  }
49637
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/evaluate.mjs
50309
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/evaluate.mjs
49638
50310
  function EvaluateDeferred(type, options = {}) {
49639
50311
  return Deferred("Evaluate", [type], options);
49640
50312
  }
49641
50313
  function Evaluate(type, options = {}) {
49642
50314
  return EvaluateAction(type, options);
49643
50315
  }
49644
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/module.mjs
50316
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/action/module.mjs
49645
50317
  function ModuleDeferred(declarations, options = {}) {
49646
50318
  return Deferred("Module", [declarations], options);
49647
50319
  }
49648
50320
  function Module2(declarations, options = {}) {
49649
50321
  return ModuleInstantiate({}, State([], []), declarations, options);
49650
50322
  }
49651
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/script.mjs
50323
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/type/script/script.mjs
49652
50324
  function Script2(...args) {
49653
50325
  const [context, input, options] = exports_arguments.Match(args, {
49654
50326
  2: (script, options2) => exports_guard.IsString(script) ? [{}, script, options2] : [script, options2, {}],
@@ -49659,7 +50331,7 @@ function Script2(...args) {
49659
50331
  const parsed = exports_guard.IsArray(result) && exports_guard.IsEqual(result.length, 2) ? InstantiateType(context, State([], []), result[0]) : Never();
49660
50332
  return exports_memory.Update(parsed, {}, options);
49661
50333
  }
49662
- // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/typebox.mjs
50334
+ // ../../node_modules/.bun/typebox@1.3.7/node_modules/typebox/build/typebox.mjs
49663
50335
  var exports_typebox = {};
49664
50336
  __export(exports_typebox, {
49665
50337
  Any: () => Any,
@@ -49705,6 +50377,7 @@ __export(exports_typebox, {
49705
50377
  IsCyclic: () => IsCyclic,
49706
50378
  IsDependent: () => IsDependent,
49707
50379
  IsEnum: () => IsEnum,
50380
+ IsEnumValue: () => IsEnumValue,
49708
50381
  IsFunction: () => IsFunction2,
49709
50382
  IsGeneric: () => IsGeneric,
49710
50383
  IsIdentifier: () => IsIdentifier,
@@ -49754,6 +50427,7 @@ __export(exports_typebox, {
49754
50427
  Pick: () => Pick,
49755
50428
  Readonly: () => Readonly,
49756
50429
  ReadonlyObject: () => ReadonlyObject,
50430
+ ReadonlyType: () => ReadonlyType,
49757
50431
  Record: () => Record,
49758
50432
  RecordKey: () => RecordKey,
49759
50433
  RecordPattern: () => RecordPattern,
@@ -51605,7 +52279,7 @@ import { isAbsolute as isAbsolute5 } from "node:path";
51605
52279
 
51606
52280
  // ../retina-local-fs/src/path-fence.ts
51607
52281
  import { lstat, readlink, realpath } from "node:fs/promises";
51608
- import { homedir as homedir6 } from "node:os";
52282
+ import { homedir as homedir7 } from "node:os";
51609
52283
  import { basename as basename4, dirname as dirname8, isAbsolute as isAbsolute4, join as join10, relative, resolve as resolve5, sep } from "node:path";
51610
52284
 
51611
52285
  // ../retina-local-fs/src/errors.ts
@@ -51630,7 +52304,7 @@ async function resolveAndFenceProviderPath(configuredPath, options) {
51630
52304
  return canonical;
51631
52305
  }
51632
52306
  async function resolveFenceRoots(options) {
51633
- const configuredHomePath = resolve5(options.homeDirectory ?? process.env.HOME ?? homedir6());
52307
+ const configuredHomePath = resolve5(options.homeDirectory ?? process.env.HOME ?? homedir7());
51634
52308
  let home;
51635
52309
  try {
51636
52310
  home = await realpath(configuredHomePath);
@@ -56194,4 +56868,4 @@ function registerMagicContextTools(pi, opts) {
56194
56868
  }
56195
56869
  }
56196
56870
 
56197
- export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, migrateMagicContextConfigLocations, ProjectIdentityError, resolveProjectIdentityStrict, resolveProjectIdentity, resolveProjectIdentityForSession, beginBootQuietPeriod, scheduleAfterBootQuiet, Database, closeQuietly, isMidTurn, textMentionsRecentCommit, hasMeaningfulUserText, extractTexts, extractToolCallSummaries, preloadTokenizer, estimateTokens, normalizeText, isRecord, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripPersistedAssistantText, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, isEditTool, applyEditMarkerToInput, setRawMessageProvider, withRawMessageProvider, cleanUserText, withRawSessionMessageCache, readRawSessionMessages, primeTailRawMessageCache, getCachedAbsoluteMessageCount, primeInMemoryTailRawMessageCache, getRawSessionMessageCount, getRawSessionTagKeysThrough, getLegacyProtectedTailStartOrdinal, readSessionChunk, clearCompressionDepth, clearCompressionDepthRange, getMessageIndexSourceIdentity, isMessageIndexSourceCurrent, getLastIndexedOrdinal, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, indexSingleMessage, indexMessagesAfterOrdinal, sweepOrphanedOpenCodeMessageIndexes, recordSessionProjectIdentity, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, isCompartmentLeaseHeld, piModelRefToCanonical, resolveModelRefForPi, modelRefLookupOrder, ompModelRefToCanonical, resolveModelRefForOmp, persistCachedM0, clearCachedM0M1, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getModuleNoteEvaluationBridge, getContextStoreUuid, parseCompartmentOutput, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, sourceNameForMemory, computeWorkspaceEpochFingerprint, bumpEpochsForWorkspaceMembers, readProjectDocsCanonical, copySessionStateForClone, getErrorMessage, describeError, setStoragePrivatePermissionEnforcement, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getDatabasePath, getPersistedSchemaVersion, setSqlitePragmaConfig, applySqliteTuningPragmas, runSqliteOptimize, openDatabase, openDatabaseAsync, queueM0Mutation, getMaxM0MutationId, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, MAX_EXECUTE_THRESHOLD, escalationBands, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, resetLastNudgeCycle, resetLastNudgeCycleIfTailShrank, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, getSessionsWithPendingPiMarker, peekDeferredExecutePending, setDeferredExecutePendingIfAbsent, clearDeferredExecutePendingIfMatches, setSessionWorkMetrics, getSessionWorkMetrics, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, getNotes, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, markNoteReady, markNoteChecked, queuePendingOp, getPendingOps, clearPendingOps, removePendingOp, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, insertPrimerCandidates, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, CTX_REDUCE_KEEP, estimateImageTokensFromDataUrl, normalizeTodoStateJson, buildSyntheticTodoPart, stripChannel1ReminderSpans, effectiveTailHygiene, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, decideChannel1, evaluateChannel2, buildChannel2Reminder, shouldUseStickyChannel1Reminder, buildChannel1Reminder, planEmergencyDrop, updateTagByteSize, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, updateTagInputByteSize, updateTagTokenCount, getPersistedToolTagAccounting, getAllStatusTagTokenTotalsFlat, updateTagInputTokenCount, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, updateTagDropMode, updateCavemanDepth, hasPiFallbackMessageTags, findAdoptableFallbackTags, hasPiFallbackToolOwnerTags, findPiFallbackToolOwnerTags, adoptPiFallbackToolOwnerTag, adoptPiFallbackMessageTag, getMaxTagNumberBySession, getTagNumberByMessageId, deriveTagLoadFloor, getTagsBySession, getActiveTagsBySession, getTagsForPendingOperations, getTagsByNumbers, getDroppedTagsByNumbers, getMaxDroppedTagNumber, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, BoundedSessionMap, getWindowOverlay, resolveWindowOverlayFacts, deriveWindowGeometry, formatWindowDerivationLine, isSaneLimit, resolveOutputReserve, getSdkContextLimit, resolveModelConfigOrDefault, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, isMidTurnPi, readPiSessionMessages, findLastModelKeyFromBranch, convertEntriesToRawMessages, withContentLanguageDirective, withMigrationLanguageDirective, buildPrimaryLanguageDirective, computeCueContentHash, hasMuralCueColumns, getMuralCueState, memoryNeedsCue, setMuralCue, recordMuralCueRejection, invalidateMemory, computeNormalizedHash, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, getUnclassifiedMemoryIds, insertMemory, getMemoryByHash, getMemoriesByProject, getMemoriesByProjects, getMaxMemoryIdForProjects, getAllActiveMemoriesForMigration, getMemoryById, setMemoryClassification, archiveMemory, deleteMemory, getMemoryCount, getMemoryCountsByStatus, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getOpenCodeDbPath2 as getOpenCodeDbPath, parseCron, nextOccurrence, nextDueAtMs, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, DEFAULT_HISTORIAN_TIMEOUT_MS, buildCanonicalChunkTextFromFts, buildCompartmentSummaryFallbackText, canonicalizeInMemoryChunkTextForEmbedding, chunkCanonicalText, chunkEmbeddingWindowsAreCurrent, replaceCompartmentChunkEmbeddings, cosineSimilarity, GIT_SWEEP_LEASE_RENEWAL_MS, acquireGitSweepLease, renewGitSweepLease, markGitSweepSuccessAndRelease, parkGitSweepNonIndexable, releaseGitSweepLease, contentSha256, sweepStaleEmbeddingIdentitiesForProject, enqueueShadowEmbeddingItems, getProjectEmbeddingSnapshot, getProjectChunkEmbeddingModelId, getProjectEmbeddingMaxInputTokens, embedTextForProject, embedBatchForProject, embedItemsForProject, embedUnembeddedMemoriesForProject, drainCommitBacklogForProject, embedSessionCompartmentChunks, getEmbeddingCoverageStatus, promoteSessionFactsDurable, embedPromotedFacts, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles, wakePlaneStatus, indexCommitsForProject, embedUnembeddedCommits, loadPiConfig, ensureProjectRegisteredFromPiDirectory, resolveMuralWire, updateCompactionMarkerAfterPublication, COMPARTMENT_RENDER_EPOCH, encodeCachedM0UpgradeIdentity, decodeCachedM0UpgradeIdentity, DEFAULT_HISTORY_BUDGET_TOKENS, renderCompartmentAtTier, renderDecayedCompartments, extractM0Block, TEMPORAL_MARKER_PATTERN, temporalMarkerPrefix, clearInjectionCache, getVisibleMemoryIds, renderMemoryBlock, DEFAULT_MEMORY_BUDGET_TOKENS, DEFAULT_USER_PROFILE_BUDGET_TOKENS, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, unifiedSearch, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, registerMagicContextTools };
56871
+ export { COMPACTION_ENABLED_PATH, isDreamerRunnable, isCompactionEnabled, migrateMagicContextConfigLocations, hasShareabilitySensitiveText, FAIL_CLOSED_DOCTOR_COMMAND, formatFailClosedBlockingMessage, createFailClosedBlockingError, isFailClosedBlockingError, shouldBypassFailClosedBlock, createFailClosedController, ProjectIdentityError, resolveProjectIdentityStrict, resolveProjectIdentity, resolveProjectIdentityForSession, beginBootQuietPeriod, scheduleAfterBootQuiet, Database, closeQuietly, isMidTurn, textMentionsRecentCommit, hasMeaningfulUserText, extractTexts, extractToolCallSummaries, preloadTokenizer, estimateTokens, normalizeText, isRecord, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripPersistedAssistantText, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, isEditTool, applyEditMarkerToInput, setRawMessageProvider, withRawMessageProvider, cleanUserText, withRawSessionMessageCache, readRawSessionMessages, primeTailRawMessageCache, getCachedAbsoluteMessageCount, primeInMemoryTailRawMessageCache, getRawSessionMessageCount, getRawSessionTagKeysThrough, getLegacyProtectedTailStartOrdinal, readSessionChunk, clearCompressionDepth, clearCompressionDepthRange, getMessageIndexSourceIdentity, isMessageIndexSourceCurrent, getLastIndexedOrdinal, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, indexSingleMessage, indexMessagesAfterOrdinal, sweepOrphanedOpenCodeMessageIndexes, recordSessionProjectIdentity, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, isCompartmentLeaseHeld, piModelRefToCanonical, resolveModelRefForPi, modelRefLookupOrder, ompModelRefToCanonical, resolveModelRefForOmp, persistCachedM0, clearCachedM0M1, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getModuleNoteEvaluationBridge, getContextStoreUuid, parseCompartmentOutput, resolveWorkspaceShareCategories, resolveWorkspaceIdentitySet, expandWorkspaceIdentitySetWithAliases, sourceNameForMemory, computeWorkspaceEpochFingerprint, bumpEpochsForWorkspaceMembers, readProjectDocsCanonical, copySessionStateForClone, getErrorMessage, describeError, setStoragePrivatePermissionEnforcement, getSchemaFenceRejection, getMigrationOnOpenRefusal, LATEST_SUPPORTED_VERSION, getDatabasePath, getPersistedSchemaVersion, setSqlitePragmaConfig, applySqliteTuningPragmas, runSqliteOptimize, openDatabase, openDatabaseAsync, queueM0Mutation, getMaxM0MutationId, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, MAX_EXECUTE_THRESHOLD, escalationBands, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, resetLastNudgeCycle, resetLastNudgeCycleIfTailShrank, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, pruneAutoSearchHintDecisions, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, getProcessedImageStrippedIds, addProcessedImageStrippedIds, getPendingCompactionMarkerState, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, getSessionsWithPendingPiMarker, peekDeferredExecutePending, setDeferredExecutePendingIfAbsent, clearDeferredExecutePendingIfMatches, setSessionWorkMetrics, getSessionWorkMetrics, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, retryPendingSessionCleanups, getNotes, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, markNoteReady, markNoteChecked, queuePendingOp, getPendingOps, clearPendingOps, removePendingOp, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, insertPrimerCandidates, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId, CTX_REDUCE_KEEP, estimateImageTokensFromDataUrl, normalizeTodoStateJson, buildSyntheticTodoPart, stripChannel1ReminderSpans, effectiveTailHygiene, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, decideChannel1, evaluateChannel2, buildChannel2Reminder, shouldUseStickyChannel1Reminder, buildChannel1Reminder, planEmergencyDrop, updateTagByteSize, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, updateTagInputByteSize, updateTagTokenCount, getPersistedToolTagAccounting, getAllStatusTagTokenTotalsFlat, updateTagInputTokenCount, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, updateTagDropMode, updateCavemanDepth, hasPiFallbackMessageTags, findAdoptableFallbackTags, hasPiFallbackToolOwnerTags, findPiFallbackToolOwnerTags, adoptPiFallbackToolOwnerTag, adoptPiFallbackMessageTag, getMaxTagNumberBySession, getTagNumberByMessageId, deriveTagLoadFloor, getTagsBySession, getActiveTagsBySession, getTagsForPendingOperations, getTagsByNumbers, getDroppedTagsByNumbers, getMaxDroppedTagNumber, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, BoundedSessionMap, getWindowOverlay, resolveWindowOverlayFacts, deriveWindowGeometry, formatWindowDerivationLine, isSaneLimit, resolveOutputReserve, getSdkContextLimit, resolveModelConfigOrDefault, promptSurfaceHashMaterial, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, SYNTH_USER_ID_PREFIX, resolvePiStableId, isMidTurnPi, readPiSessionMessages, findLastModelKeyFromBranch, convertEntriesToRawMessages, withContentLanguageDirective, withMigrationLanguageDirective, buildPrimaryLanguageDirective, computeCueContentHash, hasMuralCueColumns, getMuralCueState, memoryNeedsCue, setMuralCue, recordMuralCueRejection, invalidateMemory, computeNormalizedHash, hasMemoryShareableColumn, hasMemoryClassifiedAtColumn, getUnclassifiedMemoryIds, insertMemory, getMemoryByHash, getMemoriesByProject, getMemoriesByProjects, getMaxMemoryIdForProjects, getAllActiveMemoriesForMigration, getMemoryById, setMemoryClassification, archiveMemory, deleteMemory, getMemoryCount, getMemoryCountsByStatus, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getOpenCodeDbPath2 as getOpenCodeDbPath, parseCron, nextOccurrence, nextDueAtMs, DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE, DEFAULT_HISTORIAN_TIMEOUT_MS, buildCanonicalChunkTextFromFts, buildCompartmentSummaryFallbackText, canonicalizeInMemoryChunkTextForEmbedding, chunkCanonicalText, chunkEmbeddingWindowsAreCurrent, replaceCompartmentChunkEmbeddings, cosineSimilarity, GIT_SWEEP_LEASE_RENEWAL_MS, acquireGitSweepLease, renewGitSweepLease, markGitSweepSuccessAndRelease, parkGitSweepNonIndexable, releaseGitSweepLease, contentSha256, sweepStaleEmbeddingIdentitiesForProject, enqueueShadowEmbeddingItems, getProjectEmbeddingSnapshot, getProjectChunkEmbeddingModelId, getProjectEmbeddingMaxInputTokens, embedTextForProject, embedBatchForProject, embedItemsForProject, embedUnembeddedMemoriesForProject, drainCommitBacklogForProject, embedSessionCompartmentChunks, getEmbeddingCoverageStatus, promoteSessionFactsDurable, embedPromotedFacts, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles, wakePlaneStatus, indexCommitsForProject, embedUnembeddedCommits, loadPiConfig, ensureProjectRegisteredFromPiDirectory, resolveMuralWire, updateCompactionMarkerAfterPublication, COMPARTMENT_RENDER_EPOCH, encodeCachedM0UpgradeIdentity, decodeCachedM0UpgradeIdentity, DEFAULT_HISTORY_BUDGET_TOKENS, renderCompartmentAtTier, renderDecayedCompartments, extractM0Block, TEMPORAL_MARKER_PATTERN, temporalMarkerPrefix, clearInjectionCache, getVisibleMemoryIds, renderMemoryBlock, DEFAULT_MEMORY_BUDGET_TOKENS, DEFAULT_USER_PROFILE_BUDGET_TOKENS, trimMemoriesToBudgetV2, trimWorkspaceMemoriesToBudgetV2, trimUserMemoriesToBudget, renderMemoryBlockV2, stripMemoryMuralBlock, unifiedSearch, rememberTodowriteToolCallTodos, parseTodos, setTodoSnapshot, registerTodoOverlay, registerTodoStateLifecycle, registerMagicContextTools };