chatroom-cli 1.30.0 → 1.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +691 -280
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2167,7 +2167,7 @@ function getVersion() {
2167
2167
  }
2168
2168
  var init_version = () => {};
2169
2169
 
2170
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/common/index.js
2170
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/common/index.js
2171
2171
  function parseArgs(args) {
2172
2172
  if (args === undefined) {
2173
2173
  return {};
@@ -2203,10 +2203,10 @@ function isSimpleObject(value) {
2203
2203
  return isObject && isSimple;
2204
2204
  }
2205
2205
 
2206
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/index.js
2207
- var version = "1.34.0";
2206
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/index.js
2207
+ var version = "1.34.1";
2208
2208
 
2209
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/values/base64.js
2209
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/values/base64.js
2210
2210
  var exports_base64 = {};
2211
2211
  __export(exports_base64, {
2212
2212
  toByteArray: () => toByteArray,
@@ -2306,7 +2306,7 @@ var init_base64 = __esm(() => {
2306
2306
  revLookup[95] = 63;
2307
2307
  });
2308
2308
 
2309
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/values/value.js
2309
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/values/value.js
2310
2310
  function isSpecial(n) {
2311
2311
  return Number.isNaN(n) || !Number.isFinite(n) || Object.is(n, -0);
2312
2312
  }
@@ -2547,7 +2547,7 @@ var init_value = __esm(() => {
2547
2547
  base64ToBigInt = DataView.prototype.getBigInt64 ? modernBase64ToBigInt : slowBase64ToBigInt;
2548
2548
  });
2549
2549
 
2550
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/values/errors.js
2550
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/values/errors.js
2551
2551
  var __defProp2, __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value), _a, _b, IDENTIFYING_FIELD, ConvexError;
2552
2552
  var init_errors = __esm(() => {
2553
2553
  init_value();
@@ -2564,14 +2564,14 @@ var init_errors = __esm(() => {
2564
2564
  };
2565
2565
  });
2566
2566
 
2567
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/values/index.js
2567
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/values/index.js
2568
2568
  var init_values = __esm(() => {
2569
2569
  init_value();
2570
2570
  init_base64();
2571
2571
  init_errors();
2572
2572
  });
2573
2573
 
2574
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/logging.js
2574
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/logging.js
2575
2575
  function prefix_for_source(source) {
2576
2576
  switch (source) {
2577
2577
  case "query":
@@ -2691,7 +2691,7 @@ var init_logging = __esm(() => {
2691
2691
  __defProp3 = Object.defineProperty;
2692
2692
  });
2693
2693
 
2694
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/udf_path_utils.js
2694
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/udf_path_utils.js
2695
2695
  function canonicalizeUdfPath(udfPath) {
2696
2696
  const pieces = udfPath.split(":");
2697
2697
  let moduleName;
@@ -2731,7 +2731,7 @@ var init_udf_path_utils = __esm(() => {
2731
2731
  init_values();
2732
2732
  });
2733
2733
 
2734
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/local_state.js
2734
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/local_state.js
2735
2735
  class LocalSyncState {
2736
2736
  constructor() {
2737
2737
  __publicField3(this, "nextQueryId");
@@ -3020,7 +3020,7 @@ var init_local_state = __esm(() => {
3020
3020
  __defProp4 = Object.defineProperty;
3021
3021
  });
3022
3022
 
3023
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/request_manager.js
3023
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/request_manager.js
3024
3024
  class RequestManager {
3025
3025
  constructor(logger, markConnectionStateDirty) {
3026
3026
  this.logger = logger;
@@ -3205,13 +3205,13 @@ var init_request_manager = __esm(() => {
3205
3205
  __defProp5 = Object.defineProperty;
3206
3206
  });
3207
3207
 
3208
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/functionName.js
3208
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/functionName.js
3209
3209
  var functionName;
3210
3210
  var init_functionName = __esm(() => {
3211
3211
  functionName = Symbol.for("functionName");
3212
3212
  });
3213
3213
 
3214
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/components/paths.js
3214
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/components/paths.js
3215
3215
  function extractReferencePath(reference) {
3216
3216
  return reference[toReferencePath] ?? null;
3217
3217
  }
@@ -3243,7 +3243,7 @@ var init_paths = __esm(() => {
3243
3243
  toReferencePath = Symbol.for("toReferencePath");
3244
3244
  });
3245
3245
 
3246
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/api.js
3246
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/api.js
3247
3247
  function getFunctionName(functionReference) {
3248
3248
  const address = getFunctionAddress(functionReference);
3249
3249
  if (address.name === undefined) {
@@ -3296,7 +3296,7 @@ var init_api = __esm(() => {
3296
3296
  anyApi = createApi();
3297
3297
  });
3298
3298
 
3299
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/optimistic_updates_impl.js
3299
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/optimistic_updates_impl.js
3300
3300
  class OptimisticLocalStoreImpl {
3301
3301
  constructor(queryResults) {
3302
3302
  __publicField5(this, "queryResults");
@@ -3435,7 +3435,7 @@ var init_optimistic_updates_impl = __esm(() => {
3435
3435
  __defProp6 = Object.defineProperty;
3436
3436
  });
3437
3437
 
3438
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/vendor/long.js
3438
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/vendor/long.js
3439
3439
  class Long {
3440
3440
  constructor(low, high) {
3441
3441
  __publicField6(this, "low");
@@ -3513,7 +3513,7 @@ var init_long = __esm(() => {
3513
3513
  MAX_UNSIGNED_VALUE = new Long(4294967295 | 0, 4294967295 | 0);
3514
3514
  });
3515
3515
 
3516
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/remote_query_set.js
3516
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/remote_query_set.js
3517
3517
  class RemoteQuerySet {
3518
3518
  constructor(queryPath, logger) {
3519
3519
  __publicField7(this, "version");
@@ -3589,7 +3589,7 @@ var init_remote_query_set = __esm(() => {
3589
3589
  __defProp8 = Object.defineProperty;
3590
3590
  });
3591
3591
 
3592
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/protocol.js
3592
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/protocol.js
3593
3593
  function u64ToLong(encoded) {
3594
3594
  const integerBytes = exports_base64.toByteArray(encoded);
3595
3595
  return Long.fromBytesLE(Array.from(integerBytes));
@@ -3659,7 +3659,7 @@ var init_protocol = __esm(() => {
3659
3659
  init_long();
3660
3660
  });
3661
3661
 
3662
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/web_socket_manager.js
3662
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/web_socket_manager.js
3663
3663
  function monotonicMillis() {
3664
3664
  if (firstTime === undefined) {
3665
3665
  firstTime = Date.now();
@@ -3712,7 +3712,7 @@ class WebSocketManager {
3712
3712
  this.connectionCount = 0;
3713
3713
  this.lastCloseReason = "InitialConnect";
3714
3714
  this.defaultInitialBackoff = 1000;
3715
- this.maxBackoff = 64000;
3715
+ this.maxBackoff = 16000;
3716
3716
  this.retries = 0;
3717
3717
  this.serverInactivityThreshold = 60000;
3718
3718
  this.reconnectDueToServerInactivityTimeout = null;
@@ -4204,17 +4204,13 @@ var init_web_socket_manager = __esm(() => {
4204
4204
  VectorIndexesUnavailable: { timeout: 1000 },
4205
4205
  SearchIndexesUnavailable: { timeout: 1000 },
4206
4206
  TableSummariesUnavailable: { timeout: 1000 },
4207
- ServiceUnavailable: { timeout: 3000 },
4208
- WorkerOverloaded: { timeout: 3000 },
4209
- IsolateNotClean: { timeout: 3000 },
4210
- InitialPermitTimeoutError: { timeout: 3000 },
4211
4207
  VectorIndexTooLarge: { timeout: 3000 },
4212
4208
  SearchIndexTooLarge: { timeout: 3000 },
4213
4209
  TooManyWritesInTimePeriod: { timeout: 3000 }
4214
4210
  };
4215
4211
  });
4216
4212
 
4217
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/session.js
4213
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/session.js
4218
4214
  function newSessionId() {
4219
4215
  return uuidv4();
4220
4216
  }
@@ -4225,7 +4221,7 @@ function uuidv4() {
4225
4221
  });
4226
4222
  }
4227
4223
 
4228
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/vendor/jwt-decode/index.js
4224
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/vendor/jwt-decode/index.js
4229
4225
  function b64DecodeUnicode(str) {
4230
4226
  return decodeURIComponent(atob(str).replace(/(.)/g, (_m, p) => {
4231
4227
  let code2 = p.charCodeAt(0).toString(16).toUpperCase();
@@ -4284,7 +4280,7 @@ var init_jwt_decode = __esm(() => {
4284
4280
  InvalidTokenError.prototype.name = "InvalidTokenError";
4285
4281
  });
4286
4282
 
4287
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/authentication_manager.js
4283
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/authentication_manager.js
4288
4284
  class AuthenticationManager {
4289
4285
  constructor(syncState, callbacks, config) {
4290
4286
  __publicField9(this, "authState", { state: "noAuth" });
@@ -4343,6 +4339,8 @@ class AuthenticationManager {
4343
4339
  if (serverMessage.endVersion.identity <= serverMessage.startVersion.identity) {
4344
4340
  return;
4345
4341
  }
4342
+ this._logVerbose(`auth state is ${this.authState.state} when handling transition`);
4343
+ this.syncState.markAuthCompletion();
4346
4344
  if (this.authState.state === "waitingForServerConfirmationOfCachedToken") {
4347
4345
  this._logVerbose("server confirmed auth token is valid");
4348
4346
  this.refetchToken();
@@ -4525,7 +4523,6 @@ class AuthenticationManager {
4525
4523
  }
4526
4524
  if (this.authState.state === "waitingForScheduledRefetch") {
4527
4525
  clearTimeout(this.authState.refetchTokenTimeoutId);
4528
- this.syncState.markAuthCompletion();
4529
4526
  }
4530
4527
  this.authState = newAuth;
4531
4528
  }
@@ -4548,7 +4545,7 @@ var init_authentication_manager = __esm(() => {
4548
4545
  MAXIMUM_REFRESH_DELAY = 20 * 24 * 60 * 60 * 1000;
4549
4546
  });
4550
4547
 
4551
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/metrics.js
4548
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/metrics.js
4552
4549
  function mark(name, sessionId) {
4553
4550
  const detail = { sessionId };
4554
4551
  if (typeof performance === "undefined" || !performance.mark)
@@ -4583,7 +4580,7 @@ var init_metrics = __esm(() => {
4583
4580
  ];
4584
4581
  });
4585
4582
 
4586
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/client.js
4583
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/client.js
4587
4584
  class BaseConvexClient {
4588
4585
  constructor(address, onTransition, options) {
4589
4586
  __publicField10(this, "address");
@@ -5078,12 +5075,12 @@ var init_client = __esm(() => {
5078
5075
  __defProp11 = Object.defineProperty;
5079
5076
  });
5080
5077
 
5081
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/index.js
5078
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/index.js
5082
5079
  var init_browser = __esm(() => {
5083
5080
  init_client();
5084
5081
  });
5085
5082
 
5086
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/pagination.js
5083
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/pagination.js
5087
5084
  function asPaginationResult(value) {
5088
5085
  if (typeof value !== "object" || value === null || !Array.isArray(value.page) || typeof value.isDone !== "boolean" || typeof value.continueCursor !== "string") {
5089
5086
  throw new Error(`Not a valid paginated query result: ${value?.toString()}`);
@@ -5091,7 +5088,7 @@ function asPaginationResult(value) {
5091
5088
  return value;
5092
5089
  }
5093
5090
 
5094
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/sync/paginated_query_client.js
5091
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/sync/paginated_query_client.js
5095
5092
  class PaginatedQueryClient {
5096
5093
  constructor(client, onTransition) {
5097
5094
  this.client = client;
@@ -5370,7 +5367,7 @@ var init_paginated_query_client = __esm(() => {
5370
5367
  __defProp12 = Object.defineProperty;
5371
5368
  });
5372
5369
 
5373
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/simple_client.js
5370
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/simple_client.js
5374
5371
  function setDefaultWebSocketConstructor(ws) {
5375
5372
  defaultWebSocketConstructor = ws;
5376
5373
  }
@@ -5622,10 +5619,10 @@ var init_simple_client = __esm(() => {
5622
5619
  __defProp13 = Object.defineProperty;
5623
5620
  });
5624
5621
 
5625
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/simple_client-node.js
5622
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/simple_client-node.js
5626
5623
  import { createRequire as createRequire2 } from "module";
5627
5624
  import { resolve as nodePathResolve } from "path";
5628
- var __dirname = "/home/runner/work/chatroom/chatroom/node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser", require2, __create2, __defProp14, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __require2, __commonJS2 = (cb, mod) => function __require22() {
5625
+ var __dirname = "/home/runner/work/chatroom/chatroom/node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser", require2, __create2, __defProp14, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __require2, __commonJS2 = (cb, mod) => function __require22() {
5629
5626
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5630
5627
  }, __copyProps = (to, from, except, desc) => {
5631
5628
  if (from && typeof from === "object" || typeof from === "function") {
@@ -8707,7 +8704,7 @@ var init_simple_client_node = __esm(() => {
8707
8704
  setDefaultWebSocketConstructor(nodeWebSocket);
8708
8705
  });
8709
8706
 
8710
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/http_client.js
8707
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/http_client.js
8711
8708
  class ConvexHttpClient2 {
8712
8709
  constructor(address, options) {
8713
8710
  __publicField13(this, "address");
@@ -9027,7 +9024,7 @@ var init_http_client = __esm(() => {
9027
9024
  __defProp15 = Object.defineProperty;
9028
9025
  });
9029
9026
 
9030
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/browser/index-node.js
9027
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/browser/index-node.js
9031
9028
  var init_index_node = __esm(() => {
9032
9029
  init_simple_client_node();
9033
9030
  init_http_client();
@@ -9276,7 +9273,7 @@ var init_storage = __esm(() => {
9276
9273
  CHATROOM_DIR = join2(homedir(), ".chatroom");
9277
9274
  });
9278
9275
 
9279
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/values/validators.js
9276
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/values/validators.js
9280
9277
  function throwUndefinedValidatorError(context, fieldName) {
9281
9278
  const fieldInfo = fieldName !== undefined ? ` for field "${fieldName}"` : "";
9282
9279
  throw new Error(`A validator is undefined${fieldInfo} in ${context}. This is often caused by circular imports. See ${UNDEFINED_VALIDATOR_ERROR_URL} for details.`);
@@ -9611,7 +9608,7 @@ var init_validators = __esm(() => {
9611
9608
  };
9612
9609
  });
9613
9610
 
9614
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/values/validator.js
9611
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/values/validator.js
9615
9612
  var v2;
9616
9613
  var init_validator = __esm(() => {
9617
9614
  init_validators();
@@ -9680,7 +9677,7 @@ var init_validator = __esm(() => {
9680
9677
  };
9681
9678
  });
9682
9679
 
9683
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/pagination.js
9680
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/pagination.js
9684
9681
  var paginationOptsValidator;
9685
9682
  var init_pagination = __esm(() => {
9686
9683
  init_validator();
@@ -9694,10 +9691,10 @@ var init_pagination = __esm(() => {
9694
9691
  });
9695
9692
  });
9696
9693
 
9697
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/search_filter_builder.js
9694
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/search_filter_builder.js
9698
9695
  var init_search_filter_builder = () => {};
9699
9696
 
9700
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/components/index.js
9697
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/components/index.js
9701
9698
  function createChildComponents(root, pathParts) {
9702
9699
  const handler = {
9703
9700
  get(_, prop) {
@@ -9722,7 +9719,7 @@ var init_components = __esm(() => {
9722
9719
  init_paths();
9723
9720
  });
9724
9721
 
9725
- // ../../node_modules/.pnpm/convex@1.34.0_react@19.2.3/node_modules/convex/dist/esm/server/index.js
9722
+ // ../../node_modules/.pnpm/convex@1.34.1_react@19.2.3/node_modules/convex/dist/esm/server/index.js
9726
9723
  var init_server = __esm(() => {
9727
9724
  init_api();
9728
9725
  init_components();
@@ -12170,7 +12167,7 @@ var init_p_limit = __esm(() => {
12170
12167
  init_yocto_queue();
12171
12168
  });
12172
12169
 
12173
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/core/config.js
12170
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/core/config.js
12174
12171
  function mergeConfig(userConfig) {
12175
12172
  return {
12176
12173
  ...DEFAULT_CONFIG,
@@ -24328,7 +24325,7 @@ var require_lib = __commonJS((exports, module) => {
24328
24325
  module.exports = Sharp;
24329
24326
  });
24330
24327
 
24331
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/engines/pdf/pdfium-renderer.js
24328
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/engines/pdf/pdfium-renderer.js
24332
24329
  import { promises as fs } from "fs";
24333
24330
 
24334
24331
  class PdfiumRenderer {
@@ -24454,7 +24451,7 @@ var init_pdfium_renderer = __esm(() => {
24454
24451
  import_sharp = __toESM(require_lib(), 1);
24455
24452
  });
24456
24453
 
24457
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/engines/pdf/pdfjsImporter.js
24454
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/engines/pdf/pdfjsImporter.js
24458
24455
  import { fileURLToPath as fileURLToPath2 } from "node:url";
24459
24456
  import { dirname as dirname2 } from "node:path";
24460
24457
  async function importPdfJs() {
@@ -24468,7 +24465,7 @@ async function importPdfJs() {
24468
24465
  }
24469
24466
  var init_pdfjsImporter = () => {};
24470
24467
 
24471
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/engines/pdf/pdfjs.js
24468
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/engines/pdf/pdfjs.js
24472
24469
  import fs2 from "node:fs/promises";
24473
24470
  function getRotation(transform) {
24474
24471
  return Math.atan2(transform[1], transform[0]) * (180 / Math.PI);
@@ -24489,85 +24486,53 @@ function applyTransformation(point, transform) {
24489
24486
  y: point.x * transform[1] + point.y * transform[3] + transform[5]
24490
24487
  };
24491
24488
  }
24492
- function canDecodeAsAscii(glyphs) {
24493
- for (const g of glyphs) {
24494
- if (!(g >= 32 && g <= 126 || g === 9 || g === 10 || g === 13)) {
24495
- return false;
24496
- }
24497
- }
24498
- return true;
24499
- }
24500
- function scoreNumberFormat(decoded) {
24501
- let score = 0;
24502
- const digitCount = (decoded.match(/[0-9]/g) || []).length;
24503
- score += digitCount * 2;
24504
- if (/^\d{1,3}(,\d{3})*$/.test(decoded)) {
24505
- score += 5;
24506
- }
24507
- if (/^\d+\.\d+$/.test(decoded)) {
24508
- score += 5;
24509
- }
24510
- if (/^[*-]?\d/.test(decoded)) {
24511
- score += 2;
24512
- }
24513
- if (/^\d+$/.test(decoded)) {
24514
- score += 3;
24515
- }
24516
- if (/[.,]{2,}/.test(decoded)) {
24517
- score -= 10;
24518
- }
24519
- if (/^[.,+]|[.,+]$/.test(decoded)) {
24520
- score -= 5;
24521
- }
24522
- if (/,(?!\d{3}(?:[,.]|$))/.test(decoded)) {
24523
- score -= 3;
24524
- }
24525
- if (/\.(?![0-9])/.test(decoded) && !decoded.endsWith(".")) {
24526
- score -= 3;
24527
- }
24528
- return score;
24529
- }
24530
- function tryDecodeTabularFigures(str) {
24531
- if (!str.includes(BUGGY_FONT_MARKER_CHECK))
24532
- return null;
24533
- const glyphs = [];
24534
- let match;
24535
- const regex = /:->\|>_(\d+)_\d+_<\|<-:/g;
24536
- while ((match = regex.exec(str)) !== null) {
24537
- glyphs.push(parseInt(match[1]));
24538
- }
24539
- if (glyphs.length === 0)
24540
- return null;
24541
- if (canDecodeAsAscii(glyphs)) {
24542
- return null;
24543
- }
24544
- const tabularRange = glyphs.every((g) => g >= 17 && g <= 31 || g === 42 || g === 150 || g === 8 || g === 9 || g === 10);
24545
- if (!tabularRange) {
24546
- return null;
24489
+ function resolveGlyphName(glyphName) {
24490
+ if (glyphName in ADOBE_GLYPH_MAP)
24491
+ return ADOBE_GLYPH_MAP[glyphName];
24492
+ if (glyphName.startsWith("uni") && glyphName.length === 7) {
24493
+ const code2 = parseInt(glyphName.slice(3), 16);
24494
+ if (!isNaN(code2) && code2 > 0)
24495
+ return String.fromCharCode(code2);
24547
24496
  }
24548
- let bestResult = null;
24549
- let bestScore = -Infinity;
24550
- for (const mapping of TABULAR_FIGURES_MAPPINGS) {
24551
- const decoded = glyphs.map((g) => mapping[g] || "").join("");
24552
- const unmapped = glyphs.filter((g) => !mapping[g]).length;
24553
- if (unmapped > 0)
24554
- continue;
24555
- const score = scoreNumberFormat(decoded);
24556
- if (score > bestScore) {
24557
- bestScore = score;
24558
- bestResult = decoded;
24497
+ if (glyphName.includes("_")) {
24498
+ const parts = glyphName.split("_");
24499
+ const resolved = parts.map((p) => resolveGlyphName(p));
24500
+ if (resolved.every((r) => r !== null)) {
24501
+ return resolved.join("");
24559
24502
  }
24560
24503
  }
24561
- if (bestResult && bestScore > 0) {
24562
- return bestResult;
24563
- }
24564
24504
  return null;
24565
24505
  }
24506
+ function decodeBuggyFontMarkers(str) {
24507
+ return str.replace(BUGGY_FONT_MARKER_RE, (_match, glyphIdStr, glyphName) => {
24508
+ if (glyphName) {
24509
+ const resolved = resolveGlyphName(glyphName);
24510
+ if (resolved)
24511
+ return resolved;
24512
+ }
24513
+ const glyphId = parseInt(glyphIdStr);
24514
+ if (glyphId >= 32 && glyphId <= 126) {
24515
+ return String.fromCharCode(glyphId);
24516
+ }
24517
+ return "";
24518
+ });
24519
+ }
24566
24520
  function stripControlChars(str) {
24567
24521
  let result = "";
24568
24522
  for (const char of str) {
24569
24523
  const code2 = char.charCodeAt(0);
24570
- if (code2 >= 0 && code2 <= 31 && code2 !== 9 && code2 !== 10 && code2 !== 13 || code2 >= 128 && code2 <= 159) {
24524
+ if (LIGATURE_MAP[char]) {
24525
+ result += LIGATURE_MAP[char];
24526
+ continue;
24527
+ }
24528
+ if (code2 >= 128 && code2 <= 159) {
24529
+ const mapped = WINDOWS_1252_TO_UNICODE[code2];
24530
+ if (mapped) {
24531
+ result += mapped;
24532
+ }
24533
+ continue;
24534
+ }
24535
+ if (code2 >= 0 && code2 <= 31 && code2 !== 9 && code2 !== 10 && code2 !== 13) {
24571
24536
  continue;
24572
24537
  }
24573
24538
  result += char;
@@ -24586,8 +24551,14 @@ function isGarbledFontOutput(str) {
24586
24551
  let normalCharCount = 0;
24587
24552
  for (const char of str) {
24588
24553
  const code2 = char.charCodeAt(0);
24589
- if (code2 >= 0 && code2 <= 31 && code2 !== 9 && code2 !== 10 && code2 !== 13 || code2 >= 128 && code2 <= 159) {
24554
+ if (code2 >= 0 && code2 <= 31 && code2 !== 9 && code2 !== 10 && code2 !== 13) {
24590
24555
  controlCharCount++;
24556
+ } else if (code2 >= 128 && code2 <= 159) {
24557
+ if (WINDOWS_1252_TO_UNICODE[code2]) {
24558
+ normalCharCount++;
24559
+ } else {
24560
+ controlCharCount++;
24561
+ }
24591
24562
  } else if (code2 >= 57344 && code2 <= 63743) {
24592
24563
  privateUseCount++;
24593
24564
  } else if (code2 >= 1536 && code2 <= 1791 || code2 >= 1872 && code2 <= 1919 || code2 >= 2208 && code2 <= 2303) {
@@ -24669,7 +24640,7 @@ class PdfJsEngine {
24669
24640
  _pdfDocument: pdfDocument
24670
24641
  };
24671
24642
  }
24672
- async extractPage(doc, pageNum) {
24643
+ async extractPage(doc, pageNum, options) {
24673
24644
  const pdfDocument = doc._pdfDocument;
24674
24645
  const page = await pdfDocument.getPage(pageNum);
24675
24646
  const viewport = page.getViewport({ scale: 1 });
@@ -24696,18 +24667,12 @@ class PdfJsEngine {
24696
24667
  const width = right - left;
24697
24668
  const height = bottom - top;
24698
24669
  let rotation = getRotation(cm);
24699
- if (rotation < 0) {
24670
+ if (rotation < 0)
24700
24671
  rotation += 360;
24701
- }
24702
24672
  let decodedStr = item.str;
24703
24673
  if (decodedStr.includes(BUGGY_FONT_MARKER_CHECK)) {
24704
- const tabularDecoded = tryDecodeTabularFigures(decodedStr);
24705
- if (tabularDecoded) {
24706
- decodedStr = tabularDecoded;
24707
- } else {
24708
- BUGGY_FONT_MARKER_REGEX.lastIndex = 0;
24709
- decodedStr = decodedStr.replace(BUGGY_FONT_MARKER_REGEX, (_, charCode) => String.fromCharCode(parseInt(charCode)));
24710
- }
24674
+ BUGGY_FONT_MARKER_RE.lastIndex = 0;
24675
+ decodedStr = decodeBuggyFontMarkers(decodedStr);
24711
24676
  }
24712
24677
  if (decodedStr.includes("|")) {
24713
24678
  PIPE_PATTERN_REGEX.lastIndex = 0;
@@ -24736,20 +24701,22 @@ class PdfJsEngine {
24736
24701
  });
24737
24702
  }
24738
24703
  let images = [];
24739
- try {
24740
- const pdfInput = this.currentPdfPath || this.currentPdfData || doc.data;
24741
- if (!this.pdfiumRenderer) {
24742
- this.pdfiumRenderer = new PdfiumRenderer;
24743
- await this.pdfiumRenderer.loadDocument(pdfInput);
24744
- }
24745
- const imageBounds = await this.pdfiumRenderer.extractImageBounds(pdfInput, pageNum);
24746
- images = imageBounds.map((bounds) => ({
24747
- x: bounds.x,
24748
- y: bounds.y,
24749
- width: bounds.width,
24750
- height: bounds.height
24751
- }));
24752
- } catch {}
24704
+ if (options?.extractImages !== false) {
24705
+ try {
24706
+ const pdfInput = this.currentPdfPath || this.currentPdfData || doc.data;
24707
+ if (!this.pdfiumRenderer) {
24708
+ this.pdfiumRenderer = new PdfiumRenderer;
24709
+ await this.pdfiumRenderer.loadDocument(pdfInput);
24710
+ }
24711
+ const imageBounds = await this.pdfiumRenderer.extractImageBounds(pdfInput, pageNum);
24712
+ images = imageBounds.map((bounds) => ({
24713
+ x: bounds.x,
24714
+ y: bounds.y,
24715
+ width: bounds.width,
24716
+ height: bounds.height
24717
+ }));
24718
+ } catch {}
24719
+ }
24753
24720
  const annotations = [];
24754
24721
  await page.cleanup();
24755
24722
  return {
@@ -24762,7 +24729,7 @@ class PdfJsEngine {
24762
24729
  garbledTextRegions: garbledTextRegions.length > 0 ? garbledTextRegions : undefined
24763
24730
  };
24764
24731
  }
24765
- async extractAllPages(doc, maxPages, targetPages) {
24732
+ async extractAllPages(doc, maxPages, targetPages, options) {
24766
24733
  const numPages = Math.min(doc.numPages, maxPages || doc.numPages);
24767
24734
  const pages = [];
24768
24735
  let pageNumbers;
@@ -24775,7 +24742,7 @@ class PdfJsEngine {
24775
24742
  if (maxPages && pages.length >= maxPages) {
24776
24743
  break;
24777
24744
  }
24778
- const pageData = await this.extractPage(doc, pageNum);
24745
+ const pageData = await this.extractPage(doc, pageNum, options);
24779
24746
  pages.push(pageData);
24780
24747
  }
24781
24748
  return pages;
@@ -24825,55 +24792,310 @@ class PdfJsEngine {
24825
24792
  return [...new Set(pages)].sort((a, b) => a - b);
24826
24793
  }
24827
24794
  }
24828
- var getDocument, PDFJS_DIR, CMAP_URL, STANDARD_FONT_DATA_URL, CMAP_PACKED = true, BUGGY_FONT_MARKER_REGEX, BUGGY_FONT_MARKER_CHECK = ":->|>", PIPE_PATTERN_REGEX, TABULAR_FIGURES_MAPPINGS;
24795
+ var getDocument, PDFJS_DIR, CMAP_URL, STANDARD_FONT_DATA_URL, CMAP_PACKED = true, BUGGY_FONT_MARKER_CHECK = ":->|>", PIPE_PATTERN_REGEX, ADOBE_GLYPH_MAP, BUGGY_FONT_MARKER_RE, WINDOWS_1252_TO_UNICODE, LIGATURE_MAP;
24829
24796
  var init_pdfjs = __esm(async () => {
24830
24797
  init_pdfium_renderer();
24831
24798
  init_pdfjsImporter();
24832
24799
  ({ fn: getDocument, dir: PDFJS_DIR } = await importPdfJs());
24833
24800
  CMAP_URL = `${PDFJS_DIR}/cmaps/`;
24834
24801
  STANDARD_FONT_DATA_URL = `${PDFJS_DIR}/standard_fonts/`;
24835
- BUGGY_FONT_MARKER_REGEX = /:->\|>_(\d+)_\d+_<\|<-:/g;
24836
24802
  PIPE_PATTERN_REGEX = /\s*\|([^|])\|\s*/g;
24837
- TABULAR_FIGURES_MAPPINGS = [
24838
- {
24839
- 17: "4",
24840
- 18: "6",
24841
- 19: "8",
24842
- 20: "5",
24843
- 21: "9",
24844
- 22: "7",
24845
- 23: "1",
24846
- 24: " ",
24847
- 25: ",",
24848
- 26: "+",
24849
- 27: "-",
24850
- 28: "3",
24851
- 29: "0",
24852
- 30: "2",
24853
- 31: ".",
24854
- 42: "*",
24855
- 150: "-"
24856
- },
24857
- {
24858
- 17: "+",
24859
- 18: "7",
24860
- 19: "-",
24861
- 20: "9",
24862
- 21: "6",
24863
- 22: "3",
24864
- 23: "1",
24865
- 24: " ",
24866
- 25: "8",
24867
- 26: "5",
24868
- 27: "4",
24869
- 28: "0",
24870
- 29: "2",
24871
- 30: ".",
24872
- 31: ",",
24873
- 42: "*",
24874
- 150: "-"
24875
- }
24876
- ];
24803
+ ADOBE_GLYPH_MAP = {
24804
+ A: "A",
24805
+ B: "B",
24806
+ C: "C",
24807
+ D: "D",
24808
+ E: "E",
24809
+ F: "F",
24810
+ G: "G",
24811
+ H: "H",
24812
+ I: "I",
24813
+ J: "J",
24814
+ K: "K",
24815
+ L: "L",
24816
+ M: "M",
24817
+ N: "N",
24818
+ O: "O",
24819
+ P: "P",
24820
+ Q: "Q",
24821
+ R: "R",
24822
+ S: "S",
24823
+ T: "T",
24824
+ U: "U",
24825
+ V: "V",
24826
+ W: "W",
24827
+ X: "X",
24828
+ Y: "Y",
24829
+ Z: "Z",
24830
+ a: "a",
24831
+ b: "b",
24832
+ c: "c",
24833
+ d: "d",
24834
+ e: "e",
24835
+ f: "f",
24836
+ g: "g",
24837
+ h: "h",
24838
+ i: "i",
24839
+ j: "j",
24840
+ k: "k",
24841
+ l: "l",
24842
+ m: "m",
24843
+ n: "n",
24844
+ o: "o",
24845
+ p: "p",
24846
+ q: "q",
24847
+ r: "r",
24848
+ s: "s",
24849
+ t: "t",
24850
+ u: "u",
24851
+ v: "v",
24852
+ w: "w",
24853
+ x: "x",
24854
+ y: "y",
24855
+ z: "z",
24856
+ zero: "0",
24857
+ one: "1",
24858
+ two: "2",
24859
+ three: "3",
24860
+ four: "4",
24861
+ five: "5",
24862
+ six: "6",
24863
+ seven: "7",
24864
+ eight: "8",
24865
+ nine: "9",
24866
+ fi: "fi",
24867
+ fl: "fl",
24868
+ ff: "ff",
24869
+ ffi: "ffi",
24870
+ ffl: "ffl",
24871
+ space: " ",
24872
+ period: ".",
24873
+ comma: ",",
24874
+ colon: ":",
24875
+ semicolon: ";",
24876
+ hyphen: "-",
24877
+ minus: "−",
24878
+ slash: "/",
24879
+ question: "?",
24880
+ dollar: "$",
24881
+ parenleft: "(",
24882
+ parenright: ")",
24883
+ asterisk: "*",
24884
+ plus: "+",
24885
+ equal: "=",
24886
+ numbersign: "#",
24887
+ percent: "%",
24888
+ ampersand: "&",
24889
+ at: "@",
24890
+ exclam: "!",
24891
+ bracketleft: "[",
24892
+ bracketright: "]",
24893
+ braceleft: "{",
24894
+ braceright: "}",
24895
+ underscore: "_",
24896
+ quotedbl: '"',
24897
+ quotesingle: "'",
24898
+ backslash: "\\",
24899
+ bar: "|",
24900
+ asciitilde: "~",
24901
+ asciicircum: "^",
24902
+ grave: "`",
24903
+ less: "<",
24904
+ greater: ">",
24905
+ quoteright: "’",
24906
+ quoteleft: "‘",
24907
+ quotedblleft: "“",
24908
+ quotedblright: "”",
24909
+ quotesinglbase: "‚",
24910
+ quotedblbase: "„",
24911
+ endash: "–",
24912
+ emdash: "—",
24913
+ bullet: "•",
24914
+ ellipsis: "…",
24915
+ dagger: "†",
24916
+ daggerdbl: "‡",
24917
+ guilsinglleft: "‹",
24918
+ guilsinglright: "›",
24919
+ guillemotleft: "«",
24920
+ guillemotright: "»",
24921
+ trademark: "™",
24922
+ registered: "®",
24923
+ copyright: "©",
24924
+ Alpha: "Α",
24925
+ Beta: "Β",
24926
+ Gamma: "Γ",
24927
+ Delta: "∆",
24928
+ Epsilon: "Ε",
24929
+ Zeta: "Ζ",
24930
+ Eta: "Η",
24931
+ Theta: "Θ",
24932
+ Iota: "Ι",
24933
+ Kappa: "Κ",
24934
+ Lambda: "Λ",
24935
+ Mu: "Μ",
24936
+ Nu: "Ν",
24937
+ Xi: "Ξ",
24938
+ Omicron: "Ο",
24939
+ Pi: "Π",
24940
+ Rho: "Ρ",
24941
+ Sigma: "Σ",
24942
+ Tau: "Τ",
24943
+ Upsilon: "Υ",
24944
+ Phi: "Φ",
24945
+ Chi: "Χ",
24946
+ Psi: "Ψ",
24947
+ Omega: "Ω",
24948
+ alpha: "α",
24949
+ beta: "β",
24950
+ gamma: "γ",
24951
+ delta: "δ",
24952
+ epsilon: "ε",
24953
+ zeta: "ζ",
24954
+ eta: "η",
24955
+ theta: "θ",
24956
+ iota: "ι",
24957
+ kappa: "κ",
24958
+ lambda: "λ",
24959
+ mu: "µ",
24960
+ nu: "ν",
24961
+ xi: "ξ",
24962
+ omicron: "ο",
24963
+ pi: "π",
24964
+ rho: "ρ",
24965
+ sigma: "σ",
24966
+ tau: "τ",
24967
+ upsilon: "υ",
24968
+ phi: "φ",
24969
+ chi: "χ",
24970
+ psi: "ψ",
24971
+ omega: "ω",
24972
+ greaterequal: "≥",
24973
+ lessequal: "≤",
24974
+ notequal: "≠",
24975
+ plusminus: "±",
24976
+ multiply: "×",
24977
+ divide: "÷",
24978
+ infinity: "∞",
24979
+ summation: "∑",
24980
+ integral: "∫",
24981
+ partialdiff: "∂",
24982
+ radical: "√",
24983
+ approxequal: "≈",
24984
+ degree: "°",
24985
+ Aacute: "Á",
24986
+ Agrave: "À",
24987
+ Acircumflex: "Â",
24988
+ Atilde: "Ã",
24989
+ Adieresis: "Ä",
24990
+ Aring: "Å",
24991
+ Eacute: "É",
24992
+ Egrave: "È",
24993
+ Ecircumflex: "Ê",
24994
+ Edieresis: "Ë",
24995
+ Iacute: "Í",
24996
+ Igrave: "Ì",
24997
+ Icircumflex: "Î",
24998
+ Idieresis: "Ï",
24999
+ Oacute: "Ó",
25000
+ Ograve: "Ò",
25001
+ Ocircumflex: "Ô",
25002
+ Otilde: "Õ",
25003
+ Odieresis: "Ö",
25004
+ Uacute: "Ú",
25005
+ Ugrave: "Ù",
25006
+ Ucircumflex: "Û",
25007
+ Udieresis: "Ü",
25008
+ Ntilde: "Ñ",
25009
+ Ccedilla: "Ç",
25010
+ Scaron: "Š",
25011
+ Zcaron: "Ž",
25012
+ aacute: "á",
25013
+ agrave: "à",
25014
+ acircumflex: "â",
25015
+ atilde: "ã",
25016
+ adieresis: "ä",
25017
+ aring: "å",
25018
+ eacute: "é",
25019
+ egrave: "è",
25020
+ ecircumflex: "ê",
25021
+ edieresis: "ë",
25022
+ iacute: "í",
25023
+ igrave: "ì",
25024
+ icircumflex: "î",
25025
+ idieresis: "ï",
25026
+ oacute: "ó",
25027
+ ograve: "ò",
25028
+ ocircumflex: "ô",
25029
+ otilde: "õ",
25030
+ odieresis: "ö",
25031
+ uacute: "ú",
25032
+ ugrave: "ù",
25033
+ ucircumflex: "û",
25034
+ udieresis: "ü",
25035
+ ntilde: "ñ",
25036
+ ccedilla: "ç",
25037
+ scaron: "š",
25038
+ zcaron: "ž",
25039
+ ydieresis: "ÿ",
25040
+ AE: "Æ",
25041
+ ae: "æ",
25042
+ OE: "Œ",
25043
+ oe: "œ",
25044
+ Eth: "Ð",
25045
+ eth: "ð",
25046
+ Thorn: "Þ",
25047
+ thorn: "þ",
25048
+ germandbls: "ß",
25049
+ dotlessi: "ı",
25050
+ section: "§",
25051
+ paragraph: "¶",
25052
+ currency: "¤",
25053
+ cent: "¢",
25054
+ sterling: "£",
25055
+ yen: "¥",
25056
+ Euro: "€",
25057
+ logicalnot: "¬",
25058
+ nbspace: " "
25059
+ };
25060
+ BUGGY_FONT_MARKER_RE = /:->\|>_(\d+)_\d+@([^@]*)@<\|<-:/g;
25061
+ WINDOWS_1252_TO_UNICODE = {
25062
+ 128: "€",
25063
+ 130: "‚",
25064
+ 131: "ƒ",
25065
+ 132: "„",
25066
+ 133: "…",
25067
+ 134: "†",
25068
+ 135: "‡",
25069
+ 136: "ˆ",
25070
+ 137: "‰",
25071
+ 138: "Š",
25072
+ 139: "‹",
25073
+ 140: "Œ",
25074
+ 142: "Ž",
25075
+ 145: "‘",
25076
+ 146: "’",
25077
+ 147: "“",
25078
+ 148: "”",
25079
+ 149: "•",
25080
+ 150: "–",
25081
+ 151: "—",
25082
+ 152: "˜",
25083
+ 153: "™",
25084
+ 154: "š",
25085
+ 155: "›",
25086
+ 156: "œ",
25087
+ 158: "ž",
25088
+ 159: "Ÿ"
25089
+ };
25090
+ LIGATURE_MAP = {
25091
+ "ff": "ff",
25092
+ "fi": "fi",
25093
+ "fl": "fl",
25094
+ "ffi": "ffi",
25095
+ "ffl": "ffl",
25096
+ "ſt": "st",
25097
+ "st": "st"
25098
+ };
24877
25099
  });
24878
25100
 
24879
25101
  // ../../node_modules/.pnpm/regenerator-runtime@0.13.11/node_modules/regenerator-runtime/runtime.js
@@ -28857,7 +29079,7 @@ var require_src = __commonJS((exports, module) => {
28857
29079
  };
28858
29080
  });
28859
29081
 
28860
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/engines/ocr/tesseract.js
29082
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/engines/ocr/tesseract.js
28861
29083
  class TesseractEngine {
28862
29084
  name = "tesseract";
28863
29085
  scheduler;
@@ -28921,7 +29143,7 @@ class TesseractEngine {
28921
29143
  throw new Error("Tesseract scheduler not initialized");
28922
29144
  }
28923
29145
  try {
28924
- const { data: { blocks } } = await this.scheduler.addJob("recognize", image, {}, { blocks: true });
29146
+ const { data: { blocks } } = await this.scheduler.addJob("recognize", image, options.correctRotation ? { rotateAuto: true } : {}, { blocks: true });
28925
29147
  const results = [];
28926
29148
  for (const block of blocks || []) {
28927
29149
  for (const paragraph of block.paragraphs || []) {
@@ -28989,14 +29211,14 @@ var init_tesseract = __esm(() => {
28989
29211
  import_tesseract = __toESM(require_src(), 1);
28990
29212
  });
28991
29213
 
28992
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/bind.js
29214
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/bind.js
28993
29215
  function bind(fn, thisArg) {
28994
29216
  return function wrap() {
28995
29217
  return fn.apply(thisArg, arguments);
28996
29218
  };
28997
29219
  }
28998
29220
 
28999
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/utils.js
29221
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/utils.js
29000
29222
  function isBuffer(val) {
29001
29223
  return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
29002
29224
  }
@@ -29396,7 +29618,7 @@ var init_utils = __esm(() => {
29396
29618
  };
29397
29619
  });
29398
29620
 
29399
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/AxiosError.js
29621
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/AxiosError.js
29400
29622
  var AxiosError, AxiosError_default;
29401
29623
  var init_AxiosError = __esm(() => {
29402
29624
  init_utils();
@@ -39566,14 +39788,14 @@ var require_form_data = __commonJS((exports, module) => {
39566
39788
  module.exports = FormData2;
39567
39789
  });
39568
39790
 
39569
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/platform/node/classes/FormData.js
39791
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/node/classes/FormData.js
39570
39792
  var import_form_data, FormData_default;
39571
39793
  var init_FormData = __esm(() => {
39572
39794
  import_form_data = __toESM(require_form_data(), 1);
39573
39795
  FormData_default = import_form_data.default;
39574
39796
  });
39575
39797
 
39576
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/toFormData.js
39798
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/toFormData.js
39577
39799
  function isVisitable(thing) {
39578
39800
  return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
39579
39801
  }
@@ -39691,7 +39913,7 @@ var init_toFormData = __esm(() => {
39691
39913
  toFormData_default = toFormData;
39692
39914
  });
39693
39915
 
39694
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
39916
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
39695
39917
  function encode(str) {
39696
39918
  const charMap = {
39697
39919
  "!": "%21",
@@ -39728,7 +39950,7 @@ var init_AxiosURLSearchParams = __esm(() => {
39728
39950
  AxiosURLSearchParams_default = AxiosURLSearchParams;
39729
39951
  });
39730
39952
 
39731
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/buildURL.js
39953
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/buildURL.js
39732
39954
  function encode2(val) {
39733
39955
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
39734
39956
  }
@@ -39761,7 +39983,7 @@ var init_buildURL = __esm(() => {
39761
39983
  init_AxiosURLSearchParams();
39762
39984
  });
39763
39985
 
39764
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/InterceptorManager.js
39986
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/InterceptorManager.js
39765
39987
  class InterceptorManager {
39766
39988
  constructor() {
39767
39989
  this.handlers = [];
@@ -39799,7 +40021,7 @@ var init_InterceptorManager = __esm(() => {
39799
40021
  InterceptorManager_default = InterceptorManager;
39800
40022
  });
39801
40023
 
39802
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/defaults/transitional.js
40024
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/defaults/transitional.js
39803
40025
  var transitional_default;
39804
40026
  var init_transitional = __esm(() => {
39805
40027
  transitional_default = {
@@ -39810,14 +40032,14 @@ var init_transitional = __esm(() => {
39810
40032
  };
39811
40033
  });
39812
40034
 
39813
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
40035
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
39814
40036
  import url from "url";
39815
40037
  var URLSearchParams_default;
39816
40038
  var init_URLSearchParams = __esm(() => {
39817
40039
  URLSearchParams_default = url.URLSearchParams;
39818
40040
  });
39819
40041
 
39820
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/platform/node/index.js
40042
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/node/index.js
39821
40043
  import crypto2 from "crypto";
39822
40044
  var ALPHA = "abcdefghijklmnopqrstuvwxyz", DIGIT = "0123456789", ALPHABET, generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
39823
40045
  let str = "";
@@ -39850,7 +40072,7 @@ var init_node = __esm(() => {
39850
40072
  };
39851
40073
  });
39852
40074
 
39853
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/platform/common/utils.js
40075
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/common/utils.js
39854
40076
  var exports_utils = {};
39855
40077
  __export(exports_utils, {
39856
40078
  origin: () => origin,
@@ -39870,7 +40092,7 @@ var init_utils2 = __esm(() => {
39870
40092
  origin = hasBrowserEnv && window.location.href || "http://localhost";
39871
40093
  });
39872
40094
 
39873
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/platform/index.js
40095
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/platform/index.js
39874
40096
  var platform_default;
39875
40097
  var init_platform = __esm(() => {
39876
40098
  init_node();
@@ -39881,7 +40103,7 @@ var init_platform = __esm(() => {
39881
40103
  };
39882
40104
  });
39883
40105
 
39884
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
40106
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/toURLEncodedForm.js
39885
40107
  function toURLEncodedForm(data, options) {
39886
40108
  return toFormData_default(data, new platform_default.classes.URLSearchParams, {
39887
40109
  visitor: function(value, key, path2, helpers) {
@@ -39900,7 +40122,7 @@ var init_toURLEncodedForm = __esm(() => {
39900
40122
  init_platform();
39901
40123
  });
39902
40124
 
39903
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/formDataToJSON.js
40125
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/formDataToJSON.js
39904
40126
  function parsePropPath(name) {
39905
40127
  return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
39906
40128
  return match[0] === "[]" ? "" : match[1] || match[0];
@@ -39958,7 +40180,7 @@ var init_formDataToJSON = __esm(() => {
39958
40180
  formDataToJSON_default = formDataToJSON;
39959
40181
  });
39960
40182
 
39961
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/defaults/index.js
40183
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/defaults/index.js
39962
40184
  function stringifySafely(rawValue, parser, encoder) {
39963
40185
  if (utils_default.isString(rawValue)) {
39964
40186
  try {
@@ -40073,7 +40295,7 @@ var init_defaults = __esm(() => {
40073
40295
  defaults_default = defaults;
40074
40296
  });
40075
40297
 
40076
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/parseHeaders.js
40298
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseHeaders.js
40077
40299
  var ignoreDuplicateOf, parseHeaders_default = (rawHeaders) => {
40078
40300
  const parsed = {};
40079
40301
  let key;
@@ -40122,15 +40344,38 @@ var init_parseHeaders = __esm(() => {
40122
40344
  ]);
40123
40345
  });
40124
40346
 
40125
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/AxiosHeaders.js
40347
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/AxiosHeaders.js
40348
+ function assertValidHeaderValue(value, header) {
40349
+ if (value === false || value == null) {
40350
+ return;
40351
+ }
40352
+ if (utils_default.isArray(value)) {
40353
+ value.forEach((v3) => assertValidHeaderValue(v3, header));
40354
+ return;
40355
+ }
40356
+ if (!isValidHeaderValue(String(value))) {
40357
+ throw new Error(`Invalid character in header content ["${header}"]`);
40358
+ }
40359
+ }
40126
40360
  function normalizeHeader(header) {
40127
40361
  return header && String(header).trim().toLowerCase();
40128
40362
  }
40363
+ function stripTrailingCRLF(str) {
40364
+ let end = str.length;
40365
+ while (end > 0) {
40366
+ const charCode = str.charCodeAt(end - 1);
40367
+ if (charCode !== 10 && charCode !== 13) {
40368
+ break;
40369
+ }
40370
+ end -= 1;
40371
+ }
40372
+ return end === str.length ? str : str.slice(0, end);
40373
+ }
40129
40374
  function normalizeValue(value) {
40130
40375
  if (value === false || value == null) {
40131
40376
  return value;
40132
40377
  }
40133
- return utils_default.isArray(value) ? value.map(normalizeValue) : String(value).replace(/[\r\n]+$/, "");
40378
+ return utils_default.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
40134
40379
  }
40135
40380
  function parseTokens(str) {
40136
40381
  const tokens = Object.create(null);
@@ -40173,7 +40418,7 @@ function buildAccessors(obj, header) {
40173
40418
  });
40174
40419
  });
40175
40420
  }
40176
- var $internals, isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), AxiosHeaders, AxiosHeaders_default;
40421
+ var $internals, isValidHeaderValue = (value) => !/[\r\n]/.test(value), isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), AxiosHeaders, AxiosHeaders_default;
40177
40422
  var init_AxiosHeaders = __esm(() => {
40178
40423
  init_utils();
40179
40424
  init_parseHeaders();
@@ -40191,6 +40436,7 @@ var init_AxiosHeaders = __esm(() => {
40191
40436
  }
40192
40437
  const key = utils_default.findKey(self2, lHeader);
40193
40438
  if (!key || self2[key] === undefined || _rewrite === true || _rewrite === undefined && self2[key] !== false) {
40439
+ assertValidHeaderValue(_value, _header);
40194
40440
  self2[key || _header] = normalizeValue(_value);
40195
40441
  }
40196
40442
  }
@@ -40364,7 +40610,7 @@ var init_AxiosHeaders = __esm(() => {
40364
40610
  AxiosHeaders_default = AxiosHeaders;
40365
40611
  });
40366
40612
 
40367
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/transformData.js
40613
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/transformData.js
40368
40614
  function transformData(fns, response) {
40369
40615
  const config = this || defaults_default;
40370
40616
  const context = response || config;
@@ -40382,12 +40628,12 @@ var init_transformData = __esm(() => {
40382
40628
  init_AxiosHeaders();
40383
40629
  });
40384
40630
 
40385
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/cancel/isCancel.js
40631
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/isCancel.js
40386
40632
  function isCancel(value) {
40387
40633
  return !!(value && value.__CANCEL__);
40388
40634
  }
40389
40635
 
40390
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/cancel/CanceledError.js
40636
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/CanceledError.js
40391
40637
  var CanceledError, CanceledError_default;
40392
40638
  var init_CanceledError = __esm(() => {
40393
40639
  init_AxiosError();
@@ -40401,7 +40647,7 @@ var init_CanceledError = __esm(() => {
40401
40647
  CanceledError_default = CanceledError;
40402
40648
  });
40403
40649
 
40404
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/settle.js
40650
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/settle.js
40405
40651
  function settle(resolve, reject, response) {
40406
40652
  const validateStatus2 = response.config.validateStatus;
40407
40653
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
@@ -40414,7 +40660,7 @@ var init_settle = __esm(() => {
40414
40660
  init_AxiosError();
40415
40661
  });
40416
40662
 
40417
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/isAbsoluteURL.js
40663
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isAbsoluteURL.js
40418
40664
  function isAbsoluteURL(url2) {
40419
40665
  if (typeof url2 !== "string") {
40420
40666
  return false;
@@ -40422,12 +40668,12 @@ function isAbsoluteURL(url2) {
40422
40668
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
40423
40669
  }
40424
40670
 
40425
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/combineURLs.js
40671
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/combineURLs.js
40426
40672
  function combineURLs(baseURL, relativeURL) {
40427
40673
  return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
40428
40674
  }
40429
40675
 
40430
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/buildFullPath.js
40676
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/buildFullPath.js
40431
40677
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
40432
40678
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
40433
40679
  if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
@@ -41241,7 +41487,7 @@ var require_src2 = __commonJS((exports, module) => {
41241
41487
  }
41242
41488
  });
41243
41489
 
41244
- // ../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/debug.js
41490
+ // ../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js
41245
41491
  var require_debug2 = __commonJS((exports, module) => {
41246
41492
  var debug;
41247
41493
  module.exports = function() {
@@ -41257,7 +41503,7 @@ var require_debug2 = __commonJS((exports, module) => {
41257
41503
  };
41258
41504
  });
41259
41505
 
41260
- // ../../node_modules/.pnpm/follow-redirects@1.15.11/node_modules/follow-redirects/index.js
41506
+ // ../../node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/index.js
41261
41507
  var require_follow_redirects = __commonJS((exports, module) => {
41262
41508
  var url2 = __require("url");
41263
41509
  var URL2 = url2.URL;
@@ -41280,6 +41526,11 @@ var require_follow_redirects = __commonJS((exports, module) => {
41280
41526
  } catch (error) {
41281
41527
  useNativeURL = error.code === "ERR_INVALID_URL";
41282
41528
  }
41529
+ var sensitiveHeaders = [
41530
+ "Authorization",
41531
+ "Proxy-Authorization",
41532
+ "Cookie"
41533
+ ];
41283
41534
  var preservedUrlFields = [
41284
41535
  "auth",
41285
41536
  "host",
@@ -41327,6 +41578,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41327
41578
  self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
41328
41579
  }
41329
41580
  };
41581
+ this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i");
41330
41582
  this._performRequest();
41331
41583
  }
41332
41584
  RedirectableRequest.prototype = Object.create(Writable.prototype);
@@ -41464,6 +41716,9 @@ var require_follow_redirects = __commonJS((exports, module) => {
41464
41716
  if (!options.headers) {
41465
41717
  options.headers = {};
41466
41718
  }
41719
+ if (!isArray2(options.sensitiveHeaders)) {
41720
+ options.sensitiveHeaders = [];
41721
+ }
41467
41722
  if (options.host) {
41468
41723
  if (!options.hostname) {
41469
41724
  options.hostname = options.host;
@@ -41560,7 +41815,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41560
41815
  this._isRedirect = true;
41561
41816
  spreadUrlObject(redirectUrl, this._options);
41562
41817
  if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
41563
- removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
41818
+ removeMatchingHeaders(this._headerFilter, this._options.headers);
41564
41819
  }
41565
41820
  if (isFunction2(beforeRedirect)) {
41566
41821
  var responseDetails = {
@@ -41708,6 +41963,9 @@ var require_follow_redirects = __commonJS((exports, module) => {
41708
41963
  var dot = subdomain.length - domain.length - 1;
41709
41964
  return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
41710
41965
  }
41966
+ function isArray2(value) {
41967
+ return value instanceof Array;
41968
+ }
41711
41969
  function isString2(value) {
41712
41970
  return typeof value === "string" || value instanceof String;
41713
41971
  }
@@ -41720,20 +41978,23 @@ var require_follow_redirects = __commonJS((exports, module) => {
41720
41978
  function isURL(value) {
41721
41979
  return URL2 && value instanceof URL2;
41722
41980
  }
41981
+ function escapeRegex(regex) {
41982
+ return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
41983
+ }
41723
41984
  module.exports = wrap({ http, https });
41724
41985
  module.exports.wrap = wrap;
41725
41986
  });
41726
41987
 
41727
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/env/data.js
41728
- var VERSION = "1.14.0";
41988
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/env/data.js
41989
+ var VERSION = "1.15.0";
41729
41990
 
41730
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/parseProtocol.js
41991
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/parseProtocol.js
41731
41992
  function parseProtocol(url2) {
41732
41993
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
41733
41994
  return match && match[1] || "";
41734
41995
  }
41735
41996
 
41736
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/fromDataURI.js
41997
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/fromDataURI.js
41737
41998
  function fromDataURI(uri, asBlob, options) {
41738
41999
  const _Blob = options && options.Blob || platform_default.classes.Blob;
41739
42000
  const protocol = parseProtocol(uri);
@@ -41767,7 +42028,7 @@ var init_fromDataURI = __esm(() => {
41767
42028
  DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
41768
42029
  });
41769
42030
 
41770
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/AxiosTransformStream.js
42031
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/AxiosTransformStream.js
41771
42032
  import stream from "stream";
41772
42033
  var kInternals, AxiosTransformStream, AxiosTransformStream_default;
41773
42034
  var init_AxiosTransformStream = __esm(() => {
@@ -41886,7 +42147,7 @@ var init_AxiosTransformStream = __esm(() => {
41886
42147
  AxiosTransformStream_default = AxiosTransformStream;
41887
42148
  });
41888
42149
 
41889
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/readBlob.js
42150
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/readBlob.js
41890
42151
  var asyncIterator, readBlob = async function* (blob) {
41891
42152
  if (blob.stream) {
41892
42153
  yield* blob.stream();
@@ -41903,7 +42164,7 @@ var init_readBlob = __esm(() => {
41903
42164
  readBlob_default = readBlob;
41904
42165
  });
41905
42166
 
41906
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/formDataToStream.js
42167
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/formDataToStream.js
41907
42168
  import util from "util";
41908
42169
  import { Readable } from "stream";
41909
42170
 
@@ -41989,7 +42250,7 @@ var init_formDataToStream = __esm(() => {
41989
42250
  formDataToStream_default = formDataToStream;
41990
42251
  });
41991
42252
 
41992
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
42253
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
41993
42254
  import stream2 from "stream";
41994
42255
  var ZlibHeaderTransformStream, ZlibHeaderTransformStream_default;
41995
42256
  var init_ZlibHeaderTransformStream = __esm(() => {
@@ -42014,7 +42275,7 @@ var init_ZlibHeaderTransformStream = __esm(() => {
42014
42275
  ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
42015
42276
  });
42016
42277
 
42017
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/callbackify.js
42278
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/callbackify.js
42018
42279
  var callbackify = (fn, reducer) => {
42019
42280
  return utils_default.isAsyncFn(fn) ? function(...args) {
42020
42281
  const cb = args.pop();
@@ -42032,7 +42293,85 @@ var init_callbackify = __esm(() => {
42032
42293
  callbackify_default = callbackify;
42033
42294
  });
42034
42295
 
42035
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/speedometer.js
42296
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/shouldBypassProxy.js
42297
+ function shouldBypassProxy(location) {
42298
+ let parsed;
42299
+ try {
42300
+ parsed = new URL(location);
42301
+ } catch (_err) {
42302
+ return false;
42303
+ }
42304
+ const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").toLowerCase();
42305
+ if (!noProxy) {
42306
+ return false;
42307
+ }
42308
+ if (noProxy === "*") {
42309
+ return true;
42310
+ }
42311
+ const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS2[parsed.protocol.split(":", 1)[0]] || 0;
42312
+ const hostname3 = normalizeNoProxyHost(parsed.hostname.toLowerCase());
42313
+ return noProxy.split(/[\s,]+/).some((entry) => {
42314
+ if (!entry) {
42315
+ return false;
42316
+ }
42317
+ let [entryHost, entryPort] = parseNoProxyEntry(entry);
42318
+ entryHost = normalizeNoProxyHost(entryHost);
42319
+ if (!entryHost) {
42320
+ return false;
42321
+ }
42322
+ if (entryPort && entryPort !== port) {
42323
+ return false;
42324
+ }
42325
+ if (entryHost.charAt(0) === "*") {
42326
+ entryHost = entryHost.slice(1);
42327
+ }
42328
+ if (entryHost.charAt(0) === ".") {
42329
+ return hostname3.endsWith(entryHost);
42330
+ }
42331
+ return hostname3 === entryHost;
42332
+ });
42333
+ }
42334
+ var DEFAULT_PORTS2, parseNoProxyEntry = (entry) => {
42335
+ let entryHost = entry;
42336
+ let entryPort = 0;
42337
+ if (entryHost.charAt(0) === "[") {
42338
+ const bracketIndex = entryHost.indexOf("]");
42339
+ if (bracketIndex !== -1) {
42340
+ const host = entryHost.slice(1, bracketIndex);
42341
+ const rest = entryHost.slice(bracketIndex + 1);
42342
+ if (rest.charAt(0) === ":" && /^\d+$/.test(rest.slice(1))) {
42343
+ entryPort = Number.parseInt(rest.slice(1), 10);
42344
+ }
42345
+ return [host, entryPort];
42346
+ }
42347
+ }
42348
+ const firstColon = entryHost.indexOf(":");
42349
+ const lastColon = entryHost.lastIndexOf(":");
42350
+ if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
42351
+ entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
42352
+ entryHost = entryHost.slice(0, lastColon);
42353
+ }
42354
+ return [entryHost, entryPort];
42355
+ }, normalizeNoProxyHost = (hostname3) => {
42356
+ if (!hostname3) {
42357
+ return hostname3;
42358
+ }
42359
+ if (hostname3.charAt(0) === "[" && hostname3.charAt(hostname3.length - 1) === "]") {
42360
+ hostname3 = hostname3.slice(1, -1);
42361
+ }
42362
+ return hostname3.replace(/\.+$/, "");
42363
+ };
42364
+ var init_shouldBypassProxy = __esm(() => {
42365
+ DEFAULT_PORTS2 = {
42366
+ http: 80,
42367
+ https: 443,
42368
+ ws: 80,
42369
+ wss: 443,
42370
+ ftp: 21
42371
+ };
42372
+ });
42373
+
42374
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/speedometer.js
42036
42375
  function speedometer(samplesCount, min) {
42037
42376
  samplesCount = samplesCount || 10;
42038
42377
  const bytes = new Array(samplesCount);
@@ -42071,7 +42410,7 @@ var init_speedometer = __esm(() => {
42071
42410
  speedometer_default = speedometer;
42072
42411
  });
42073
42412
 
42074
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/throttle.js
42413
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/throttle.js
42075
42414
  function throttle(fn, freq) {
42076
42415
  let timestamp = 0;
42077
42416
  let threshold = 1000 / freq;
@@ -42109,7 +42448,7 @@ var init_throttle = __esm(() => {
42109
42448
  throttle_default = throttle;
42110
42449
  });
42111
42450
 
42112
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/progressEventReducer.js
42451
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/progressEventReducer.js
42113
42452
  var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
42114
42453
  let bytesNotified = 0;
42115
42454
  const _speedometer = speedometer_default(50, 250);
@@ -42150,7 +42489,7 @@ var init_progressEventReducer = __esm(() => {
42150
42489
  init_utils();
42151
42490
  });
42152
42491
 
42153
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
42492
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
42154
42493
  function estimateDataURLDecodedBytes(url2) {
42155
42494
  if (!url2 || typeof url2 !== "string")
42156
42495
  return 0;
@@ -42202,7 +42541,7 @@ function estimateDataURLDecodedBytes(url2) {
42202
42541
  return Buffer.byteLength(body, "utf8");
42203
42542
  }
42204
42543
 
42205
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/adapters/http.js
42544
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/http.js
42206
42545
  import http from "http";
42207
42546
  import https from "https";
42208
42547
  import http2 from "http2";
@@ -42293,7 +42632,9 @@ function setProxy(options, configProxy, location) {
42293
42632
  if (!proxy && proxy !== false) {
42294
42633
  const proxyUrl = getProxyForUrl(location);
42295
42634
  if (proxyUrl) {
42296
- proxy = new URL(proxyUrl);
42635
+ if (!shouldBypassProxy(location)) {
42636
+ proxy = new URL(proxyUrl);
42637
+ }
42297
42638
  }
42298
42639
  }
42299
42640
  if (proxy) {
@@ -42373,6 +42714,7 @@ var init_http = __esm(() => {
42373
42714
  init_readBlob();
42374
42715
  init_ZlibHeaderTransformStream();
42375
42716
  init_callbackify();
42717
+ init_shouldBypassProxy();
42376
42718
  init_progressEventReducer();
42377
42719
  import_follow_redirects = __toESM(require_follow_redirects(), 1);
42378
42720
  zlibOptions = {
@@ -42815,7 +43157,7 @@ var init_http = __esm(() => {
42815
43157
  };
42816
43158
  });
42817
43159
 
42818
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/isURLSameOrigin.js
43160
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isURLSameOrigin.js
42819
43161
  var isURLSameOrigin_default;
42820
43162
  var init_isURLSameOrigin = __esm(() => {
42821
43163
  init_platform();
@@ -42825,7 +43167,7 @@ var init_isURLSameOrigin = __esm(() => {
42825
43167
  })(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true;
42826
43168
  });
42827
43169
 
42828
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/cookies.js
43170
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/cookies.js
42829
43171
  var cookies_default;
42830
43172
  var init_cookies = __esm(() => {
42831
43173
  init_utils();
@@ -42870,7 +43212,7 @@ var init_cookies = __esm(() => {
42870
43212
  };
42871
43213
  });
42872
43214
 
42873
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/mergeConfig.js
43215
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/mergeConfig.js
42874
43216
  function mergeConfig2(config1, config2) {
42875
43217
  config2 = config2 || {};
42876
43218
  const config = {};
@@ -42956,7 +43298,7 @@ var init_mergeConfig = __esm(() => {
42956
43298
  init_AxiosHeaders();
42957
43299
  });
42958
43300
 
42959
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/resolveConfig.js
43301
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/resolveConfig.js
42960
43302
  var resolveConfig_default = (config) => {
42961
43303
  const newConfig = mergeConfig2({}, config);
42962
43304
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
@@ -43000,7 +43342,7 @@ var init_resolveConfig = __esm(() => {
43000
43342
  init_buildURL();
43001
43343
  });
43002
43344
 
43003
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/adapters/xhr.js
43345
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/xhr.js
43004
43346
  var isXHRAdapterSupported, xhr_default;
43005
43347
  var init_xhr = __esm(() => {
43006
43348
  init_utils();
@@ -43135,7 +43477,7 @@ var init_xhr = __esm(() => {
43135
43477
  };
43136
43478
  });
43137
43479
 
43138
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/composeSignals.js
43480
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/composeSignals.js
43139
43481
  var composeSignals = (signals, timeout) => {
43140
43482
  const { length } = signals = signals ? signals.filter(Boolean) : [];
43141
43483
  if (timeout || length) {
@@ -43176,7 +43518,7 @@ var init_composeSignals = __esm(() => {
43176
43518
  composeSignals_default = composeSignals;
43177
43519
  });
43178
43520
 
43179
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/trackStream.js
43521
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/trackStream.js
43180
43522
  var streamChunk = function* (chunk, chunkSize) {
43181
43523
  let len2 = chunk.byteLength;
43182
43524
  if (!chunkSize || len2 < chunkSize) {
@@ -43250,7 +43592,7 @@ var streamChunk = function* (chunk, chunkSize) {
43250
43592
  });
43251
43593
  };
43252
43594
 
43253
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/adapters/fetch.js
43595
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/fetch.js
43254
43596
  var DEFAULT_CHUNK_SIZE, isFunction2, globalFetchAPI, ReadableStream2, TextEncoder2, test = (fn, ...args) => {
43255
43597
  try {
43256
43598
  return !!fn(...args);
@@ -43450,7 +43792,7 @@ var init_fetch = __esm(() => {
43450
43792
  adapter = getFetch();
43451
43793
  });
43452
43794
 
43453
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/adapters/adapters.js
43795
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/adapters/adapters.js
43454
43796
  function getAdapter(adapters, config) {
43455
43797
  adapters = utils_default.isArray(adapters) ? adapters : [adapters];
43456
43798
  const { length } = adapters;
@@ -43509,7 +43851,7 @@ var init_adapters = __esm(() => {
43509
43851
  };
43510
43852
  });
43511
43853
 
43512
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/dispatchRequest.js
43854
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/dispatchRequest.js
43513
43855
  function throwIfCancellationRequested(config) {
43514
43856
  if (config.cancelToken) {
43515
43857
  config.cancelToken.throwIfRequested();
@@ -43550,7 +43892,7 @@ var init_dispatchRequest = __esm(() => {
43550
43892
  init_adapters();
43551
43893
  });
43552
43894
 
43553
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/validator.js
43895
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/validator.js
43554
43896
  function assertOptions(options, schema, allowUnknown) {
43555
43897
  if (typeof options !== "object") {
43556
43898
  throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
@@ -43610,7 +43952,7 @@ var init_validator2 = __esm(() => {
43610
43952
  };
43611
43953
  });
43612
43954
 
43613
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/core/Axios.js
43955
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/core/Axios.js
43614
43956
  class Axios {
43615
43957
  constructor(instanceConfig) {
43616
43958
  this.defaults = instanceConfig || {};
@@ -43626,13 +43968,27 @@ class Axios {
43626
43968
  if (err instanceof Error) {
43627
43969
  let dummy = {};
43628
43970
  Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error;
43629
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
43971
+ const stack = (() => {
43972
+ if (!dummy.stack) {
43973
+ return "";
43974
+ }
43975
+ const firstNewlineIndex = dummy.stack.indexOf(`
43976
+ `);
43977
+ return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
43978
+ })();
43630
43979
  try {
43631
43980
  if (!err.stack) {
43632
43981
  err.stack = stack;
43633
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
43634
- err.stack += `
43982
+ } else if (stack) {
43983
+ const firstNewlineIndex = stack.indexOf(`
43984
+ `);
43985
+ const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf(`
43986
+ `, firstNewlineIndex + 1);
43987
+ const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
43988
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
43989
+ err.stack += `
43635
43990
  ` + stack;
43991
+ }
43636
43992
  }
43637
43993
  } catch (e) {}
43638
43994
  }
@@ -43786,7 +44142,7 @@ var init_Axios = __esm(() => {
43786
44142
  Axios_default = Axios;
43787
44143
  });
43788
44144
 
43789
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/cancel/CancelToken.js
44145
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/cancel/CancelToken.js
43790
44146
  class CancelToken {
43791
44147
  constructor(executor) {
43792
44148
  if (typeof executor !== "function") {
@@ -43876,14 +44232,14 @@ var init_CancelToken = __esm(() => {
43876
44232
  CancelToken_default = CancelToken;
43877
44233
  });
43878
44234
 
43879
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/spread.js
44235
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/spread.js
43880
44236
  function spread(callback) {
43881
44237
  return function wrap(arr) {
43882
44238
  return callback.apply(null, arr);
43883
44239
  };
43884
44240
  }
43885
44241
 
43886
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/isAxiosError.js
44242
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/isAxiosError.js
43887
44243
  function isAxiosError(payload) {
43888
44244
  return utils_default.isObject(payload) && payload.isAxiosError === true;
43889
44245
  }
@@ -43891,7 +44247,7 @@ var init_isAxiosError = __esm(() => {
43891
44247
  init_utils();
43892
44248
  });
43893
44249
 
43894
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/helpers/HttpStatusCode.js
44250
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/helpers/HttpStatusCode.js
43895
44251
  var HttpStatusCode, HttpStatusCode_default;
43896
44252
  var init_HttpStatusCode = __esm(() => {
43897
44253
  HttpStatusCode = {
@@ -43971,7 +44327,7 @@ var init_HttpStatusCode = __esm(() => {
43971
44327
  HttpStatusCode_default = HttpStatusCode;
43972
44328
  });
43973
44329
 
43974
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/lib/axios.js
44330
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/lib/axios.js
43975
44331
  function createInstance(defaultConfig) {
43976
44332
  const context = new Axios_default(defaultConfig);
43977
44333
  const instance = bind(Axios_default.prototype.request, context);
@@ -44020,12 +44376,12 @@ var init_axios = __esm(() => {
44020
44376
  axios_default = axios;
44021
44377
  });
44022
44378
 
44023
- // ../../node_modules/.pnpm/axios@1.14.0/node_modules/axios/index.js
44379
+ // ../../node_modules/.pnpm/axios@1.15.0/node_modules/axios/index.js
44024
44380
  var init_axios2 = __esm(() => {
44025
44381
  init_axios();
44026
44382
  });
44027
44383
 
44028
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/engines/ocr/http-simple.js
44384
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/engines/ocr/http-simple.js
44029
44385
  import fs3 from "fs";
44030
44386
 
44031
44387
  class HttpOcrEngine {
@@ -44083,7 +44439,7 @@ var init_http_simple = __esm(() => {
44083
44439
  import_form_data2 = __toESM(require_form_data(), 1);
44084
44440
  });
44085
44441
 
44086
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/textUtils.js
44442
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/textUtils.js
44087
44443
  function cleanOcrTableArtifacts(text) {
44088
44444
  const borderArtifacts = /^[|[\](){}]+|[|[\](){}]+$/g;
44089
44445
  const cleaned = text.trim();
@@ -44203,7 +44559,7 @@ function strToPostScript(str) {
44203
44559
  return postStr;
44204
44560
  }
44205
44561
 
44206
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/ocrUtils.js
44562
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/ocrUtils.js
44207
44563
  function parseImageOcrBlocks(image) {
44208
44564
  if (!image || !image.ocrRaw?.length) {
44209
44565
  return [];
@@ -44235,7 +44591,7 @@ function parseImageOcrBlocks(image) {
44235
44591
  return blocks;
44236
44592
  }
44237
44593
 
44238
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/bbox.js
44594
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/bbox.js
44239
44595
  function filterImagesForOCR(images, page) {
44240
44596
  let filtered = images.filter((image) => !image.type?.startsWith("g_") && !image.type?.startsWith("pattern_"));
44241
44597
  if (filtered.length > MAX_IMAGES_PER_PAGE) {
@@ -44416,7 +44772,7 @@ function buildBoundingBoxes(textItems) {
44416
44772
  var OCR_CONFIDENCE_THRESHOLD = 0.1, OCR_OVERLAP_THRESHOLD = 0.5, MAX_IMAGES_PER_PAGE = 10, MIN_IMAGE_DIMENSION = 12, MIN_IMAGE_AREA = 200, MIN_RENDERED_DIMENSION = 6, MIN_RENDERED_AREA = 200;
44417
44773
  var init_bbox = () => {};
44418
44774
 
44419
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/cleanText.js
44775
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/cleanText.js
44420
44776
  function detectAndRemoveMarginOnPage(page) {
44421
44777
  const lines = page.text.split(`
44422
44778
  `);
@@ -44465,7 +44821,7 @@ function cleanRawText(pages, _config) {
44465
44821
  }
44466
44822
  }
44467
44823
 
44468
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/markupUtils.js
44824
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/markupUtils.js
44469
44825
  function applyMarkupTags(markup, text) {
44470
44826
  let result = text;
44471
44827
  if (markup.strikeout) {
@@ -44483,10 +44839,22 @@ function applyMarkupTags(markup, text) {
44483
44839
  return result;
44484
44840
  }
44485
44841
 
44486
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/gridProjection.js
44842
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/gridProjection.js
44487
44843
  function roundAnchor(anchor) {
44488
44844
  return Math.round(anchor * 4) / 4;
44489
44845
  }
44846
+ function getRepresentativeLineMetrics(line, globalMedianHeight) {
44847
+ const minRepresentativeHeight = globalMedianHeight * 0.5;
44848
+ const representativeItems = line.filter((bbox) => bbox.h >= minRepresentativeHeight);
44849
+ const items = representativeItems.length > 0 ? representativeItems : line;
44850
+ const top = Math.min(...items.map((bbox) => bbox.y));
44851
+ const bottom = Math.max(...items.map((bbox) => bbox.y + bbox.h));
44852
+ return {
44853
+ top,
44854
+ bottom,
44855
+ height: bottom - top
44856
+ };
44857
+ }
44490
44858
  function isSmallTextLine(line) {
44491
44859
  const smallText = line.filter((item) => item.h < SMALL_FONT_SIZE_THRESHOLD);
44492
44860
  if (smallText.length / line.length > 0.5) {
@@ -45003,8 +45371,9 @@ function bboxToLine(textBbox, medianWidth, medianHeight, pageWidth) {
45003
45371
  }
45004
45372
  function canMerge(previousBbox2, bbox) {
45005
45373
  if (bbox.y == previousBbox2.y && bbox.h == previousBbox2.h) {
45006
- const xDelta = bbox.x - previousBbox2.x - previousBbox2.w;
45007
- if ((xDelta < 0 && xDelta > -0.5 || xDelta >= 0 && xDelta < 0.1) && canMergeMarkup(previousBbox2, bbox)) {
45374
+ const prevRawWidth = previousBbox2.pageBbox?.w ?? previousBbox2.w;
45375
+ const xDelta = bbox.x - previousBbox2.x - prevRawWidth;
45376
+ if ((xDelta < 0 && xDelta > -1 || xDelta >= 0 && xDelta < 0.1) && canMergeMarkup(previousBbox2, bbox)) {
45008
45377
  return true;
45009
45378
  }
45010
45379
  }
@@ -45146,9 +45515,12 @@ function bboxToLine(textBbox, medianWidth, medianHeight, pageWidth) {
45146
45515
  }
45147
45516
  }
45148
45517
  for (let i2 = 1;i2 < lines.length; i2++) {
45149
- const yDelta = lines[i2][0].y - lines[i2 - 1][0].y - lines[i2 - 1][0].h;
45150
- if (yDelta > medianHeight) {
45151
- const numBlankLines = Math.round(yDelta / medianHeight) - 1;
45518
+ const previousLineMetrics = getRepresentativeLineMetrics(lines[i2 - 1], medianHeight);
45519
+ const currentLineMetrics = getRepresentativeLineMetrics(lines[i2], medianHeight);
45520
+ const yDelta = currentLineMetrics.top - previousLineMetrics.bottom;
45521
+ const referenceHeight = Math.max(medianHeight, Math.min(previousLineMetrics.height, currentLineMetrics.height));
45522
+ if (yDelta > referenceHeight) {
45523
+ const numBlankLines = Math.round(yDelta / referenceHeight) - 1;
45152
45524
  const linesToInsert = Math.min(Math.max(numBlankLines, 1), 10);
45153
45525
  const blankLines = Array(linesToInsert).fill([]);
45154
45526
  lines.splice(i2, 0, ...blankLines);
@@ -45784,7 +46156,7 @@ var init_gridProjection = __esm(() => {
45784
46156
  init_bbox();
45785
46157
  });
45786
46158
 
45787
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/grid.js
46159
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/grid.js
45788
46160
  function projectPagesToGrid2(pages, config) {
45789
46161
  const fullConfig = {
45790
46162
  ...DEFAULT_CONFIG,
@@ -45797,7 +46169,7 @@ var init_grid = __esm(() => {
45797
46169
  init_config();
45798
46170
  });
45799
46171
 
45800
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/output/json.js
46172
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/output/json.js
45801
46173
  function buildJSON(pages) {
45802
46174
  return {
45803
46175
  pages: pages.map((page) => ({
@@ -49855,7 +50227,7 @@ var init_file_type = __esm(() => {
49855
50227
  };
49856
50228
  });
49857
50229
 
49858
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/conversion/convertToPdf.js
50230
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/conversion/convertToPdf.js
49859
50231
  import { promises as fs5, constants as fsConstants } from "fs";
49860
50232
  import { spawn as spawn2 } from "child_process";
49861
50233
  import path2 from "path";
@@ -50172,7 +50544,7 @@ var init_convertToPdf = __esm(() => {
50172
50544
  ghostscriptRequiredExtensions = [".svg", ".eps", ".ps", ".ai"];
50173
50545
  });
50174
50546
 
50175
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/core/parser.js
50547
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/core/parser.js
50176
50548
  class LiteParse {
50177
50549
  config;
50178
50550
  pdfEngine;
@@ -50236,7 +50608,7 @@ class LiteParse {
50236
50608
  }
50237
50609
  log(`Loaded PDF with ${doc.numPages} pages`);
50238
50610
  try {
50239
- const pages = await this.pdfEngine.extractAllPages(doc, this.config.maxPages, this.config.targetPages);
50611
+ const pages = await this.pdfEngine.extractAllPages(doc, this.config.maxPages, this.config.targetPages, { extractImages: this.config.ocrEnabled });
50240
50612
  if (this.ocrEngine) {
50241
50613
  await this.runOCR(doc, pages, log);
50242
50614
  }
@@ -50331,7 +50703,7 @@ class LiteParse {
50331
50703
  }
50332
50704
  log(`Rendering page ${pageNum}...`);
50333
50705
  const imageBuffer = await renderer.renderPageToBuffer(pdfInput, pageNum, this.config.dpi);
50334
- const pageData = await this.pdfEngine.extractPage(doc, pageNum);
50706
+ const pageData = await this.pdfEngine.extractPage(doc, pageNum, { extractImages: false });
50335
50707
  results.push({
50336
50708
  pageNum,
50337
50709
  width: pageData.width,
@@ -50453,7 +50825,7 @@ var init_parser = __esm(async () => {
50453
50825
  await init_pdfjs();
50454
50826
  });
50455
50827
 
50456
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/processing/searchItems.js
50828
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/processing/searchItems.js
50457
50829
  function searchItems(items, options) {
50458
50830
  const results = [];
50459
50831
  const caseSensitive = options.caseSensitive ?? false;
@@ -50515,7 +50887,7 @@ function searchItems(items, options) {
50515
50887
  return results;
50516
50888
  }
50517
50889
 
50518
- // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.2/node_modules/@llamaindex/liteparse/dist/src/lib.js
50890
+ // ../../node_modules/.pnpm/@llamaindex+liteparse@1.4.6/node_modules/@llamaindex/liteparse/dist/src/lib.js
50519
50891
  var exports_lib3 = {};
50520
50892
  __export(exports_lib3, {
50521
50893
  searchItems: () => searchItems,
@@ -56520,11 +56892,39 @@ class CrashLoopTracker {
56520
56892
  const windowStart = now - CRASH_LOOP_WINDOW_MS;
56521
56893
  const raw = this.history.get(key) ?? [];
56522
56894
  const recent = raw.filter((ts2) => ts2 >= windowStart);
56895
+ const restartCount = recent.length;
56896
+ if (restartCount >= CRASH_LOOP_MAX_RESTARTS) {
56897
+ return {
56898
+ allowed: false,
56899
+ restartCount: restartCount + 1,
56900
+ windowMs: CRASH_LOOP_WINDOW_MS
56901
+ };
56902
+ }
56903
+ const nextAttemptNumber = restartCount + 1;
56904
+ const backoffIndex = Math.min(nextAttemptNumber - 1, BACKOFF_INTERVALS.length - 1);
56905
+ const expectedInterval = BACKOFF_INTERVALS[backoffIndex];
56906
+ const lastRestart = recent[recent.length - 1];
56907
+ if (lastRestart !== undefined && expectedInterval > 0) {
56908
+ const timeSinceLastRestart = now - lastRestart;
56909
+ if (timeSinceLastRestart < expectedInterval) {
56910
+ const nextAllowedAt = lastRestart + expectedInterval;
56911
+ const waitMs = nextAllowedAt - now;
56912
+ return {
56913
+ allowed: false,
56914
+ restartCount: restartCount + 1,
56915
+ windowMs: CRASH_LOOP_WINDOW_MS,
56916
+ nextAllowedAt,
56917
+ waitMs
56918
+ };
56919
+ }
56920
+ }
56523
56921
  recent.push(now);
56524
56922
  this.history.set(key, recent);
56525
- const restartCount = recent.length;
56526
- const allowed = restartCount <= CRASH_LOOP_MAX_RESTARTS;
56527
- return { allowed, restartCount, windowMs: CRASH_LOOP_WINDOW_MS };
56923
+ return {
56924
+ allowed: true,
56925
+ restartCount: restartCount + 1,
56926
+ windowMs: CRASH_LOOP_WINDOW_MS
56927
+ };
56528
56928
  }
56529
56929
  clear(chatroomId, role) {
56530
56930
  const key = `${chatroomId}:${role.toLowerCase()}`;
@@ -56537,9 +56937,14 @@ class CrashLoopTracker {
56537
56937
  return raw.filter((ts2) => ts2 >= windowStart).length;
56538
56938
  }
56539
56939
  }
56540
- var CRASH_LOOP_MAX_RESTARTS = 3, CRASH_LOOP_WINDOW_MS;
56940
+ var CRASH_LOOP_MAX_RESTARTS = 10, CRASH_LOOP_WINDOW_MS, BACKOFF_INTERVALS;
56541
56941
  var init_crash_loop_tracker = __esm(() => {
56542
- CRASH_LOOP_WINDOW_MS = 5 * 60 * 1000;
56942
+ CRASH_LOOP_WINDOW_MS = 10 * 60 * 1000;
56943
+ BACKOFF_INTERVALS = [
56944
+ 0,
56945
+ 30000,
56946
+ 60000
56947
+ ];
56543
56948
  });
56544
56949
 
56545
56950
  // src/infrastructure/machine/stop-reason.ts
@@ -56787,6 +57192,12 @@ class AgentProcessManager {
56787
57192
  if (opts.reason === "platform.crash_recovery") {
56788
57193
  const loopCheck = this.deps.crashLoop.record(opts.chatroomId, opts.role);
56789
57194
  if (!loopCheck.allowed) {
57195
+ if (loopCheck.waitMs !== undefined && loopCheck.waitMs > 0) {
57196
+ console.log(` ⏳ Agent restart backoff: waiting ${loopCheck.waitMs}ms before retry`);
57197
+ slot.state = "idle";
57198
+ slot.pendingOperation = undefined;
57199
+ return { success: false, error: "backoff" };
57200
+ }
56790
57201
  this.deps.backend.mutation(api.machines.emitRestartLimitReached, {
56791
57202
  sessionId: this.deps.sessionId,
56792
57203
  machineId: this.deps.machineId,