@kaoruisaac/pedelec 0.1.19 → 0.1.20

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/README.md CHANGED
@@ -135,7 +135,7 @@ const path = await session.uploadAsset(file);
135
135
  const assets = await session.listAssets();
136
136
  ```
137
137
 
138
- `assets/` is shared by uploads and files written by the agent. `listAssets()` lists only its first level, ordered by filesystem modification time (newest first), and may run while the agent runs. One session can only upload one file at a time, but uploads can run alongside prepare or agent execution.
138
+ `assets/` is shared by uploads and files written by the agent. `listAssets()` recursively lists regular files at every level as a flat array, ordered by filesystem modification time (newest first) and then by name; nested paths such as `/results/report.json` are returned in full. Directory entries and symlinks are excluded, as are `.pedelec-*` entries at every level; other dotfiles are included. It may run while the agent runs. One session can only upload one file at a time, but uploads can run alongside prepare or agent execution.
139
139
 
140
140
  ```ts
141
141
  const text = await session.readAsset("/report.txt", "text");
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ function normalizeListAssetsResponse(response) {
12
12
  return invalidListAssetsResponse({ index, asset });
13
13
  const { name, path, sizeBytes, modifiedAt } = asset;
14
14
  const validName = typeof name === "string" && name.length > 0 && name !== "." && name !== ".." && !name.includes("/") && !name.includes("\\");
15
- const validPath = typeof path === "string" && path === `/${name}` && isValidAssetPath(path);
15
+ const validPath = typeof path === "string" && isValidAssetPath(path) && path.slice(path.lastIndexOf("/") + 1) === name;
16
16
  const validNumber = (value) => typeof value === "number" && Number.isFinite(value) && Number.isInteger(value) && value >= 0;
17
17
  if (!validName || !validPath || !validNumber(sizeBytes) || !validNumber(modifiedAt)) {
18
18
  return invalidListAssetsResponse({ index, asset });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaoruisaac/pedelec",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",