@cortexkit/pi-magic-context 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +3671 -3411
  2. package/dist/subagent-entry.js +1224 -988
  3. package/package.json +9 -9
@@ -6958,7 +6958,7 @@ var require_src = __commonJS((exports, module) => {
6958
6958
  };
6959
6959
  });
6960
6960
 
6961
- // ../../node_modules/.bun/comment-json@4.6.2/node_modules/comment-json/src/common.js
6961
+ // ../../node_modules/.bun/comment-json@5.0.0/node_modules/comment-json/src/common.js
6962
6962
  var require_common = __commonJS((exports, module) => {
6963
6963
  var PREFIX_BEFORE = "before";
6964
6964
  var PREFIX_AFTER_PROP = "after-prop";
@@ -6990,8 +6990,6 @@ var require_common = __commonJS((exports, module) => {
6990
6990
  var NON_PROP_SYMBOL_KEYS = NON_PROP_SYMBOL_PREFIXES.map(Symbol.for);
6991
6991
  var COLON = ":";
6992
6992
  var UNDEFINED = undefined;
6993
- var LINE_BREAKS_BEFORE = new WeakMap;
6994
- var LINE_BREAKS_AFTER = new WeakMap;
6995
6993
  var RAW_STRING_LITERALS = new WeakMap;
6996
6994
  var is_string = (subject) => typeof subject === "string";
6997
6995
  var is_number = (subject) => typeof subject === "number";
@@ -7094,17 +7092,49 @@ var require_common = __commonJS((exports, module) => {
7094
7092
  });
7095
7093
  return target;
7096
7094
  };
7097
- var is_raw_json = typeof JSON.isRawJSON === "function" ? JSON.isRawJSON : () => false;
7098
- var set_comment_line_breaks = (comment, before, after) => {
7099
- if (is_number(before) && before >= 0) {
7100
- LINE_BREAKS_BEFORE.set(comment, before);
7095
+ var is_comment_symbol = (subject) => {
7096
+ const key = Symbol.keyFor(subject);
7097
+ return is_string(key) && (NON_PROP_SYMBOL_PREFIXES.includes(key) || PROP_SYMBOL_PREFIXES.some((prefix) => key.indexOf(prefix + COLON) === 0));
7098
+ };
7099
+ var remove_blank_line_tokens = (comments) => {
7100
+ let write = 0;
7101
+ let removed = false;
7102
+ comments.forEach((comment) => {
7103
+ if (comment && comment.type === "BlankLine") {
7104
+ removed = true;
7105
+ return;
7106
+ }
7107
+ comments[write++] = comment;
7108
+ });
7109
+ comments.length = write;
7110
+ return removed;
7111
+ };
7112
+ var remove_blank_lines_from_prop = (target, prop) => {
7113
+ if (!Object.hasOwn(target, prop)) {
7114
+ return;
7101
7115
  }
7102
- if (is_number(after) && after >= 0) {
7103
- LINE_BREAKS_AFTER.set(comment, after);
7116
+ const comments = target[prop];
7117
+ if (!Array.isArray(comments) || !remove_blank_line_tokens(comments)) {
7118
+ return;
7104
7119
  }
7120
+ if (!comments.length) {
7121
+ delete target[prop];
7122
+ }
7123
+ };
7124
+ var remove_blank_lines_deep = (target) => {
7125
+ Object.getOwnPropertySymbols(target).forEach((prop) => {
7126
+ if (is_comment_symbol(prop)) {
7127
+ remove_blank_lines_from_prop(target, prop);
7128
+ }
7129
+ });
7130
+ Object.keys(target).forEach((key) => {
7131
+ const value = target[key];
7132
+ if (is_object(value)) {
7133
+ remove_blank_lines_deep(value);
7134
+ }
7135
+ });
7105
7136
  };
7106
- var get_comment_line_breaks_before = (comment) => LINE_BREAKS_BEFORE.get(comment);
7107
- var get_comment_line_breaks_after = (comment) => LINE_BREAKS_AFTER.get(comment);
7137
+ var is_raw_json = typeof JSON.isRawJSON === "function" ? JSON.isRawJSON : () => false;
7108
7138
  module.exports = {
7109
7139
  PROP_SYMBOL_PREFIXES,
7110
7140
  PREFIX_BEFORE,
@@ -7134,9 +7164,6 @@ var require_common = __commonJS((exports, module) => {
7134
7164
  is_raw_json,
7135
7165
  set_raw_string_literal,
7136
7166
  get_raw_string_literal,
7137
- set_comment_line_breaks,
7138
- get_comment_line_breaks_before,
7139
- get_comment_line_breaks_after,
7140
7167
  assign(target, source, keys) {
7141
7168
  if (!is_object(target)) {
7142
7169
  throw new TypeError("Cannot convert undefined or null to object");
@@ -7198,11 +7225,26 @@ var require_common = __commonJS((exports, module) => {
7198
7225
  return;
7199
7226
  }
7200
7227
  delete target[prop];
7228
+ },
7229
+ removeBlankLines(target, location) {
7230
+ if (!is_object(target)) {
7231
+ throw new TypeError("target must be an object");
7232
+ }
7233
+ if (location === UNDEFINED) {
7234
+ remove_blank_lines_deep(target);
7235
+ return;
7236
+ }
7237
+ const {
7238
+ where,
7239
+ key
7240
+ } = location;
7241
+ const prop = symbol_checked(where, key);
7242
+ remove_blank_lines_from_prop(target, prop);
7201
7243
  }
7202
7244
  };
7203
7245
  });
7204
7246
 
7205
- // ../../node_modules/.bun/comment-json@4.6.2/node_modules/comment-json/src/array.js
7247
+ // ../../node_modules/.bun/comment-json@5.0.0/node_modules/comment-json/src/array.js
7206
7248
  var require_array = __commonJS((exports, module) => {
7207
7249
  var { sort } = require_src();
7208
7250
  var {
@@ -7360,7 +7402,7 @@ var require_array = __commonJS((exports, module) => {
7360
7402
  };
7361
7403
  });
7362
7404
 
7363
- // ../../node_modules/.bun/comment-json@4.6.2/node_modules/comment-json/src/parse.js
7405
+ // ../../node_modules/.bun/comment-json@5.0.0/node_modules/comment-json/src/parse.js
7364
7406
  var require_parse = __commonJS((exports, module) => {
7365
7407
  var esprima = require_esprima();
7366
7408
  var {
@@ -7386,7 +7428,6 @@ var require_parse = __commonJS((exports, module) => {
7386
7428
  is_object,
7387
7429
  define: define2,
7388
7430
  set_raw_string_literal,
7389
- set_comment_line_breaks,
7390
7431
  assign_non_prop_comments
7391
7432
  } = require_common();
7392
7433
  var tokenize = (code) => esprima.tokenize(code, {
@@ -7400,23 +7441,27 @@ var require_parse = __commonJS((exports, module) => {
7400
7441
  var previous_props = [];
7401
7442
  var last_prop;
7402
7443
  var remove_comments = false;
7444
+ var remove_blank_lines = false;
7403
7445
  var inline = false;
7404
7446
  var tokens = null;
7405
7447
  var last = null;
7406
7448
  var current = null;
7407
7449
  var index;
7408
7450
  var reviver = null;
7451
+ var source_line_count = 0;
7409
7452
  var clean = () => {
7410
7453
  current_code = UNDEFINED;
7411
7454
  previous_props.length = previous_hosts.length = 0;
7412
7455
  last = null;
7413
7456
  last_prop = UNDEFINED;
7457
+ remove_blank_lines = false;
7414
7458
  };
7415
7459
  var free = () => {
7416
7460
  clean();
7417
7461
  tokens.length = 0;
7418
7462
  unassigned_comments = comments_host = tokens = last = current = reviver = null;
7419
7463
  current_code = UNDEFINED;
7464
+ source_line_count = 0;
7420
7465
  };
7421
7466
  var symbolFor = (prefix) => Symbol.for(last_prop !== UNDEFINED ? prefix + COLON + last_prop : prefix);
7422
7467
  var transform2 = (k, { value, context = {} }) => reviver ? reviver(k, value, context) : value;
@@ -7460,6 +7505,37 @@ var require_parse = __commonJS((exports, module) => {
7460
7505
  var restore_comments_host = () => {
7461
7506
  comments_host = previous_hosts.pop();
7462
7507
  };
7508
+ var create_blank_line = () => ({
7509
+ type: "BlankLine",
7510
+ inline: false
7511
+ });
7512
+ var append_blank_lines = (comments, from_line, to_line) => {
7513
+ if (remove_blank_lines) {
7514
+ return;
7515
+ }
7516
+ let blank_lines = Math.max(0, to_line - from_line - 1);
7517
+ while (blank_lines-- > 0) {
7518
+ comments.push(create_blank_line());
7519
+ }
7520
+ };
7521
+ var normalize_parse_options = (options) => {
7522
+ if (typeof options === "boolean") {
7523
+ return {
7524
+ no_comments: options,
7525
+ no_blank_lines: false
7526
+ };
7527
+ }
7528
+ if (!is_object(options)) {
7529
+ return {
7530
+ no_comments: false,
7531
+ no_blank_lines: false
7532
+ };
7533
+ }
7534
+ return {
7535
+ no_comments: !!options.no_comments,
7536
+ no_blank_lines: !!options.no_blank_lines
7537
+ };
7538
+ };
7463
7539
  var assign_after_comments = () => {
7464
7540
  if (!unassigned_comments) {
7465
7541
  return;
@@ -7492,26 +7568,26 @@ var require_parse = __commonJS((exports, module) => {
7492
7568
  };
7493
7569
  var parse_comments = (prefix) => {
7494
7570
  const comments = [];
7571
+ let previous_line = last ? last.loc.end.line : 0;
7495
7572
  while (current && (is("LineComment") || is("BlockComment"))) {
7573
+ append_blank_lines(comments, previous_line, current.loc.start.line);
7496
7574
  const comment = {
7497
7575
  ...current,
7498
7576
  inline
7499
7577
  };
7500
- const previous_line = last ? last.loc.end.line : 1;
7501
- set_comment_line_breaks(comment, Math.max(0, comment.loc.start.line - previous_line));
7502
7578
  comments.push(comment);
7579
+ previous_line = comment.loc.end.line;
7503
7580
  next();
7504
7581
  }
7505
- const { length } = comments;
7506
- if (length) {
7507
- const comment = comments[length - 1];
7508
- const current_line = current ? current.loc.start.line : comment.loc.end.line;
7509
- set_comment_line_breaks(comment, undefined, Math.max(0, current_line - comment.loc.end.line));
7510
- }
7582
+ append_blank_lines(comments, previous_line, current ? current.loc.start.line : source_line_count);
7511
7583
  if (remove_comments) {
7512
- return;
7584
+ for (let i = comments.length - 1;i >= 0; i--) {
7585
+ if (comments[i].type !== "BlankLine") {
7586
+ comments.splice(i, 1);
7587
+ }
7588
+ }
7513
7589
  }
7514
- if (!length) {
7590
+ if (!comments.length) {
7515
7591
  return;
7516
7592
  }
7517
7593
  if (prefix) {
@@ -7650,12 +7726,19 @@ var require_parse = __commonJS((exports, module) => {
7650
7726
  return {};
7651
7727
  }
7652
7728
  }
7653
- var parse5 = (code, rev, no_comments) => {
7729
+ var parse5 = (code, rev, options) => {
7654
7730
  clean();
7731
+ const {
7732
+ no_comments,
7733
+ no_blank_lines
7734
+ } = normalize_parse_options(options);
7655
7735
  current_code = code;
7736
+ source_line_count = code.split(`
7737
+ `).length;
7656
7738
  tokens = tokenize(code);
7657
7739
  reviver = rev;
7658
7740
  remove_comments = no_comments;
7741
+ remove_blank_lines = no_blank_lines;
7659
7742
  if (!tokens.length) {
7660
7743
  unexpected_end();
7661
7744
  }
@@ -7685,7 +7768,7 @@ var require_parse = __commonJS((exports, module) => {
7685
7768
  };
7686
7769
  });
7687
7770
 
7688
- // ../../node_modules/.bun/comment-json@4.6.2/node_modules/comment-json/src/stringify.js
7771
+ // ../../node_modules/.bun/comment-json@5.0.0/node_modules/comment-json/src/stringify.js
7689
7772
  var require_stringify = __commonJS((exports, module) => {
7690
7773
  var {
7691
7774
  PREFIX_BEFORE_ALL,
@@ -7707,8 +7790,6 @@ var require_stringify = __commonJS((exports, module) => {
7707
7790
  is_number,
7708
7791
  is_object,
7709
7792
  get_raw_string_literal,
7710
- get_comment_line_breaks_before,
7711
- get_comment_line_breaks_after,
7712
7793
  is_raw_json
7713
7794
  } = require_common();
7714
7795
  var SPACE = " ";
@@ -7723,26 +7804,18 @@ var require_stringify = __commonJS((exports, module) => {
7723
7804
  var quote = JSON.stringify;
7724
7805
  var comment_stringify = (value, line) => line ? `//${value}` : `/*${value}*/`;
7725
7806
  var repeat_line_breaks = (line_breaks, gap) => (LF + gap).repeat(line_breaks);
7726
- var read_line_breaks = (line_breaks) => is_number(line_breaks) && line_breaks >= 0 ? line_breaks : null;
7727
- var read_line_breaks_from_loc = (previous_comment, comment) => {
7728
- if (!previous_comment || !previous_comment.loc || !comment.loc) {
7729
- return null;
7730
- }
7731
- const { end } = previous_comment.loc;
7732
- const { start } = comment.loc;
7733
- if (!end || !start || !is_number(end.line) || !is_number(start.line)) {
7734
- return null;
7735
- }
7736
- const line_breaks = start.line - end.line;
7737
- return line_breaks >= 0 ? line_breaks : null;
7738
- };
7739
- var count_trailing_line_breaks = (str, gap) => {
7740
- const unit = LF + gap;
7741
- const { length } = unit;
7807
+ var is_inline_whitespace = (char) => char === SPACE || char === "\t";
7808
+ var count_trailing_line_breaks = (str) => {
7742
7809
  let i = str.length;
7743
7810
  let count = 0;
7744
- while (i >= length && str.slice(i - length, i) === unit) {
7745
- i -= length;
7811
+ while (i > 0) {
7812
+ while (i > 0 && is_inline_whitespace(str[i - 1])) {
7813
+ i--;
7814
+ }
7815
+ if (i === 0 || str[i - 1] !== LF) {
7816
+ return count;
7817
+ }
7818
+ i--;
7746
7819
  count++;
7747
7820
  }
7748
7821
  return count;
@@ -7753,27 +7826,30 @@ var require_stringify = __commonJS((exports, module) => {
7753
7826
  return EMPTY;
7754
7827
  }
7755
7828
  let str = EMPTY;
7829
+ let blank_lines = 0;
7756
7830
  let last_comment = null;
7757
7831
  comments.forEach((comment, i) => {
7832
+ if (comment.type === "BlankLine") {
7833
+ blank_lines++;
7834
+ return;
7835
+ }
7758
7836
  const {
7759
7837
  inline,
7760
7838
  type,
7761
7839
  value
7762
7840
  } = comment;
7763
- let line_breaks_before = read_line_breaks(get_comment_line_breaks_before(comment));
7764
- if (line_breaks_before === null) {
7765
- line_breaks_before = read_line_breaks_from_loc(last_comment, comment);
7766
- }
7767
- if (line_breaks_before === null) {
7768
- line_breaks_before = inline ? 0 : 1;
7769
- }
7770
- const delimiter = line_breaks_before > 0 ? repeat_line_breaks(line_breaks_before, deeper_gap) : inline ? SPACE : i === 0 ? EMPTY : LF + deeper_gap;
7841
+ const line_breaks_before = blank_lines > 0 ? blank_lines + (inline ? 0 : 1) : null;
7842
+ const delimiter = line_breaks_before > 0 ? repeat_line_breaks(line_breaks_before, deeper_gap) : inline ? SPACE : i === 0 && symbol_tag === PREFIX_BEFORE_ALL && deeper_gap === EMPTY ? EMPTY : LF + deeper_gap;
7771
7843
  const is_line_comment = type === "LineComment";
7772
7844
  str += delimiter + comment_stringify(value, is_line_comment);
7845
+ blank_lines = 0;
7773
7846
  last_comment = comment;
7774
7847
  });
7848
+ if (!last_comment) {
7849
+ return blank_lines ? repeat_line_breaks(blank_lines + 1, deeper_gap) : EMPTY;
7850
+ }
7775
7851
  const default_line_breaks_after = display_block || last_comment.type === "LineComment" ? 1 : 0;
7776
- const line_breaks_after = Math.max(default_line_breaks_after, read_line_breaks(get_comment_line_breaks_after(last_comment)) || 0);
7852
+ const line_breaks_after = blank_lines > 0 ? blank_lines + 1 : default_line_breaks_after;
7777
7853
  return str + repeat_line_breaks(line_breaks_after, deeper_gap);
7778
7854
  };
7779
7855
  var replacer = null;
@@ -7782,7 +7858,7 @@ var require_stringify = __commonJS((exports, module) => {
7782
7858
  replacer = null;
7783
7859
  indent = EMPTY;
7784
7860
  };
7785
- var join5 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + repeat_line_breaks(Math.max(1, count_trailing_line_breaks(one, gap)), gap) : two ? two.trimRight() + repeat_line_breaks(Math.max(1, count_trailing_line_breaks(two, gap)), gap) : EMPTY;
7861
+ var join5 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + repeat_line_breaks(Math.max(1, count_trailing_line_breaks(one)), gap) : two ? two.trimRight() + repeat_line_breaks(Math.max(1, count_trailing_line_breaks(two)), gap) : EMPTY;
7786
7862
  var join_content = (inside, value, gap) => {
7787
7863
  const comment = process_comments(value, PREFIX_BEFORE, gap + indent, true);
7788
7864
  return join5(comment, inside, gap);
@@ -7881,6 +7957,8 @@ var require_stringify = __commonJS((exports, module) => {
7881
7957
  const str = toString.call(subject);
7882
7958
  return PRIMITIVE_OBJECT_TYPES.includes(str);
7883
7959
  };
7960
+ var normalize_blank_lines = (str) => typeof str === "string" ? str.replace(/\n[ \t]+(?=\n)/g, `
7961
+ `) : str;
7884
7962
  module.exports = (value, replacer_, space) => {
7885
7963
  const indent_ = get_indent(space);
7886
7964
  if (!indent_) {
@@ -7893,11 +7971,12 @@ var require_stringify = __commonJS((exports, module) => {
7893
7971
  indent = indent_;
7894
7972
  const str = is_primitive_object(value) ? JSON.stringify(value) : stringify("", { "": value }, EMPTY);
7895
7973
  clean();
7896
- return is_object(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY, true).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str;
7974
+ const output = is_object(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY, true).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str;
7975
+ return normalize_blank_lines(output);
7897
7976
  };
7898
7977
  });
7899
7978
 
7900
- // ../../node_modules/.bun/comment-json@4.6.2/node_modules/comment-json/src/index.js
7979
+ // ../../node_modules/.bun/comment-json@5.0.0/node_modules/comment-json/src/index.js
7901
7980
  var require_src2 = __commonJS((exports, module) => {
7902
7981
  var { parse: parse5, tokenize } = require_parse();
7903
7982
  var stringify = require_stringify();
@@ -7912,7 +7991,8 @@ var require_src2 = __commonJS((exports, module) => {
7912
7991
  PREFIX_AFTER_ALL,
7913
7992
  assign,
7914
7993
  moveComments,
7915
- removeComments
7994
+ removeComments,
7995
+ removeBlankLines
7916
7996
  } = require_common();
7917
7997
  module.exports = {
7918
7998
  PREFIX_BEFORE,
@@ -7928,7 +8008,8 @@ var require_src2 = __commonJS((exports, module) => {
7928
8008
  CommentArray,
7929
8009
  assign,
7930
8010
  moveComments,
7931
- removeComments
8011
+ removeComments,
8012
+ removeBlankLines
7932
8013
  };
7933
8014
  });
7934
8015
 
@@ -8080,6 +8161,102 @@ function closeQuietly(db) {
8080
8161
  // ../plugin/src/features/magic-context/migrations.ts
8081
8162
  init_logger();
8082
8163
 
8164
+ // ../plugin/src/features/magic-context/storage-schema-helpers.ts
8165
+ function ensureColumn(db, table, column, definition) {
8166
+ if (!/^[a-z][a-z0-9_]*$/.test(table) || !/^[a-z][a-z0-9_]*$/.test(column) || !/^[A-Z0-9_"'(),[\]\s]+$/i.test(definition)) {
8167
+ throw new Error(`Unsafe schema identifier: ${table}.${column} ${definition}`);
8168
+ }
8169
+ const rows = db.prepare(`PRAGMA table_info(${table})`).all();
8170
+ if (rows.some((row) => row.name === column)) {
8171
+ return;
8172
+ }
8173
+ try {
8174
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
8175
+ } catch (err) {
8176
+ const recheck = db.prepare(`PRAGMA table_info(${table})`).all();
8177
+ if (recheck.some((row) => row.name === column)) {
8178
+ return;
8179
+ }
8180
+ throw err;
8181
+ }
8182
+ }
8183
+ function healAllNullColumns(db) {
8184
+ healNullTextColumns(db);
8185
+ healNullIntegerColumns(db);
8186
+ healMissingMemoryBlockIds(db);
8187
+ }
8188
+ function healMissingMemoryBlockIds(db) {
8189
+ try {
8190
+ db.prepare("UPDATE session_meta SET memory_block_cache = '' WHERE memory_block_cache != '' AND (memory_block_ids IS NULL OR memory_block_ids = '') AND memory_block_count > 0").run();
8191
+ } catch {}
8192
+ }
8193
+ function healNullTextColumns(db) {
8194
+ const columns = [
8195
+ ["cache_ttl", ""],
8196
+ ["last_nudge_band", ""],
8197
+ ["last_nudge_level", ""],
8198
+ ["last_transform_error", ""],
8199
+ ["nudge_anchor_message_id", ""],
8200
+ ["nudge_anchor_text", ""],
8201
+ ["sticky_turn_reminder_text", ""],
8202
+ ["sticky_turn_reminder_message_id", ""],
8203
+ ["note_nudge_trigger_message_id", ""],
8204
+ ["note_nudge_sticky_text", ""],
8205
+ ["note_nudge_sticky_message_id", ""],
8206
+ ["last_todo_state", ""],
8207
+ ["todo_synthetic_call_id", ""],
8208
+ ["todo_synthetic_anchor_message_id", ""],
8209
+ ["todo_synthetic_state_json", ""],
8210
+ ["system_prompt_hash", ""],
8211
+ ["stripped_placeholder_ids", ""],
8212
+ ["stale_reduce_stripped_ids", ""],
8213
+ ["processed_image_stripped_ids", ""],
8214
+ ["memory_block_cache", ""],
8215
+ ["memory_block_ids", ""],
8216
+ ["compaction_marker_state", ""],
8217
+ ["key_files", ""]
8218
+ ];
8219
+ for (const [column, fallback] of columns) {
8220
+ try {
8221
+ db.prepare(`UPDATE session_meta SET ${column} = ? WHERE ${column} IS NULL`).run(fallback);
8222
+ } catch (_error) {}
8223
+ }
8224
+ }
8225
+ function healNullIntegerColumns(db) {
8226
+ const columns = [
8227
+ ["times_execute_threshold_reached", 0],
8228
+ ["compartment_in_progress", 0],
8229
+ ["historian_failure_count", 0],
8230
+ ["cleared_reasoning_through_tag", 0],
8231
+ ["memory_block_count", 0],
8232
+ ["system_prompt_tokens", 0],
8233
+ ["conversation_tokens", 0],
8234
+ ["tool_call_tokens", 0],
8235
+ ["note_nudge_trigger_pending", 0],
8236
+ ["observed_safe_input_tokens", 0],
8237
+ ["cache_alert_sent", 0],
8238
+ ["new_work_tokens", 0],
8239
+ ["total_input_tokens", 0],
8240
+ ["last_emergency_input_sample", 0],
8241
+ ["channel2_nudge_claimed_at", 0],
8242
+ ["last_usage_context_limit", 0],
8243
+ ["prior_boundary_ordinal", 1],
8244
+ ["protected_tail_policy_version", 0],
8245
+ ["protected_tail_drain_window_started_at", 0],
8246
+ ["protected_tail_drain_tokens", 0],
8247
+ ["recovery_no_eligible_head_count", 0],
8248
+ ["force_emergency_bypass_window_start", 0],
8249
+ ["force_emergency_bypass_used", 0],
8250
+ ["emergency_drain_active", 0],
8251
+ ["historian_drain_failure_at", 0]
8252
+ ];
8253
+ for (const [column, fallback] of columns) {
8254
+ try {
8255
+ db.prepare(`UPDATE session_meta SET ${column} = ? WHERE ${column} IS NULL`).run(fallback);
8256
+ } catch (_error) {}
8257
+ }
8258
+ }
8259
+
8083
8260
  // ../plugin/src/features/magic-context/workspaces.ts
8084
8261
  import { createHash as createHash2 } from "node:crypto";
8085
8262
 
@@ -143916,11 +144093,6 @@ CREATE INDEX IF NOT EXISTS idx_dream_queue_pending ON dream_queue(started_at, en
143916
144093
  ensureColumn(db, "message_history_index", "harness", "TEXT NOT NULL DEFAULT 'opencode'");
143917
144094
  ensureColumn(db, "workspaces", "share_categories", `TEXT NOT NULL DEFAULT '["CONSTRAINTS"]'`);
143918
144095
  }
143919
- function healAllNullColumns(db) {
143920
- healNullTextColumns(db);
143921
- healNullIntegerColumns(db);
143922
- healMissingMemoryBlockIds(db);
143923
- }
143924
144096
  var CHANNEL2_CLAIM_TTL_MS = 120000;
143925
144097
  function healWedgedChannel2Claims(db) {
143926
144098
  try {
@@ -143928,95 +144100,6 @@ function healWedgedChannel2Claims(db) {
143928
144100
  db.prepare("UPDATE session_meta SET channel2_nudge_state = 'pending', channel2_nudge_claimed_at = 0 WHERE channel2_nudge_state = 'claimed' AND (channel2_nudge_claimed_at IS NULL OR channel2_nudge_claimed_at = 0 OR channel2_nudge_claimed_at <= ?)").run(staleBefore);
143929
144101
  } catch {}
143930
144102
  }
143931
- function healMissingMemoryBlockIds(db) {
143932
- try {
143933
- db.prepare("UPDATE session_meta SET memory_block_cache = '' WHERE memory_block_cache != '' AND (memory_block_ids IS NULL OR memory_block_ids = '') AND memory_block_count > 0").run();
143934
- } catch {}
143935
- }
143936
- function healNullTextColumns(db) {
143937
- const columns = [
143938
- ["cache_ttl", ""],
143939
- ["last_nudge_band", ""],
143940
- ["last_nudge_level", ""],
143941
- ["last_transform_error", ""],
143942
- ["nudge_anchor_message_id", ""],
143943
- ["nudge_anchor_text", ""],
143944
- ["sticky_turn_reminder_text", ""],
143945
- ["sticky_turn_reminder_message_id", ""],
143946
- ["note_nudge_trigger_message_id", ""],
143947
- ["note_nudge_sticky_text", ""],
143948
- ["note_nudge_sticky_message_id", ""],
143949
- ["last_todo_state", ""],
143950
- ["todo_synthetic_call_id", ""],
143951
- ["todo_synthetic_anchor_message_id", ""],
143952
- ["todo_synthetic_state_json", ""],
143953
- ["system_prompt_hash", ""],
143954
- ["stripped_placeholder_ids", ""],
143955
- ["stale_reduce_stripped_ids", ""],
143956
- ["processed_image_stripped_ids", ""],
143957
- ["memory_block_cache", ""],
143958
- ["memory_block_ids", ""],
143959
- ["compaction_marker_state", ""],
143960
- ["key_files", ""]
143961
- ];
143962
- for (const [column, fallback] of columns) {
143963
- try {
143964
- db.prepare(`UPDATE session_meta SET ${column} = ? WHERE ${column} IS NULL`).run(fallback);
143965
- } catch (_error) {}
143966
- }
143967
- }
143968
- function healNullIntegerColumns(db) {
143969
- const columns = [
143970
- ["times_execute_threshold_reached", 0],
143971
- ["compartment_in_progress", 0],
143972
- ["historian_failure_count", 0],
143973
- ["cleared_reasoning_through_tag", 0],
143974
- ["memory_block_count", 0],
143975
- ["system_prompt_tokens", 0],
143976
- ["conversation_tokens", 0],
143977
- ["tool_call_tokens", 0],
143978
- ["note_nudge_trigger_pending", 0],
143979
- ["observed_safe_input_tokens", 0],
143980
- ["cache_alert_sent", 0],
143981
- ["new_work_tokens", 0],
143982
- ["total_input_tokens", 0],
143983
- ["last_emergency_input_sample", 0],
143984
- ["channel2_nudge_claimed_at", 0],
143985
- ["last_usage_context_limit", 0],
143986
- ["prior_boundary_ordinal", 1],
143987
- ["protected_tail_policy_version", 0],
143988
- ["protected_tail_drain_window_started_at", 0],
143989
- ["protected_tail_drain_tokens", 0],
143990
- ["recovery_no_eligible_head_count", 0],
143991
- ["force_emergency_bypass_window_start", 0],
143992
- ["force_emergency_bypass_used", 0],
143993
- ["emergency_drain_active", 0],
143994
- ["historian_drain_failure_at", 0]
143995
- ];
143996
- for (const [column, fallback] of columns) {
143997
- try {
143998
- db.prepare(`UPDATE session_meta SET ${column} = ? WHERE ${column} IS NULL`).run(fallback);
143999
- } catch (_error) {}
144000
- }
144001
- }
144002
- function ensureColumn(db, table, column, definition) {
144003
- if (!/^[a-z][a-z0-9_]*$/.test(table) || !/^[a-z][a-z0-9_]*$/.test(column) || !/^[A-Z0-9_"'(),[\]\s]+$/i.test(definition)) {
144004
- throw new Error(`Unsafe schema identifier: ${table}.${column} ${definition}`);
144005
- }
144006
- const rows = db.prepare(`PRAGMA table_info(${table})`).all();
144007
- if (rows.some((row) => row.name === column)) {
144008
- return;
144009
- }
144010
- try {
144011
- db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
144012
- } catch (err) {
144013
- const recheck = db.prepare(`PRAGMA table_info(${table})`).all();
144014
- if (recheck.some((row) => row.name === column)) {
144015
- return;
144016
- }
144017
- throw err;
144018
- }
144019
- }
144020
144103
  function openDatabase(dbPathOrOptions) {
144021
144104
  const options = typeof dbPathOrOptions === "string" ? { dbPath: dbPathOrOptions } : dbPathOrOptions;
144022
144105
  const explicitDbPath = options?.dbPath !== undefined;
@@ -159440,7 +159523,6 @@ var CANONICAL_DREAM_TASKS = [
159440
159523
  "refresh-primers"
159441
159524
  ];
159442
159525
  var AGENTIC_DREAM_TASKS = ["curate", "maintain-docs"];
159443
- var AGENTIC_SET = new Set(AGENTIC_DREAM_TASKS);
159444
159526
  var MEMORY_DOMAIN_TASKS = [
159445
159527
  "map-memories",
159446
159528
  "verify",
@@ -164193,7 +164275,7 @@ ${partLines.join(`
164193
164275
  `), lastOrdinal, truncated };
164194
164276
  }
164195
164277
 
164196
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/memory.mjs
164278
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/memory.mjs
164197
164279
  var exports_memory = {};
164198
164280
  __export(exports_memory, {
164199
164281
  Update: () => Update,
@@ -164204,7 +164286,7 @@ __export(exports_memory, {
164204
164286
  Assign: () => Assign
164205
164287
  });
164206
164288
 
164207
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/metrics.mjs
164289
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/metrics.mjs
164208
164290
  var Metrics = {
164209
164291
  assign: 0,
164210
164292
  create: 0,
@@ -164213,17 +164295,17 @@ var Metrics = {
164213
164295
  update: 0
164214
164296
  };
164215
164297
 
164216
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/assign.mjs
164298
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/assign.mjs
164217
164299
  function Assign(left, right) {
164218
164300
  Metrics.assign += 1;
164219
164301
  return { ...left, ...right };
164220
164302
  }
164221
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/guard/guard.mjs
164303
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/guard.mjs
164222
164304
  var exports_guard = {};
164223
164305
  __export(exports_guard, {
164224
164306
  Values: () => Values,
164225
- TakeLeft: () => TakeLeft,
164226
164307
  Symbols: () => Symbols,
164308
+ ShiftLeft: () => ShiftLeft,
164227
164309
  Keys: () => Keys,
164228
164310
  IsValueLike: () => IsValueLike,
164229
164311
  IsUnsafePropertyKey: () => IsUnsafePropertyKey,
@@ -164239,7 +164321,6 @@ __export(exports_guard, {
164239
164321
  IsMaxLength: () => IsMaxLength2,
164240
164322
  IsLessThan: () => IsLessThan,
164241
164323
  IsLessEqualThan: () => IsLessEqualThan,
164242
- IsIterator: () => IsIterator,
164243
164324
  IsInteger: () => IsInteger,
164244
164325
  IsGreaterThan: () => IsGreaterThan,
164245
164326
  IsGreaterEqualThan: () => IsGreaterEqualThan,
@@ -164250,7 +164331,6 @@ __export(exports_guard, {
164250
164331
  IsClassInstance: () => IsClassInstance,
164251
164332
  IsBoolean: () => IsBoolean,
164252
164333
  IsBigInt: () => IsBigInt,
164253
- IsAsyncIterator: () => IsAsyncIterator,
164254
164334
  IsArray: () => IsArray,
164255
164335
  HasPropertyKey: () => HasPropertyKey,
164256
164336
  GraphemeCount: () => GraphemeCount2,
@@ -164260,7 +164340,7 @@ __export(exports_guard, {
164260
164340
  Entries: () => Entries
164261
164341
  });
164262
164342
 
164263
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/guard/string.mjs
164343
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/string.mjs
164264
164344
  function IsBetween(value, min, max) {
164265
164345
  return value >= min && value <= max;
164266
164346
  }
@@ -164364,13 +164444,10 @@ function IsMaxLengthFast(value, maxLength) {
164364
164444
  return true;
164365
164445
  }
164366
164446
 
164367
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/guard/guard.mjs
164447
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/guard.mjs
164368
164448
  function IsArray(value) {
164369
164449
  return Array.isArray(value);
164370
164450
  }
164371
- function IsAsyncIterator(value) {
164372
- return IsObject(value) && Symbol.asyncIterator in value;
164373
- }
164374
164451
  function IsBigInt(value) {
164375
164452
  return IsEqual(typeof value, "bigint");
164376
164453
  }
@@ -164393,9 +164470,6 @@ function IsFunction(value) {
164393
164470
  function IsInteger(value) {
164394
164471
  return Number.isInteger(value);
164395
164472
  }
164396
- function IsIterator(value) {
164397
- return IsObject(value) && Symbol.iterator in value;
164398
- }
164399
164473
  function IsNull(value) {
164400
164474
  return IsEqual(value, null);
164401
164475
  }
@@ -164479,7 +164553,7 @@ function EveryAll(value, offset, callback) {
164479
164553
  }
164480
164554
  return result;
164481
164555
  }
164482
- function TakeLeft(array2, true_, false_) {
164556
+ function ShiftLeft(array2, true_, false_) {
164483
164557
  return IsEqual(array2.length, 0) ? false_() : true_(array2[0], array2.slice(1));
164484
164558
  }
164485
164559
  function IsUnsafePropertyKey(key) {
@@ -164515,20 +164589,99 @@ function DeepEqualArray(left, right) {
164515
164589
  function IsDeepEqual(left, right) {
164516
164590
  return IsArray(left) ? DeepEqualArray(left, right) : IsObject(left) ? DeepEqualObject(left, right) : IsEqual(left, right);
164517
164591
  }
164518
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/clone.mjs
164519
- function IsGuard(value) {
164520
- return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~guard");
164592
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/guard/globals.mjs
164593
+ var exports_globals = {};
164594
+ __export(exports_globals, {
164595
+ IsUint8ClampedArray: () => IsUint8ClampedArray,
164596
+ IsUint8Array: () => IsUint8Array,
164597
+ IsUint32Array: () => IsUint32Array,
164598
+ IsUint16Array: () => IsUint16Array,
164599
+ IsTypeArray: () => IsTypeArray,
164600
+ IsString: () => IsString2,
164601
+ IsSet: () => IsSet,
164602
+ IsRegExp: () => IsRegExp,
164603
+ IsNumber: () => IsNumber2,
164604
+ IsMap: () => IsMap,
164605
+ IsInt8Array: () => IsInt8Array,
164606
+ IsInt32Array: () => IsInt32Array,
164607
+ IsInt16Array: () => IsInt16Array,
164608
+ IsFloat64Array: () => IsFloat64Array,
164609
+ IsFloat32Array: () => IsFloat32Array,
164610
+ IsDate: () => IsDate,
164611
+ IsBoolean: () => IsBoolean2,
164612
+ IsBigUint64Array: () => IsBigUint64Array,
164613
+ IsBigInt64Array: () => IsBigInt64Array
164614
+ });
164615
+ function IsBoolean2(value) {
164616
+ return value instanceof Boolean;
164617
+ }
164618
+ function IsNumber2(value) {
164619
+ return value instanceof Number;
164620
+ }
164621
+ function IsString2(value) {
164622
+ return value instanceof String;
164623
+ }
164624
+ function IsTypeArray(value) {
164625
+ return globalThis.ArrayBuffer.isView(value);
164626
+ }
164627
+ function IsInt8Array(value) {
164628
+ return value instanceof globalThis.Int8Array;
164629
+ }
164630
+ function IsUint8Array(value) {
164631
+ return value instanceof globalThis.Uint8Array;
164632
+ }
164633
+ function IsUint8ClampedArray(value) {
164634
+ return value instanceof globalThis.Uint8ClampedArray;
164635
+ }
164636
+ function IsInt16Array(value) {
164637
+ return value instanceof globalThis.Int16Array;
164638
+ }
164639
+ function IsUint16Array(value) {
164640
+ return value instanceof globalThis.Uint16Array;
164641
+ }
164642
+ function IsInt32Array(value) {
164643
+ return value instanceof globalThis.Int32Array;
164644
+ }
164645
+ function IsUint32Array(value) {
164646
+ return value instanceof globalThis.Uint32Array;
164521
164647
  }
164522
- function FromGuard(value) {
164648
+ function IsFloat32Array(value) {
164649
+ return value instanceof globalThis.Float32Array;
164650
+ }
164651
+ function IsFloat64Array(value) {
164652
+ return value instanceof globalThis.Float64Array;
164653
+ }
164654
+ function IsBigInt64Array(value) {
164655
+ return value instanceof globalThis.BigInt64Array;
164656
+ }
164657
+ function IsBigUint64Array(value) {
164658
+ return value instanceof globalThis.BigUint64Array;
164659
+ }
164660
+ function IsRegExp(value) {
164661
+ return value instanceof globalThis.RegExp;
164662
+ }
164663
+ function IsDate(value) {
164664
+ return value instanceof globalThis.Date;
164665
+ }
164666
+ function IsSet(value) {
164667
+ return value instanceof globalThis.Set;
164668
+ }
164669
+ function IsMap(value) {
164670
+ return value instanceof globalThis.Map;
164671
+ }
164672
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/clone.mjs
164673
+ function FromClassInstance(value) {
164523
164674
  return value;
164524
164675
  }
164525
- function FromArray(value) {
164526
- return value.map((value2) => FromValue(value2));
164676
+ function IsTypeObject(value) {
164677
+ return exports_guard.HasPropertyKey(value, "~kind") || exports_guard.HasPropertyKey(value, "~unsafe");
164527
164678
  }
164528
- function FromObject(value) {
164679
+ function FromTypeObject(value) {
164529
164680
  const result = {};
164530
164681
  const descriptors = Object.getOwnPropertyDescriptors(value);
164531
164682
  for (const key of Object.keys(descriptors)) {
164683
+ if (exports_guard.IsUnsafePropertyKey(key))
164684
+ continue;
164532
164685
  const descriptor = descriptors[key];
164533
164686
  if (exports_guard.HasPropertyKey(descriptor, "value")) {
164534
164687
  Object.defineProperty(result, key, { ...descriptor, value: FromValue(descriptor.value) });
@@ -164536,20 +164689,44 @@ function FromObject(value) {
164536
164689
  }
164537
164690
  return result;
164538
164691
  }
164692
+ function FromPlainObject(value) {
164693
+ const result = {};
164694
+ for (const key of exports_guard.Keys(value)) {
164695
+ if (exports_guard.IsUnsafePropertyKey(key))
164696
+ continue;
164697
+ result[key] = FromValue(value[key]);
164698
+ }
164699
+ for (const key of exports_guard.Symbols(value)) {
164700
+ result[key] = FromValue(value[key]);
164701
+ }
164702
+ return result;
164703
+ }
164704
+ function FromObject(value) {
164705
+ return exports_guard.IsClassInstance(value) ? FromClassInstance(value) : IsTypeObject(value) ? FromTypeObject(value) : FromPlainObject(value);
164706
+ }
164707
+ function FromArray(value) {
164708
+ return value.map((element) => FromValue(element));
164709
+ }
164710
+ function FromTypedArray(value) {
164711
+ return value.slice();
164712
+ }
164539
164713
  function FromRegExp(value) {
164540
164714
  return new RegExp(value.source, value.flags);
164541
164715
  }
164542
- function FromUnknown(value) {
164543
- return value;
164716
+ function FromMap(value) {
164717
+ return new Map(FromValue([...value.entries()]));
164718
+ }
164719
+ function FromSet(value) {
164720
+ return new Set(FromValue([...value.values()]));
164544
164721
  }
164545
164722
  function FromValue(value) {
164546
- return value instanceof RegExp ? FromRegExp(value) : IsGuard(value) ? FromGuard(value) : exports_guard.IsArray(value) ? FromArray(value) : exports_guard.IsObject(value) ? FromObject(value) : FromUnknown(value);
164723
+ return exports_globals.IsTypeArray(value) ? FromTypedArray(value) : exports_globals.IsRegExp(value) ? FromRegExp(value) : exports_globals.IsMap(value) ? FromMap(value) : exports_globals.IsSet(value) ? FromSet(value) : exports_guard.IsArray(value) ? FromArray(value) : exports_guard.IsObject(value) ? FromObject(value) : value;
164547
164724
  }
164548
164725
  function Clone(value) {
164549
164726
  Metrics.clone += 1;
164550
164727
  return FromValue(value);
164551
164728
  }
164552
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/settings/settings.mjs
164729
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/settings/settings.mjs
164553
164730
  var exports_settings = {};
164554
164731
  __export(exports_settings, {
164555
164732
  Set: () => Set2,
@@ -164562,7 +164739,8 @@ var settings = {
164562
164739
  useAcceleration: true,
164563
164740
  exactOptionalPropertyTypes: false,
164564
164741
  enumerableKind: false,
164565
- correctiveParse: false
164742
+ correctiveParse: false,
164743
+ unionPrioritySort: true
164566
164744
  };
164567
164745
  function Reset() {
164568
164746
  settings.immutableTypes = false;
@@ -164571,6 +164749,7 @@ function Reset() {
164571
164749
  settings.exactOptionalPropertyTypes = false;
164572
164750
  settings.enumerableKind = false;
164573
164751
  settings.correctiveParse = false;
164752
+ settings.unionPrioritySort = true;
164574
164753
  }
164575
164754
  function Set2(options) {
164576
164755
  for (const key of exports_guard.Keys(options)) {
@@ -164583,7 +164762,7 @@ function Set2(options) {
164583
164762
  function Get() {
164584
164763
  return settings;
164585
164764
  }
164586
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/create.mjs
164765
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/create.mjs
164587
164766
  function MergeHidden(left, right) {
164588
164767
  for (const key of Object.keys(right)) {
164589
164768
  Object.defineProperty(left, key, {
@@ -164605,7 +164784,7 @@ function Create(hidden, enumerable, options = {}) {
164605
164784
  const withHidden = settings2.enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
164606
164785
  return settings2.immutableTypes ? Object.freeze(withHidden) : withHidden;
164607
164786
  }
164608
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/discard.mjs
164787
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/discard.mjs
164609
164788
  function Discard(value, propertyKeys) {
164610
164789
  Metrics.discard += 1;
164611
164790
  const result = {};
@@ -164618,7 +164797,7 @@ function Discard(value, propertyKeys) {
164618
164797
  }
164619
164798
  return result;
164620
164799
  }
164621
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/memory/update.mjs
164800
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/memory/update.mjs
164622
164801
  function Update(current, hidden, enumerable) {
164623
164802
  Metrics.update += 1;
164624
164803
  const settings2 = exports_settings.Get();
@@ -164641,7 +164820,7 @@ function Update(current, hidden, enumerable) {
164641
164820
  }
164642
164821
  return result;
164643
164822
  }
164644
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/schema.mjs
164823
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/schema.mjs
164645
164824
  function IsKind(value, kind) {
164646
164825
  return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~kind") && exports_guard.IsEqual(value["~kind"], kind);
164647
164826
  }
@@ -164649,136 +164828,41 @@ function IsSchema(value) {
164649
164828
  return exports_guard.IsObject(value);
164650
164829
  }
164651
164830
 
164652
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/_optional.mjs
164653
- function OptionalAddAction(type) {
164654
- return exports_memory.Create({ ["~kind"]: "OptionalAddAction" }, { type }, {});
164655
- }
164656
- function IsOptionalAddAction(value) {
164657
- return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~kind") && exports_guard.HasPropertyKey(value, "type") && exports_guard.IsEqual(value["~kind"], "OptionalAddAction") && IsSchema(value.type);
164658
- }
164659
- function OptionalRemoveAction(type) {
164660
- return exports_memory.Create({ ["~kind"]: "OptionalRemoveAction" }, { type }, {});
164661
- }
164662
- function IsOptionalRemoveAction(value) {
164663
- return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~kind") && exports_guard.HasPropertyKey(value, "type") && exports_guard.IsEqual(value["~kind"], "OptionalRemoveAction") && IsSchema(value.type);
164664
- }
164665
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/_readonly.mjs
164666
- function ReadonlyAddAction(type) {
164667
- return exports_memory.Create({ ["~kind"]: "ReadonlyAddAction" }, { type }, {});
164668
- }
164669
- function IsReadonlyAddAction(value) {
164670
- return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~kind") && exports_guard.HasPropertyKey(value, "type") && exports_guard.IsEqual(value["~kind"], "ReadonlyAddAction") && IsSchema(value.type);
164671
- }
164672
- function ReadonlyRemoveAction(type) {
164673
- return exports_memory.Create({ ["~kind"]: "ReadonlyRemoveAction" }, { type }, {});
164674
- }
164675
- function IsReadonlyRemoveAction(value) {
164676
- return exports_guard.IsObject(value) && exports_guard.HasPropertyKey(value, "~kind") && exports_guard.HasPropertyKey(value, "type") && exports_guard.IsEqual(value["~kind"], "ReadonlyRemoveAction") && IsSchema(value.type);
164677
- }
164678
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/deferred.mjs
164831
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/deferred.mjs
164679
164832
  function Deferred(action, parameters, options) {
164680
- return exports_memory.Create({ "~kind": "Deferred" }, { action, parameters, options }, {});
164833
+ return exports_memory.Create({ "~kind": "Deferred" }, { type: "deferred", action, parameters, options }, {});
164681
164834
  }
164682
164835
  function IsDeferred(value) {
164683
164836
  return IsKind(value, "Deferred");
164684
164837
  }
164685
164838
 
164686
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/promise.mjs
164687
- function _Promise_(item, options) {
164688
- return exports_memory.Create({ ["~kind"]: "Promise" }, { type: "promise", item }, options);
164689
- }
164690
- function IsPromise(value) {
164691
- return IsKind(value, "Promise");
164692
- }
164693
- function PromiseOptions(type) {
164694
- return exports_memory.Discard(type, ["~kind", "type", "item"]);
164695
- }
164696
-
164697
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/_immutable.mjs
164698
- function ImmutableAdd(type) {
164699
- return exports_memory.Update(type, { "~immutable": true }, {});
164700
- }
164701
- function Immutable(type) {
164702
- return ImmutableAdd(type);
164703
- }
164704
- function IsImmutable(value) {
164705
- return IsSchema(value) && exports_guard.HasPropertyKey(value, "~immutable");
164706
- }
164707
-
164708
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/_optional.mjs
164709
- function OptionalRemove(type) {
164710
- const result = exports_memory.Discard(type, ["~optional"]);
164711
- return result;
164712
- }
164713
- function OptionalAdd(type) {
164714
- return exports_memory.Update(type, { "~optional": true }, {});
164715
- }
164716
- function Optional(type) {
164717
- return OptionalAdd(type);
164718
- }
164719
- function IsOptional(value) {
164720
- return IsSchema(value) && exports_guard.HasPropertyKey(value, "~optional");
164721
- }
164722
-
164723
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/_readonly.mjs
164724
- function ReadonlyRemove(type) {
164725
- return exports_memory.Discard(type, ["~readonly"]);
164726
- }
164727
- function ReadonlyAdd(type) {
164839
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs
164840
+ function AddReadonlyOperation(type) {
164728
164841
  return exports_memory.Update(type, { "~readonly": true }, {});
164729
164842
  }
164730
- function Readonly(type) {
164731
- return ReadonlyAdd(type);
164843
+ function AddReadonlyAction(type, options) {
164844
+ const result = exports_memory.Update(AddReadonlyOperation(type), {}, options);
164845
+ return result;
164732
164846
  }
164733
- function IsReadonly(value) {
164734
- return IsSchema(value) && exports_guard.HasPropertyKey(value, "~readonly");
164847
+ function AddReadonlyInstantiate(context, state, type, options) {
164848
+ const instantiatedType = InstantiateType(context, state, type);
164849
+ return AddReadonlyAction(instantiatedType, options);
164735
164850
  }
164736
164851
 
164737
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/base.mjs
164738
- function BaseProperty(value) {
164739
- return {
164740
- enumerable: exports_settings.Get().enumerableKind,
164741
- writable: false,
164742
- configurable: false,
164743
- value
164744
- };
164852
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs
164853
+ function AddOptionalOperation(type) {
164854
+ return exports_memory.Update(type, { "~optional": true }, {});
164745
164855
  }
164746
-
164747
- class Base {
164748
- constructor() {
164749
- globalThis.Object.defineProperty(this, "~kind", BaseProperty("Base"));
164750
- globalThis.Object.defineProperty(this, "~guard", BaseProperty({
164751
- check: (value) => this.Check(value),
164752
- errors: (value) => this.Errors(value)
164753
- }));
164754
- }
164755
- Check(_value) {
164756
- return true;
164757
- }
164758
- Errors(_value) {
164759
- return [];
164760
- }
164761
- Convert(value) {
164762
- return value;
164763
- }
164764
- Clean(value) {
164765
- return value;
164766
- }
164767
- Default(value) {
164768
- return value;
164769
- }
164770
- Create() {
164771
- throw new Error("Create not implemented");
164772
- }
164773
- Clone() {
164774
- throw Error("Clone not implemented");
164775
- }
164856
+ function AddOptionalAction(type, options) {
164857
+ const result = exports_memory.Update(AddOptionalOperation(type), {}, options);
164858
+ return result;
164776
164859
  }
164777
- function IsBase(value) {
164778
- return IsKind(value, "Base");
164860
+ function AddOptionalInstantiate(context, state, type, options) {
164861
+ const instantiatedType = InstantiateType(context, state, type);
164862
+ return AddOptionalAction(instantiatedType, options);
164779
164863
  }
164780
164864
 
164781
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/array.mjs
164865
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/array.mjs
164782
164866
  function _Array_(items, options) {
164783
164867
  return exports_memory.Create({ "~kind": "Array" }, { type: "array", items }, options);
164784
164868
  }
@@ -164789,18 +164873,7 @@ function ArrayOptions(type) {
164789
164873
  return exports_memory.Discard(type, ["~kind", "type", "items"]);
164790
164874
  }
164791
164875
 
164792
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/async_iterator.mjs
164793
- function AsyncIterator(iteratorItems, options) {
164794
- return exports_memory.Create({ "~kind": "AsyncIterator" }, { type: "asyncIterator", iteratorItems }, options);
164795
- }
164796
- function IsAsyncIterator2(value) {
164797
- return IsKind(value, "AsyncIterator");
164798
- }
164799
- function AsyncIteratorOptions(type) {
164800
- return exports_memory.Discard(type, ["~kind", "type", "iteratorItems"]);
164801
- }
164802
-
164803
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/constructor.mjs
164876
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/constructor.mjs
164804
164877
  function Constructor(parameters, instanceType, options = {}) {
164805
164878
  return exports_memory.Create({ "~kind": "Constructor" }, { type: "constructor", parameters, instanceType }, options);
164806
164879
  }
@@ -164811,7 +164884,7 @@ function ConstructorOptions(type) {
164811
164884
  return exports_memory.Discard(type, ["~kind", "type", "parameters", "instanceType"]);
164812
164885
  }
164813
164886
 
164814
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/function.mjs
164887
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/function.mjs
164815
164888
  function _Function_(parameters, returnType, options = {}) {
164816
164889
  return exports_memory.Create({ ["~kind"]: "Function" }, { type: "function", parameters, returnType }, options);
164817
164890
  }
@@ -164822,7 +164895,7 @@ function FunctionOptions(type) {
164822
164895
  return exports_memory.Discard(type, ["~kind", "type", "parameters", "returnType"]);
164823
164896
  }
164824
164897
 
164825
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/ref.mjs
164898
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/ref.mjs
164826
164899
  function Ref(ref, options) {
164827
164900
  return exports_memory.Create({ ["~kind"]: "Ref" }, { $ref: ref }, options);
164828
164901
  }
@@ -164830,7 +164903,7 @@ function IsRef(value) {
164830
164903
  return IsKind(value, "Ref");
164831
164904
  }
164832
164905
 
164833
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/generic.mjs
164906
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/generic.mjs
164834
164907
  function Generic(parameters, expression) {
164835
164908
  return exports_memory.Create({ "~kind": "Generic" }, { type: "generic", parameters, expression });
164836
164909
  }
@@ -164838,7 +164911,7 @@ function IsGeneric(value) {
164838
164911
  return IsKind(value, "Generic");
164839
164912
  }
164840
164913
 
164841
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/any.mjs
164914
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/any.mjs
164842
164915
  function Any(options) {
164843
164916
  return exports_memory.Create({ ["~kind"]: "Any" }, {}, options);
164844
164917
  }
@@ -164846,7 +164919,7 @@ function IsAny(value) {
164846
164919
  return IsKind(value, "Any");
164847
164920
  }
164848
164921
 
164849
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/never.mjs
164922
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/never.mjs
164850
164923
  var NeverPattern = "(?!)";
164851
164924
  function Never(options) {
164852
164925
  return exports_memory.Create({ "~kind": "Never" }, { not: {} }, options);
@@ -164855,7 +164928,23 @@ function IsNever(value) {
164855
164928
  return IsKind(value, "Never");
164856
164929
  }
164857
164930
 
164858
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/properties.mjs
164931
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_add_optional.mjs
164932
+ function AddOptionalDeferred(type, options = {}) {
164933
+ return Deferred("AddOptional", [type], options);
164934
+ }
164935
+ function AddOptional(type, options = {}) {
164936
+ return AddOptionalAction(type, options);
164937
+ }
164938
+
164939
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_optional.mjs
164940
+ function Optional(type) {
164941
+ return AddOptional(type);
164942
+ }
164943
+ function IsOptional(value) {
164944
+ return IsSchema(value) && exports_guard.HasPropertyKey(value, "~optional");
164945
+ }
164946
+
164947
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/properties.mjs
164859
164948
  function RequiredArray(properties) {
164860
164949
  return exports_guard.Keys(properties).filter((key) => !IsOptional(properties[key]));
164861
164950
  }
@@ -164866,7 +164955,7 @@ function PropertyValues(properties) {
164866
164955
  return exports_guard.Values(properties);
164867
164956
  }
164868
164957
 
164869
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/object.mjs
164958
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/object.mjs
164870
164959
  function _Object_(properties, options = {}) {
164871
164960
  const requiredKeys = RequiredArray(properties);
164872
164961
  const required2 = requiredKeys.length > 0 ? { required: requiredKeys } : {};
@@ -164879,18 +164968,7 @@ function ObjectOptions(type) {
164879
164968
  return exports_memory.Discard(type, ["~kind", "type", "properties", "required"]);
164880
164969
  }
164881
164970
 
164882
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/union.mjs
164883
- function Union(anyOf, options = {}) {
164884
- return exports_memory.Create({ "~kind": "Union" }, { anyOf }, options);
164885
- }
164886
- function IsUnion(value) {
164887
- return IsKind(value, "Union");
164888
- }
164889
- function UnionOptions(type) {
164890
- return exports_memory.Discard(type, ["~kind", "anyOf"]);
164891
- }
164892
-
164893
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/unknown.mjs
164971
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/unknown.mjs
164894
164972
  function Unknown(options) {
164895
164973
  return exports_memory.Create({ ["~kind"]: "Unknown" }, {}, options);
164896
164974
  }
@@ -164898,7 +164976,7 @@ function IsUnknown(value) {
164898
164976
  return IsKind(value, "Unknown");
164899
164977
  }
164900
164978
 
164901
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/cyclic.mjs
164979
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/cyclic.mjs
164902
164980
  function Cyclic($defs, $ref, options) {
164903
164981
  const defs = exports_guard.Keys($defs).reduce((result, key) => {
164904
164982
  return { ...result, [key]: exports_memory.Update($defs[key], {}, { $id: key }) };
@@ -164909,7 +164987,7 @@ function IsCyclic(value) {
164909
164987
  return IsKind(value, "Cyclic");
164910
164988
  }
164911
164989
 
164912
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/unsafe.mjs
164990
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/unsafe.mjs
164913
164991
  function Unsafe(schema) {
164914
164992
  return exports_memory.Update(schema, { ["~unsafe"]: null }, {});
164915
164993
  }
@@ -164917,7 +164995,7 @@ function IsUnsafe(value) {
164917
164995
  return exports_guard.IsObjectNotArray(value) && exports_guard.HasPropertyKey(value, "~unsafe") && exports_guard.IsNull(value["~unsafe"]);
164918
164996
  }
164919
164997
 
164920
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/arguments/arguments.mjs
164998
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/arguments/arguments.mjs
164921
164999
  var exports_arguments = {};
164922
165000
  __export(exports_arguments, {
164923
165001
  Match: () => Match
@@ -164927,7 +165005,7 @@ function Match(args, match) {
164927
165005
  throw Error("Invalid Arguments");
164928
165006
  })();
164929
165007
  }
164930
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/infer.mjs
165008
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/infer.mjs
164931
165009
  function Infer(...args) {
164932
165010
  const [name2, extends_] = exports_arguments.Match(args, {
164933
165011
  2: (name3, extends_2) => [name3, extends_2, extends_2],
@@ -164939,7 +165017,18 @@ function IsInfer(value) {
164939
165017
  return IsKind(value, "Infer");
164940
165018
  }
164941
165019
 
164942
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs
165020
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/dependent.mjs
165021
+ function Dependent(if_, then_, else_, options = {}) {
165022
+ return exports_memory.Create({ "~kind": "Dependent" }, { if: if_, then: then_, else: else_ }, options);
165023
+ }
165024
+ function IsDependent(value) {
165025
+ return IsKind(value, "Dependent");
165026
+ }
165027
+ function DependentOptions(type) {
165028
+ return exports_memory.Discard(type, ["~kind", "if", "then", "else"]);
165029
+ }
165030
+
165031
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs
164943
165032
  function IsTypeScriptEnumLike(value) {
164944
165033
  return exports_guard.IsObjectNotArray(value);
164945
165034
  }
@@ -164948,7 +165037,7 @@ function TypeScriptEnumToEnumValues(type) {
164948
165037
  return keys.reduce((result, key) => [...result, type[key]], []);
164949
165038
  }
164950
165039
 
164951
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/enum.mjs
165040
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/enum.mjs
164952
165041
  function Enum(value, options) {
164953
165042
  const values = IsTypeScriptEnumLike(value) ? TypeScriptEnumToEnumValues(value) : value;
164954
165043
  return exports_memory.Create({ "~kind": "Enum" }, { enum: values }, options);
@@ -164957,7 +165046,7 @@ function IsEnum(value) {
164957
165046
  return IsKind(value, "Enum");
164958
165047
  }
164959
165048
 
164960
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/intersect.mjs
165049
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/intersect.mjs
164961
165050
  function Intersect(types, options = {}) {
164962
165051
  return exports_memory.Create({ "~kind": "Intersect" }, { allOf: types }, options);
164963
165052
  }
@@ -164967,11 +165056,11 @@ function IsIntersect(value) {
164967
165056
  function IntersectOptions(type) {
164968
165057
  return exports_memory.Discard(type, ["~kind", "allOf"]);
164969
165058
  }
164970
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/unreachable/unreachable.mjs
165059
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/unreachable/unreachable.mjs
164971
165060
  function Unreachable() {
164972
165061
  throw new Error("Unreachable");
164973
165062
  }
164974
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/system/hashing/hash.mjs
165063
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/system/hashing/hash.mjs
164975
165064
  var ByteMarker;
164976
165065
  (function(ByteMarker2) {
164977
165066
  ByteMarker2[ByteMarker2["Array"] = 0] = "Array";
@@ -164996,7 +165085,7 @@ var F64 = new Float64Array(1);
164996
165085
  var F64In = new DataView(F64.buffer);
164997
165086
  var F64Out = new Uint8Array(F64.buffer);
164998
165087
  var encoder2 = new TextEncoder;
164999
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/_codec.mjs
165088
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_codec.mjs
165000
165089
  class EncodeBuilder {
165001
165090
  constructor(type, decode3) {
165002
165091
  this.type = type;
@@ -165035,17 +165124,38 @@ function Encode(type, callback) {
165035
165124
  function IsCodec(value) {
165036
165125
  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");
165037
165126
  }
165038
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/_refine.mjs
165127
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_immutable.mjs
165128
+ function Immutable(type) {
165129
+ return AddImmutable(type);
165130
+ }
165131
+ function IsImmutable(value) {
165132
+ return IsSchema(value) && exports_guard.HasPropertyKey(value, "~immutable");
165133
+ }
165134
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_add_readonly.mjs
165135
+ function AddReadonlyDeferred(type, options = {}) {
165136
+ return Deferred("AddReadonly", [type], options);
165137
+ }
165138
+ function AddReadonly(type, options = {}) {
165139
+ return AddReadonlyAction(type, options);
165140
+ }
165141
+
165142
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_readonly.mjs
165143
+ function Readonly(type) {
165144
+ return AddReadonly(type);
165145
+ }
165146
+ function IsReadonly(value) {
165147
+ return IsSchema(value) && exports_guard.HasPropertyKey(value, "~readonly");
165148
+ }
165149
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/_refine.mjs
165039
165150
  function RefineAdd(type, refinement) {
165040
165151
  const refinements = IsRefine(type) ? [...type["~refine"], refinement] : [refinement];
165041
165152
  return exports_memory.Update(type, { "~refine": refinements }, {});
165042
165153
  }
165043
165154
  function Refine(...args) {
165044
- const [type, check2, error_or_message] = exports_arguments.Match(args, {
165155
+ const [type, check2, error51] = exports_arguments.Match(args, {
165045
165156
  3: (type2, check3, error52) => [type2, check3, error52],
165046
165157
  2: (type2, check3) => [type2, check3, () => "Refine Error"]
165047
165158
  });
165048
- const error51 = exports_guard.IsString(error_or_message) ? () => error_or_message : error_or_message;
165049
165159
  return RefineAdd(type, { check: check2, error: error51 });
165050
165160
  }
165051
165161
  function IsRefinement(value) {
@@ -165054,7 +165164,7 @@ function IsRefinement(value) {
165054
165164
  function IsRefine(value) {
165055
165165
  return IsSchema(value) && exports_guard.HasPropertyKey(value, "~refine") && exports_guard.IsArray(value["~refine"]) && exports_guard.Every(value["~refine"], 0, (value2) => IsRefinement(value2));
165056
165166
  }
165057
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/bigint.mjs
165167
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/bigint.mjs
165058
165168
  var BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
165059
165169
  function BigInt2(options) {
165060
165170
  return exports_memory.Create({ "~kind": "BigInt" }, { type: "bigint" }, options);
@@ -165062,21 +165172,21 @@ function BigInt2(options) {
165062
165172
  function IsBigInt2(value) {
165063
165173
  return IsKind(value, "BigInt");
165064
165174
  }
165065
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/boolean.mjs
165175
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/boolean.mjs
165066
165176
  function Boolean2(options) {
165067
165177
  return exports_memory.Create({ "~kind": "Boolean" }, { type: "boolean" }, options);
165068
165178
  }
165069
- function IsBoolean2(value) {
165179
+ function IsBoolean3(value) {
165070
165180
  return IsKind(value, "Boolean");
165071
165181
  }
165072
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/identifier.mjs
165182
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/identifier.mjs
165073
165183
  function Identifier(name2) {
165074
165184
  return exports_memory.Create({ "~kind": "Identifier" }, { name: name2 });
165075
165185
  }
165076
165186
  function IsIdentifier(value) {
165077
165187
  return IsKind(value, "Identifier");
165078
165188
  }
165079
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/integer.mjs
165189
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/integer.mjs
165080
165190
  var IntegerPattern = "-?(?:0|[1-9][0-9]*)";
165081
165191
  function Integer(options) {
165082
165192
  return exports_memory.Create({ "~kind": "Integer" }, { type: "integer" }, options);
@@ -165084,17 +165194,7 @@ function Integer(options) {
165084
165194
  function IsInteger2(value) {
165085
165195
  return IsKind(value, "Integer");
165086
165196
  }
165087
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/iterator.mjs
165088
- function Iterator(iteratorItems, options) {
165089
- return exports_memory.Create({ "~kind": "Iterator" }, { type: "iterator", iteratorItems }, options);
165090
- }
165091
- function IsIterator2(value) {
165092
- return IsKind(value, "Iterator");
165093
- }
165094
- function IteratorOptions(type) {
165095
- return exports_memory.Discard(type, ["~kind", "type", "iteratorItems"]);
165096
- }
165097
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/literal.mjs
165197
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/literal.mjs
165098
165198
  class InvalidLiteralValue extends Error {
165099
165199
  constructor(value) {
165100
165200
  super(`Invalid Literal value`);
@@ -165126,29 +165226,29 @@ function IsLiteralString(value) {
165126
165226
  function IsLiteral(value) {
165127
165227
  return IsKind(value, "Literal");
165128
165228
  }
165129
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/null.mjs
165229
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/null.mjs
165130
165230
  function Null(options) {
165131
165231
  return exports_memory.Create({ "~kind": "Null" }, { type: "null" }, options);
165132
165232
  }
165133
165233
  function IsNull2(value) {
165134
165234
  return IsKind(value, "Null");
165135
165235
  }
165136
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/number.mjs
165137
- var NumberPattern = "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";
165236
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/number.mjs
165237
+ var NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
165138
165238
  function Number2(options) {
165139
165239
  return exports_memory.Create({ "~kind": "Number" }, { type: "number" }, options);
165140
165240
  }
165141
- function IsNumber2(value) {
165241
+ function IsNumber3(value) {
165142
165242
  return IsKind(value, "Number");
165143
165243
  }
165144
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/symbol.mjs
165244
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/symbol.mjs
165145
165245
  function Symbol2(options) {
165146
165246
  return exports_memory.Create({ "~kind": "Symbol" }, { type: "symbol" }, options);
165147
165247
  }
165148
165248
  function IsSymbol2(value) {
165149
165249
  return IsKind(value, "Symbol");
165150
165250
  }
165151
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/parameter.mjs
165251
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/parameter.mjs
165152
165252
  function Parameter(...args) {
165153
165253
  const [name2, extends_, equals] = exports_arguments.Match(args, {
165154
165254
  3: (name3, extends_2, equals2) => [name3, extends_2, equals2],
@@ -165160,28 +165260,39 @@ function Parameter(...args) {
165160
165260
  function IsParameter(value) {
165161
165261
  return IsKind(value, "Parameter");
165162
165262
  }
165163
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/string.mjs
165263
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/string.mjs
165164
165264
  var StringPattern = ".*";
165165
165265
  function String2(options) {
165166
165266
  return exports_memory.Create({ "~kind": "String" }, { type: "string" }, options);
165167
165267
  }
165168
- function IsString2(value) {
165268
+ function IsString3(value) {
165169
165269
  return IsKind(value, "String");
165170
165270
  }
165171
165271
 
165172
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/patterns/pattern.mjs
165272
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/union.mjs
165273
+ function Union(anyOf, options = {}) {
165274
+ return exports_memory.Create({ "~kind": "Union" }, { anyOf }, options);
165275
+ }
165276
+ function IsUnion(value) {
165277
+ return IsKind(value, "Union");
165278
+ }
165279
+ function UnionOptions(type) {
165280
+ return exports_memory.Discard(type, ["~kind", "anyOf"]);
165281
+ }
165282
+
165283
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/patterns/pattern.mjs
165173
165284
  function ParsePatternIntoTypes(pattern) {
165174
165285
  const parsed = Pattern(pattern);
165175
165286
  const result = exports_guard.IsEqual(parsed.length, 2) ? parsed[0] : [];
165176
165287
  return result;
165177
165288
  }
165178
165289
 
165179
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
165290
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
165180
165291
  function FromLiteral(_value) {
165181
165292
  return true;
165182
165293
  }
165183
165294
  function FromTypesReduce(types) {
165184
- return exports_guard.TakeLeft(types, (left, right) => FromType(left) ? FromTypesReduce(right) : false, () => true);
165295
+ return exports_guard.ShiftLeft(types, (left, right) => FromType(left) ? FromTypesReduce(right) : false, () => true);
165185
165296
  }
165186
165297
  function FromTypes(types) {
165187
165298
  const result = exports_guard.IsEqual(types.length, 0) ? false : FromTypesReduce(types);
@@ -165195,27 +165306,27 @@ function IsTemplateLiteralFinite(types) {
165195
165306
  return result;
165196
165307
  }
165197
165308
 
165198
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/template_literal/create.mjs
165309
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/create.mjs
165199
165310
  function TemplateLiteralCreate(pattern) {
165200
165311
  return exports_memory.Create({ ["~kind"]: "TemplateLiteral" }, { type: "string", pattern }, {});
165201
165312
  }
165202
165313
 
165203
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/template_literal/decode.mjs
165314
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/decode.mjs
165204
165315
  function FromLiteralPush(variants, value, result = []) {
165205
- return exports_guard.TakeLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
165316
+ return exports_guard.ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
165206
165317
  }
165207
165318
  function FromLiteral2(variants, value) {
165208
165319
  return exports_guard.IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value);
165209
165320
  }
165210
165321
  function FromUnion(variants, types, result = []) {
165211
- return exports_guard.TakeLeft(types, (left, right) => FromUnion(variants, right, [...result, ...FromType2(variants, left)]), () => result);
165322
+ return exports_guard.ShiftLeft(types, (left, right) => FromUnion(variants, right, [...result, ...FromType2(variants, left)]), () => result);
165212
165323
  }
165213
165324
  function FromType2(variants, type) {
165214
165325
  const result = IsUnion(type) ? FromUnion(variants, type.anyOf) : IsLiteral(type) ? FromLiteral2(variants, type.const) : Unreachable();
165215
165326
  return result;
165216
165327
  }
165217
165328
  function DecodeFromSpan(variants, types) {
165218
- return exports_guard.TakeLeft(types, (left, right) => DecodeFromSpan(FromType2(variants, left), right), () => variants);
165329
+ return exports_guard.ShiftLeft(types, (left, right) => DecodeFromSpan(FromType2(variants, left), right), () => variants);
165219
165330
  }
165220
165331
  function VariantsToLiterals(variants) {
165221
165332
  return variants.map((variant) => Literal(variant));
@@ -165240,67 +165351,78 @@ function TemplateLiteralDecode(pattern) {
165240
165351
  return result;
165241
165352
  }
165242
165353
 
165243
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/record_create.mjs
165354
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/record_create.mjs
165244
165355
  function CreateRecord(key, value) {
165245
165356
  const type = "object";
165246
165357
  const patternProperties = { [key]: value };
165247
165358
  return exports_memory.Create({ ["~kind"]: "Record" }, { type, patternProperties });
165248
165359
  }
165249
165360
 
165250
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_any.mjs
165361
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_any.mjs
165251
165362
  function FromAnyKey(value) {
165252
165363
  return CreateRecord(StringKey, value);
165253
165364
  }
165254
165365
 
165255
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
165366
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
165256
165367
  function FromBooleanKey(value) {
165257
165368
  return _Object_({ true: value, false: value });
165258
165369
  }
165259
165370
 
165260
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs
165261
- function FromEnumValue(value) {
165262
- return exports_guard.IsString(value) || exports_guard.IsNumber(value) ? Literal(value) : exports_guard.IsNull(value) ? Null() : Never();
165371
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/tuple.mjs
165372
+ function Tuple(types, options = {}) {
165373
+ const [items, minItems, additionalItems] = [types, types.length, false];
165374
+ return exports_memory.Create({ ["~kind"]: "Tuple" }, { type: "array", additionalItems, items, minItems }, options);
165263
165375
  }
165264
- function EnumValuesToVariants(values) {
165265
- const result = values.map((value) => FromEnumValue(value));
165266
- return result;
165376
+ function IsTuple(value) {
165377
+ return IsKind(value, "Tuple");
165267
165378
  }
165268
- function EnumValuesToUnion(values) {
165269
- const variants = EnumValuesToVariants(values);
165270
- const result = Union(variants);
165271
- return result;
165379
+ function TupleOptions(type) {
165380
+ return exports_memory.Discard(type, ["~kind", "type", "items", "minItems", "additionalItems"]);
165272
165381
  }
165273
- function EnumToUnion(type) {
165274
- const result = EnumValuesToUnion(type.enum);
165382
+
165383
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs
165384
+ function RemoveReadonlyOperation(type) {
165385
+ return exports_memory.Discard(type, ["~readonly"]);
165386
+ }
165387
+ function RemoveReadonlyAction(type, options) {
165388
+ const result = exports_memory.Update(RemoveReadonlyOperation(type), {}, options);
165275
165389
  return result;
165276
165390
  }
165391
+ function RemoveReadonlyInstantiate(context, state, type, options) {
165392
+ const instantiatedType = InstantiateType(context, state, type);
165393
+ return RemoveReadonlyAction(instantiatedType, options);
165394
+ }
165277
165395
 
165278
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
165279
- function FromEnumKey(values, value) {
165280
- const unionKey = EnumValuesToUnion(values);
165281
- const result = FromKey(unionKey, value);
165282
- return result;
165396
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_remove_readonly.mjs
165397
+ function RemoveReadonlyDeferred(type, options = {}) {
165398
+ return Deferred("RemoveReadonly", [type], options);
165399
+ }
165400
+ function RemoveReadonly(type, options = {}) {
165401
+ return RemoveReadonlyAction(type, options);
165283
165402
  }
165284
165403
 
165285
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
165286
- function FromIntegerKey(_key, value) {
165287
- const result = CreateRecord(IntegerKey, value);
165404
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs
165405
+ function RemoveOptionalOperation(type) {
165406
+ return exports_memory.Discard(type, ["~optional"]);
165407
+ }
165408
+ function RemoveOptionalAction(type, options) {
165409
+ const result = exports_memory.Update(RemoveOptionalOperation(type), {}, options);
165288
165410
  return result;
165289
165411
  }
165412
+ function RemoveOptionalInstantiate(context, state, type, options) {
165413
+ const instantiatedType = InstantiateType(context, state, type);
165414
+ return RemoveOptionalAction(instantiatedType, options);
165415
+ }
165290
165416
 
165291
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/tuple.mjs
165292
- function Tuple(types, options = {}) {
165293
- const [items, minItems, additionalItems] = [types, types.length, false];
165294
- return exports_memory.Create({ ["~kind"]: "Tuple" }, { type: "array", additionalItems, items, minItems }, options);
165417
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_remove_optional.mjs
165418
+ function RemoveOptionalDeferred(type, options = {}) {
165419
+ return Deferred("RemoveOptional", [type], options);
165295
165420
  }
165296
- function IsTuple(value) {
165297
- return IsKind(value, "Tuple");
165298
- }
165299
- function TupleOptions(type) {
165300
- return exports_memory.Discard(type, ["~kind", "type", "items", "minItems", "additionalItems"]);
165421
+ function RemoveOptional(type, options = {}) {
165422
+ return RemoveOptionalAction(type, options);
165301
165423
  }
165302
165424
 
165303
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/tuple/to_object.mjs
165425
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/tuple/to_object.mjs
165304
165426
  function TupleElementsToProperties(types) {
165305
165427
  const result = types.reduceRight((result2, right, index) => {
165306
165428
  return { [index]: right, ...result2 };
@@ -165313,7 +165435,7 @@ function TupleToObject(type) {
165313
165435
  return result;
165314
165436
  }
165315
165437
 
165316
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/composite.mjs
165438
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/composite.mjs
165317
165439
  function IsReadonlyProperty(left, right) {
165318
165440
  return IsReadonly(left) ? IsReadonly(right) ? true : false : false;
165319
165441
  }
@@ -165324,8 +165446,8 @@ function CompositeProperty(left, right) {
165324
165446
  const isReadonly = IsReadonlyProperty(left, right);
165325
165447
  const isOptional = IsOptionalProperty(left, right);
165326
165448
  const evaluated = EvaluateIntersect([left, right]);
165327
- const property = ReadonlyRemove(OptionalRemove(evaluated));
165328
- return isReadonly && isOptional ? ReadonlyAdd(OptionalAdd(property)) : isReadonly && !isOptional ? ReadonlyAdd(property) : !isReadonly && isOptional ? OptionalAdd(property) : property;
165449
+ const property = RemoveReadonly(RemoveOptional(evaluated));
165450
+ return isReadonly && isOptional ? AddReadonly(AddOptional(property)) : isReadonly && !isOptional ? AddReadonly(property) : !isReadonly && isOptional ? AddOptional(property) : property;
165329
165451
  }
165330
165452
  function CompositePropertyKey(left, right, key) {
165331
165453
  return key in left ? key in right ? CompositeProperty(left[key], right[key]) : left[key] : (key in right) ? right[key] : Never();
@@ -165347,13 +165469,13 @@ function Composite(left, right) {
165347
165469
  return _Object_(properties);
165348
165470
  }
165349
165471
 
165350
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
165472
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
165351
165473
  function Narrow(left, right) {
165352
165474
  const result = Compare(left, right);
165353
165475
  return exports_guard.IsEqual(result, ResultLeftInside) ? left : exports_guard.IsEqual(result, ResultRightInside) ? right : exports_guard.IsEqual(result, ResultEqual) ? right : Never();
165354
165476
  }
165355
165477
 
165356
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
165478
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
165357
165479
  function IsObjectLike(type) {
165358
165480
  return IsObject2(type) || IsTuple(type);
165359
165481
  }
@@ -165373,65 +165495,114 @@ function DistributeOperation(left, right) {
165373
165495
  return result;
165374
165496
  }
165375
165497
  function DistributeType(type, types, result = []) {
165376
- return exports_guard.TakeLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(type, left)]), () => exports_guard.IsEqual(result.length, 0) ? [type] : result);
165498
+ return exports_guard.ShiftLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(type, left)]), () => exports_guard.IsEqual(result.length, 0) ? [type] : result);
165377
165499
  }
165378
165500
  function DistributeUnion(types, distribution, result = []) {
165379
- return exports_guard.TakeLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute([left], distribution)]), () => result);
165501
+ return exports_guard.ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute([left], distribution)]), () => result);
165380
165502
  }
165381
165503
  function Distribute(types, result = []) {
165382
- return exports_guard.TakeLeft(types, (left, right) => IsUnion(left) ? Distribute(right, DistributeUnion(left.anyOf, result)) : Distribute(right, DistributeType(left, result)), () => result);
165504
+ return exports_guard.ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute(right, DistributeUnion(left.anyOf, result)) : Distribute(right, DistributeType(left, result)), () => result);
165505
+ }
165506
+
165507
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/exclude/operation.mjs
165508
+ function ExcludeType(left, right) {
165509
+ const check2 = Extends({}, left, right);
165510
+ const result = exports_result.IsExtendsTrueLike(check2) ? [] : [left];
165511
+ return result;
165512
+ }
165513
+ function ExcludeUnion(types, right) {
165514
+ return types.reduce((result, head) => {
165515
+ return [...result, ...ExcludeType(head, right)];
165516
+ }, []);
165517
+ }
165518
+ function ExcludeOperation(left, right) {
165519
+ const evaluated = EvaluateType(left);
165520
+ const canonical = IsUnion(evaluated) ? evaluated.anyOf : [evaluated];
165521
+ const remaining = ExcludeUnion(canonical, right);
165522
+ const result = EvaluateUnion(remaining);
165523
+ return result;
165383
165524
  }
165384
165525
 
165385
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
165526
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
165527
+ function EvaluateDependent(if_, then_, else_) {
165528
+ const intersect = Intersect([if_, then_]);
165529
+ const excluded = ExcludeOperation(else_, if_);
165530
+ const result = EvaluateUnion([intersect, excluded]);
165531
+ return result;
165532
+ }
165533
+ function EvaluateEnum(values) {
165534
+ const result = values.map((value) => Literal(value));
165535
+ return EvaluateUnion(result);
165536
+ }
165386
165537
  function EvaluateIntersect(types) {
165387
165538
  const distribution = Distribute(types);
165388
- const result = Broaden(distribution);
165539
+ const broadend = Broaden(distribution);
165540
+ const result = EvaluateUnionFast(broadend);
165541
+ return result;
165542
+ }
165543
+ function EvaluateTemplateLiteral(pattern) {
165544
+ const evaluated = TemplateLiteralDecode(pattern);
165545
+ const result = EvaluateType(evaluated);
165389
165546
  return result;
165390
165547
  }
165391
165548
  function EvaluateUnion(types) {
165392
- const result = Broaden(types);
165549
+ const broadend = Broaden(types);
165550
+ const result = EvaluateUnionFast(broadend);
165393
165551
  return result;
165394
165552
  }
165395
165553
  function EvaluateType(type) {
165396
- return IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
165554
+ return IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) : IsEnum(type) ? EvaluateEnum(type.enum) : IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
165397
165555
  }
165398
165556
  function EvaluateUnionFast(types) {
165399
165557
  const result = exports_guard.IsEqual(types.length, 1) ? types[0] : exports_guard.IsEqual(types.length, 0) ? Never() : Union(types);
165400
165558
  return result;
165401
165559
  }
165402
165560
 
165403
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
165561
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
165562
+ function FromEnumKey(values, value) {
165563
+ const unionKey = EvaluateEnum(values);
165564
+ const result = FromKey(unionKey, value);
165565
+ return result;
165566
+ }
165567
+
165568
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
165569
+ function FromIntegerKey(_key, value) {
165570
+ const result = CreateRecord(IntegerKey, value);
165571
+ return result;
165572
+ }
165573
+
165574
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
165404
165575
  function FromIntersectKey(types, value) {
165405
165576
  const evaluatedKey = EvaluateIntersect(types);
165406
165577
  const result = FromKey(evaluatedKey, value);
165407
165578
  return result;
165408
165579
  }
165409
165580
 
165410
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
165581
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
165411
165582
  function FromLiteralKey(key, value) {
165412
165583
  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_({});
165413
165584
  }
165414
165585
 
165415
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_number.mjs
165586
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_number.mjs
165416
165587
  function FromNumberKey(_key, value) {
165417
165588
  const result = CreateRecord(NumberKey, value);
165418
165589
  return result;
165419
165590
  }
165420
165591
 
165421
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_string.mjs
165592
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_string.mjs
165422
165593
  function FromStringKey(key, value) {
165423
165594
  return exports_guard.HasPropertyKey(key, "pattern") && (exports_guard.IsString(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
165424
165595
  }
165425
165596
 
165426
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
165597
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
165427
165598
  function FromTemplateKey(pattern, value) {
165428
165599
  const types = ParsePatternIntoTypes(pattern);
165429
165600
  const finite = IsTemplateLiteralFinite(types);
165430
- const result = finite ? FromKey(TemplateLiteralDecode(pattern), value) : CreateRecord(pattern, value);
165601
+ const result = finite ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
165431
165602
  return result;
165432
165603
  }
165433
165604
 
165434
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
165605
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
165435
165606
  function FlattenType(type) {
165436
165607
  const result = IsUnion(type) ? Flatten(type.anyOf) : [type];
165437
165608
  return result;
@@ -165442,9 +165613,9 @@ function Flatten(types) {
165442
165613
  }, []);
165443
165614
  }
165444
165615
 
165445
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key_union.mjs
165616
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key_union.mjs
165446
165617
  function StringOrNumberCheck(types) {
165447
- return types.some((type) => IsString2(type) || IsNumber2(type) || IsInteger2(type));
165618
+ return types.some((type) => IsString3(type) || IsNumber3(type) || IsInteger2(type));
165448
165619
  }
165449
165620
  function TryBuildRecord(types, value) {
165450
165621
  return exports_guard.IsEqual(StringOrNumberCheck(types), true) ? CreateRecord(StringKey, value) : undefined;
@@ -165465,13 +165636,13 @@ function FromUnionKey(types, value) {
165465
165636
  return IsSchema(record2) ? record2 : CreateObject(flattened, value);
165466
165637
  }
165467
165638
 
165468
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/from_key.mjs
165639
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/from_key.mjs
165469
165640
  function FromKey(key, value) {
165470
- const result = IsAny(key) ? FromAnyKey(value) : IsBoolean2(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) : IsNumber2(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString2(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_({});
165641
+ 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_({});
165471
165642
  return result;
165472
165643
  }
165473
165644
 
165474
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/record/instantiate.mjs
165645
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/record/instantiate.mjs
165475
165646
  function RecordAction(key, value, options) {
165476
165647
  const result = CanInstantiate([key]) ? exports_memory.Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
165477
165648
  return result;
@@ -165482,7 +165653,7 @@ function RecordInstantiate(context, state, key, value, options) {
165482
165653
  return RecordAction(instantiatedKey, instantiatedValue, options);
165483
165654
  }
165484
165655
 
165485
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/record.mjs
165656
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/record.mjs
165486
165657
  var IntegerKey = `^${IntegerPattern}$`;
165487
165658
  var NumberKey = `^${NumberPattern}$`;
165488
165659
  var StringKey = `^${StringPattern}$`;
@@ -165492,15 +165663,19 @@ function RecordDeferred(key, value, options = {}) {
165492
165663
  function Record(key, value, options = {}) {
165493
165664
  return RecordAction(key, value, options);
165494
165665
  }
165495
- function RecordFromPattern(key, value) {
165496
- return CreateRecord(key, value);
165666
+ function RecordFromPattern(pattern, value) {
165667
+ return CreateRecord(pattern, value);
165668
+ }
165669
+ function RecordPatternToType(pattern) {
165670
+ const result = exports_guard.IsEqual(pattern, StringKey) ? String2() : exports_guard.IsEqual(pattern, IntegerKey) ? Integer() : exports_guard.IsEqual(pattern, NumberKey) ? Number2() : TemplateLiteralDecodeUnsafe(pattern);
165671
+ return result;
165497
165672
  }
165498
165673
  function RecordPattern(type) {
165499
165674
  return exports_guard.Keys(type.patternProperties)[0];
165500
165675
  }
165501
165676
  function RecordKey(type) {
165502
165677
  const pattern = RecordPattern(type);
165503
- const result = exports_guard.IsEqual(pattern, StringKey) ? String2() : exports_guard.IsEqual(pattern, IntegerKey) ? Integer() : exports_guard.IsEqual(pattern, NumberKey) ? Number2() : TemplateLiteralDecodeUnsafe(pattern);
165678
+ const result = RecordPatternToType(pattern);
165504
165679
  return result;
165505
165680
  }
165506
165681
  function RecordValue(type) {
@@ -165509,37 +165684,37 @@ function RecordValue(type) {
165509
165684
  function IsRecord(value) {
165510
165685
  return IsKind(value, "Record");
165511
165686
  }
165512
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/rest.mjs
165687
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/rest.mjs
165513
165688
  function Rest(type) {
165514
165689
  return exports_memory.Create({ "~kind": "Rest" }, { type: "rest", items: type }, {});
165515
165690
  }
165516
165691
  function IsRest(value) {
165517
165692
  return IsKind(value, "Rest");
165518
165693
  }
165519
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/this.mjs
165694
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/this.mjs
165520
165695
  function This(options) {
165521
165696
  return exports_memory.Create({ ["~kind"]: "This" }, { $ref: "#" }, options);
165522
165697
  }
165523
165698
  function IsThis(value) {
165524
165699
  return IsKind(value, "This");
165525
165700
  }
165526
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/undefined.mjs
165701
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/undefined.mjs
165527
165702
  function Undefined(options) {
165528
165703
  return exports_memory.Create({ "~kind": "Undefined" }, { type: "undefined" }, options);
165529
165704
  }
165530
165705
  function IsUndefined2(value) {
165531
165706
  return IsKind(value, "Undefined");
165532
165707
  }
165533
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/void.mjs
165708
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/void.mjs
165534
165709
  function Void(options) {
165535
165710
  return exports_memory.Create({ "~kind": "Void" }, { type: "void" }, options);
165536
165711
  }
165537
165712
  function IsVoid(value) {
165538
165713
  return IsKind(value, "Void");
165539
165714
  }
165540
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/mapping.mjs
165715
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/mapping.mjs
165541
165716
  function IntrinsicOrCall(ref2, parameters) {
165542
- return exports_guard.IsEqual(ref2, "Array") ? _Array_(parameters[0]) : exports_guard.IsEqual(ref2, "AsyncIterator") ? AsyncIterator(parameters[0]) : exports_guard.IsEqual(ref2, "Iterator") ? Iterator(parameters[0]) : exports_guard.IsEqual(ref2, "Promise") ? _Promise_(parameters[0]) : exports_guard.IsEqual(ref2, "Awaited") ? AwaitedDeferred(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, "Options") ? OptionsDeferred(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);
165717
+ 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);
165543
165718
  }
165544
165719
  function Unreachable2() {
165545
165720
  throw Error("Unreachable");
@@ -165628,8 +165803,17 @@ function KeywordVoidMapping(input) {
165628
165803
  function KeywordThisMapping(input) {
165629
165804
  return This();
165630
165805
  }
165631
- function KeywordMapping(input) {
165632
- return input;
165806
+ function LiteralBigIntMapping(input) {
165807
+ return Literal(BigInt(input));
165808
+ }
165809
+ function LiteralBooleanMapping(input) {
165810
+ return Literal(exports_guard.IsEqual(input, "true"));
165811
+ }
165812
+ function LiteralNumberMapping(input) {
165813
+ return Literal(parseFloat(input));
165814
+ }
165815
+ function LiteralStringMapping(input) {
165816
+ return Literal(input);
165633
165817
  }
165634
165818
  function TemplateInterpolateMapping(input) {
165635
165819
  return input[1];
@@ -165646,20 +165830,8 @@ function TemplateLiteralTypesMapping(input) {
165646
165830
  function TemplateLiteralMapping(input) {
165647
165831
  return TemplateLiteralDeferred(input);
165648
165832
  }
165649
- function LiteralBigIntMapping(input) {
165650
- return Literal(BigInt(input));
165651
- }
165652
- function LiteralBooleanMapping(input) {
165653
- return Literal(exports_guard.IsEqual(input, "true"));
165654
- }
165655
- function LiteralNumberMapping(input) {
165656
- return Literal(parseFloat(input));
165657
- }
165658
- function LiteralStringMapping(input) {
165659
- return Literal(input);
165660
- }
165661
- function LiteralMapping(input) {
165662
- return input;
165833
+ function DependentMapping(input) {
165834
+ return exports_guard.IsEqual(input.length, 6) ? Dependent(input[1], input[3], input[5]) : Dependent(input[1], input[3], Unknown());
165663
165835
  }
165664
165836
  function KeyOfMapping(input) {
165665
165837
  return input.length > 0;
@@ -165675,18 +165847,24 @@ function ExtendsMapping(input) {
165675
165847
  function BaseMapping(input) {
165676
165848
  return exports_guard.IsArray(input) && exports_guard.IsEqual(input.length, 3) ? input[1] : input;
165677
165849
  }
165678
- var FactorIndexArray = (Type, indexArray) => {
165850
+ function WithMapping(input) {
165851
+ return exports_guard.IsEqual(input.length, 2) ? input[1] : [];
165852
+ }
165853
+ function FactorIndexArray(Type, indexArray) {
165679
165854
  return indexArray.reduce((result, left) => {
165680
165855
  const _left = left;
165681
165856
  return exports_guard.IsEqual(_left.length, 1) ? IndexDeferred(result, _left[0]) : exports_guard.IsEqual(_left.length, 0) ? _Array_(result) : Unreachable2();
165682
165857
  }, Type);
165683
- };
165684
- var FactorExtends = (type, extend2) => {
165858
+ }
165859
+ function FactorExtends(type, extend2) {
165685
165860
  return exports_guard.IsEqual(extend2.length, 3) ? ConditionalDeferred(type, extend2[0], extend2[1], extend2[2]) : type;
165686
- };
165861
+ }
165862
+ function FactorWith(type, withClause) {
165863
+ return exports_guard.IsArray(withClause) && exports_guard.IsEqual(withClause.length, 0) ? type : WithDeferred(type, withClause);
165864
+ }
165687
165865
  function FactorMapping(input) {
165688
- const [keyOf, type, indexArray, extend2] = input;
165689
- return keyOf ? FactorExtends(KeyOfDeferred(FactorIndexArray(type, indexArray)), extend2) : FactorExtends(FactorIndexArray(type, indexArray), extend2);
165866
+ const [keyOf, type, indexArray, extend2, withClause] = input;
165867
+ return FactorWith(keyOf ? FactorExtends(KeyOfDeferred(FactorIndexArray(type, indexArray)), extend2) : FactorExtends(FactorIndexArray(type, indexArray), extend2), withClause);
165690
165868
  }
165691
165869
  function ExprBinaryMapping(left, rest2) {
165692
165870
  return exports_guard.IsEqual(rest2.length, 3) ? (() => {
@@ -165716,7 +165894,7 @@ function ExprMapping(input) {
165716
165894
  return ExprBinaryMapping(left, rest2);
165717
165895
  }
165718
165896
  function ExprReadonlyMapping(input) {
165719
- return ImmutableAdd(input[1]);
165897
+ return AddImmutableDeferred(input[1]);
165720
165898
  }
165721
165899
  function ExprPipeMapping(input) {
165722
165900
  return input[1];
@@ -165740,7 +165918,7 @@ function PropertyKeyQuotedMapping(input) {
165740
165918
  return input;
165741
165919
  }
165742
165920
  function PropertyKeyIndexMapping(input) {
165743
- return IsInteger2(input[3]) ? IntegerKey : IsNumber2(input[3]) ? NumberKey : IsSymbol2(input[3]) ? StringKey : IsString2(input[3]) ? StringKey : Unreachable2();
165921
+ return IsInteger2(input[3]) ? IntegerKey : IsNumber3(input[3]) ? NumberKey : IsSymbol2(input[3]) ? StringKey : IsString3(input[3]) ? StringKey : Unreachable2();
165744
165922
  }
165745
165923
  function PropertyKeyMapping(input) {
165746
165924
  return input;
@@ -165754,7 +165932,7 @@ function OptionalMapping(input) {
165754
165932
  function PropertyMapping(input) {
165755
165933
  const [isReadonly, key, isOptional, _colon, type] = input;
165756
165934
  return {
165757
- [key]: isReadonly && isOptional ? ReadonlyAdd(OptionalAdd(type)) : isReadonly && !isOptional ? ReadonlyAdd(type) : !isReadonly && isOptional ? OptionalAdd(type) : type
165935
+ [key]: isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type
165758
165936
  };
165759
165937
  }
165760
165938
  function PropertyDelimiterMapping(input) {
@@ -165778,16 +165956,16 @@ function _Object_Mapping(input) {
165778
165956
  return _Object_(properties2, options);
165779
165957
  }
165780
165958
  function ElementNamedMapping(input) {
165781
- return exports_guard.IsEqual(input.length, 5) ? ReadonlyAdd(OptionalAdd(input[4])) : exports_guard.IsEqual(input.length, 3) ? input[2] : exports_guard.IsEqual(input.length, 4) ? exports_guard.IsEqual(input[2], "readonly") ? ReadonlyAdd(input[3]) : OptionalAdd(input[3]) : Unreachable2();
165959
+ return exports_guard.IsEqual(input.length, 5) ? AddReadonlyDeferred(AddOptionalDeferred(input[4])) : exports_guard.IsEqual(input.length, 3) ? input[2] : exports_guard.IsEqual(input.length, 4) ? exports_guard.IsEqual(input[2], "readonly") ? AddReadonlyDeferred(input[3]) : AddOptionalDeferred(input[3]) : Unreachable2();
165782
165960
  }
165783
165961
  function ElementReadonlyOptionalMapping(input) {
165784
- return ReadonlyAdd(OptionalAdd(input[1]));
165962
+ return AddReadonlyDeferred(AddOptionalDeferred(input[1]));
165785
165963
  }
165786
165964
  function ElementReadonlyMapping(input) {
165787
- return ReadonlyAdd(input[1]);
165965
+ return AddReadonlyDeferred(input[1]);
165788
165966
  }
165789
165967
  function ElementOptionalMapping(input) {
165790
- return OptionalAdd(input[0]);
165968
+ return AddOptionalDeferred(input[0]);
165791
165969
  }
165792
165970
  function ElementBaseMapping(input) {
165793
165971
  return input;
@@ -165798,17 +165976,17 @@ function ElementMapping(input) {
165798
165976
  function ElementListMapping(input) {
165799
165977
  return Delimited(input);
165800
165978
  }
165801
- function TupleMapping(input) {
165979
+ function _Tuple_Mapping(input) {
165802
165980
  return Tuple(input[1]);
165803
165981
  }
165804
165982
  function ParameterReadonlyOptionalMapping(input) {
165805
- return ReadonlyAdd(OptionalAdd(input[4]));
165983
+ return AddReadonlyDeferred(AddOptionalDeferred(input[4]));
165806
165984
  }
165807
165985
  function ParameterReadonlyMapping(input) {
165808
- return ReadonlyAdd(input[3]);
165986
+ return AddReadonlyDeferred(input[3]);
165809
165987
  }
165810
165988
  function ParameterOptionalMapping(input) {
165811
- return OptionalAdd(input[3]);
165989
+ return AddOptionalDeferred(input[3]);
165812
165990
  }
165813
165991
  function ParameterTypeMapping(input) {
165814
165992
  return input[2];
@@ -165825,17 +166003,17 @@ function ParameterListMapping(input) {
165825
166003
  function _Function_Mapping(input) {
165826
166004
  return _Function_(input[1], input[4]);
165827
166005
  }
165828
- function ConstructorMapping(input) {
166006
+ function _Constructor_Mapping(input) {
165829
166007
  return Constructor(input[2], input[5]);
165830
166008
  }
165831
166009
  function ApplyReadonly(state, type) {
165832
- return exports_guard.IsEqual(state, "remove") ? ReadonlyRemoveAction(type) : exports_guard.IsEqual(state, "add") ? ReadonlyAddAction(type) : type;
166010
+ return exports_guard.IsEqual(state, "remove") ? RemoveReadonlyDeferred(type) : exports_guard.IsEqual(state, "add") ? AddReadonlyDeferred(type) : type;
165833
166011
  }
165834
166012
  function MappedReadonlyMapping(input) {
165835
166013
  return exports_guard.IsEqual(input.length, 2) && exports_guard.IsEqual(input[0], "-") ? "remove" : exports_guard.IsEqual(input.length, 2) && exports_guard.IsEqual(input[0], "+") ? "add" : exports_guard.IsEqual(input.length, 1) ? "add" : "none";
165836
166014
  }
165837
166015
  function ApplyOptional(state, type) {
165838
- return exports_guard.IsEqual(state, "remove") ? OptionalRemoveAction(type) : exports_guard.IsEqual(state, "add") ? OptionalAddAction(type) : type;
166016
+ return exports_guard.IsEqual(state, "remove") ? RemoveOptionalDeferred(type) : exports_guard.IsEqual(state, "add") ? AddOptionalDeferred(type) : type;
165839
166017
  }
165840
166018
  function MappedOptionalMapping(input) {
165841
166019
  return exports_guard.IsEqual(input.length, 2) && exports_guard.IsEqual(input[0], "-") ? "remove" : exports_guard.IsEqual(input.length, 2) && exports_guard.IsEqual(input[0], "+") ? "add" : exports_guard.IsEqual(input.length, 1) ? "add" : "none";
@@ -165843,48 +166021,51 @@ function MappedOptionalMapping(input) {
165843
166021
  function MappedAsMapping(input) {
165844
166022
  return exports_guard.IsEqual(input.length, 2) ? [input[1]] : [];
165845
166023
  }
165846
- function MappedMapping(input) {
166024
+ function _Mapped_Mapping(input) {
165847
166025
  return exports_guard.IsArray(input[6]) && exports_guard.IsEqual(input[6].length, 1) ? MappedDeferred(Identifier(input[3]), input[5], input[6][0], ApplyReadonly(input[1], ApplyOptional(input[8], input[10]))) : MappedDeferred(Identifier(input[3]), input[5], Ref(input[3]), ApplyReadonly(input[1], ApplyOptional(input[8], input[10])));
165848
166026
  }
165849
166027
  function ReferenceMapping(input) {
165850
166028
  return Ref(input);
165851
166029
  }
165852
- function OptionsMapping(input) {
165853
- return OptionsDeferred(input[2], input[4]);
166030
+ function WithBigIntMapping(input) {
166031
+ return BigInt(input);
165854
166032
  }
165855
- function JsonNumberMapping(input) {
166033
+ function WithNumberMapping(input) {
165856
166034
  return parseFloat(input);
165857
166035
  }
165858
- function JsonBooleanMapping(input) {
166036
+ function WithBooleanMapping(input) {
165859
166037
  return exports_guard.IsEqual(input, "true");
165860
166038
  }
165861
- function JsonStringMapping(input) {
166039
+ function WithStringMapping(input) {
165862
166040
  return input;
165863
166041
  }
165864
- function JsonNullMapping(input) {
166042
+ function WithNullMapping(input) {
165865
166043
  return null;
165866
166044
  }
165867
- function JsonPropertyMapping(input) {
166045
+ function WithUndefinedMapping(input) {
166046
+ return;
166047
+ }
166048
+ function WithPropertyMapping(input) {
165868
166049
  return { [input[0]]: input[2] };
165869
166050
  }
165870
- function JsonPropertyListMapping(input) {
166051
+ function WithPropertyListMapping(input) {
165871
166052
  return Delimited(input);
165872
166053
  }
165873
- function JsonObjectMappingReduce(propertyList) {
166054
+ function WithObjectMappingReduce(propertyList) {
165874
166055
  return propertyList.reduce((result, left) => {
165875
166056
  return exports_memory.Assign(result, left);
165876
166057
  }, {});
165877
166058
  }
165878
- function JsonObjectMapping(input) {
165879
- return JsonObjectMappingReduce(input[1]);
166059
+ function WithObjectMapping(input) {
166060
+ return WithObjectMappingReduce(input[1]);
165880
166061
  }
165881
- function JsonElementListMapping(input) {
166062
+ function WithElementListMapping(input) {
165882
166063
  return Delimited(input);
165883
166064
  }
165884
- function JsonArrayMapping(input) {
166065
+ function WithArrayMapping(input) {
165885
166066
  return input[1];
165886
166067
  }
165887
- function JsonMapping(input) {
166068
+ function WithValueMapping(input) {
165888
166069
  return input;
165889
166070
  }
165890
166071
  function PatternBigIntMapping(input) {
@@ -165968,7 +166149,7 @@ function ModuleMapping(input) {
165968
166149
  function ScriptMapping(input) {
165969
166150
  return input;
165970
166151
  }
165971
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/match.mjs
166152
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/match.mjs
165972
166153
  function IsMatch(value) {
165973
166154
  return IsEqual(value.length, 2);
165974
166155
  }
@@ -165976,7 +166157,7 @@ function Match2(input, ok, fail) {
165976
166157
  return IsMatch(input) ? ok(input[0], input[1]) : fail();
165977
166158
  }
165978
166159
 
165979
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/take.mjs
166160
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/take.mjs
165980
166161
  function TakeVariant(variant, input) {
165981
166162
  return IsEqual(input.indexOf(variant), 0) ? [variant, input.slice(variant.length)] : [];
165982
166163
  }
@@ -165989,7 +166170,7 @@ function Take(variants, input) {
165989
166170
  return [];
165990
166171
  }
165991
166172
 
165992
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/char.mjs
166173
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/char.mjs
165993
166174
  function Range(start, end) {
165994
166175
  return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
165995
166176
  }
@@ -166008,7 +166189,7 @@ var Dot = ".";
166008
166189
  var DollarSign = "$";
166009
166190
  var Hyphen = "-";
166010
166191
 
166011
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/trim.mjs
166192
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/trim.mjs
166012
166193
  var LineComment = "//";
166013
166194
  var OpenComment = "/*";
166014
166195
  var CloseComment = "*/";
@@ -166034,12 +166215,12 @@ function Trim(input) {
166034
166215
  return trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) : trimmed;
166035
166216
  }
166036
166217
 
166037
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/optional.mjs
166218
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/optional.mjs
166038
166219
  function Optional2(value, input) {
166039
166220
  return Match2(Take([value], input), (Optional3, Rest2) => [Optional3, Rest2], () => ["", input]);
166040
166221
  }
166041
166222
 
166042
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/many.mjs
166223
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/internal/many.mjs
166043
166224
  function IsDiscard(discard2, input) {
166044
166225
  return discard2.includes(input);
166045
166226
  }
@@ -166047,7 +166228,7 @@ function Many(allowed, discard2, input, result = "") {
166047
166228
  return Match2(Take(allowed, input), (Char, Rest2) => IsDiscard(discard2, Char) ? Many(allowed, discard2, Rest2, result) : Many(allowed, discard2, Rest2, `${result}${Char}`), () => [result, input]);
166048
166229
  }
166049
166230
 
166050
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/unsigned_integer.mjs
166231
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/unsigned_integer.mjs
166051
166232
  function TakeNonZero(input) {
166052
166233
  return Take(NonZero, input);
166053
166234
  }
@@ -166062,7 +166243,7 @@ function UnsignedInteger(input) {
166062
166243
  return TakeUnsignedInteger(Trim(input));
166063
166244
  }
166064
166245
 
166065
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/integer.mjs
166246
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/integer.mjs
166066
166247
  function TakeSign(input) {
166067
166248
  return Optional2(Hyphen, input);
166068
166249
  }
@@ -166073,21 +166254,21 @@ function Integer2(input) {
166073
166254
  return TakeSignedInteger(Trim(input));
166074
166255
  }
166075
166256
 
166076
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/bigint.mjs
166257
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/bigint.mjs
166077
166258
  function TakeBigInt(input) {
166078
166259
  return Match2(Integer2(input), (Integer3, IntegerRest) => Match2(Take(["n"], IntegerRest), (_N, NRest) => [`${Integer3}`, NRest], () => []), () => []);
166079
166260
  }
166080
166261
  function BigInt3(input) {
166081
166262
  return TakeBigInt(input);
166082
166263
  }
166083
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/const.mjs
166264
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/const.mjs
166084
166265
  function TakeConst(const_, input) {
166085
166266
  return Take([const_], input);
166086
166267
  }
166087
166268
  function Const(const_, input) {
166088
166269
  return IsEqual(const_, "") ? ["", input] : const_.startsWith(NewLine) ? TakeConst(const_, TrimWhitespace(input)) : const_.startsWith(WhiteSpace) ? TakeConst(const_, input) : TakeConst(const_, Trim(input));
166089
166270
  }
166090
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/ident.mjs
166271
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/ident.mjs
166091
166272
  var Initial = [...Alpha, UnderScore, DollarSign];
166092
166273
  function TakeInitial(input) {
166093
166274
  return Take(Initial, input);
@@ -166102,7 +166283,7 @@ function TakeIdent(input) {
166102
166283
  function Ident(input) {
166103
166284
  return TakeIdent(Trim(input));
166104
166285
  }
166105
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/unsigned_number.mjs
166286
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/unsigned_number.mjs
166106
166287
  var AllowedDigits2 = [...Digit, UnderScore];
166107
166288
  function IsLeadingDot(input) {
166108
166289
  return IsMatch(Take([Dot], input));
@@ -166123,7 +166304,7 @@ function UnsignedNumber(input) {
166123
166304
  return TakeUnsignedNumber(Trim(input));
166124
166305
  }
166125
166306
 
166126
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/number.mjs
166307
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/number.mjs
166127
166308
  function TakeSign2(input) {
166128
166309
  return Optional2(Hyphen, input);
166129
166310
  }
@@ -166133,19 +166314,19 @@ function TakeSignedNumber(input) {
166133
166314
  function Number3(input) {
166134
166315
  return TakeSignedNumber(Trim(input));
166135
166316
  }
166136
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/until.mjs
166317
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/until.mjs
166137
166318
  function TakeOne(input) {
166138
166319
  const result = IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
166139
166320
  return result;
166140
166321
  }
166141
166322
  function IsInputMatchSentinal(end, input) {
166142
- return TakeLeft(end, (left, right) => input.startsWith(left) ? true : IsInputMatchSentinal(right, input), () => false);
166323
+ return ShiftLeft(end, (left, right) => input.startsWith(left) ? true : IsInputMatchSentinal(right, input), () => false);
166143
166324
  }
166144
166325
  function Until(end, input, result = "") {
166145
166326
  return Match2(TakeOne(input), (One, Rest2) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest2, `${result}${One}`), () => []);
166146
166327
  }
166147
166328
 
166148
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/span.mjs
166329
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/span.mjs
166149
166330
  function MultiLine(start, end, input) {
166150
166331
  return Match2(Take([start], input), (_, Rest2) => Match2(Until([end], Rest2), (Until2, UntilRest) => Match2(Take([end], UntilRest), (_2, Rest3) => [`${Until2}`, Rest3], () => []), () => []), () => []);
166151
166332
  }
@@ -166155,7 +166336,7 @@ function SingleLine(start, end, input) {
166155
166336
  function Span(start, end, multiLine, input) {
166156
166337
  return multiLine ? MultiLine(start, end, Trim(input)) : SingleLine(start, end, Trim(input));
166157
166338
  }
166158
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/string.mjs
166339
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/string.mjs
166159
166340
  function TakeInitial2(quotes, input) {
166160
166341
  return Take(quotes, input);
166161
166342
  }
@@ -166168,11 +166349,11 @@ function TakeString(quotes, input) {
166168
166349
  function String3(quotes, input) {
166169
166350
  return TakeString(quotes, Trim(input));
166170
166351
  }
166171
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/token/until_1.mjs
166352
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/token/until_1.mjs
166172
166353
  function Until_1(end, input) {
166173
166354
  return Match2(Until(end, input), (Until2, UntilRest) => IsEqual(Until2, "") ? [] : [Until2, UntilRest], () => []);
166174
166355
  }
166175
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/parser.mjs
166356
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/parser.mjs
166176
166357
  var If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
166177
166358
  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]);
166178
166359
  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]);
@@ -166201,23 +166382,23 @@ var KeywordNever = (input) => If(Const("never", input), ([_0, input2]) => [Keywo
166201
166382
  var KeywordSymbol = (input) => If(Const("symbol", input), ([_0, input2]) => [KeywordSymbolMapping(_0), input2]);
166202
166383
  var KeywordVoid = (input) => If(Const("void", input), ([_0, input2]) => [KeywordVoidMapping(_0), input2]);
166203
166384
  var KeywordThis = (input) => If(Const("this", input), ([_0, input2]) => [KeywordThisMapping(_0), input2]);
166204
- var Keyword = (input) => If(If(KeywordString(input), ([_0, input2]) => [_0, input2], () => If(KeywordNumber(input), ([_0, input2]) => [_0, input2], () => If(KeywordBoolean(input), ([_0, input2]) => [_0, input2], () => If(KeywordUndefined(input), ([_0, input2]) => [_0, input2], () => If(KeywordNull(input), ([_0, input2]) => [_0, input2], () => If(KeywordInteger(input), ([_0, input2]) => [_0, input2], () => If(KeywordBigInt(input), ([_0, input2]) => [_0, input2], () => If(KeywordUnknown(input), ([_0, input2]) => [_0, input2], () => If(KeywordAny(input), ([_0, input2]) => [_0, input2], () => If(KeywordObject(input), ([_0, input2]) => [_0, input2], () => If(KeywordNever(input), ([_0, input2]) => [_0, input2], () => If(KeywordSymbol(input), ([_0, input2]) => [_0, input2], () => If(KeywordVoid(input), ([_0, input2]) => [_0, input2], () => If(KeywordThis(input), ([_0, input2]) => [_0, input2], () => [])))))))))))))), ([_0, input2]) => [KeywordMapping(_0), input2]);
166205
166385
  var TemplateInterpolate = (input) => If(If(Const("${", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("}", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [TemplateInterpolateMapping(_0), input2]);
166206
166386
  var TemplateSpan = (input) => If(Until(["${", "`"], input), ([_0, input2]) => [TemplateSpanMapping(_0), input2]);
166207
166387
  var TemplateBody = (input) => If(If(If(TemplateSpan(input), ([_0, input2]) => If(TemplateInterpolate(input2), ([_1, input3]) => If(TemplateBody(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(If(TemplateSpan(input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If(If(TemplateSpan(input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => []))), ([_0, input2]) => [TemplateBodyMapping(_0), input2]);
166208
166388
  var TemplateLiteralTypes = (input) => If(If(Const("`", input), ([_0, input2]) => If(TemplateBody(input2), ([_1, input3]) => If(Const("`", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [TemplateLiteralTypesMapping(_0), input2]);
166209
166389
  var TemplateLiteral = (input) => If(TemplateLiteralTypes(input), ([_0, input2]) => [TemplateLiteralMapping(_0), input2]);
166390
+ var Dependent2 = (input) => If(If(If(Const("if", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("then", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => If(Const("else", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [_0, input2], () => If(If(Const("if", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("then", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => [[_0, _1, _2, _3], input5])))), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [DependentMapping(_0), input2]);
166210
166391
  var LiteralBigInt = (input) => If(BigInt3(input), ([_0, input2]) => [LiteralBigIntMapping(_0), input2]);
166211
166392
  var LiteralBoolean = (input) => If(If(Const("true", input), ([_0, input2]) => [_0, input2], () => If(Const("false", input), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [LiteralBooleanMapping(_0), input2]);
166212
166393
  var LiteralNumber = (input) => If(Number3(input), ([_0, input2]) => [LiteralNumberMapping(_0), input2]);
166213
166394
  var LiteralString = (input) => If(String3(["'", '"'], input), ([_0, input2]) => [LiteralStringMapping(_0), input2]);
166214
- var Literal2 = (input) => If(If(LiteralBigInt(input), ([_0, input2]) => [_0, input2], () => If(LiteralBoolean(input), ([_0, input2]) => [_0, input2], () => If(LiteralNumber(input), ([_0, input2]) => [_0, input2], () => If(LiteralString(input), ([_0, input2]) => [_0, input2], () => [])))), ([_0, input2]) => [LiteralMapping(_0), input2]);
166215
166395
  var KeyOf = (input) => If(If(If(Const("keyof", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [KeyOfMapping(_0), input2]);
166216
166396
  var IndexArray_0 = (input, result = []) => If(If(If(Const("[", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(If(Const("[", input), ([_0, input2]) => If(Const("]", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => IndexArray_0(input2, [...result, _0]), () => [result, input]);
166217
166397
  var IndexArray = (input) => If(IndexArray_0(input), ([_0, input2]) => [IndexArrayMapping(_0), input2]);
166218
- var Extends = (input) => If(If(If(Const("extends", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("?", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => If(Const(":", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ExtendsMapping(_0), input2]);
166219
- var Base2 = (input) => If(If(If(Const("(", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const(")", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(Keyword(input), ([_0, input2]) => [_0, input2], () => If(_Object_2(input), ([_0, input2]) => [_0, input2], () => If(Tuple2(input), ([_0, input2]) => [_0, input2], () => If(TemplateLiteral(input), ([_0, input2]) => [_0, input2], () => If(Literal2(input), ([_0, input2]) => [_0, input2], () => If(Constructor2(input), ([_0, input2]) => [_0, input2], () => If(_Function_2(input), ([_0, input2]) => [_0, input2], () => If(Mapped(input), ([_0, input2]) => [_0, input2], () => If(Options(input), ([_0, input2]) => [_0, input2], () => If(GenericCall(input), ([_0, input2]) => [_0, input2], () => If(Reference(input), ([_0, input2]) => [_0, input2], () => [])))))))))))), ([_0, input2]) => [BaseMapping(_0), input2]);
166220
- var Factor = (input) => If(If(KeyOf(input), ([_0, input2]) => If(Base2(input2), ([_1, input3]) => If(IndexArray(input3), ([_2, input4]) => If(Extends(input4), ([_3, input5]) => [[_0, _1, _2, _3], input5])))), ([_0, input2]) => [FactorMapping(_0), input2]);
166398
+ var Extends2 = (input) => If(If(If(Const("extends", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const("?", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => If(Const(":", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ExtendsMapping(_0), input2]);
166399
+ var Base = (input) => If(If(If(Const("(", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => If(Const(")", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(KeywordString(input), ([_0, input2]) => [_0, input2], () => If(KeywordNumber(input), ([_0, input2]) => [_0, input2], () => If(KeywordBoolean(input), ([_0, input2]) => [_0, input2], () => If(KeywordUndefined(input), ([_0, input2]) => [_0, input2], () => If(KeywordNull(input), ([_0, input2]) => [_0, input2], () => If(KeywordInteger(input), ([_0, input2]) => [_0, input2], () => If(KeywordBigInt(input), ([_0, input2]) => [_0, input2], () => If(KeywordUnknown(input), ([_0, input2]) => [_0, input2], () => If(KeywordAny(input), ([_0, input2]) => [_0, input2], () => If(KeywordObject(input), ([_0, input2]) => [_0, input2], () => If(KeywordNever(input), ([_0, input2]) => [_0, input2], () => If(KeywordSymbol(input), ([_0, input2]) => [_0, input2], () => If(KeywordVoid(input), ([_0, input2]) => [_0, input2], () => If(KeywordThis(input), ([_0, input2]) => [_0, input2], () => If(LiteralBigInt(input), ([_0, input2]) => [_0, input2], () => If(LiteralBoolean(input), ([_0, input2]) => [_0, input2], () => If(LiteralNumber(input), ([_0, input2]) => [_0, input2], () => If(LiteralString(input), ([_0, input2]) => [_0, input2], () => If(TemplateLiteral(input), ([_0, input2]) => [_0, input2], () => If(Dependent2(input), ([_0, input2]) => [_0, input2], () => If(_Object_2(input), ([_0, input2]) => [_0, input2], () => If(_Tuple_(input), ([_0, input2]) => [_0, input2], () => If(_Constructor_(input), ([_0, input2]) => [_0, input2], () => If(_Function_2(input), ([_0, input2]) => [_0, input2], () => If(_Mapped_(input), ([_0, input2]) => [_0, input2], () => If(GenericCall(input), ([_0, input2]) => [_0, input2], () => If(Reference(input), ([_0, input2]) => [_0, input2], () => [])))))))))))))))))))))))))))), ([_0, input2]) => [BaseMapping(_0), input2]);
166400
+ var With = (input) => If(If(If(Const("with", input), ([_0, input2]) => If(WithObject(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [WithMapping(_0), input2]);
166401
+ var Factor = (input) => If(If(KeyOf(input), ([_0, input2]) => If(Base(input2), ([_1, input3]) => If(IndexArray(input3), ([_2, input4]) => If(Extends2(input4), ([_3, input5]) => If(With(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [FactorMapping(_0), input2]);
166221
166402
  var ExprTermTail = (input) => If(If(If(Const("&", input), ([_0, input2]) => If(Factor(input2), ([_1, input3]) => If(ExprTermTail(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ExprTermTailMapping(_0), input2]);
166222
166403
  var ExprTerm = (input) => If(If(Factor(input), ([_0, input2]) => If(ExprTermTail(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ExprTermMapping(_0), input2]);
166223
166404
  var ExprTail = (input) => If(If(If(Const("|", input), ([_0, input2]) => If(ExprTerm(input2), ([_1, input3]) => If(ExprTail(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ExprTailMapping(_0), input2]);
@@ -166251,7 +166432,7 @@ var ElementBase = (input) => If(If(ElementNamed(input), ([_0, input2]) => [_0, i
166251
166432
  var Element = (input) => If(If(If(Const("...", input), ([_0, input2]) => If(ElementBase(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(ElementBase(input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [ElementMapping(_0), input2]);
166252
166433
  var ElementList_0 = (input, result = []) => If(If(Element(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ElementList_0(input2, [...result, _0]), () => [result, input]);
166253
166434
  var ElementList = (input) => If(If(ElementList_0(input), ([_0, input2]) => If(If(If(Element(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ElementListMapping(_0), input2]);
166254
- var Tuple2 = (input) => If(If(Const("[", input), ([_0, input2]) => If(ElementList(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [TupleMapping(_0), input2]);
166435
+ var _Tuple_ = (input) => If(If(Const("[", input), ([_0, input2]) => If(ElementList(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_Tuple_Mapping(_0), input2]);
166255
166436
  var ParameterReadonlyOptional = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("?", input2), ([_1, input3]) => If(Const(":", input3), ([_2, input4]) => If(Const("readonly", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [ParameterReadonlyOptionalMapping(_0), input2]);
166256
166437
  var ParameterReadonly = (input) => If(If(Ident(input), ([_0, input2]) => If(Const(":", input2), ([_1, input3]) => If(Const("readonly", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => [[_0, _1, _2, _3], input5])))), ([_0, input2]) => [ParameterReadonlyMapping(_0), input2]);
166257
166438
  var ParameterOptional = (input) => If(If(Ident(input), ([_0, input2]) => If(Const("?", input2), ([_1, input3]) => If(Const(":", input3), ([_2, input4]) => If(Type(input4), ([_3, input5]) => [[_0, _1, _2, _3], input5])))), ([_0, input2]) => [ParameterOptionalMapping(_0), input2]);
@@ -166261,31 +166442,32 @@ var Parameter2 = (input) => If(If(If(Const("...", input), ([_0, input2]) => If(P
166261
166442
  var ParameterList_0 = (input, result = []) => If(If(Parameter2(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => ParameterList_0(input2, [...result, _0]), () => [result, input]);
166262
166443
  var ParameterList = (input) => If(If(ParameterList_0(input), ([_0, input2]) => If(If(If(Parameter2(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ParameterListMapping(_0), input2]);
166263
166444
  var _Function_2 = (input) => If(If(Const("(", input), ([_0, input2]) => If(ParameterList(input2), ([_1, input3]) => If(Const(")", input3), ([_2, input4]) => If(Const("=>", input4), ([_3, input5]) => If(Type(input5), ([_4, input6]) => [[_0, _1, _2, _3, _4], input6]))))), ([_0, input2]) => [_Function_Mapping(_0), input2]);
166264
- var Constructor2 = (input) => If(If(Const("new", input), ([_0, input2]) => If(Const("(", input2), ([_1, input3]) => If(ParameterList(input3), ([_2, input4]) => If(Const(")", input4), ([_3, input5]) => If(Const("=>", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [ConstructorMapping(_0), input2]);
166445
+ var _Constructor_ = (input) => If(If(Const("new", input), ([_0, input2]) => If(Const("(", input2), ([_1, input3]) => If(ParameterList(input3), ([_2, input4]) => If(Const(")", input4), ([_3, input5]) => If(Const("=>", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [_Constructor_Mapping(_0), input2]);
166265
166446
  var MappedReadonly = (input) => If(If(If(Const("+", input), ([_0, input2]) => If(Const("readonly", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const("-", input), ([_0, input2]) => If(Const("readonly", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const("readonly", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])))), ([_0, input2]) => [MappedReadonlyMapping(_0), input2]);
166266
166447
  var MappedOptional = (input) => If(If(If(Const("+", input), ([_0, input2]) => If(Const("?", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const("-", input), ([_0, input2]) => If(Const("?", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If(If(Const("?", input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])))), ([_0, input2]) => [MappedOptionalMapping(_0), input2]);
166267
166448
  var MappedAs = (input) => If(If(If(Const("as", input), ([_0, input2]) => If(Type(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [MappedAsMapping(_0), input2]);
166268
- var Mapped = (input) => If(If(Const("{", input), ([_0, input2]) => If(MappedReadonly(input2), ([_1, input3]) => If(Const("[", input3), ([_2, input4]) => If(Ident(input4), ([_3, input5]) => If(Const("in", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => If(MappedAs(input7), ([_6, input8]) => If(Const("]", input8), ([_7, input9]) => If(MappedOptional(input9), ([_8, input10]) => If(Const(":", input10), ([_9, input11]) => If(Type(input11), ([_10, input12]) => If(OptionalSemiColon(input12), ([_11, input13]) => If(Const("}", input13), ([_12, input14]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], input14]))))))))))))), ([_0, input2]) => [MappedMapping(_0), input2]);
166449
+ var _Mapped_ = (input) => If(If(Const("{", input), ([_0, input2]) => If(MappedReadonly(input2), ([_1, input3]) => If(Const("[", input3), ([_2, input4]) => If(Ident(input4), ([_3, input5]) => If(Const("in", input5), ([_4, input6]) => If(Type(input6), ([_5, input7]) => If(MappedAs(input7), ([_6, input8]) => If(Const("]", input8), ([_7, input9]) => If(MappedOptional(input9), ([_8, input10]) => If(Const(":", input10), ([_9, input11]) => If(Type(input11), ([_10, input12]) => If(OptionalSemiColon(input12), ([_11, input13]) => If(Const("}", input13), ([_12, input14]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], input14]))))))))))))), ([_0, input2]) => [_Mapped_Mapping(_0), input2]);
166269
166450
  var Reference = (input) => If(Ident(input), ([_0, input2]) => [ReferenceMapping(_0), input2]);
166270
- var Options = (input) => If(If(Const("Options", input), ([_0, input2]) => If(Const("<", input2), ([_1, input3]) => If(Type(input3), ([_2, input4]) => If(Const(",", input4), ([_3, input5]) => If(JsonObject(input5), ([_4, input6]) => If(Const(">", input6), ([_5, input7]) => [[_0, _1, _2, _3, _4, _5], input7])))))), ([_0, input2]) => [OptionsMapping(_0), input2]);
166271
- var JsonNumber = (input) => If(Number3(input), ([_0, input2]) => [JsonNumberMapping(_0), input2]);
166272
- var JsonBoolean = (input) => If(If(Const("true", input), ([_0, input2]) => [_0, input2], () => If(Const("false", input), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [JsonBooleanMapping(_0), input2]);
166273
- var JsonString = (input) => If(String3(['"', "'"], input), ([_0, input2]) => [JsonStringMapping(_0), input2]);
166274
- var JsonNull = (input) => If(Const("null", input), ([_0, input2]) => [JsonNullMapping(_0), input2]);
166275
- var JsonProperty = (input) => If(If(PropertyKey(input), ([_0, input2]) => If(Const(":", input2), ([_1, input3]) => If(Json(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [JsonPropertyMapping(_0), input2]);
166276
- var JsonPropertyList_0 = (input, result = []) => If(If(JsonProperty(input), ([_0, input2]) => If(PropertyDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => JsonPropertyList_0(input2, [...result, _0]), () => [result, input]);
166277
- var JsonPropertyList = (input) => If(If(JsonPropertyList_0(input), ([_0, input2]) => If(If(If(JsonProperty(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [JsonPropertyListMapping(_0), input2]);
166278
- var JsonObject = (input) => If(If(Const("{", input), ([_0, input2]) => If(JsonPropertyList(input2), ([_1, input3]) => If(Const("}", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [JsonObjectMapping(_0), input2]);
166279
- var JsonElementList_0 = (input, result = []) => If(If(Json(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => JsonElementList_0(input2, [...result, _0]), () => [result, input]);
166280
- var JsonElementList = (input) => If(If(JsonElementList_0(input), ([_0, input2]) => If(If(If(Json(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [JsonElementListMapping(_0), input2]);
166281
- var JsonArray = (input) => If(If(Const("[", input), ([_0, input2]) => If(JsonElementList(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [JsonArrayMapping(_0), input2]);
166282
- var Json = (input) => If(If(JsonNumber(input), ([_0, input2]) => [_0, input2], () => If(JsonBoolean(input), ([_0, input2]) => [_0, input2], () => If(JsonString(input), ([_0, input2]) => [_0, input2], () => If(JsonNull(input), ([_0, input2]) => [_0, input2], () => If(JsonObject(input), ([_0, input2]) => [_0, input2], () => If(JsonArray(input), ([_0, input2]) => [_0, input2], () => [])))))), ([_0, input2]) => [JsonMapping(_0), input2]);
166451
+ var WithBigInt = (input) => If(BigInt3(input), ([_0, input2]) => [WithBigIntMapping(_0), input2]);
166452
+ var WithNumber = (input) => If(Number3(input), ([_0, input2]) => [WithNumberMapping(_0), input2]);
166453
+ var WithBoolean = (input) => If(If(Const("true", input), ([_0, input2]) => [_0, input2], () => If(Const("false", input), ([_0, input2]) => [_0, input2], () => [])), ([_0, input2]) => [WithBooleanMapping(_0), input2]);
166454
+ var WithString = (input) => If(String3(['"', "'"], input), ([_0, input2]) => [WithStringMapping(_0), input2]);
166455
+ var WithNull = (input) => If(Const("null", input), ([_0, input2]) => [WithNullMapping(_0), input2]);
166456
+ var WithUndefined = (input) => If(Const("undefined", input), ([_0, input2]) => [WithUndefinedMapping(_0), input2]);
166457
+ var WithProperty = (input) => If(If(PropertyKey(input), ([_0, input2]) => If(Const(":", input2), ([_1, input3]) => If(WithValue(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [WithPropertyMapping(_0), input2]);
166458
+ var WithPropertyList_0 = (input, result = []) => If(If(WithProperty(input), ([_0, input2]) => If(PropertyDelimiter(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => WithPropertyList_0(input2, [...result, _0]), () => [result, input]);
166459
+ var WithPropertyList = (input) => If(If(WithPropertyList_0(input), ([_0, input2]) => If(If(If(WithProperty(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [WithPropertyListMapping(_0), input2]);
166460
+ var WithObject = (input) => If(If(Const("{", input), ([_0, input2]) => If(WithPropertyList(input2), ([_1, input3]) => If(Const("}", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [WithObjectMapping(_0), input2]);
166461
+ var WithElementList_0 = (input, result = []) => If(If(WithValue(input), ([_0, input2]) => If(Const(",", input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => WithElementList_0(input2, [...result, _0]), () => [result, input]);
166462
+ var WithElementList = (input) => If(If(WithElementList_0(input), ([_0, input2]) => If(If(If(WithValue(input2), ([_02, input3]) => [[_02], input3]), ([_02, input3]) => [_02, input3], () => If([[], input2], ([_02, input3]) => [_02, input3], () => [])), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [WithElementListMapping(_0), input2]);
166463
+ var WithArray = (input) => If(If(Const("[", input), ([_0, input2]) => If(WithElementList(input2), ([_1, input3]) => If(Const("]", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [WithArrayMapping(_0), input2]);
166464
+ var WithValue = (input) => If(If(WithBigInt(input), ([_0, input2]) => [_0, input2], () => If(WithNumber(input), ([_0, input2]) => [_0, input2], () => If(WithBoolean(input), ([_0, input2]) => [_0, input2], () => If(WithString(input), ([_0, input2]) => [_0, input2], () => If(WithNull(input), ([_0, input2]) => [_0, input2], () => If(WithUndefined(input), ([_0, input2]) => [_0, input2], () => If(WithObject(input), ([_0, input2]) => [_0, input2], () => If(WithArray(input), ([_0, input2]) => [_0, input2], () => [])))))))), ([_0, input2]) => [WithValueMapping(_0), input2]);
166283
166465
  var PatternBigInt = (input) => If(Const("-?(?:0|[1-9][0-9]*)n", input), ([_0, input2]) => [PatternBigIntMapping(_0), input2]);
166284
166466
  var PatternString = (input) => If(Const(".*", input), ([_0, input2]) => [PatternStringMapping(_0), input2]);
166285
- var PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?", input), ([_0, input2]) => [PatternNumberMapping(_0), input2]);
166467
+ var PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?", input), ([_0, input2]) => [PatternNumberMapping(_0), input2]);
166286
166468
  var PatternInteger = (input) => If(Const("-?(?:0|[1-9][0-9]*)", input), ([_0, input2]) => [PatternIntegerMapping(_0), input2]);
166287
166469
  var PatternNever = (input) => If(Const("(?!)", input), ([_0, input2]) => [PatternNeverMapping(_0), input2]);
166288
- var PatternText = (input) => If(Until_1(["-?(?:0|[1-9][0-9]*)n", ".*", "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?", "-?(?:0|[1-9][0-9]*)", "(?!)", "(", ")", "$", "|"], input), ([_0, input2]) => [PatternTextMapping(_0), input2]);
166470
+ var PatternText = (input) => If(Until_1(["-?(?:0|[1-9][0-9]*)n", ".*", "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?", "-?(?:0|[1-9][0-9]*)", "(?!)", "(", ")", "$", "|"], input), ([_0, input2]) => [PatternTextMapping(_0), input2]);
166289
166471
  var PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input2]) => [_0, input2], () => If(PatternString(input), ([_0, input2]) => [_0, input2], () => If(PatternNumber(input), ([_0, input2]) => [_0, input2], () => If(PatternInteger(input), ([_0, input2]) => [_0, input2], () => If(PatternNever(input), ([_0, input2]) => [_0, input2], () => If(PatternGroup(input), ([_0, input2]) => [_0, input2], () => If(PatternText(input), ([_0, input2]) => [_0, input2], () => []))))))), ([_0, input2]) => [PatternBaseMapping(_0), input2]);
166290
166472
  var PatternGroup = (input) => If(If(Const("(", input), ([_0, input2]) => If(PatternBody(input2), ([_1, input3]) => If(Const(")", input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [PatternGroupMapping(_0), input2]);
166291
166473
  var PatternUnion = (input) => If(If(If(PatternTerm(input), ([_0, input2]) => If(Const("|", input2), ([_1, input3]) => If(PatternUnion(input3), ([_2, input4]) => [[_0, _1, _2], input4]))), ([_0, input2]) => [_0, input2], () => If(If(PatternTerm(input), ([_0, input2]) => [[_0], input2]), ([_0, input2]) => [_0, input2], () => If([[], input], ([_0, input2]) => [_0, input2], () => []))), ([_0, input2]) => [PatternUnionMapping(_0), input2]);
@@ -166309,14 +166491,14 @@ var ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input2]) =>
166309
166491
  var Module = (input) => If(If(ModuleDeclaration(input), ([_0, input2]) => If(ModuleDeclarationList(input2), ([_1, input3]) => [[_0, _1], input3])), ([_0, input2]) => [ModuleMapping(_0), input2]);
166310
166492
  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]);
166311
166493
 
166312
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/patterns/template.mjs
166494
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/patterns/template.mjs
166313
166495
  function ParseTemplateIntoTypes(template) {
166314
166496
  const parsed = TemplateLiteralTypes(`\`${template}\``);
166315
166497
  const result = exports_guard.IsEqual(parsed.length, 2) ? parsed[0] : Unreachable();
166316
166498
  return result;
166317
166499
  }
166318
166500
 
166319
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/template_literal/encode.mjs
166501
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/encode.mjs
166320
166502
  function JoinString(input) {
166321
166503
  return input.join("|");
166322
166504
  }
@@ -166349,18 +166531,18 @@ function EncodeTemplateLiteralDeferred(types, right, pattern) {
166349
166531
  const result = EncodeType(templateLiteral2, right, pattern);
166350
166532
  return result;
166351
166533
  }
166352
- function EncodeEnum(types, right, pattern) {
166353
- const variants = EnumValuesToVariants(types);
166354
- return EncodeUnion(variants, right, pattern);
166534
+ function EncodeEnum(values, right, pattern) {
166535
+ const evaluated = EvaluateEnum(values);
166536
+ return EncodeType(evaluated, right, pattern);
166355
166537
  }
166356
166538
  function EncodeUnion(types, right, pattern, result = []) {
166357
- return exports_guard.TakeLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
166539
+ return exports_guard.ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
166358
166540
  }
166359
166541
  function EncodeType(type, right, pattern) {
166360
- return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger2(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt2(type) ? EncodeBigInt(right, pattern) : IsBoolean2(type) ? EncodeBoolean(right, pattern) : IsNumber2(type) ? EncodeNumber(right, pattern) : IsString2(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
166542
+ return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger2(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt2(type) ? EncodeBigInt(right, pattern) : IsBoolean3(type) ? EncodeBoolean(right, pattern) : IsNumber3(type) ? EncodeNumber(right, pattern) : IsString3(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
166361
166543
  }
166362
166544
  function EncodeTypes(types, pattern) {
166363
- return exports_guard.TakeLeft(types, (left, right) => EncodeType(left, right, pattern), () => pattern);
166545
+ return exports_guard.ShiftLeft(types, (left, right) => EncodeType(left, right, pattern), () => pattern);
166364
166546
  }
166365
166547
  function EncodePattern(types) {
166366
166548
  const encoded = EncodeTypes(types, "");
@@ -166373,7 +166555,7 @@ function TemplateLiteralEncode(types) {
166373
166555
  return result;
166374
166556
  }
166375
166557
 
166376
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
166558
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
166377
166559
  function TemplateLiteralAction(types, options) {
166378
166560
  const result = CanInstantiate(types) ? exports_memory.Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
166379
166561
  return result;
@@ -166383,7 +166565,7 @@ function TemplateLiteralInstantiate(context, state, types, options) {
166383
166565
  return TemplateLiteralAction(instantiatedTypes, options);
166384
166566
  }
166385
166567
 
166386
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/template_literal.mjs
166568
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/template_literal.mjs
166387
166569
  function TemplateLiteralDeferred(types, options = {}) {
166388
166570
  return Deferred("TemplateLiteral", [types], options);
166389
166571
  }
@@ -166405,7 +166587,7 @@ function IsTemplateLiteral(value) {
166405
166587
  return IsKind(value, "TemplateLiteral");
166406
166588
  }
166407
166589
 
166408
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/result.mjs
166590
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/result.mjs
166409
166591
  var exports_result = {};
166410
166592
  __export(exports_result, {
166411
166593
  Match: () => Match3,
@@ -166441,37 +166623,41 @@ function IsExtendsTrueLike(value) {
166441
166623
  function Match3(result, true_, false_) {
166442
166624
  return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
166443
166625
  }
166444
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/extends_right.mjs
166626
+
166627
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/extends_right.mjs
166445
166628
  function ExtendsRightInfer(inferred, name2, left, right) {
166446
166629
  return Match3(ExtendsLeft(inferred, left, right), (checkInferred) => ExtendsTrue(exports_memory.Assign(exports_memory.Assign(inferred, checkInferred), { [name2]: left })), () => ExtendsFalse());
166447
166630
  }
166448
166631
  function ExtendsRightAny(inferred, _left) {
166449
166632
  return ExtendsTrue(inferred);
166450
166633
  }
166634
+ function ExtendsRightDependent(inferred, left, if_, then_, else_) {
166635
+ return Match3(ExtendsLeft(inferred, left, if_), (inferred2) => Match3(ExtendsLeft(inferred2, left, then_), (inferred3) => ExtendsTrue(inferred3), () => ExtendsFalse()), () => Match3(ExtendsLeft(inferred, left, else_), (inferred2) => ExtendsTrue(inferred2), () => ExtendsFalse()));
166636
+ }
166451
166637
  function ExtendsRightEnum(inferred, left, right) {
166452
- const union3 = EnumValuesToUnion(right);
166453
- return ExtendsLeft(inferred, left, union3);
166638
+ const evaluated = EvaluateEnum(right);
166639
+ return ExtendsLeft(inferred, left, evaluated);
166454
166640
  }
166455
166641
  function ExtendsRightIntersect(inferred, left, right) {
166456
- return exports_guard.TakeLeft(right, (head, tail) => Match3(ExtendsLeft(inferred, left, head), (inferred2) => ExtendsRightIntersect(inferred2, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
166642
+ return exports_guard.ShiftLeft(right, (head, tail) => Match3(ExtendsLeft(inferred, left, head), (inferred2) => ExtendsRightIntersect(inferred2, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
166457
166643
  }
166458
166644
  function ExtendsRightTemplateLiteral(inferred, left, right) {
166459
- const decoded = TemplateLiteralDecode(right);
166460
- return ExtendsLeft(inferred, left, decoded);
166645
+ const evaluated = EvaluateTemplateLiteral(right);
166646
+ return ExtendsLeft(inferred, left, evaluated);
166461
166647
  }
166462
166648
  function ExtendsRightUnion(inferred, left, right) {
166463
- return exports_guard.TakeLeft(right, (head, tail) => Match3(ExtendsLeft(inferred, left, head), (inferred2) => ExtendsTrue(inferred2), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
166649
+ return exports_guard.ShiftLeft(right, (head, tail) => Match3(ExtendsLeft(inferred, left, head), (inferred2) => ExtendsTrue(inferred2), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
166464
166650
  }
166465
166651
  function ExtendsRight(inferred, left, right) {
166466
- return IsAny(right) ? ExtendsRightAny(inferred, left) : 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();
166652
+ 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();
166467
166653
  }
166468
166654
 
166469
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/any.mjs
166655
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/any.mjs
166470
166656
  function ExtendsAny(inferred, left, right) {
166471
166657
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion(inferred);
166472
166658
  }
166473
166659
 
166474
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/array.mjs
166660
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/array.mjs
166475
166661
  function ExtendsImmutable(left, right) {
166476
166662
  const isImmutableLeft = IsImmutable(left);
166477
166663
  const isImmutableRight = IsImmutable(right);
@@ -166481,22 +166667,17 @@ function ExtendsArray(inferred, arrayLeft, left, right) {
166481
166667
  return IsArray2(right) ? ExtendsImmutable(arrayLeft, right) ? ExtendsLeft(inferred, left, right.items) : ExtendsFalse() : ExtendsRight(inferred, arrayLeft, right);
166482
166668
  }
166483
166669
 
166484
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/async_iterator.mjs
166485
- function ExtendsAsyncIterator(inferred, left, right) {
166486
- return IsAsyncIterator2(right) ? ExtendsLeft(inferred, left, right.iteratorItems) : ExtendsRight(inferred, AsyncIterator(left), right);
166487
- }
166488
-
166489
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/bigint.mjs
166670
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/bigint.mjs
166490
166671
  function ExtendsBigInt(inferred, left, right) {
166491
166672
  return IsBigInt2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166492
166673
  }
166493
166674
 
166494
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/boolean.mjs
166675
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/boolean.mjs
166495
166676
  function ExtendsBoolean(inferred, left, right) {
166496
- return IsBoolean2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166677
+ return IsBoolean3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166497
166678
  }
166498
166679
 
166499
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/parameters.mjs
166680
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/parameters.mjs
166500
166681
  function ParameterCompare(inferred, left, leftRest, right, rightRest) {
166501
166682
  const checkLeft = IsInfer(right) ? left : right;
166502
166683
  const checkRight = IsInfer(right) ? right : left;
@@ -166505,52 +166686,53 @@ function ParameterCompare(inferred, left, leftRest, right, rightRest) {
166505
166686
  return !isLeftOptional && isRightOptional ? ExtendsFalse() : Match3(ExtendsLeft(inferred, checkLeft, checkRight), (inferred2) => ExtendsParameters(inferred2, leftRest, rightRest), () => ExtendsFalse());
166506
166687
  }
166507
166688
  function ParameterRight(inferred, left, leftRest, rightRest) {
166508
- return exports_guard.TakeLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) ? ExtendsTrue(inferred) : ExtendsFalse());
166689
+ return exports_guard.ShiftLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) ? ExtendsTrue(inferred) : ExtendsFalse());
166509
166690
  }
166510
166691
  function ParametersLeft(inferred, left, rightRest) {
166511
- return exports_guard.TakeLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => ExtendsTrue(inferred));
166692
+ return exports_guard.ShiftLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => ExtendsTrue(inferred));
166512
166693
  }
166513
166694
  function ExtendsParameters(inferred, left, right) {
166514
166695
  return ParametersLeft(inferred, left, right);
166515
166696
  }
166516
166697
 
166517
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/return_type.mjs
166698
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/return_type.mjs
166518
166699
  function ExtendsReturnType(inferred, left, right) {
166519
166700
  return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsLeft(inferred, left, right);
166520
166701
  }
166521
166702
 
166522
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/constructor.mjs
166703
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/constructor.mjs
166523
166704
  function ExtendsConstructor(inferred, parameters, returnType, right) {
166524
166705
  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();
166525
166706
  }
166526
166707
 
166527
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/enum.mjs
166708
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/dependent.mjs
166709
+ function ExtendsDependent(inferred, if_, then_, else_, right) {
166710
+ return Match3(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));
166711
+ }
166712
+
166713
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/enum.mjs
166528
166714
  function ExtendsEnum(inferred, left, right) {
166529
- return ExtendsLeft(inferred, EnumToUnion(left), right);
166715
+ const evaluated = EvaluateEnum(left);
166716
+ return ExtendsLeft(inferred, evaluated, right);
166530
166717
  }
166531
166718
 
166532
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/function.mjs
166719
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/function.mjs
166533
166720
  function ExtendsFunction(inferred, parameters, returnType, right) {
166534
166721
  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();
166535
166722
  }
166536
166723
 
166537
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/integer.mjs
166724
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/integer.mjs
166538
166725
  function ExtendsInteger(inferred, left, right) {
166539
- return IsInteger2(right) ? ExtendsTrue(inferred) : IsNumber2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166726
+ return IsInteger2(right) ? ExtendsTrue(inferred) : IsNumber3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166540
166727
  }
166541
166728
 
166542
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/intersect.mjs
166729
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/intersect.mjs
166543
166730
  function ExtendsIntersect(inferred, left, right) {
166544
166731
  const evaluated = EvaluateIntersect(left);
166545
166732
  return ExtendsLeft(inferred, evaluated, right);
166546
166733
  }
166547
166734
 
166548
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/iterator.mjs
166549
- function ExtendsIterator(inferred, left, right) {
166550
- return IsIterator2(right) ? ExtendsLeft(inferred, left, right.iteratorItems) : ExtendsRight(inferred, Iterator(left), right);
166551
- }
166552
-
166553
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/literal.mjs
166735
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/literal.mjs
166554
166736
  function ExtendsLiteralValue(inferred, left, right) {
166555
166737
  return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
166556
166738
  }
@@ -166558,34 +166740,34 @@ function ExtendsLiteralBigInt(inferred, left, right) {
166558
166740
  return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166559
166741
  }
166560
166742
  function ExtendsLiteralBoolean(inferred, left, right) {
166561
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166743
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166562
166744
  }
166563
166745
  function ExtendsLiteralNumber(inferred, left, right) {
166564
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166746
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166565
166747
  }
166566
166748
  function ExtendsLiteralString(inferred, left, right) {
166567
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166749
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
166568
166750
  }
166569
166751
  function ExtendsLiteral(inferred, left, right) {
166570
166752
  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();
166571
166753
  }
166572
166754
 
166573
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/never.mjs
166755
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/never.mjs
166574
166756
  function ExtendsNever(inferred, left, right) {
166575
166757
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : ExtendsTrue(inferred);
166576
166758
  }
166577
166759
 
166578
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/null.mjs
166760
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/null.mjs
166579
166761
  function ExtendsNull(inferred, left, right) {
166580
166762
  return IsNull2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166581
166763
  }
166582
166764
 
166583
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/number.mjs
166765
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/number.mjs
166584
166766
  function ExtendsNumber(inferred, left, right) {
166585
- return IsNumber2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166767
+ return IsNumber3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166586
166768
  }
166587
166769
 
166588
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/object.mjs
166770
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/object.mjs
166589
166771
  function ExtendsPropertyOptional(inferred, left, right) {
166590
166772
  return IsOptional(left) ? IsOptional(right) ? ExtendsTrue(inferred) : ExtendsFalse() : ExtendsTrue(inferred);
166591
166773
  }
@@ -166613,32 +166795,54 @@ function ExtendsProperties(inferred, left, right) {
166613
166795
  function ExtendsObjectToObject(inferred, left, right) {
166614
166796
  return ExtendsProperties(inferred, left, right);
166615
166797
  }
166798
+ function RecordMergeInferred(left, right) {
166799
+ return exports_guard.Keys(right).reduce((result, key) => {
166800
+ return {
166801
+ ...result,
166802
+ [key]: exports_guard.HasPropertyKey(left, key) ? IsUnion(result[key]) ? Union([...result[key].anyOf, right[key]]) : Union([left[key], right[key]]) : right[key]
166803
+ };
166804
+ }, left);
166805
+ }
166806
+ function ExtendsRecordComparer(properties2, keys, type, result) {
166807
+ return exports_guard.ShiftLeft(keys, (left, right) => Match3(ExtendsLeft({}, properties2[left], type), (inferred) => ExtendsRecordComparer(properties2, right, type, RecordMergeInferred(result, inferred)), () => ExtendsFalse()), () => ExtendsTrue(result));
166808
+ }
166809
+ function ExtendsObjectToRecord(inferred, properties2, _pattern, value) {
166810
+ const keys = exports_guard.Keys(properties2);
166811
+ const result = ExtendsRecordComparer(properties2, keys, value, inferred);
166812
+ return result;
166813
+ }
166616
166814
  function ExtendsObject(inferred, left, right) {
166617
- return IsObject2(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_(left), right);
166815
+ return IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) : IsObject2(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_(left), right);
166618
166816
  }
166619
166817
 
166620
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/promise.mjs
166621
- function ExtendsPromise(inferred, left, right) {
166622
- return IsPromise(right) ? ExtendsLeft(inferred, left, right.item) : ExtendsRight(inferred, _Promise_(left), right);
166818
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/record.mjs
166819
+ function FromObject2(inferred, properties2) {
166820
+ return exports_guard.IsEqual(exports_guard.Keys(properties2).length, 0) ? ExtendsTrue(inferred) : ExtendsFalse();
166821
+ }
166822
+ function FromRecord(inferred, _leftKey, leftValue, _rightKey, rightValue) {
166823
+ return ExtendsLeft(inferred, leftValue, rightValue);
166824
+ }
166825
+ function ExtendsRecord(inferred, leftPattern, leftValue, right) {
166826
+ 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();
166623
166827
  }
166624
166828
 
166625
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/string.mjs
166829
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/string.mjs
166626
166830
  function ExtendsString(inferred, left, right) {
166627
- return IsString2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166831
+ return IsString3(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166628
166832
  }
166629
166833
 
166630
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/symbol.mjs
166834
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/symbol.mjs
166631
166835
  function ExtendsSymbol(inferred, left, right) {
166632
166836
  return IsSymbol2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166633
166837
  }
166634
166838
 
166635
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/template_literal.mjs
166839
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/template_literal.mjs
166636
166840
  function ExtendsTemplateLiteral(inferred, left, right) {
166637
- const decoded = TemplateLiteralDecode(left);
166638
- return ExtendsLeft(inferred, decoded, right);
166841
+ const evaluated = EvaluateTemplateLiteral(left);
166842
+ return ExtendsLeft(inferred, evaluated, right);
166639
166843
  }
166640
166844
 
166641
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/inference.mjs
166845
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/inference.mjs
166642
166846
  function Inferrable(name2, type) {
166643
166847
  return exports_memory.Create({ "~kind": "Inferrable" }, { name: name2, type }, {});
166644
166848
  }
@@ -166652,7 +166856,7 @@ function TryInferable(type) {
166652
166856
  return IsInfer(type) ? Inferrable(type.name, type.extends) : undefined;
166653
166857
  }
166654
166858
  function TryInferResults(rest3, right, result = []) {
166655
- return exports_guard.TakeLeft(rest3, (head, tail) => Match3(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => {
166859
+ return exports_guard.ShiftLeft(rest3, (head, tail) => Match3(ExtendsLeft({}, head, right), () => TryInferResults(tail, right, [...result, head]), () => {
166656
166860
  return;
166657
166861
  }), () => result);
166658
166862
  }
@@ -166665,7 +166869,7 @@ function InferUnionResult(inferred, name2, left, right) {
166665
166869
  return exports_guard.IsArray(results) ? ExtendsTrue(exports_memory.Assign(inferred, { [name2]: Union(results) })) : ExtendsFalse();
166666
166870
  }
166667
166871
 
166668
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/tuple.mjs
166872
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/tuple.mjs
166669
166873
  function Reverse(types) {
166670
166874
  return [...types].reverse();
166671
166875
  }
@@ -166682,61 +166886,61 @@ function ElementsCompare(inferred, reversed, left, leftRest, right, rightRest) {
166682
166886
  }
166683
166887
  function ElementsLeft(inferred, reversed, leftRest, right, rightRest) {
166684
166888
  const inferable = TryRestInferable(right);
166685
- return IsInferable(inferable) ? InferTupleResult(inferred, inferable["name"], ApplyReverse(leftRest, reversed), inferable["type"]) : exports_guard.TakeLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => ExtendsFalse());
166889
+ return IsInferable(inferable) ? InferTupleResult(inferred, inferable["name"], ApplyReverse(leftRest, reversed), inferable["type"]) : exports_guard.ShiftLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => ExtendsFalse());
166686
166890
  }
166687
166891
  function ElementsRight(inferred, reversed, leftRest, rightRest) {
166688
- return exports_guard.TakeLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => exports_guard.IsEqual(leftRest.length, 0) ? ExtendsTrue(inferred) : ExtendsFalse());
166892
+ return exports_guard.ShiftLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => exports_guard.IsEqual(leftRest.length, 0) ? ExtendsTrue(inferred) : ExtendsFalse());
166689
166893
  }
166690
166894
  function Elements(inferred, reversed, leftRest, rightRest) {
166691
166895
  return ElementsRight(inferred, reversed, leftRest, rightRest);
166692
166896
  }
166693
166897
  function ExtendsTupleToTuple(inferred, left, right) {
166694
- const instantiatedRight = InstantiateElements(inferred, { callstack: [] }, right);
166898
+ const instantiatedRight = InstantiateElements(inferred, State([], []), right);
166695
166899
  const reversed = Reversed(instantiatedRight);
166696
166900
  return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
166697
166901
  }
166698
166902
  function ExtendsTupleToArray(inferred, left, right) {
166699
166903
  const inferrable = TryInferable(right);
166700
- return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : exports_guard.TakeLeft(left, (head, tail) => Match3(ExtendsLeft(inferred, head, right), (inferred2) => ExtendsTupleToArray(inferred2, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
166904
+ return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : exports_guard.ShiftLeft(left, (head, tail) => Match3(ExtendsLeft(inferred, head, right), (inferred2) => ExtendsTupleToArray(inferred2, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
166701
166905
  }
166702
166906
  function ExtendsTuple(inferred, left, right) {
166703
- const instantiatedLeft = InstantiateElements(inferred, { callstack: [] }, left);
166907
+ const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
166704
166908
  return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray2(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
166705
166909
  }
166706
166910
 
166707
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/undefined.mjs
166911
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/undefined.mjs
166708
166912
  function ExtendsUndefined(inferred, left, right) {
166709
166913
  return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined2(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166710
166914
  }
166711
166915
 
166712
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/union.mjs
166916
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/union.mjs
166713
166917
  function ExtendsUnionSome(inferred, type, unionTypes) {
166714
- return exports_guard.TakeLeft(unionTypes, (head, tail) => Match3(ExtendsLeft(inferred, type, head), (inferred2) => ExtendsTrue(inferred2), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
166918
+ return exports_guard.ShiftLeft(unionTypes, (head, tail) => Match3(ExtendsLeft(inferred, type, head), (inferred2) => ExtendsTrue(inferred2), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
166715
166919
  }
166716
166920
  function ExtendsUnionLeft(inferred, left, right) {
166717
- return exports_guard.TakeLeft(left, (head, tail) => Match3(ExtendsUnionSome(inferred, head, right), (inferred2) => ExtendsUnionLeft(inferred2, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
166921
+ return exports_guard.ShiftLeft(left, (head, tail) => Match3(ExtendsUnionSome(inferred, head, right), (inferred2) => ExtendsUnionLeft(inferred2, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
166718
166922
  }
166719
166923
  function ExtendsUnion2(inferred, left, right) {
166720
166924
  const inferrable = TryInferable(right);
166721
166925
  return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable.name, left, inferrable.type) : IsUnion(right) ? ExtendsUnionLeft(inferred, left, right.anyOf) : ExtendsUnionLeft(inferred, left, [right]);
166722
166926
  }
166723
166927
 
166724
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/unknown.mjs
166928
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/unknown.mjs
166725
166929
  function ExtendsUnknown(inferred, left, right) {
166726
166930
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
166727
166931
  }
166728
166932
 
166729
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/void.mjs
166933
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/void.mjs
166730
166934
  function ExtendsVoid(inferred, left, right) {
166731
166935
  return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
166732
166936
  }
166733
166937
 
166734
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/extends_left.mjs
166938
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/extends_left.mjs
166735
166939
  function ExtendsLeft(inferred, left, right) {
166736
- return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray2(left) ? ExtendsArray(inferred, left, left.items, right) : IsAsyncIterator2(left) ? ExtendsAsyncIterator(inferred, left.iteratorItems, right) : IsBigInt2(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean2(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor2(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsEnum(left) ? ExtendsEnum(inferred, left, right) : IsFunction2(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger2(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsIterator2(left) ? ExtendsIterator(inferred, left.iteratorItems, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull2(left) ? ExtendsNull(inferred, left, right) : IsNumber2(left) ? ExtendsNumber(inferred, left, right) : IsObject2(left) ? ExtendsObject(inferred, left.properties, right) : IsPromise(left) ? ExtendsPromise(inferred, left.item, right) : IsString2(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();
166940
+ 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();
166737
166941
  }
166738
166942
 
166739
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/interface/instantiate.mjs
166943
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/interface/instantiate.mjs
166740
166944
  function InterfaceOperation(heritage, properties2) {
166741
166945
  const result = EvaluateIntersect([...heritage, _Object_(properties2)]);
166742
166946
  return result;
@@ -166751,7 +166955,7 @@ function InterfaceInstantiate(context, state, heritage, properties2, options) {
166751
166955
  return InterfaceAction(instantiatedHeritage, instantiatedProperties, options);
166752
166956
  }
166753
166957
 
166754
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/interface.mjs
166958
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/interface.mjs
166755
166959
  function InterfaceDeferred(heritage, properties2, options = {}) {
166756
166960
  return Deferred("Interface", [heritage, properties2], options);
166757
166961
  }
@@ -166762,7 +166966,7 @@ function Interface(heritage, properties2, options = {}) {
166762
166966
  return InterfaceAction(heritage, properties2, options);
166763
166967
  }
166764
166968
 
166765
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/cyclic/check.mjs
166969
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/check.mjs
166766
166970
  function FromRef(stack, context, ref2) {
166767
166971
  return stack.includes(ref2) ? true : FromType3([...stack, ref2], context, context[ref2]);
166768
166972
  }
@@ -166771,20 +166975,20 @@ function FromProperties(stack, context, properties2) {
166771
166975
  return FromTypes2(stack, context, types);
166772
166976
  }
166773
166977
  function FromTypes2(stack, context, types) {
166774
- return exports_guard.TakeLeft(types, (left, right) => FromType3(stack, context, left) ? true : FromTypes2(stack, context, right), () => false);
166978
+ return exports_guard.ShiftLeft(types, (left, right) => FromType3(stack, context, left) ? true : FromTypes2(stack, context, right), () => false);
166775
166979
  }
166776
166980
  function FromType3(stack, context, type) {
166777
- return IsRef(type) ? FromRef(stack, context, type.$ref) : IsArray2(type) ? FromType3(stack, context, type.items) : IsAsyncIterator2(type) ? FromType3(stack, context, type.iteratorItems) : IsConstructor2(type) ? FromTypes2(stack, context, [...type.parameters, type.instanceType]) : IsFunction2(type) ? FromTypes2(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes2(stack, context, type.allOf) : IsIterator2(type) ? FromType3(stack, context, type.iteratorItems) : IsObject2(type) ? FromProperties(stack, context, type.properties) : IsPromise(type) ? FromType3(stack, context, type.item) : IsUnion(type) ? FromTypes2(stack, context, type.anyOf) : IsTuple(type) ? FromTypes2(stack, context, type.items) : IsRecord(type) ? FromType3(stack, context, RecordValue(type)) : false;
166981
+ return IsRef(type) ? FromRef(stack, context, type.$ref) : IsArray2(type) ? FromType3(stack, context, type.items) : IsConstructor2(type) ? FromTypes2(stack, context, [...type.parameters, type.instanceType]) : IsFunction2(type) ? FromTypes2(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes2(stack, context, type.allOf) : IsObject2(type) ? FromProperties(stack, context, type.properties) : IsUnion(type) ? FromTypes2(stack, context, type.anyOf) : IsTuple(type) ? FromTypes2(stack, context, type.items) : IsRecord(type) ? FromType3(stack, context, RecordValue(type)) : false;
166778
166982
  }
166779
166983
  function CyclicCheck(stack, context, type) {
166780
166984
  const result = FromType3(stack, context, type);
166781
166985
  return result;
166782
166986
  }
166783
166987
 
166784
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
166988
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
166785
166989
  function ResolveCandidateKeys(context, keys) {
166786
166990
  return keys.reduce((result, left) => {
166787
- return left in context ? CyclicCheck([left], context, context[left]) ? [...result, left] : result : Unreachable();
166991
+ return CyclicCheck([left], context, context[left]) ? [...result, left] : result;
166788
166992
  }, []);
166789
166993
  }
166790
166994
  function CyclicCandidates(context) {
@@ -166792,7 +166996,7 @@ function CyclicCandidates(context) {
166792
166996
  const result = ResolveCandidateKeys(context, keys);
166793
166997
  return result;
166794
166998
  }
166795
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
166999
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
166796
167000
  function FromRef2(context, ref2, result) {
166797
167001
  return result.includes(ref2) ? result : (ref2 in context) ? FromType4(context, context[ref2], [...result, ref2]) : Unreachable();
166798
167002
  }
@@ -166806,13 +167010,13 @@ function FromTypes3(context, types, result) {
166806
167010
  }, result);
166807
167011
  }
166808
167012
  function FromType4(context, type, result) {
166809
- return IsRef(type) ? FromRef2(context, type.$ref, result) : IsArray2(type) ? FromType4(context, type.items, result) : IsAsyncIterator2(type) ? FromType4(context, type.iteratorItems, result) : IsConstructor2(type) ? FromTypes3(context, [...type.parameters, type.instanceType], result) : IsFunction2(type) ? FromTypes3(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties2(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes3(context, type.allOf, result) : IsIterator2(type) ? FromType4(context, type.iteratorItems, result) : IsObject2(type) ? FromProperties2(context, type.properties, result) : IsPromise(type) ? FromType4(context, type.item, result) : IsUnion(type) ? FromTypes3(context, type.anyOf, result) : IsTuple(type) ? FromTypes3(context, type.items, result) : IsRecord(type) ? FromType4(context, RecordValue(type), result) : result;
167013
+ return IsRef(type) ? FromRef2(context, type.$ref, result) : IsArray2(type) ? FromType4(context, type.items, result) : IsConstructor2(type) ? FromTypes3(context, [...type.parameters, type.instanceType], result) : IsFunction2(type) ? FromTypes3(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties2(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes3(context, type.allOf, result) : IsObject2(type) ? FromProperties2(context, type.properties, result) : IsUnion(type) ? FromTypes3(context, type.anyOf, result) : IsTuple(type) ? FromTypes3(context, type.items, result) : IsRecord(type) ? FromType4(context, RecordValue(type), result) : result;
166810
167014
  }
166811
167015
  function CyclicDependencies(context, key, type) {
166812
167016
  const result = FromType4(context, type, [key]);
166813
167017
  return result;
166814
167018
  }
166815
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/cyclic/extends.mjs
167019
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/extends.mjs
166816
167020
  function FromRef3(_ref) {
166817
167021
  return Any();
166818
167022
  }
@@ -166827,7 +167031,7 @@ function FromTypes4(types) {
166827
167031
  }, []);
166828
167032
  }
166829
167033
  function FromType5(type) {
166830
- return IsRef(type) ? FromRef3(type.$ref) : IsArray2(type) ? _Array_(FromType5(type.items), ArrayOptions(type)) : IsAsyncIterator2(type) ? AsyncIterator(FromType5(type.iteratorItems)) : IsConstructor2(type) ? Constructor(FromTypes4(type.parameters), FromType5(type.instanceType)) : IsFunction2(type) ? _Function_(FromTypes4(type.parameters), FromType5(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes4(type.allOf)) : IsIterator2(type) ? Iterator(FromType5(type.iteratorItems)) : IsObject2(type) ? _Object_(FromProperties3(type.properties)) : IsPromise(type) ? _Promise_(FromType5(type.item)) : IsRecord(type) ? Record(RecordKey(type), FromType5(RecordValue(type))) : IsUnion(type) ? Union(FromTypes4(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes4(type.items)) : type;
167034
+ return IsRef(type) ? FromRef3(type.$ref) : IsArray2(type) ? _Array_(FromType5(type.items), ArrayOptions(type)) : IsConstructor2(type) ? Constructor(FromTypes4(type.parameters), FromType5(type.instanceType)) : IsFunction2(type) ? _Function_(FromTypes4(type.parameters), FromType5(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes4(type.allOf)) : IsObject2(type) ? _Object_(FromProperties3(type.properties)) : IsRecord(type) ? Record(RecordKey(type), FromType5(RecordValue(type))) : IsUnion(type) ? Union(FromTypes4(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes4(type.items)) : type;
166831
167035
  }
166832
167036
  function CyclicAnyFromParameters(defs, ref2) {
166833
167037
  return ref2 in defs ? FromType5(defs[ref2]) : Unknown();
@@ -166835,10 +167039,10 @@ function CyclicAnyFromParameters(defs, ref2) {
166835
167039
  function CyclicExtends(type) {
166836
167040
  return CyclicAnyFromParameters(type.$defs, type.$ref);
166837
167041
  }
166838
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
167042
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
166839
167043
  function CyclicInterface(context, heritage, properties2) {
166840
- const instantiatedHeritage = InstantiateTypes(context, { callstack: [] }, heritage);
166841
- const instantiatedProperties = InstantiateProperties({}, { callstack: [] }, properties2);
167044
+ const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
167045
+ const instantiatedProperties = InstantiateProperties({}, State([], []), properties2);
166842
167046
  const evaluatedInterface = EvaluateIntersect([...instantiatedHeritage, _Object_(instantiatedProperties)]);
166843
167047
  return evaluatedInterface;
166844
167048
  }
@@ -166856,7 +167060,7 @@ function InstantiateCyclic(context, ref2, type) {
166856
167060
  const result = Cyclic(definitions, ref2);
166857
167061
  return result;
166858
167062
  }
166859
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/cyclic/target.mjs
167063
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/cyclic/target.mjs
166860
167064
  function Resolve(defs, ref2) {
166861
167065
  return ref2 in defs ? IsRef(defs[ref2]) ? Resolve(defs, defs[ref2].$ref) : defs[ref2] : Never();
166862
167066
  }
@@ -166864,29 +167068,29 @@ function CyclicTarget(defs, ref2) {
166864
167068
  const result = Resolve(defs, ref2);
166865
167069
  return result;
166866
167070
  }
166867
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/extends/extends.mjs
167071
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/extends/extends.mjs
166868
167072
  function Canonical(type) {
166869
167073
  return IsCyclic(type) ? CyclicExtends(type) : IsUnsafe(type) ? Unknown() : type;
166870
167074
  }
166871
- function Extends2(inferred, left, right) {
167075
+ function Extends(inferred, left, right) {
166872
167076
  const canonicalLeft = Canonical(left);
166873
167077
  const canonicalRight = Canonical(right);
166874
167078
  return ExtendsLeft(inferred, canonicalLeft, canonicalRight);
166875
167079
  }
166876
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/compare.mjs
167080
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/compare.mjs
166877
167081
  var ResultEqual = "equal";
166878
167082
  var ResultDisjoint = "disjoint";
166879
167083
  var ResultLeftInside = "left-inside";
166880
167084
  var ResultRightInside = "right-inside";
166881
167085
  function Compare(left, right) {
166882
167086
  const extendsCheck = [
166883
- IsUnknown(left) ? exports_result.ExtendsFalse() : Extends2({}, left, right),
166884
- IsUnknown(left) ? exports_result.ExtendsTrue({}) : Extends2({}, right, left)
167087
+ IsUnknown(left) ? exports_result.ExtendsFalse() : Extends({}, left, right),
167088
+ IsUnknown(left) ? exports_result.ExtendsTrue({}) : Extends({}, right, left)
166885
167089
  ];
166886
167090
  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;
166887
167091
  }
166888
167092
 
166889
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
167093
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
166890
167094
  function BroadFilter(type, types) {
166891
167095
  return types.filter((left) => {
166892
167096
  return Compare(type, left) === ResultRightInside ? false : true;
@@ -166911,10 +167115,9 @@ function BroadenTypes(types) {
166911
167115
  function Broaden(types) {
166912
167116
  const broadened = BroadenTypes(types);
166913
167117
  const flattened = Flatten(broadened);
166914
- const result = flattened.length === 0 ? Never() : flattened.length === 1 ? flattened[0] : Union(flattened);
166915
- return result;
167118
+ return flattened;
166916
167119
  }
166917
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
167120
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
166918
167121
  function EvaluateAction(type, options) {
166919
167122
  const result = exports_memory.Update(EvaluateType(type), {}, options);
166920
167123
  return result;
@@ -166923,7 +167126,7 @@ function EvaluateInstantiate(context, state, type, options) {
166923
167126
  const instantiatedType = InstantiateType(context, state, type);
166924
167127
  return EvaluateAction(instantiatedType, options);
166925
167128
  }
166926
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
167129
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
166927
167130
  function CollectDistributionNames(expression, result = []) {
166928
167131
  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;
166929
167132
  }
@@ -166931,7 +167134,7 @@ function BuildDistributionArray(parameters, names) {
166931
167134
  return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
166932
167135
  }
166933
167136
  function ZipDistributionArray(arguments_, distributionArray, result = []) {
166934
- return exports_guard.TakeLeft(arguments_, (argumentLeft, argumentRight) => exports_guard.TakeLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);
167137
+ return exports_guard.ShiftLeft(arguments_, (argumentLeft, argumentRight) => exports_guard.ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);
166935
167138
  }
166936
167139
  function Expand(type) {
166937
167140
  return IsUnion(type) ? [...type.anyOf] : [type];
@@ -166956,7 +167159,7 @@ function DistributeArguments(parameters, arguments_, expression) {
166956
167159
  return IsDeferred(expression) && exports_guard.IsEqual(expression.action, "Conditional") ? Distribute2(zippedArguments) : IsDeferred(expression) && exports_guard.IsEqual(expression.action, "Mapped") ? Distribute2(zippedArguments) : [arguments_];
166957
167160
  }
166958
167161
 
166959
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/call/resolve_target.mjs
167162
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/resolve_target.mjs
166960
167163
  function FromNotResolvable() {
166961
167164
  return ["(not-resolvable)", Never()];
166962
167165
  }
@@ -166976,9 +167179,9 @@ function ResolveTarget(context, target2, arguments_) {
166976
167179
  return FromType6(context, "(anonymous)", target2, arguments_);
166977
167180
  }
166978
167181
 
166979
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
167182
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
166980
167183
  function AssertArgumentExtends(name2, type, extends_) {
166981
- if (IsInfer(type) || IsCall(type) || exports_result.IsExtendsTrueLike(Extends2({}, type, extends_)))
167184
+ if (IsInfer(type) || IsCall(type) || exports_result.IsExtendsTrueLike(Extends({}, type, extends_)))
166982
167185
  return;
166983
167186
  const cause = { parameter: name2, expect: extends_, actual: type };
166984
167187
  throw new Error(`Argument for parameter ${name2} does not satisfy constraint`, { cause });
@@ -166991,16 +167194,16 @@ function BindArgument(context, state, name2, extends_, type) {
166991
167194
  function BindArguments(context, state, parameterLeft, parameterRight, arguments_) {
166992
167195
  const instantiatedExtends = InstantiateType(context, state, parameterLeft.extends);
166993
167196
  const instantiatedEquals = InstantiateType(context, state, parameterLeft.equals);
166994
- return exports_guard.TakeLeft(arguments_, (left, right) => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, left), state, parameterRight, right), () => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, instantiatedEquals), state, parameterRight, []));
167197
+ return exports_guard.ShiftLeft(arguments_, (left, right) => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, left), state, parameterRight, right), () => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, instantiatedEquals), state, parameterRight, []));
166995
167198
  }
166996
167199
  function BindParameters(context, state, parameters, arguments_) {
166997
- return exports_guard.TakeLeft(parameters, (left, right) => BindArguments(context, state, left, right, arguments_), () => context);
167200
+ return exports_guard.ShiftLeft(parameters, (left, right) => BindArguments(context, state, left, right, arguments_), () => context);
166998
167201
  }
166999
167202
  function ResolveArgumentsContext(context, state, parameters, arguments_) {
167000
167203
  return BindParameters(context, state, parameters, arguments_);
167001
167204
  }
167002
167205
 
167003
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/call/instantiate.mjs
167206
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/call/instantiate.mjs
167004
167207
  function Peek(state) {
167005
167208
  const result = exports_guard.IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
167006
167209
  return result;
@@ -167011,8 +167214,8 @@ function IsTailCall(state, name2) {
167011
167214
  }
167012
167215
  function CallDispatch(context, state, target2, parameters, expression, arguments_) {
167013
167216
  const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
167014
- const returnType = InstantiateType(argumentsContext, { callstack: [...state.callstack, target2.$ref] }, expression);
167015
- return InstantiateType(context, state, returnType);
167217
+ const returnType = InstantiateType(argumentsContext, State([...state["callstack"], target2["$ref"]], state["visited"]), expression);
167218
+ return InstantiateType(argumentsContext, State([], []), returnType);
167016
167219
  }
167017
167220
  function CallDistributed(context, state, target2, parameters, expression, distributedArguments) {
167018
167221
  return distributedArguments.reduce((result, arguments_) => [...result, CallDispatch(context, state, target2, parameters, expression, arguments_)], []);
@@ -167032,46 +167235,59 @@ function CallInstantiate(context, state, target2, arguments_) {
167032
167235
  return result;
167033
167236
  }
167034
167237
 
167035
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/types/call.mjs
167238
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/types/call.mjs
167036
167239
  function CallConstruct(target2, arguments_) {
167037
- return exports_memory.Create({ ["~kind"]: "Call" }, { target: target2, arguments: arguments_ }, {});
167240
+ return exports_memory.Create({ ["~kind"]: "Call" }, { type: "call", target: target2, arguments: arguments_ }, {});
167038
167241
  }
167039
167242
  function Call(target2, arguments_) {
167040
- return CallInstantiate({}, { callstack: [] }, target2, arguments_);
167243
+ return CallInstantiate({}, State([], []), target2, arguments_);
167041
167244
  }
167042
167245
  function IsCall(value) {
167043
167246
  return IsKind(value, "Call");
167044
167247
  }
167045
167248
 
167046
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
167249
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
167250
+ function RemoveImmutableOperation(type) {
167251
+ return exports_memory.Discard(type, ["~immutable"]);
167252
+ }
167253
+ function RemoveImmutableAction(type, options) {
167254
+ const result = exports_memory.Update(RemoveImmutableOperation(type), {}, options);
167255
+ return result;
167256
+ }
167257
+ function RemoveImmutableInstantiate(context, state, type, options) {
167258
+ const instantiatedType = InstantiateType(context, state, type);
167259
+ return RemoveImmutableAction(instantiatedType, options);
167260
+ }
167261
+
167262
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
167047
167263
  function ApplyMapping(mapping, value) {
167048
167264
  return mapping(value);
167049
167265
  }
167050
167266
 
167051
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
167267
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
167052
167268
  function FromLiteral3(mapping, value) {
167053
167269
  return exports_guard.IsString(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
167054
167270
  }
167055
167271
 
167056
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
167272
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
167057
167273
  function FromTemplateLiteral(mapping, pattern) {
167058
- const decoded = TemplateLiteralDecode(pattern);
167059
- const result = FromType7(mapping, decoded);
167274
+ const evaluated = EvaluateTemplateLiteral(pattern);
167275
+ const result = FromType7(mapping, evaluated);
167060
167276
  return result;
167061
167277
  }
167062
167278
 
167063
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
167279
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
167064
167280
  function FromUnion2(mapping, types) {
167065
167281
  const result = types.map((type) => FromType7(mapping, type));
167066
167282
  return Union(result);
167067
167283
  }
167068
167284
 
167069
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
167285
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
167070
167286
  function FromType7(mapping, type) {
167071
167287
  return IsLiteral(type) ? FromLiteral3(mapping, type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(mapping, type.pattern) : IsUnion(type) ? FromUnion2(mapping, type.anyOf) : type;
167072
167288
  }
167073
167289
 
167074
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/capitalize.mjs
167290
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/capitalize.mjs
167075
167291
  function CapitalizeDeferred(type, options = {}) {
167076
167292
  return Deferred("Capitalize", [type], options);
167077
167293
  }
@@ -167079,7 +167295,7 @@ function Capitalize(type, options = {}) {
167079
167295
  return CapitalizeAction(type, options);
167080
167296
  }
167081
167297
 
167082
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/lowercase.mjs
167298
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/lowercase.mjs
167083
167299
  function LowercaseDeferred(type, options = {}) {
167084
167300
  return Deferred("Lowercase", [type], options);
167085
167301
  }
@@ -167087,7 +167303,7 @@ function Lowercase(type, options = {}) {
167087
167303
  return LowercaseAction(type, options);
167088
167304
  }
167089
167305
 
167090
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/uncapitalize.mjs
167306
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/uncapitalize.mjs
167091
167307
  function UncapitalizeDeferred(type, options = {}) {
167092
167308
  return Deferred("Uncapitalize", [type], options);
167093
167309
  }
@@ -167095,7 +167311,7 @@ function Uncapitalize(type, options = {}) {
167095
167311
  return UncapitalizeAction(type, options);
167096
167312
  }
167097
167313
 
167098
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/uppercase.mjs
167314
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/uppercase.mjs
167099
167315
  function UppercaseDeferred(type, options = {}) {
167100
167316
  return Deferred("Uppercase", [type], options);
167101
167317
  }
@@ -167103,7 +167319,7 @@ function Uppercase(type, options = {}) {
167103
167319
  return UppercaseAction(type, options);
167104
167320
  }
167105
167321
 
167106
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
167322
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
167107
167323
  var CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);
167108
167324
  var LowercaseMapping = (input) => input.toLowerCase();
167109
167325
  var UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);
@@ -167141,17 +167357,17 @@ function UppercaseInstantiate(context, state, type, options) {
167141
167357
  return UppercaseAction(instantiatedType, options);
167142
167358
  }
167143
167359
 
167144
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/conditional.mjs
167360
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/conditional.mjs
167145
167361
  function ConditionalDeferred(left, right, true_, false_, options = {}) {
167146
167362
  return Deferred("Conditional", [left, right, true_, false_], options);
167147
167363
  }
167148
167364
  function Conditional(left, right, true_, false_, options = {}) {
167149
- return ConditionalAction({}, { callstack: [] }, left, right, true_, false_, options);
167365
+ return ConditionalAction({}, State([], []), left, right, true_, false_, options);
167150
167366
  }
167151
167367
 
167152
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
167368
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
167153
167369
  function ConditionalOperation(context, state, left, right, true_, false_) {
167154
- const extendsResult = Extends2(context, left, right);
167370
+ const extendsResult = Extends(context, left, right);
167155
167371
  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_);
167156
167372
  }
167157
167373
  function ConditionalAction(context, state, left, right, true_, false_, options) {
@@ -167163,7 +167379,7 @@ function ConditionalInstantiate(context, state, left, right, true_, false_, opti
167163
167379
  const instantiatedRight = InstantiateType(context, state, right);
167164
167380
  return ConditionalAction(context, state, instantiatedLeft, instantiatedRight, true_, false_, options);
167165
167381
  }
167166
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/constructor_parameters.mjs
167382
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/constructor_parameters.mjs
167167
167383
  function ConstructorParametersDeferred(type, options = {}) {
167168
167384
  return Deferred("ConstructorParameters", [type], options);
167169
167385
  }
@@ -167171,10 +167387,10 @@ function ConstructorParameters(type, options = {}) {
167171
167387
  return ConstructorParametersAction(type, options);
167172
167388
  }
167173
167389
 
167174
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
167390
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
167175
167391
  function ConstructorParametersOperation(type) {
167176
167392
  const parameters = IsConstructor2(type) ? type["parameters"] : [];
167177
- const instantiatedParameters = InstantiateElements({}, { callstack: [] }, parameters);
167393
+ const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
167178
167394
  const result = Tuple(instantiatedParameters);
167179
167395
  return result;
167180
167396
  }
@@ -167187,7 +167403,7 @@ function ConstructorParametersInstantiate(context, state, type, options) {
167187
167403
  return ConstructorParametersAction(instantiatedType, options);
167188
167404
  }
167189
167405
 
167190
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/exclude.mjs
167406
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/exclude.mjs
167191
167407
  function ExcludeDeferred(left, right, options = {}) {
167192
167408
  return Deferred("Exclude", [left, right], options);
167193
167409
  }
@@ -167195,24 +167411,7 @@ function Exclude(left, right, options = {}) {
167195
167411
  return ExcludeAction(left, right, options);
167196
167412
  }
167197
167413
 
167198
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/exclude/operation.mjs
167199
- function ExcludeUnionLeft(types, right) {
167200
- return types.reduce((result, head) => {
167201
- return [...result, ...ExcludeTypeLeft(head, right)];
167202
- }, []);
167203
- }
167204
- function ExcludeTypeLeft(left, right) {
167205
- const check3 = Extends2({}, left, right);
167206
- const result = exports_result.IsExtendsTrueLike(check3) ? [] : [left];
167207
- return result;
167208
- }
167209
- function ExcludeOperation(left, right) {
167210
- const remaining = IsEnum(left) ? ExcludeUnionLeft(EnumValuesToVariants(left.enum), right) : IsUnion(left) ? ExcludeUnionLeft(Flatten(left.anyOf), right) : ExcludeTypeLeft(left, right);
167211
- const result = EvaluateUnion(remaining);
167212
- return result;
167213
- }
167214
-
167215
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
167414
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
167216
167415
  function ExcludeAction(left, right, options) {
167217
167416
  const result = CanInstantiate([left, right]) ? exports_memory.Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
167218
167417
  return result;
@@ -167223,7 +167422,7 @@ function ExcludeInstantiate(context, state, left, right, options) {
167223
167422
  return ExcludeAction(instantiatedLeft, instantiatedRight, options);
167224
167423
  }
167225
167424
 
167226
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/extract.mjs
167425
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/extract.mjs
167227
167426
  function ExtractDeferred(left, right, options = {}) {
167228
167427
  return Deferred("Extract", [left, right], options);
167229
167428
  }
@@ -167231,24 +167430,26 @@ function Extract(left, right, options = {}) {
167231
167430
  return ExtractAction(left, right, options);
167232
167431
  }
167233
167432
 
167234
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/extract/operation.mjs
167235
- function ExtractUnionLeft(types, right) {
167236
- return types.reduce((result, head) => {
167237
- return [...result, ...ExtractTypeLeft(head, right)];
167238
- }, []);
167239
- }
167240
- function ExtractTypeLeft(left, right) {
167241
- const check3 = Extends2({}, left, right);
167433
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/extract/operation.mjs
167434
+ function ExtractType(left, right) {
167435
+ const check3 = Extends({}, left, right);
167242
167436
  const result = exports_result.IsExtendsTrueLike(check3) ? [left] : [];
167243
167437
  return result;
167244
167438
  }
167439
+ function ExtractUnion(types, right) {
167440
+ return types.reduce((result, head) => {
167441
+ return [...result, ...ExtractType(head, right)];
167442
+ }, []);
167443
+ }
167245
167444
  function ExtractOperation(left, right) {
167246
- const remaining = IsEnum(left) ? ExtractUnionLeft(EnumValuesToVariants(left.enum), right) : IsUnion(left) ? ExtractUnionLeft(Flatten(left.anyOf), right) : ExtractTypeLeft(left, right);
167445
+ const evaluated = EvaluateType(left);
167446
+ const canonical = IsUnion(evaluated) ? evaluated.anyOf : [evaluated];
167447
+ const remaining = ExtractUnion(canonical, right);
167247
167448
  const result = EvaluateUnion(remaining);
167248
167449
  return result;
167249
167450
  }
167250
167451
 
167251
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/extract/instantiate.mjs
167452
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/extract/instantiate.mjs
167252
167453
  function ExtractAction(left, right, options) {
167253
167454
  const result = CanInstantiate([left, right]) ? exports_memory.Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
167254
167455
  return result;
@@ -167259,7 +167460,7 @@ function ExtractInstantiate(context, state, left, right, options) {
167259
167460
  return ExtractAction(instantiatedLeft, instantiatedRight, options);
167260
167461
  }
167261
167462
 
167262
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
167463
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
167263
167464
  function KeysToLiterals(keys) {
167264
167465
  return keys.reduce((result, left) => {
167265
167466
  return IsLiteralValue(left) ? [...result, Literal(left)] : result;
@@ -167271,7 +167472,7 @@ function KeysToIndexer(keys) {
167271
167472
  return result;
167272
167473
  }
167273
167474
 
167274
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/indexed.mjs
167475
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/indexed.mjs
167275
167476
  function IndexDeferred(type, indexer, options = {}) {
167276
167477
  return Deferred("Index", [type, indexer], options);
167277
167478
  }
@@ -167280,14 +167481,21 @@ function Index(type, indexer_or_keys, options = {}) {
167280
167481
  return IndexAction(type, indexer, options);
167281
167482
  }
167282
167483
 
167283
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
167484
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
167284
167485
  function FromCyclic(defs, ref2) {
167285
167486
  const target2 = CyclicTarget(defs, ref2);
167286
167487
  const result = FromType8(target2);
167287
167488
  return result;
167288
167489
  }
167289
167490
 
167290
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/from_intersect.mjs
167491
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_dependent.mjs
167492
+ function FromDependent(if_, then_, else_) {
167493
+ const evaluated = EvaluateDependent(if_, then_, else_);
167494
+ const result = FromType8(evaluated);
167495
+ return result;
167496
+ }
167497
+
167498
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_intersect.mjs
167291
167499
  function CollapseIntersectProperties(left, right) {
167292
167500
  const leftKeys = exports_guard.Keys(left).filter((key) => !exports_guard.HasPropertyKey(right, key));
167293
167501
  const rightKeys = exports_guard.Keys(right).filter((key) => !exports_guard.HasPropertyKey(left, key));
@@ -167305,19 +167513,19 @@ function FromIntersect(types) {
167305
167513
  }, {});
167306
167514
  }
167307
167515
 
167308
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/from_object.mjs
167309
- function FromObject2(properties2) {
167516
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_object.mjs
167517
+ function FromObject3(properties2) {
167310
167518
  return properties2;
167311
167519
  }
167312
167520
 
167313
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/from_tuple.mjs
167521
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_tuple.mjs
167314
167522
  function FromTuple(types) {
167315
167523
  const object3 = TupleToObject(Tuple(types));
167316
167524
  const result = FromType8(object3);
167317
167525
  return result;
167318
167526
  }
167319
167527
 
167320
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/from_union.mjs
167528
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_union.mjs
167321
167529
  function CollapseUnionProperties(left, right) {
167322
167530
  const sharedKeys = exports_guard.Keys(left).filter((key) => (key in right));
167323
167531
  const result = sharedKeys.reduce((result2, key) => {
@@ -167326,31 +167534,31 @@ function CollapseUnionProperties(left, right) {
167326
167534
  return result;
167327
167535
  }
167328
167536
  function ReduceVariants(types, result) {
167329
- return exports_guard.TakeLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType8(left))), () => result);
167537
+ return exports_guard.ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType8(left))), () => result);
167330
167538
  }
167331
167539
  function FromUnion3(types) {
167332
- return exports_guard.TakeLeft(types, (left, right) => ReduceVariants(right, FromType8(left)), () => Unreachable());
167540
+ return exports_guard.ShiftLeft(types, (left, right) => ReduceVariants(right, FromType8(left)), () => Unreachable());
167333
167541
  }
167334
167542
 
167335
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/from_type.mjs
167543
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/from_type.mjs
167336
167544
  function FromType8(type) {
167337
- return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion3(type.anyOf) : IsTuple(type) ? FromTuple(type.items) : IsObject2(type) ? FromObject2(type.properties) : {};
167545
+ 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) : {};
167338
167546
  }
167339
167547
 
167340
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/object/collapse.mjs
167548
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/object/collapse.mjs
167341
167549
  function CollapseToObject(type) {
167342
167550
  const properties2 = FromType8(type);
167343
167551
  const result = _Object_(properties2);
167344
167552
  return result;
167345
167553
  }
167346
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/helpers/keys.mjs
167554
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/helpers/keys.mjs
167347
167555
  var integerKeyPattern = new RegExp("^(?:0|[1-9][0-9]*)$");
167348
167556
  function ConvertToIntegerKey(value) {
167349
167557
  const normal = `${value}`;
167350
167558
  return integerKeyPattern.test(normal) ? parseInt(normal) : value;
167351
167559
  }
167352
167560
 
167353
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexed/from_array.mjs
167561
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_array.mjs
167354
167562
  function NormalizeLiteral(value) {
167355
167563
  return Literal(ConvertToIntegerKey(value));
167356
167564
  }
@@ -167362,76 +167570,83 @@ function NormalizeIndexer(type) {
167362
167570
  }
167363
167571
  function FromArray2(type, indexer) {
167364
167572
  const normalizedIndexer = NormalizeIndexer(indexer);
167365
- const check3 = Extends2({}, normalizedIndexer, Number2());
167573
+ const check3 = Extends({}, normalizedIndexer, Number2());
167366
167574
  const result = exports_result.IsExtendsTrueLike(check3) ? type : IsLiteral(indexer) && exports_guard.IsEqual(indexer.const, "length") ? Number2() : Never();
167367
167575
  return result;
167368
167576
  }
167369
167577
 
167370
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
167578
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
167371
167579
  function FromCyclic2(defs, ref2) {
167372
167580
  const target2 = CyclicTarget(defs, ref2);
167373
167581
  const result = FromType9(target2);
167374
167582
  return result;
167375
167583
  }
167376
167584
 
167377
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_union.mjs
167378
- function FromUnion4(types) {
167379
- return types.reduce((result, left) => {
167380
- return [...result, ...FromType9(left)];
167381
- }, []);
167585
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
167586
+ function FromDependent2(if_, then_, else_) {
167587
+ const evaluated = EvaluateDependent(if_, then_, else_);
167588
+ const result = FromType9(evaluated);
167589
+ return result;
167382
167590
  }
167383
167591
 
167384
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
167592
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
167385
167593
  function FromEnum(values) {
167386
- const variants = EnumValuesToVariants(values);
167387
- const result = FromUnion4(variants);
167594
+ const evaluated = EvaluateEnum(values);
167595
+ const result = FromType9(evaluated);
167388
167596
  return result;
167389
167597
  }
167390
167598
 
167391
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
167599
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
167392
167600
  function FromIntersect2(types) {
167393
167601
  const evaluated = EvaluateIntersect(types);
167394
167602
  const result = FromType9(evaluated);
167395
167603
  return result;
167396
167604
  }
167397
167605
 
167398
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
167606
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
167399
167607
  function FromLiteral4(value) {
167400
167608
  const result = [`${value}`];
167401
167609
  return result;
167402
167610
  }
167403
167611
 
167404
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
167612
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
167405
167613
  function FromTemplateLiteral2(pattern) {
167406
- const decoded = TemplateLiteralDecode(pattern);
167407
- const result = FromType9(decoded);
167614
+ const evaluated = EvaluateTemplateLiteral(pattern);
167615
+ const result = FromType9(evaluated);
167408
167616
  return result;
167409
167617
  }
167410
167618
 
167411
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/from_type.mjs
167619
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_union.mjs
167620
+ function FromUnion4(types) {
167621
+ return types.reduce((result, left) => {
167622
+ return [...result, ...FromType9(left)];
167623
+ }, []);
167624
+ }
167625
+
167626
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/from_type.mjs
167412
167627
  function FromType9(type) {
167413
- return IsCyclic(type) ? FromCyclic2(type.$defs, type.$ref) : 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) : [];
167628
+ 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) : [];
167414
167629
  }
167415
167630
 
167416
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
167631
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
167417
167632
  function ToIndexableKeys(type) {
167418
167633
  const result = FromType9(type);
167419
167634
  return result;
167420
167635
  }
167421
167636
 
167422
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/this/expand_this.mjs
167637
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/this/expand_this.mjs
167423
167638
  function FromTypes5(properties2, types) {
167424
167639
  return types.map((type) => FromType10(properties2, type));
167425
167640
  }
167426
167641
  function FromType10(properties2, type) {
167427
- return IsArray2(type) ? _Array_(FromType10(properties2, type.items)) : IsAsyncIterator2(type) ? AsyncIterator(FromType10(properties2, type.iteratorItems)) : IsConstructor2(type) ? Constructor(FromTypes5(properties2, type.parameters), FromType10(properties2, type.instanceType)) : IsFunction2(type) ? _Function_(FromTypes5(properties2, type.parameters), FromType10(properties2, type.returnType)) : IsIterator2(type) ? Iterator(FromType10(properties2, type.iteratorItems)) : IsPromise(type) ? _Promise_(FromType10(properties2, type.item)) : IsTuple(type) ? Tuple(FromTypes5(properties2, type.items)) : IsUnion(type) ? Union(FromTypes5(properties2, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes5(properties2, type.allOf)) : IsThis(type) ? _Object_(properties2) : type;
167642
+ return IsArray2(type) ? _Array_(FromType10(properties2, type.items)) : IsConstructor2(type) ? Constructor(FromTypes5(properties2, type.parameters), FromType10(properties2, type.instanceType)) : IsFunction2(type) ? _Function_(FromTypes5(properties2, type.parameters), FromType10(properties2, type.returnType)) : IsTuple(type) ? Tuple(FromTypes5(properties2, type.items)) : IsUnion(type) ? Union(FromTypes5(properties2, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes5(properties2, type.allOf)) : IsThis(type) ? _Object_(properties2) : type;
167428
167643
  }
167429
167644
  function ExpandThis(properties2, type) {
167430
167645
  const result = FromType10(properties2, type);
167431
167646
  return result;
167432
167647
  }
167433
167648
 
167434
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexed/from_object.mjs
167649
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_object.mjs
167435
167650
  function IndexProperty(properties2, key) {
167436
167651
  const selectedType = key in properties2 ? properties2[key] : Never();
167437
167652
  const result = ExpandThis(properties2, selectedType);
@@ -167460,12 +167675,12 @@ function FromIndexerNumber(properties2) {
167460
167675
  const result = EvaluateUnion(variants);
167461
167676
  return result;
167462
167677
  }
167463
- function FromObject3(properties2, indexer) {
167464
- const result = IsNumber2(indexer) ? FromIndexerNumber(properties2) : FromIndexer(properties2, indexer);
167678
+ function FromObject4(properties2, indexer) {
167679
+ const result = IsNumber3(indexer) ? FromIndexerNumber(properties2) : FromIndexer(properties2, indexer);
167465
167680
  return result;
167466
167681
  }
167467
167682
 
167468
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
167683
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
167469
167684
  function ConvertLiteral(value) {
167470
167685
  return Literal(ConvertToIntegerKey(value));
167471
167686
  }
@@ -167476,10 +167691,10 @@ function FormatArrayIndexer(type) {
167476
167691
  return IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) : IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) : IsLiteral(type) ? ConvertLiteral(type.const) : type;
167477
167692
  }
167478
167693
 
167479
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
167694
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
167480
167695
  function IndexElementsWithIndexer(types, indexer) {
167481
167696
  return types.reduceRight((result, right, index) => {
167482
- const check3 = Extends2({}, Literal(index), indexer);
167697
+ const check3 = Extends({}, Literal(index), indexer);
167483
167698
  return exports_result.IsExtendsTrueLike(check3) ? [right, ...result] : result;
167484
167699
  }, []);
167485
167700
  }
@@ -167492,17 +167707,17 @@ function FromTupleWithoutIndexer(types) {
167492
167707
  return EvaluateUnionFast(types);
167493
167708
  }
167494
167709
  function FromTuple2(types, indexer) {
167495
- return IsLiteral(indexer) && exports_guard.IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber2(indexer) || IsInteger2(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
167710
+ return IsLiteral(indexer) && exports_guard.IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber3(indexer) || IsInteger2(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
167496
167711
  }
167497
167712
 
167498
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexed/from_type.mjs
167713
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/from_type.mjs
167499
167714
  function FromType11(type, indexer) {
167500
- return IsArray2(type) ? FromArray2(type.items, indexer) : IsObject2(type) ? FromObject3(type.properties, indexer) : IsTuple(type) ? FromTuple2(type.items, indexer) : Never();
167715
+ return IsArray2(type) ? FromArray2(type.items, indexer) : IsObject2(type) ? FromObject4(type.properties, indexer) : IsTuple(type) ? FromTuple2(type.items, indexer) : Never();
167501
167716
  }
167502
167717
 
167503
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
167718
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
167504
167719
  function NormalizeType(type) {
167505
- const result = IsCyclic(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
167720
+ const result = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
167506
167721
  return result;
167507
167722
  }
167508
167723
  function IndexAction(type, indexer, options) {
@@ -167515,7 +167730,7 @@ function IndexInstantiate(context, state, type, indexer, options) {
167515
167730
  return IndexAction(instantiatedType, instantiatedIndexer, options);
167516
167731
  }
167517
167732
 
167518
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/instance_type.mjs
167733
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/instance_type.mjs
167519
167734
  function InstanceTypeDeferred(type, options = {}) {
167520
167735
  return Deferred("InstanceType", [type], options);
167521
167736
  }
@@ -167523,7 +167738,7 @@ function InstanceType(type, options = {}) {
167523
167738
  return InstanceTypeAction(type, options);
167524
167739
  }
167525
167740
 
167526
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
167741
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
167527
167742
  function InstanceTypeOperation(type) {
167528
167743
  return IsConstructor2(type) ? type["instanceType"] : Never();
167529
167744
  }
@@ -167536,7 +167751,7 @@ function InstanceTypeInstantiate(context, state, type, options = {}) {
167536
167751
  return InstanceTypeAction(instantiatedType, options);
167537
167752
  }
167538
167753
 
167539
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/keyof.mjs
167754
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/keyof.mjs
167540
167755
  function KeyOfDeferred(type, options = {}) {
167541
167756
  return Deferred("KeyOf", [type], options);
167542
167757
  }
@@ -167544,49 +167759,49 @@ function KeyOf2(type, options = {}) {
167544
167759
  return KeyOfAction(type, options);
167545
167760
  }
167546
167761
 
167547
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/from_any.mjs
167762
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_any.mjs
167548
167763
  function FromAny() {
167549
167764
  return Union([Number2(), String2(), Symbol2()]);
167550
167765
  }
167551
167766
 
167552
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/from_array.mjs
167767
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_array.mjs
167553
167768
  function FromArray3(_type) {
167554
167769
  return Number2();
167555
167770
  }
167556
167771
 
167557
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/from_object.mjs
167772
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_object.mjs
167558
167773
  function FromPropertyKeys(keys) {
167559
167774
  const result = keys.reduce((result2, left) => {
167560
167775
  return IsLiteralValue(left) ? [...result2, Literal(ConvertToIntegerKey(left))] : Unreachable();
167561
167776
  }, []);
167562
167777
  return result;
167563
167778
  }
167564
- function FromObject4(properties2) {
167779
+ function FromObject5(properties2) {
167565
167780
  const propertyKeys = exports_guard.Keys(properties2);
167566
167781
  const variants = FromPropertyKeys(propertyKeys);
167567
167782
  const result = EvaluateUnionFast(variants);
167568
167783
  return result;
167569
167784
  }
167570
167785
 
167571
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/from_record.mjs
167572
- function FromRecord(type) {
167786
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_record.mjs
167787
+ function FromRecord2(type) {
167573
167788
  return RecordKey(type);
167574
167789
  }
167575
167790
 
167576
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
167791
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
167577
167792
  function FromTuple3(types) {
167578
167793
  const result = types.map((_, index) => Literal(index));
167579
167794
  return EvaluateUnionFast(result);
167580
167795
  }
167581
167796
 
167582
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/from_type.mjs
167797
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/from_type.mjs
167583
167798
  function FromType12(type) {
167584
- return IsAny(type) ? FromAny() : IsArray2(type) ? FromArray3(type.items) : IsObject2(type) ? FromObject4(type.properties) : IsRecord(type) ? FromRecord(type) : IsTuple(type) ? FromTuple3(type.items) : Never();
167799
+ return IsAny(type) ? FromAny() : IsArray2(type) ? FromArray3(type.items) : IsObject2(type) ? FromObject5(type.properties) : IsRecord(type) ? FromRecord2(type) : IsTuple(type) ? FromTuple3(type.items) : Never();
167585
167800
  }
167586
167801
 
167587
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
167802
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
167588
167803
  function NormalizeType2(type) {
167589
- const result = IsCyclic(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
167804
+ const result = IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
167590
167805
  return result;
167591
167806
  }
167592
167807
  function KeyOfAction(type, options) {
@@ -167597,18 +167812,18 @@ function KeyOfInstantiate(context, state, type, options) {
167597
167812
  return KeyOfAction(instantiatedType, options);
167598
167813
  }
167599
167814
 
167600
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/mapped.mjs
167815
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/mapped.mjs
167601
167816
  function MappedDeferred(identifier2, type, as, property, options = {}) {
167602
167817
  return Deferred("Mapped", [identifier2, type, as, property], options);
167603
167818
  }
167604
- function Mapped2(identifier2, type, as, property, options = {}) {
167605
- return MappedAction({}, { callstack: [] }, identifier2, type, as, property, options);
167819
+ function Mapped(identifier2, type, as, property, options = {}) {
167820
+ return MappedAction({}, State([], []), identifier2, type, as, property, options);
167606
167821
  }
167607
167822
 
167608
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
167823
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
167609
167824
  function FromTemplateLiteral3(pattern) {
167610
- const decoded = TemplateLiteralDecode(pattern);
167611
- const result = FromType13(decoded);
167825
+ const evaluated = EvaluateTemplateLiteral(pattern);
167826
+ const result = FromType13(evaluated);
167612
167827
  return result;
167613
167828
  }
167614
167829
  function FromUnion5(types) {
@@ -167616,12 +167831,17 @@ function FromUnion5(types) {
167616
167831
  return [...result, ...FromType13(left)];
167617
167832
  }, []);
167618
167833
  }
167834
+ function FromEnum2(values) {
167835
+ const evaluated = EvaluateEnum(values);
167836
+ const result = FromType13(evaluated);
167837
+ return result;
167838
+ }
167619
167839
  function FromLiteral5(value) {
167620
167840
  const result = exports_guard.IsNumber(value) ? [Literal(`${value}`)] : [Literal(value)];
167621
167841
  return result;
167622
167842
  }
167623
167843
  function FromType13(type) {
167624
- const result = IsEnum(type) ? FromUnion5(EnumValuesToVariants(type.enum)) : IsLiteral(type) ? FromLiteral5(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral3(type.pattern) : IsUnion(type) ? FromUnion5(type.anyOf) : [type];
167844
+ const result = IsEnum(type) ? FromEnum2(type.enum) : IsLiteral(type) ? FromLiteral5(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral3(type.pattern) : IsUnion(type) ? FromUnion5(type.anyOf) : [type];
167625
167845
  return result;
167626
167846
  }
167627
167847
  function MappedVariants(type) {
@@ -167629,9 +167849,9 @@ function MappedVariants(type) {
167629
167849
  return result;
167630
167850
  }
167631
167851
 
167632
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
167852
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
167633
167853
  function CanonicalAs(instantiatedAs) {
167634
- const result = IsTemplateLiteral(instantiatedAs) ? TemplateLiteralDecode(instantiatedAs.pattern) : instantiatedAs;
167854
+ const result = IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
167635
167855
  return result;
167636
167856
  }
167637
167857
  function MappedVariant(context, state, identifier2, variant, as, property) {
@@ -167659,7 +167879,7 @@ function MappedOperation(context, state, identifier2, type, as, property) {
167659
167879
  return result;
167660
167880
  }
167661
167881
 
167662
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
167882
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
167663
167883
  function MappedAction(context, state, identifier2, type, as, property, options) {
167664
167884
  const result = CanInstantiate([type]) ? exports_memory.Update(MappedOperation(context, state, identifier2, type, as, property), {}, options) : MappedDeferred(identifier2, type, as, property, options);
167665
167885
  return result;
@@ -167669,33 +167889,34 @@ function MappedInstantiate(context, state, identifier2, type, as, property, opti
167669
167889
  return MappedAction(context, state, identifier2, instantiatedType, as, property, options);
167670
167890
  }
167671
167891
 
167672
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/module/instantiate.mjs
167673
- function InstantiateCyclics(context, cyclicKeys) {
167674
- const keys = exports_guard.Keys(context).filter((key) => cyclicKeys.includes(key));
167675
- return keys.reduce((result, key) => {
167676
- return { ...result, [key]: InstantiateCyclic(context, key, context[key]) };
167892
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/module/instantiate.mjs
167893
+ function InstantiateCyclics(context, declarations, cyclicKeys) {
167894
+ const declarationContext = exports_memory.Assign(context, declarations);
167895
+ const declarationKeys = exports_guard.Keys(declarations).filter((key) => cyclicKeys.includes(key));
167896
+ return declarationKeys.reduce((result, key) => {
167897
+ return { ...result, [key]: InstantiateCyclic(declarationContext, key, declarations[key]) };
167677
167898
  }, {});
167678
167899
  }
167679
- function InstantiateNonCyclics(context, cyclicKeys) {
167680
- const keys = exports_guard.Keys(context).filter((key) => !cyclicKeys.includes(key));
167681
- return keys.reduce((result, key) => {
167682
- return { ...result, [key]: InstantiateType(context, { callstack: [] }, context[key]) };
167900
+ function InstantiateNonCyclics(context, declarations, cyclicKeys) {
167901
+ const declarationContext = exports_memory.Assign(context, declarations);
167902
+ const declarationKeys = exports_guard.Keys(declarations).filter((key) => !cyclicKeys.includes(key));
167903
+ return declarationKeys.reduce((result, key) => {
167904
+ return { ...result, [key]: InstantiateType(declarationContext, State([], []), declarations[key]) };
167683
167905
  }, {});
167684
167906
  }
167685
- function InstantiateModule(context, options) {
167686
- const cyclicCandidates = CyclicCandidates(context);
167687
- const instantiatedCyclics = InstantiateCyclics(context, cyclicCandidates);
167688
- const instantiatedNonCyclics = InstantiateNonCyclics(context, cyclicCandidates);
167907
+ function InstantiateModule(context, declarations, options) {
167908
+ const cyclicCandidates = CyclicCandidates(declarations);
167909
+ const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);
167910
+ const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);
167689
167911
  const instantiatedModule = { ...instantiatedCyclics, ...instantiatedNonCyclics };
167690
167912
  return exports_memory.Update(instantiatedModule, {}, options);
167691
167913
  }
167692
- function ModuleInstantiate(context, _state, properties2, options) {
167693
- const moduleContext = exports_memory.Assign(context, properties2);
167694
- const instantiatedModule = InstantiateModule(moduleContext, options);
167914
+ function ModuleInstantiate(context, _state, declarations, options) {
167915
+ const instantiatedModule = InstantiateModule(context, declarations, options);
167695
167916
  return instantiatedModule;
167696
167917
  }
167697
167918
 
167698
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/non_nullable.mjs
167919
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/non_nullable.mjs
167699
167920
  function NonNullableDeferred(type, options = {}) {
167700
167921
  return Deferred("NonNullable", [type], options);
167701
167922
  }
@@ -167703,7 +167924,7 @@ function NonNullable(type, options = {}) {
167703
167924
  return NonNullableAction(type, options);
167704
167925
  }
167705
167926
 
167706
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
167927
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
167707
167928
  function NonNullableOperation(type) {
167708
167929
  const excluded = Union([Null(), Undefined()]);
167709
167930
  return ExcludeAction(type, excluded, {});
@@ -167717,7 +167938,7 @@ function NonNullableInstantiate(context, state, type, options) {
167717
167938
  return NonNullableAction(instantiatedType, options);
167718
167939
  }
167719
167940
 
167720
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/omit.mjs
167941
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/omit.mjs
167721
167942
  function OmitDeferred(type, indexer, options = {}) {
167722
167943
  return Deferred("Omit", [type, indexer], options);
167723
167944
  }
@@ -167726,14 +167947,14 @@ function Omit(type, indexer_or_keys, options = {}) {
167726
167947
  return OmitAction(type, indexer, options);
167727
167948
  }
167728
167949
 
167729
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
167950
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
167730
167951
  function ToIndexable(type) {
167731
167952
  const collapsed = CollapseToObject(type);
167732
167953
  const result = IsObject2(collapsed) ? collapsed.properties : Unreachable();
167733
167954
  return result;
167734
167955
  }
167735
167956
 
167736
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/omit/from_type.mjs
167957
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/omit/from_type.mjs
167737
167958
  function FromKeys(properties2, keys) {
167738
167959
  const result = exports_guard.Keys(properties2).reduce((result2, key) => {
167739
167960
  return keys.includes(key) ? result2 : { ...result2, [key]: properties2[key] };
@@ -167748,7 +167969,7 @@ function FromType14(type, indexer) {
167748
167969
  return result;
167749
167970
  }
167750
167971
 
167751
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/omit/instantiate.mjs
167972
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/omit/instantiate.mjs
167752
167973
  function OmitAction(type, indexer, options) {
167753
167974
  const result = CanInstantiate([type, indexer]) ? exports_memory.Update(FromType14(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
167754
167975
  return result;
@@ -167759,25 +167980,7 @@ function OmitInstantiate(context, state, type, indexer, options) {
167759
167980
  return OmitAction(instantiatedType, instantiatedIndexer, options);
167760
167981
  }
167761
167982
 
167762
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/options.mjs
167763
- function OptionsDeferred(type, options) {
167764
- return Deferred("Options", [type, options], {});
167765
- }
167766
- function Options2(type, options) {
167767
- return OptionsAction(type, options);
167768
- }
167769
-
167770
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/options/instantiate.mjs
167771
- function OptionsAction(type, options) {
167772
- const result = CanInstantiate([type]) ? exports_memory.Update(type, {}, options) : OptionsDeferred(type, options);
167773
- return result;
167774
- }
167775
- function OptionsInstantiate(context, state, type, options) {
167776
- const instaniatedType = InstantiateType(context, state, type);
167777
- return OptionsAction(instaniatedType, options);
167778
- }
167779
-
167780
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/parameters.mjs
167983
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/parameters.mjs
167781
167984
  function ParametersDeferred(type, options = {}) {
167782
167985
  return Deferred("Parameters", [type], options);
167783
167986
  }
@@ -167785,10 +167988,10 @@ function Parameters(type, options = {}) {
167785
167988
  return ParametersAction(type, options);
167786
167989
  }
167787
167990
 
167788
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
167991
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
167789
167992
  function ParametersOperation(type) {
167790
167993
  const parameters = IsFunction2(type) ? type["parameters"] : [];
167791
- const instantiatedParameters = InstantiateElements({}, { callstack: [] }, parameters);
167994
+ const instantiatedParameters = InstantiateElements({}, State([], []), parameters);
167792
167995
  const result = Tuple(instantiatedParameters);
167793
167996
  return result;
167794
167997
  }
@@ -167801,7 +168004,7 @@ function ParametersInstantiate(context, state, type, options) {
167801
168004
  return ParametersAction(instantiatedType, options);
167802
168005
  }
167803
168006
 
167804
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/partial.mjs
168007
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/partial.mjs
167805
168008
  function PartialDeferred(type, options = {}) {
167806
168009
  return Deferred("Partial", [type], options);
167807
168010
  }
@@ -167809,7 +168012,7 @@ function Partial(type, options = {}) {
167809
168012
  return PartialAction(type, options);
167810
168013
  }
167811
168014
 
167812
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
168015
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
167813
168016
  function FromCyclic3(defs, ref2) {
167814
168017
  const target2 = CyclicTarget(defs, ref2);
167815
168018
  const partial2 = FromType15(target2);
@@ -167817,33 +168020,41 @@ function FromCyclic3(defs, ref2) {
167817
168020
  return result;
167818
168021
  }
167819
168022
 
167820
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
168023
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
168024
+ function FromDependent3(if_, then_, else_) {
168025
+ const evaluated = EvaluateDependent(if_, then_, else_);
168026
+ const result = FromType15(evaluated);
168027
+ return result;
168028
+ }
168029
+
168030
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
167821
168031
  function FromIntersect3(types) {
167822
- const result = types.map((type) => FromType15(type));
167823
- return EvaluateIntersect(result);
168032
+ const evaluated = EvaluateIntersect(types);
168033
+ const result = FromType15(evaluated);
168034
+ return result;
167824
168035
  }
167825
168036
 
167826
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/partial/from_union.mjs
168037
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_union.mjs
167827
168038
  function FromUnion6(types) {
167828
168039
  const result = types.map((type) => FromType15(type));
167829
168040
  return Union(result);
167830
168041
  }
167831
168042
 
167832
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/partial/from_object.mjs
167833
- function FromObject5(properties2) {
168043
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_object.mjs
168044
+ function FromObject6(properties2) {
167834
168045
  const mapped = exports_guard.Keys(properties2).reduce((result2, left) => {
167835
- return { ...result2, [left]: Optional(properties2[left]) };
168046
+ return { ...result2, [left]: AddOptional(properties2[left]) };
167836
168047
  }, {});
167837
168048
  const result = _Object_(mapped);
167838
168049
  return result;
167839
168050
  }
167840
168051
 
167841
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/partial/from_type.mjs
168052
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/from_type.mjs
167842
168053
  function FromType15(type) {
167843
- return IsCyclic(type) ? FromCyclic3(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion6(type.anyOf) : IsObject2(type) ? FromObject5(type.properties) : _Object_({});
168054
+ 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_({});
167844
168055
  }
167845
168056
 
167846
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/partial/instantiate.mjs
168057
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/partial/instantiate.mjs
167847
168058
  function PartialAction(type, options) {
167848
168059
  const result = CanInstantiate([type]) ? exports_memory.Update(FromType15(type), {}, options) : PartialDeferred(type, options);
167849
168060
  return result;
@@ -167853,7 +168064,7 @@ function PartialInstantiate(context, state, type, options) {
167853
168064
  return PartialAction(instantiatedType, options);
167854
168065
  }
167855
168066
 
167856
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/pick.mjs
168067
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/pick.mjs
167857
168068
  function PickDeferred(type, indexer, options = {}) {
167858
168069
  return Deferred("Pick", [type, indexer], options);
167859
168070
  }
@@ -167862,7 +168073,7 @@ function Pick(type, indexer_or_keys, options = {}) {
167862
168073
  return PickAction(type, indexer, options);
167863
168074
  }
167864
168075
 
167865
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/pick/from_type.mjs
168076
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/pick/from_type.mjs
167866
168077
  function FromKeys2(properties2, keys) {
167867
168078
  const result = exports_guard.Keys(properties2).reduce((result2, key) => {
167868
168079
  return keys.includes(key) ? exports_memory.Assign(result2, { [key]: properties2[key] }) : result2;
@@ -167877,7 +168088,7 @@ function FromType16(type, indexer) {
167877
168088
  return result;
167878
168089
  }
167879
168090
 
167880
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/pick/instantiate.mjs
168091
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/pick/instantiate.mjs
167881
168092
  function PickAction(type, indexer, options) {
167882
168093
  const result = CanInstantiate([type, indexer]) ? exports_memory.Update(FromType16(type, indexer), {}, options) : PickDeferred(type, indexer, options);
167883
168094
  return result;
@@ -167888,22 +168099,21 @@ function PickInstantiate(context, state, type, indexer, options) {
167888
168099
  return PickAction(instantiatedType, instantiatedIndexer, options);
167889
168100
  }
167890
168101
 
167891
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/readonly_object.mjs
168102
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/readonly_object.mjs
167892
168103
  function ReadonlyObjectDeferred(type, options = {}) {
167893
168104
  return Deferred("ReadonlyObject", [type], options);
167894
168105
  }
167895
168106
  function ReadonlyObject(type, options = {}) {
167896
168107
  return ReadonlyObjectAction(type, options);
167897
168108
  }
167898
- var ReadonlyType = ReadonlyObject;
167899
168109
 
167900
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
168110
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
167901
168111
  function FromArray4(type) {
167902
- const result = Immutable(_Array_(type));
168112
+ const result = AddImmutable(_Array_(type));
167903
168113
  return result;
167904
168114
  }
167905
168115
 
167906
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
168116
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
167907
168117
  function FromCyclic4(defs, ref2) {
167908
168118
  const target2 = CyclicTarget(defs, ref2);
167909
168119
  const partial2 = FromType17(target2);
@@ -167911,39 +168121,47 @@ function FromCyclic4(defs, ref2) {
167911
168121
  return result;
167912
168122
  }
167913
168123
 
167914
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
168124
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
168125
+ function FromDependent4(if_, then_, else_) {
168126
+ const evaluated = EvaluateDependent(if_, then_, else_);
168127
+ const result = FromType17(evaluated);
168128
+ return result;
168129
+ }
168130
+
168131
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
167915
168132
  function FromIntersect4(types) {
167916
- const result = types.map((type) => FromType17(type));
167917
- return EvaluateIntersect(result);
168133
+ const evaluated = EvaluateIntersect(types);
168134
+ const result = FromType17(evaluated);
168135
+ return result;
167918
168136
  }
167919
168137
 
167920
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
167921
- function FromObject6(properties2) {
168138
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
168139
+ function FromObject7(properties2) {
167922
168140
  const mapped = exports_guard.Keys(properties2).reduce((result2, left) => {
167923
- return { ...result2, [left]: Readonly(properties2[left]) };
168141
+ return { ...result2, [left]: AddReadonly(properties2[left]) };
167924
168142
  }, {});
167925
168143
  const result = _Object_(mapped);
167926
168144
  return result;
167927
168145
  }
167928
168146
 
167929
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
168147
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
167930
168148
  function FromTuple4(types) {
167931
- const result = Immutable(Tuple(types));
168149
+ const result = AddImmutable(Tuple(types));
167932
168150
  return result;
167933
168151
  }
167934
168152
 
167935
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
168153
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
167936
168154
  function FromUnion7(types) {
167937
168155
  const result = types.map((type) => FromType17(type));
167938
168156
  return Union(result);
167939
168157
  }
167940
168158
 
167941
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
168159
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
167942
168160
  function FromType17(type) {
167943
- return IsArray2(type) ? FromArray4(type.items) : IsCyclic(type) ? FromCyclic4(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect4(type.allOf) : IsObject2(type) ? FromObject6(type.properties) : IsTuple(type) ? FromTuple4(type.items) : IsUnion(type) ? FromUnion7(type.anyOf) : type;
168161
+ 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;
167944
168162
  }
167945
168163
 
167946
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
168164
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
167947
168165
  function ReadonlyObjectAction(type, options) {
167948
168166
  const result = CanInstantiate([type]) ? exports_memory.Update(FromType17(type), {}, options) : ReadonlyObjectDeferred(type);
167949
168167
  return result;
@@ -167953,12 +168171,12 @@ function ReadonlyObjectInstantiate(context, state, type, options) {
167953
168171
  return ReadonlyObjectAction(instantiatedType, options);
167954
168172
  }
167955
168173
 
167956
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/ref/instantiate.mjs
168174
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/ref/instantiate.mjs
167957
168175
  function RefInstantiate(context, state, type, ref2) {
167958
- return ref2 in context ? CyclicCheck([ref2], context, context[ref2]) ? type : InstantiateType(context, state, context[ref2]) : type;
168176
+ return state.visited.includes(ref2) ? type : (ref2 in context) ? InstantiateType(context, State(state["callstack"], [...state["visited"], ref2]), context[ref2]) : type;
167959
168177
  }
167960
168178
 
167961
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
168179
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
167962
168180
  function FromCyclic5(defs, ref2) {
167963
168181
  const target2 = CyclicTarget(defs, ref2);
167964
168182
  const partial2 = FromType18(target2);
@@ -167966,33 +168184,41 @@ function FromCyclic5(defs, ref2) {
167966
168184
  return result;
167967
168185
  }
167968
168186
 
167969
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/required/from_intersect.mjs
168187
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_dependent.mjs
168188
+ function FromDependent5(if_, then_, else_) {
168189
+ const evaluated = EvaluateDependent(if_, then_, else_);
168190
+ const result = FromType18(evaluated);
168191
+ return result;
168192
+ }
168193
+
168194
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_intersect.mjs
167970
168195
  function FromIntersect5(types) {
167971
- const result = types.map((type) => FromType18(type));
167972
- return EvaluateIntersect(result);
168196
+ const evaluated = EvaluateIntersect(types);
168197
+ const result = FromType18(evaluated);
168198
+ return result;
167973
168199
  }
167974
168200
 
167975
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/required/from_union.mjs
168201
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_union.mjs
167976
168202
  function FromUnion8(types) {
167977
168203
  const result = types.map((type) => FromType18(type));
167978
168204
  return Union(result);
167979
168205
  }
167980
168206
 
167981
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/required/from_object.mjs
167982
- function FromObject7(properties2) {
168207
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_object.mjs
168208
+ function FromObject8(properties2) {
167983
168209
  const mapped = exports_guard.Keys(properties2).reduce((result2, left) => {
167984
- return { ...result2, [left]: OptionalRemove(properties2[left]) };
168210
+ return { ...result2, [left]: RemoveOptional(properties2[left]) };
167985
168211
  }, {});
167986
168212
  const result = _Object_(mapped);
167987
168213
  return result;
167988
168214
  }
167989
168215
 
167990
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/required/from_type.mjs
168216
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/from_type.mjs
167991
168217
  function FromType18(type) {
167992
- return IsCyclic(type) ? FromCyclic5(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect5(type.allOf) : IsUnion(type) ? FromUnion8(type.anyOf) : IsObject2(type) ? FromObject7(type.properties) : _Object_({});
168218
+ 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_({});
167993
168219
  }
167994
168220
 
167995
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/required.mjs
168221
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/required.mjs
167996
168222
  function RequiredDeferred(type, options = {}) {
167997
168223
  return Deferred("Required", [type], options);
167998
168224
  }
@@ -168000,7 +168226,7 @@ function Required(type, options = {}) {
168000
168226
  return RequiredAction(type, options);
168001
168227
  }
168002
168228
 
168003
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/required/instantiate.mjs
168229
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/required/instantiate.mjs
168004
168230
  function RequiredAction(type, options) {
168005
168231
  const result = CanInstantiate([type]) ? exports_memory.Update(FromType18(type), {}, options) : RequiredDeferred(type, options);
168006
168232
  return result;
@@ -168010,7 +168236,7 @@ function RequiredInstantiate(context, state, type, options) {
168010
168236
  return RequiredAction(instaniatedType, options);
168011
168237
  }
168012
168238
 
168013
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/return_type.mjs
168239
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/return_type.mjs
168014
168240
  function ReturnTypeDeferred(type, options = {}) {
168015
168241
  return Deferred("ReturnType", [type], options);
168016
168242
  }
@@ -168018,7 +168244,7 @@ function ReturnType(type, options = {}) {
168018
168244
  return ReturnTypeAction(type, options);
168019
168245
  }
168020
168246
 
168021
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
168247
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
168022
168248
  function ReturnTypeOperation(type) {
168023
168249
  return IsFunction2(type) ? type["returnType"] : Never();
168024
168250
  }
@@ -168031,7 +168257,25 @@ function ReturnTypeInstantiate(context, state, type, options = {}) {
168031
168257
  return ReturnTypeAction(instantiatedType, options);
168032
168258
  }
168033
168259
 
168034
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/rest/spread.mjs
168260
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/with.mjs
168261
+ function WithDeferred(type, options) {
168262
+ return Deferred("With", [type, options], {});
168263
+ }
168264
+ function With2(type, options) {
168265
+ return WithAction(type, options);
168266
+ }
168267
+
168268
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/with/instantiate.mjs
168269
+ function WithAction(type, options) {
168270
+ const result = CanInstantiate([type]) ? exports_memory.Update(type, {}, options) : WithDeferred(type, options);
168271
+ return result;
168272
+ }
168273
+ function WithInstantiate(context, state, type, options) {
168274
+ const instaniatedType = InstantiateType(context, state, type);
168275
+ return WithAction(instaniatedType, options);
168276
+ }
168277
+
168278
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/rest/spread.mjs
168035
168279
  function SpreadElement(type) {
168036
168280
  const result = IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
168037
168281
  return result;
@@ -168042,18 +168286,12 @@ function RestSpread(types) {
168042
168286
  }, []);
168043
168287
  return result;
168044
168288
  }
168045
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/instantiate.mjs
168046
- function CanInstantiate(types) {
168047
- return exports_guard.TakeLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
168048
- }
168049
- function ModifierActions(type, readonly2, optional2) {
168050
- return IsReadonlyRemoveAction(type) ? ModifierActions(type.type, "remove", optional2) : IsOptionalRemoveAction(type) ? ModifierActions(type.type, readonly2, "remove") : IsReadonlyAddAction(type) ? ModifierActions(type.type, "add", optional2) : IsOptionalAddAction(type) ? ModifierActions(type.type, readonly2, "add") : [type, readonly2, optional2];
168289
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/instantiate.mjs
168290
+ function State(callstack, visited) {
168291
+ return { callstack, visited };
168051
168292
  }
168052
- function ApplyReadonly2(action, type) {
168053
- return exports_guard.IsEqual(action, "remove") ? ReadonlyRemove(type) : exports_guard.IsEqual(action, "add") ? ReadonlyAdd(type) : type;
168054
- }
168055
- function ApplyOptional2(action, type) {
168056
- return exports_guard.IsEqual(action, "remove") ? OptionalRemove(type) : exports_guard.IsEqual(action, "add") ? OptionalAdd(type) : type;
168293
+ function CanInstantiate(types) {
168294
+ return exports_guard.ShiftLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
168057
168295
  }
168058
168296
  function InstantiateProperties(context, state, properties2) {
168059
168297
  return exports_guard.Keys(properties2).reduce((result, key) => {
@@ -168068,70 +168306,77 @@ function InstantiateElements(context, state, types) {
168068
168306
  function InstantiateTypes(context, state, types) {
168069
168307
  return types.map((type) => InstantiateType(context, state, type));
168070
168308
  }
168309
+ function WithModifiers(type, instantiatedType) {
168310
+ const withOptional = IsOptional(type) ? AddOptionalAction(instantiatedType, {}) : instantiatedType;
168311
+ const withReadonly = IsReadonly(type) ? AddReadonlyAction(withOptional, {}) : withOptional;
168312
+ const withImmutable = IsImmutable(type) ? AddImmutableAction(withReadonly, {}) : withReadonly;
168313
+ return withImmutable;
168314
+ }
168071
168315
  function InstantiateDeferred(context, state, action, parameters, options) {
168072
- return exports_guard.IsEqual(action, "Awaited") ? AwaitedInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : exports_guard.IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : exports_guard.IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Options") ? OptionsInstantiate(context, state, parameters[0], parameters[1]) : exports_guard.IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : Deferred(action, parameters, options);
168073
- }
168074
- function InstantiateType(context, state, input) {
168075
- const immutable = IsImmutable(input);
168076
- const modifiers = ModifierActions(input, IsReadonly(input) ? "add" : "none", IsOptional(input) ? "add" : "none");
168077
- const type = IsBase(modifiers[0]) ? modifiers[0].Clone() : modifiers[0];
168078
- const instantiated = IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray2(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsAsyncIterator2(type) ? AsyncIterator(InstantiateType(context, state, type.iteratorItems), AsyncIteratorOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor2(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : IsFunction2(type) ? _Function_(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsIterator2(type) ? Iterator(InstantiateType(context, state, type.iteratorItems), IteratorOptions(type)) : IsObject2(type) ? _Object_(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsPromise(type) ? _Promise_(InstantiateType(context, state, type.item), PromiseOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type;
168079
- const withImmutable = immutable ? Immutable(instantiated) : instantiated;
168080
- const withModifiers = ApplyReadonly2(modifiers[1], ApplyOptional2(modifiers[2], withImmutable));
168316
+ return exports_guard.IsEqual(action, "AddImmutable") ? AddImmutableInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "RemoveImmutable") ? RemoveImmutableInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "AddReadonly") ? AddReadonlyInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "RemoveReadonly") ? RemoveReadonlyInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "AddOptional") ? AddOptionalInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "RemoveOptional") ? RemoveOptionalInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : exports_guard.IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : exports_guard.IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : exports_guard.IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : exports_guard.IsEqual(action, "With") ? WithInstantiate(context, state, parameters[0], parameters[1]) : Deferred(action, parameters, options);
168317
+ }
168318
+ function InstantiateImmediate(context, state, type) {
168319
+ const instantiatedType = IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray2(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor2(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsFunction2(type) ? _Function_(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsDependent(type) ? Dependent(InstantiateType(context, state, type.if), InstantiateType(context, state, type.then), InstantiateType(context, state, type.else), DependentOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsObject2(type) ? _Object_(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type;
168320
+ const withModifiers = WithModifiers(type, instantiatedType);
168081
168321
  return withModifiers;
168082
168322
  }
168323
+ function InstantiateType(context, state, type) {
168324
+ const result = IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : InstantiateImmediate(context, state, type);
168325
+ return result;
168326
+ }
168083
168327
  function Instantiate(context, type) {
168084
- return InstantiateType(context, { callstack: [] }, type);
168328
+ return InstantiateType(context, State([], []), type);
168085
168329
  }
168086
168330
 
168087
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/engine/awaited/instantiate.mjs
168088
- function AwaitedOperation(type) {
168089
- return IsPromise(type) ? AwaitedOperation(type.item) : type;
168331
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
168332
+ function AddImmutableOperation(type) {
168333
+ return exports_memory.Update(type, { "~immutable": true }, {});
168090
168334
  }
168091
- function AwaitedAction(type, options) {
168092
- const result = CanInstantiate([type]) ? exports_memory.Update(AwaitedOperation(type), {}, options) : AwaitedDeferred(type, options);
168335
+ function AddImmutableAction(type, options) {
168336
+ const result = exports_memory.Update(AddImmutableOperation(type), {}, options);
168093
168337
  return result;
168094
168338
  }
168095
- function AwaitedInstantiate(context, state, type, options) {
168339
+ function AddImmutableInstantiate(context, state, type, options) {
168096
168340
  const instantiatedType = InstantiateType(context, state, type);
168097
- return AwaitedAction(instantiatedType, options);
168341
+ return AddImmutableAction(instantiatedType, options);
168098
168342
  }
168099
168343
 
168100
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/awaited.mjs
168101
- function AwaitedDeferred(type, options = {}) {
168102
- return Deferred("Awaited", [type], options);
168344
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/_add_immutable.mjs
168345
+ function AddImmutableDeferred(type, options = {}) {
168346
+ return Deferred("AddImmutable", [type], options);
168103
168347
  }
168104
- function Awaited(type, options = {}) {
168105
- return AwaitedAction(type, options);
168348
+ function AddImmutable(type, options = {}) {
168349
+ return AddImmutableAction(type, options);
168106
168350
  }
168107
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/evaluate.mjs
168351
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/evaluate.mjs
168108
168352
  function EvaluateDeferred(type, options = {}) {
168109
168353
  return Deferred("Evaluate", [type], options);
168110
168354
  }
168111
168355
  function Evaluate(type, options = {}) {
168112
168356
  return EvaluateAction(type, options);
168113
168357
  }
168114
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/action/module.mjs
168115
- function ModuleDeferred(context, options = {}) {
168116
- return Deferred("Module", [context], options);
168358
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/action/module.mjs
168359
+ function ModuleDeferred(declarations, options = {}) {
168360
+ return Deferred("Module", [declarations], options);
168117
168361
  }
168118
- function Module2(context, options = {}) {
168119
- return Instantiate({}, ModuleDeferred(context, options));
168362
+ function Module2(declarations, options = {}) {
168363
+ return ModuleInstantiate({}, State([], []), declarations, options);
168120
168364
  }
168121
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/type/script/script.mjs
168365
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/type/script/script.mjs
168122
168366
  function Script2(...args) {
168123
- const [context, input, options3] = exports_arguments.Match(args, {
168124
- 2: (script, options4) => exports_guard.IsString(script) ? [{}, script, options4] : [script, options4, {}],
168125
- 3: (context2, script, options4) => [context2, script, options4],
168367
+ const [context, input, options] = exports_arguments.Match(args, {
168368
+ 2: (script, options2) => exports_guard.IsString(script) ? [{}, script, options2] : [script, options2, {}],
168369
+ 3: (context2, script, options2) => [context2, script, options2],
168126
168370
  1: (script) => [{}, script, {}]
168127
168371
  });
168128
168372
  const result = Script(input);
168129
- const parsed = exports_guard.IsArray(result) && exports_guard.IsEqual(result.length, 2) ? InstantiateType(context, { callstack: [] }, result[0]) : Never();
168130
- return exports_memory.Update(parsed, {}, options3);
168373
+ const parsed = exports_guard.IsArray(result) && exports_guard.IsEqual(result.length, 2) ? InstantiateType(context, State([], []), result[0]) : Never();
168374
+ return exports_memory.Update(parsed, {}, options);
168131
168375
  }
168132
- // ../../node_modules/.bun/typebox@1.1.38/node_modules/typebox/build/typebox.mjs
168376
+ // ../../node_modules/.bun/typebox@1.3.1/node_modules/typebox/build/typebox.mjs
168133
168377
  var exports_typebox = {};
168134
168378
  __export(exports_typebox, {
168379
+ With: () => With2,
168135
168380
  Void: () => Void,
168136
168381
  Uppercase: () => Uppercase,
168137
168382
  Unsafe: () => Unsafe,
@@ -168154,15 +168399,12 @@ __export(exports_typebox, {
168154
168399
  RecordPattern: () => RecordPattern,
168155
168400
  RecordKey: () => RecordKey,
168156
168401
  Record: () => Record,
168157
- ReadonlyType: () => ReadonlyType,
168158
168402
  ReadonlyObject: () => ReadonlyObject,
168159
168403
  Readonly: () => Readonly,
168160
- Promise: () => _Promise_,
168161
168404
  Pick: () => Pick,
168162
168405
  Partial: () => Partial,
168163
168406
  Parameters: () => Parameters,
168164
168407
  Parameter: () => Parameter,
168165
- Options: () => Options2,
168166
168408
  Optional: () => Optional,
168167
168409
  Omit: () => Omit,
168168
168410
  Object: () => _Object_,
@@ -168171,11 +168413,10 @@ __export(exports_typebox, {
168171
168413
  NonNullable: () => NonNullable,
168172
168414
  Never: () => Never,
168173
168415
  Module: () => Module2,
168174
- Mapped: () => Mapped2,
168416
+ Mapped: () => Mapped,
168175
168417
  Lowercase: () => Lowercase,
168176
168418
  Literal: () => Literal,
168177
168419
  KeyOf: () => KeyOf2,
168178
- Iterator: () => Iterator,
168179
168420
  IsVoid: () => IsVoid,
168180
168421
  IsUnsafe: () => IsUnsafe,
168181
168422
  IsUnknown: () => IsUnknown,
@@ -168185,23 +168426,21 @@ __export(exports_typebox, {
168185
168426
  IsThis: () => IsThis,
168186
168427
  IsTemplateLiteral: () => IsTemplateLiteral,
168187
168428
  IsSymbol: () => IsSymbol2,
168188
- IsString: () => IsString2,
168429
+ IsString: () => IsString3,
168189
168430
  IsSchema: () => IsSchema,
168190
168431
  IsRest: () => IsRest,
168191
168432
  IsRefine: () => IsRefine,
168192
168433
  IsRef: () => IsRef,
168193
168434
  IsRecord: () => IsRecord,
168194
168435
  IsReadonly: () => IsReadonly,
168195
- IsPromise: () => IsPromise,
168196
168436
  IsParameter: () => IsParameter,
168197
168437
  IsOptional: () => IsOptional,
168198
168438
  IsObject: () => IsObject2,
168199
- IsNumber: () => IsNumber2,
168439
+ IsNumber: () => IsNumber3,
168200
168440
  IsNull: () => IsNull2,
168201
168441
  IsNever: () => IsNever,
168202
168442
  IsLiteral: () => IsLiteral,
168203
168443
  IsKind: () => IsKind,
168204
- IsIterator: () => IsIterator2,
168205
168444
  IsIntersect: () => IsIntersect,
168206
168445
  IsInteger: () => IsInteger2,
168207
168446
  IsInfer: () => IsInfer,
@@ -168210,14 +168449,13 @@ __export(exports_typebox, {
168210
168449
  IsGeneric: () => IsGeneric,
168211
168450
  IsFunction: () => IsFunction2,
168212
168451
  IsEnum: () => IsEnum,
168452
+ IsDependent: () => IsDependent,
168213
168453
  IsCyclic: () => IsCyclic,
168214
168454
  IsConstructor: () => IsConstructor2,
168215
168455
  IsCodec: () => IsCodec,
168216
168456
  IsCall: () => IsCall,
168217
- IsBoolean: () => IsBoolean2,
168457
+ IsBoolean: () => IsBoolean3,
168218
168458
  IsBigInt: () => IsBigInt2,
168219
- IsBase: () => IsBase,
168220
- IsAsyncIterator: () => IsAsyncIterator2,
168221
168459
  IsArray: () => IsArray2,
168222
168460
  IsAny: () => IsAny,
168223
168461
  Intersect: () => Intersect,
@@ -168233,12 +168471,13 @@ __export(exports_typebox, {
168233
168471
  Function: () => _Function_,
168234
168472
  Extract: () => Extract,
168235
168473
  ExtendsResult: () => exports_result,
168236
- Extends: () => Extends2,
168474
+ Extends: () => Extends,
168237
168475
  Exclude: () => Exclude,
168238
168476
  Evaluate: () => Evaluate,
168239
168477
  Enum: () => Enum,
168240
168478
  EncodeBuilder: () => EncodeBuilder,
168241
168479
  Encode: () => Encode,
168480
+ Dependent: () => Dependent,
168242
168481
  DecodeBuilder: () => DecodeBuilder,
168243
168482
  Decode: () => Decode,
168244
168483
  Cyclic: () => Cyclic,
@@ -168250,9 +168489,6 @@ __export(exports_typebox, {
168250
168489
  Call: () => Call,
168251
168490
  Boolean: () => Boolean2,
168252
168491
  BigInt: () => BigInt2,
168253
- Base: () => Base,
168254
- Awaited: () => Awaited,
168255
- AsyncIterator: () => AsyncIterator,
168256
168492
  Array: () => _Array_,
168257
168493
  Any: () => Any
168258
168494
  });
@@ -169186,18 +169422,18 @@ function updateMemoryStatus(db, id, status) {
169186
169422
  getUpdateMemoryStatusStatement(db).run(status, Date.now(), id);
169187
169423
  }
169188
169424
  function mergeMetadataJson(existing, patch) {
169189
- let base2 = {};
169425
+ let base = {};
169190
169426
  if (existing) {
169191
169427
  try {
169192
169428
  const parsed = JSON.parse(existing);
169193
169429
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
169194
- base2 = parsed;
169430
+ base = parsed;
169195
169431
  }
169196
169432
  } catch {
169197
- base2 = {};
169433
+ base = {};
169198
169434
  }
169199
169435
  }
169200
- return JSON.stringify({ ...base2, ...patch });
169436
+ return JSON.stringify({ ...base, ...patch });
169201
169437
  }
169202
169438
  function updateMemoryContent(db, id, content, normalizedHash) {
169203
169439
  const memory2 = getMemoryById(db, id);
@@ -170537,11 +170773,11 @@ function getAutoSearchHintDecisions(db, sessionId) {
170537
170773
  const row = db.prepare("SELECT auto_search_hint_decisions FROM session_meta WHERE session_id = ?").get(sessionId);
170538
170774
  return parseJsonArray(row?.auto_search_hint_decisions, isValidAutoSearchHintDecision);
170539
170775
  }
170540
- function casUpdateJsonArrayColumn(db, sessionId, column, validator, mutate, options3) {
170776
+ function casUpdateJsonArrayColumn(db, sessionId, column, validator, mutate, options) {
170541
170777
  if (column !== "note_nudge_anchors" && column !== "auto_search_hint_decisions") {
170542
170778
  throw new Error(`casUpdateJsonArrayColumn: refusing unknown column "${column}"`);
170543
170779
  }
170544
- if (options3?.ensureRow === false) {
170780
+ if (options?.ensureRow === false) {
170545
170781
  const exists = db.prepare("SELECT 1 FROM session_meta WHERE session_id = ?").get(sessionId);
170546
170782
  if (!exists)
170547
170783
  return true;
@@ -171106,22 +171342,22 @@ function buildStatusClause(status) {
171106
171342
  params: statuses
171107
171343
  };
171108
171344
  }
171109
- function getNotes(db, options3 = {}) {
171345
+ function getNotes(db, options = {}) {
171110
171346
  const clauses = [];
171111
171347
  const params = [];
171112
- if (options3.sessionId !== undefined) {
171348
+ if (options.sessionId !== undefined) {
171113
171349
  clauses.push("session_id = ?");
171114
- params.push(options3.sessionId);
171350
+ params.push(options.sessionId);
171115
171351
  }
171116
- if (options3.projectPath !== undefined) {
171352
+ if (options.projectPath !== undefined) {
171117
171353
  clauses.push("project_path = ?");
171118
- params.push(options3.projectPath);
171354
+ params.push(options.projectPath);
171119
171355
  }
171120
- if (options3.type !== undefined) {
171356
+ if (options.type !== undefined) {
171121
171357
  clauses.push("type = ?");
171122
- params.push(options3.type);
171358
+ params.push(options.type);
171123
171359
  }
171124
- const statusClause = buildStatusClause(options3.status);
171360
+ const statusClause = buildStatusClause(options.status);
171125
171361
  if (statusClause) {
171126
171362
  clauses.push(statusClause.sql);
171127
171363
  params.push(...statusClause.params);
@@ -171129,9 +171365,9 @@ function getNotes(db, options3 = {}) {
171129
171365
  const where = clauses.length > 0 ? ` WHERE ${clauses.join(" AND ")}` : "";
171130
171366
  return db.prepare(`SELECT * FROM notes${where} ORDER BY created_at ASC, id ASC`).all(...params).filter(isNoteRow).map(toNote);
171131
171367
  }
171132
- function addNote(db, type, options3) {
171368
+ function addNote(db, type, options) {
171133
171369
  const now = Date.now();
171134
- const result = type === "session" ? db.prepare("INSERT INTO notes (type, status, content, session_id, created_at, updated_at, harness, anchor_ordinal) VALUES ('session', 'active', ?, ?, ?, ?, ?, ?) RETURNING *").get(options3.content, options3.sessionId, now, now, getHarness(), options3.anchorOrdinal ?? null) : db.prepare("INSERT INTO notes (type, status, content, session_id, project_path, surface_condition, created_at, updated_at, harness, anchor_ordinal) VALUES ('smart', 'pending', ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *").get(options3.content, options3.sessionId ?? null, options3.projectPath, options3.surfaceCondition, now, now, getHarness(), options3.anchorOrdinal ?? null);
171370
+ const result = type === "session" ? db.prepare("INSERT INTO notes (type, status, content, session_id, created_at, updated_at, harness, anchor_ordinal) VALUES ('session', 'active', ?, ?, ?, ?, ?, ?) RETURNING *").get(options.content, options.sessionId, now, now, getHarness(), options.anchorOrdinal ?? null) : db.prepare("INSERT INTO notes (type, status, content, session_id, project_path, surface_condition, created_at, updated_at, harness, anchor_ordinal) VALUES ('smart', 'pending', ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *").get(options.content, options.sessionId ?? null, options.projectPath, options.surfaceCondition, now, now, getHarness(), options.anchorOrdinal ?? null);
171135
171371
  if (!isNoteRow(result)) {
171136
171372
  throw new Error("[notes] failed to insert note");
171137
171373
  }
@@ -172653,7 +172889,7 @@ function createCtxNoteTool(deps) {
172653
172889
  parameters: ParamsSchema3,
172654
172890
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
172655
172891
  const sessionId = ctx.sessionManager.getSessionId();
172656
- const action2 = params.action ?? (typeof params.content === "string" ? "write" : "read");
172892
+ const action2 = params.action ?? (params.content?.trim() ? "write" : "read");
172657
172893
  if (action2 === "write") {
172658
172894
  const content = params.content?.trim();
172659
172895
  if (!content)
@@ -172999,21 +173235,21 @@ var GIT_TIMEOUT_MS3 = 1e4;
172999
173235
  var DEFAULT_MAX_COMMITS = 5000;
173000
173236
  var RECORD_SEPARATOR = "\x1E";
173001
173237
  var FIELD_SEPARATOR = "\x1F";
173002
- async function readGitCommits(directory, options3 = {}) {
173003
- const revision = options3.branch ?? "HEAD";
173238
+ async function readGitCommits(directory, options = {}) {
173239
+ const revision = options.branch ?? "HEAD";
173004
173240
  if (revision.startsWith("-")) {
173005
173241
  throw new Error(`readGitCommits: refusing revision that looks like an option: "${revision}"`);
173006
173242
  }
173007
- const projectLabel = options3.projectIdentity ?? "<project>";
173243
+ const projectLabel = options.projectIdentity ?? "<project>";
173008
173244
  const args = [
173009
173245
  "log",
173010
173246
  revision,
173011
173247
  "--no-merges",
173012
- `--max-count=${options3.maxCommits ?? DEFAULT_MAX_COMMITS}`,
173248
+ `--max-count=${options.maxCommits ?? DEFAULT_MAX_COMMITS}`,
173013
173249
  `--format=%H${FIELD_SEPARATOR}%s${FIELD_SEPARATOR}%ae${FIELD_SEPARATOR}%ct${FIELD_SEPARATOR}%b${RECORD_SEPARATOR}`
173014
173250
  ];
173015
- if (options3.sinceMs !== undefined && options3.sinceMs > 0) {
173016
- const iso = new Date(options3.sinceMs).toISOString();
173251
+ if (options.sinceMs !== undefined && options.sinceMs > 0) {
173252
+ const iso = new Date(options.sinceMs).toISOString();
173017
173253
  args.push(`--since=${iso}`);
173018
173254
  }
173019
173255
  let stdout;
@@ -173031,7 +173267,7 @@ async function readGitCommits(directory, options3 = {}) {
173031
173267
  return [];
173032
173268
  }
173033
173269
  if (stdout.trim().length === 0) {
173034
- log(`[git-commits] readGitCommits returned empty stdout for ${projectLabel} (sinceMs=${options3.sinceMs ?? "none"} args=${args.slice(0, 4).join(" ")})`);
173270
+ log(`[git-commits] readGitCommits returned empty stdout for ${projectLabel} (sinceMs=${options.sinceMs ?? "none"} args=${args.slice(0, 4).join(" ")})`);
173035
173271
  }
173036
173272
  return parseGitLogOutput(stdout);
173037
173273
  }
@@ -173083,7 +173319,7 @@ var EMBED_MAX_PER_SWEEP = 500;
173083
173319
  var EMBED_SWEEP_MAX_WALL_CLOCK_MS = 5 * 60 * 1000;
173084
173320
  var indexInProgress = new Set;
173085
173321
  var embedInProgress = new Set;
173086
- async function indexCommitsForProject(db, projectPath, directory, options3) {
173322
+ async function indexCommitsForProject(db, projectPath, directory, options) {
173087
173323
  const result = {
173088
173324
  scanned: 0,
173089
173325
  inserted: 0,
@@ -173098,15 +173334,15 @@ async function indexCommitsForProject(db, projectPath, directory, options3) {
173098
173334
  indexInProgress.add(projectPath);
173099
173335
  try {
173100
173336
  const latestIndexed = getLatestIndexedCommitTimeMs(db, projectPath);
173101
- const sinceMs = latestIndexed !== null ? Math.max(latestIndexed - 60000, Date.now() - options3.sinceDays * MS_PER_DAY) : Date.now() - options3.sinceDays * MS_PER_DAY;
173337
+ const sinceMs = latestIndexed !== null ? Math.max(latestIndexed - 60000, Date.now() - options.sinceDays * MS_PER_DAY) : Date.now() - options.sinceDays * MS_PER_DAY;
173102
173338
  const commits = await readGitCommits(directory, {
173103
173339
  sinceMs,
173104
- maxCommits: options3.maxCommits,
173340
+ maxCommits: options.maxCommits,
173105
173341
  projectIdentity: projectPath
173106
173342
  });
173107
173343
  result.scanned = commits.length;
173108
173344
  if (commits.length === 0) {
173109
- result.evicted = enforceProjectCap(db, projectPath, options3.maxCommits);
173345
+ result.evicted = enforceProjectCap(db, projectPath, options.maxCommits);
173110
173346
  log(`[git-commits] no new commits for ${projectPath} (sinceMs=${sinceMs} latestIndexed=${latestIndexed ?? "none"} evicted=${result.evicted})`);
173111
173347
  return result;
173112
173348
  }
@@ -173114,10 +173350,10 @@ async function indexCommitsForProject(db, projectPath, directory, options3) {
173114
173350
  const upsert = upsertCommits(db, projectPath, commits);
173115
173351
  result.inserted = upsert.inserted;
173116
173352
  result.updated = upsert.updated;
173117
- result.evicted = enforceProjectCap(db, projectPath, options3.maxCommits);
173353
+ result.evicted = enforceProjectCap(db, projectPath, options.maxCommits);
173118
173354
  const snapshot = getProjectEmbeddingSnapshot(projectPath);
173119
- if (options3.skipEmbed || !snapshot?.gitCommitEnabled) {
173120
- log(`[git-commits] indexed ${projectPath}: scanned=${result.scanned} inserted=${result.inserted} updated=${result.updated} evicted=${result.evicted} embedded=0 (embedding skipped: skipEmbed=${options3.skipEmbed === true} gitCommitEnabled=${snapshot?.gitCommitEnabled === true})`);
173355
+ if (options.skipEmbed || !snapshot?.gitCommitEnabled) {
173356
+ log(`[git-commits] indexed ${projectPath}: scanned=${result.scanned} inserted=${result.inserted} updated=${result.updated} evicted=${result.evicted} embedded=0 (embedding skipped: skipEmbed=${options.skipEmbed === true} gitCommitEnabled=${snapshot?.gitCommitEnabled === true})`);
173121
173357
  return result;
173122
173358
  }
173123
173359
  result.embedded = await embedUnembeddedCommits(db, projectPath);
@@ -173232,14 +173468,14 @@ function clamp01(value) {
173232
173468
  return 0;
173233
173469
  return Math.min(1, Math.max(0, value));
173234
173470
  }
173235
- function searchGitCommitsSync(db, projectPath, query, options3) {
173471
+ function searchGitCommitsSync(db, projectPath, query, options) {
173236
173472
  const trimmed = query.trim();
173237
- if (trimmed.length === 0 || options3.limit <= 0)
173473
+ if (trimmed.length === 0 || options.limit <= 0)
173238
173474
  return [];
173239
- const semanticWeight = options3.semanticWeight ?? 0.7;
173240
- const ftsWeight = options3.ftsWeight ?? 0.3;
173241
- const singleSourcePenalty = options3.singleSourcePenalty ?? 0.8;
173242
- const fetchLimit = Math.max(options3.limit * 3, 30);
173475
+ const semanticWeight = options.semanticWeight ?? 0.7;
173476
+ const ftsWeight = options.ftsWeight ?? 0.3;
173477
+ const singleSourcePenalty = options.singleSourcePenalty ?? 0.8;
173478
+ const fetchLimit = Math.max(options.limit * 3, 30);
173243
173479
  const ftsCandidates = [];
173244
173480
  const sanitized = sanitizeFtsQuery(trimmed);
173245
173481
  if (sanitized.length > 0) {
@@ -173261,10 +173497,10 @@ function searchGitCommitsSync(db, projectPath, query, options3) {
173261
173497
  ftsScores.set(commit.sha, 1 / (rank + 1));
173262
173498
  });
173263
173499
  const semanticScores = new Map;
173264
- if (options3.queryEmbedding && options3.queryModelId && options3.queryModelId !== "off") {
173265
- const embeddings = loadProjectCommitEmbeddings(db, projectPath, options3.queryModelId);
173500
+ if (options.queryEmbedding && options.queryModelId && options.queryModelId !== "off") {
173501
+ const embeddings = loadProjectCommitEmbeddings(db, projectPath, options.queryModelId);
173266
173502
  for (const [sha, embedding2] of embeddings.entries()) {
173267
- const similarity = clamp01(cosineSimilarity(options3.queryEmbedding, embedding2));
173503
+ const similarity = clamp01(cosineSimilarity(options.queryEmbedding, embedding2));
173268
173504
  if (similarity > 0) {
173269
173505
  semanticScores.set(sha, similarity);
173270
173506
  }
@@ -173307,7 +173543,7 @@ function searchGitCommitsSync(db, projectPath, query, options3) {
173307
173543
  return right.score - left.score;
173308
173544
  return right.commit.committedAtMs - left.commit.committedAtMs;
173309
173545
  });
173310
- return results.slice(0, options3.limit);
173546
+ return results.slice(0, options.limit);
173311
173547
  }
173312
173548
  // ../plugin/src/features/magic-context/literal-probes.ts
173313
173549
  var MAX_PROBES = 5;
@@ -173952,37 +174188,37 @@ function resolveSources(sources) {
173952
174188
  }
173953
174189
  return set2;
173954
174190
  }
173955
- async function unifiedSearch(db, sessionId, projectPath, query, options3 = {}) {
174191
+ async function unifiedSearch(db, sessionId, projectPath, query, options = {}) {
173956
174192
  const trimmedQuery = query.trim();
173957
174193
  if (trimmedQuery.length === 0) {
173958
174194
  return [];
173959
174195
  }
173960
- const limit = normalizeLimit2(options3.limit);
174196
+ const limit = normalizeLimit2(options.limit);
173961
174197
  const tierLimit = Math.max(limit * 3, DEFAULT_UNIFIED_SEARCH_LIMIT);
173962
- const embeddingEnabled = options3.embeddingEnabled ?? true;
173963
- const embedQuery = options3.embedQuery ?? embedText;
173964
- const isEmbeddingRuntimeEnabled = options3.isEmbeddingRuntimeEnabled ?? isEmbeddingEnabled;
173965
- const gitCommitsEnabled = options3.gitCommitsEnabled ?? false;
173966
- const activeSources = resolveSources(options3.sources);
173967
- const memoryFeatureEnabled = options3.memoryEnabled ?? true;
174198
+ const embeddingEnabled = options.embeddingEnabled ?? true;
174199
+ const embedQuery = options.embedQuery ?? embedText;
174200
+ const isEmbeddingRuntimeEnabled = options.isEmbeddingRuntimeEnabled ?? isEmbeddingEnabled;
174201
+ const gitCommitsEnabled = options.gitCommitsEnabled ?? false;
174202
+ const activeSources = resolveSources(options.sources);
174203
+ const memoryFeatureEnabled = options.memoryEnabled ?? true;
173968
174204
  const runMemory = activeSources.has("memory") && memoryFeatureEnabled;
173969
174205
  const runMessages = activeSources.has("message");
173970
174206
  const runGitCommits = activeSources.has("git_commit") && gitCommitsEnabled;
173971
174207
  const runPrimers = activeSources.has("primer") && memoryFeatureEnabled;
173972
174208
  const runCompartmentChunks = runMessages && memoryFeatureEnabled && embeddingEnabled;
173973
174209
  const needsEmbedding = (runMemory || runGitCommits || runCompartmentChunks || runPrimers) && embeddingEnabled && isEmbeddingRuntimeEnabled();
173974
- const queryEmbeddingPromise = needsEmbedding ? embedQuery(trimmedQuery, options3.signal).catch((error51) => {
174210
+ const queryEmbeddingPromise = needsEmbedding ? embedQuery(trimmedQuery, options.signal).catch((error51) => {
173975
174211
  log(`[search] query embedding failed: ${error51 instanceof Error ? error51.message : String(error51)}`);
173976
174212
  return null;
173977
174213
  }) : Promise.resolve(null);
173978
174214
  await Promise.resolve();
173979
- const messageProbes = options3.explicitSearch ? extractLiteralProbes(trimmedQuery) : [];
174215
+ const messageProbes = options.explicitSearch ? extractLiteralProbes(trimmedQuery) : [];
173980
174216
  const messageResults = runMessages ? searchMessages({
173981
174217
  db,
173982
174218
  sessionId,
173983
174219
  query: trimmedQuery,
173984
174220
  limit: tierLimit,
173985
- maxOrdinal: options3.maxMessageOrdinal,
174221
+ maxOrdinal: options.maxMessageOrdinal,
173986
174222
  probes: messageProbes
173987
174223
  }) : [];
173988
174224
  const queryEmbedding = await queryEmbeddingPromise;
@@ -173996,7 +174232,7 @@ async function unifiedSearch(db, sessionId, projectPath, query, options3 = {}) {
173996
174232
  projectPath,
173997
174233
  queryEmbedding,
173998
174234
  limit: tierLimit,
173999
- maxOrdinal: options3.maxMessageOrdinal,
174235
+ maxOrdinal: options.maxMessageOrdinal,
174000
174236
  modelId: chunkModelId && chunkModelId !== "off" ? chunkModelId : null
174001
174237
  }) : [];
174002
174238
  const messageLikeResults = mergeMessageAndCompartmentResults({
@@ -174014,7 +174250,7 @@ async function unifiedSearch(db, sessionId, projectPath, query, options3 = {}) {
174014
174250
  queryEmbedding,
174015
174251
  queryModelId: embeddingModelId && embeddingModelId !== "off" ? embeddingModelId : null,
174016
174252
  workspace,
174017
- visibleMemoryIds: options3.visibleMemoryIds
174253
+ visibleMemoryIds: options.visibleMemoryIds
174018
174254
  }) : Promise.resolve([]),
174019
174255
  runGitCommits ? Promise.resolve(searchGitCommits({
174020
174256
  db,
@@ -174034,7 +174270,7 @@ async function unifiedSearch(db, sessionId, projectPath, query, options3 = {}) {
174034
174270
  })) : Promise.resolve([])
174035
174271
  ]);
174036
174272
  const results = [...memoryResults, ...primerResults, ...messageLikeResults, ...gitCommitResults].sort(compareUnifiedResults).slice(0, limit);
174037
- const countRetrievals = options3.countRetrievals ?? true;
174273
+ const countRetrievals = options.countRetrievals ?? true;
174038
174274
  if (countRetrievals) {
174039
174275
  const memoryIds = results.filter((result) => result.source === "memory").map((result) => result.memoryId);
174040
174276
  if (memoryIds.length > 0) {
@@ -174203,8 +174439,8 @@ function renderedTier(compartmentIndex, importance, budgetPressure, anchorOverla
174203
174439
  if (shouldArchive(compartmentIndex, importance, budgetPressure, anchorOverlap)) {
174204
174440
  return 5;
174205
174441
  }
174206
- const base2 = tier(compartmentIndex, importance, budgetPressure);
174207
- return Math.min(base2, 4);
174442
+ const base = tier(compartmentIndex, importance, budgetPressure);
174443
+ return Math.min(base, 4);
174208
174444
  }
174209
174445
  function computeBudgetPressure(compartments, historyBudget) {
174210
174446
  if (historyBudget <= 0)