typebulb 0.58.1 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/render.js CHANGED
@@ -799,6 +799,17 @@ ${B1}
799
799
  });
800
800
  await failIfNotOk(resp, 'write', path);
801
801
  return true;
802
+ },
803
+ // Immediate children of a folder (default: the bulb's own), as { name, dir, mtime }[].
804
+ list: async (path = '.') => {
805
+ if (isFramed) throw inlineErr('tb.fs');
806
+ const resp = await fetch('/__fs/list', {
807
+ method: 'POST',
808
+ headers: { 'Content-Type': 'application/json' },
809
+ body: JSON.stringify({ path })
810
+ });
811
+ await failIfNotOk(resp, 'list', path);
812
+ return resp.json();
802
813
  }
803
814
  };
804
815
 
@@ -916,8 +927,8 @@ ${B1}
916
927
  if (inferRunning) return Promise.reject(new Error('Inference already in progress'));
917
928
  inferRunning = true;
918
929
  // Data to preview: the explicit arg, else undefined \u2014 the modal then seeds from the SOURCE
919
- // chunks (/__infer-info), the local Data tab, exactly as .com's IDE modal reseeds from the
920
- // Data tab rather than post-run runtime state.
930
+ // chunks the page currently holds, else the SOURCE chunks from /__infer-info \u2014 the same
931
+ // precedence .com's modal seeds by (TB-Inference.md, "Data seed").
921
932
  let data = opts.data;
922
933
  if (data !== undefined && !Array.isArray(data)) data = [data];
923
934
  return new Promise((resolve, reject) => {