deepagents 1.15.0 → 1.15.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.
@@ -8809,6 +8809,15 @@ var ContextHubBackend = class ContextHubBackend {
8809
8809
  static stripPrefix(path) {
8810
8810
  return path.replace(/^\/+/, "");
8811
8811
  }
8812
+ /**
8813
+ * `filePath` relative to the glob root `root`, or `null` when it is outside
8814
+ * it. An exact file root yields the file's basename.
8815
+ */
8816
+ static relativeToRoot(filePath, root) {
8817
+ if (!root) return filePath;
8818
+ if (filePath === root) return filePath.slice(filePath.lastIndexOf("/") + 1);
8819
+ return filePath.startsWith(`${root}/`) ? filePath.slice(root.length + 1) : null;
8820
+ }
8812
8821
  static toHubUnavailableError(error) {
8813
8822
  return `Hub unavailable: ${getErrorMessage(error)}`;
8814
8823
  }
@@ -9254,7 +9263,8 @@ var ContextHubBackend = class ContextHubBackend {
9254
9263
  maxCount
9255
9264
  });
9256
9265
  }
9257
- async glob(pattern, _path = "/") {
9266
+ async glob(pattern, path = "/") {
9267
+ const root = trimTrailingSlashes(ContextHubBackend.stripPrefix(path));
9258
9268
  let cache;
9259
9269
  try {
9260
9270
  cache = await this.ensureCache();
@@ -9262,11 +9272,15 @@ var ContextHubBackend = class ContextHubBackend {
9262
9272
  if (isLangSmithError(error)) return { error: ContextHubBackend.toHubUnavailableError(error) };
9263
9273
  throw error;
9264
9274
  }
9275
+ const isMatch = (candidate) => micromatch.default.isMatch(`/${candidate}`, pattern, FNMATCH_OPTIONS) || micromatch.default.isMatch(candidate, pattern, FNMATCH_OPTIONS);
9265
9276
  const files = [];
9266
- for (const filePath of Object.keys(cache)) if (micromatch.default.isMatch(`/${filePath}`, pattern, FNMATCH_OPTIONS) || micromatch.default.isMatch(filePath, pattern, FNMATCH_OPTIONS)) files.push({
9267
- path: `/${filePath}`,
9268
- is_dir: false
9269
- });
9277
+ for (const filePath of Object.keys(cache)) {
9278
+ const relative = ContextHubBackend.relativeToRoot(filePath, root);
9279
+ if (relative !== null && (isMatch(relative) || isMatch(filePath))) files.push({
9280
+ path: `/${filePath}`,
9281
+ is_dir: false
9282
+ });
9283
+ }
9270
9284
  return { files };
9271
9285
  }
9272
9286
  async write(filePath, content) {
@@ -10472,4 +10486,4 @@ Object.defineProperty(exports, "skillsMetadataValue", {
10472
10486
  }
10473
10487
  });
10474
10488
 
10475
- //# sourceMappingURL=langsmith-DMOexB11.cjs.map
10489
+ //# sourceMappingURL=langsmith-IOLMJEwi.cjs.map