remote-codex 0.11.16 → 0.11.18

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.
@@ -24143,6 +24143,8 @@ var PREVIEW_DEFAULT_LIMIT_BYTES = 5e4;
24143
24143
  var WORKSPACE_UPLOAD_MAX_BYTES = 50 * 1024 * 1024;
24144
24144
  var WORKSPACE_FOLDER_DOWNLOAD_MAX_BYTES = 100 * 1024 * 1024;
24145
24145
  var WORKSPACE_FOLDER_DOWNLOAD_MAX_FILES = 300;
24146
+ var WORKSPACE_TREE_DIRECTORY_ENTRY_LIMIT = 400;
24147
+ var WORKSPACE_TREE_DIRECTORY_SCAN_LIMIT = 2e3;
24146
24148
  var WORKSPACE_TREE_IGNORED_NAMES = /* @__PURE__ */ new Set([
24147
24149
  ".git",
24148
24150
  "node_modules",
@@ -24226,7 +24228,7 @@ async function resolveWorkspaceItemPath(rootPath, relativePath = "") {
24226
24228
  const comparable = await assertPathWithinRoot(rootPath, candidate);
24227
24229
  return comparable;
24228
24230
  }
24229
- async function buildWorkspaceTreeNode(rootPath, absPath, depth = 0) {
24231
+ async function buildWorkspaceTreeNode(rootPath, absPath) {
24230
24232
  const stats = await fs18.stat(absPath);
24231
24233
  const relativePath = relativeWorkspacePath(rootPath, absPath);
24232
24234
  const name = relativePath ? path19.basename(absPath) : path19.basename(rootPath);
@@ -24242,18 +24244,36 @@ async function buildWorkspaceTreeNode(rootPath, absPath, depth = 0) {
24242
24244
  name,
24243
24245
  path: relativePath,
24244
24246
  kind: "directory",
24247
+ childrenLoaded: true,
24245
24248
  children: []
24246
24249
  };
24247
- if (depth >= 6) {
24248
- return node;
24249
- }
24250
- let entries;
24250
+ const visible = [];
24251
24251
  try {
24252
- entries = await fs18.readdir(absPath, { withFileTypes: true });
24252
+ const directory = await fs18.opendir(absPath);
24253
+ let scanned = 0;
24254
+ for await (const entry of directory) {
24255
+ scanned += 1;
24256
+ if (scanned > WORKSPACE_TREE_DIRECTORY_SCAN_LIMIT) {
24257
+ node.truncated = true;
24258
+ break;
24259
+ }
24260
+ if (entry.name.startsWith(".") || WORKSPACE_TREE_IGNORED_NAMES.has(entry.name)) {
24261
+ continue;
24262
+ }
24263
+ if (!entry.isDirectory() && !entry.isFile()) {
24264
+ continue;
24265
+ }
24266
+ if (visible.length >= WORKSPACE_TREE_DIRECTORY_ENTRY_LIMIT) {
24267
+ node.truncated = true;
24268
+ break;
24269
+ }
24270
+ visible.push(entry);
24271
+ }
24253
24272
  } catch {
24254
24273
  return node;
24255
24274
  }
24256
- const visible = entries.filter((entry) => !entry.name.startsWith(".")).filter((entry) => !WORKSPACE_TREE_IGNORED_NAMES.has(entry.name)).sort((left, right) => {
24275
+ node.hasChildren = visible.length > 0;
24276
+ visible.sort((left, right) => {
24257
24277
  if (left.isDirectory() && !right.isDirectory()) {
24258
24278
  return -1;
24259
24279
  }
@@ -24261,15 +24281,28 @@ async function buildWorkspaceTreeNode(rootPath, absPath, depth = 0) {
24261
24281
  return 1;
24262
24282
  }
24263
24283
  return left.name.localeCompare(right.name);
24264
- }).slice(0, 400);
24284
+ });
24265
24285
  node.children = (await Promise.all(
24266
24286
  visible.map(async (entry) => {
24267
24287
  const childPath = path19.join(absPath, entry.name);
24268
24288
  try {
24269
- if (!entry.isDirectory() && !entry.isFile()) {
24270
- return null;
24289
+ const childRelativePath = relativeWorkspacePath(rootPath, childPath);
24290
+ if (entry.isDirectory()) {
24291
+ return {
24292
+ name: entry.name,
24293
+ path: childRelativePath,
24294
+ kind: "directory",
24295
+ hasChildren: true,
24296
+ childrenLoaded: false
24297
+ };
24271
24298
  }
24272
- return await buildWorkspaceTreeNode(rootPath, childPath, depth + 1);
24299
+ const childStats = await fs18.stat(childPath);
24300
+ return {
24301
+ name: entry.name,
24302
+ path: childRelativePath,
24303
+ kind: "file",
24304
+ size: childStats.size
24305
+ };
24273
24306
  } catch {
24274
24307
  return null;
24275
24308
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildApp
3
- } from "./chunk-ZYCD54EZ.js";
3
+ } from "./chunk-TGPTF6DT.js";
4
4
 
5
5
  // src/index.ts
6
6
  import fs from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildApp
3
- } from "./chunk-ZYCD54EZ.js";
3
+ } from "./chunk-TGPTF6DT.js";
4
4
 
5
5
  // src/worker-index.ts
6
6
  import fs2 from "fs";