spawnfile 0.1.5 → 0.1.6

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.
@@ -1,6 +1,5 @@
1
1
  import path from "node:path";
2
2
  import { SpawnfileError } from "../shared/index.js";
3
- const INVALID_PATH_SEGMENT = "..";
4
3
  export const assertPortableRelativePath = (inputPath) => {
5
4
  if (inputPath.includes("\\")) {
6
5
  throw new SpawnfileError("validation_error", `Paths must use forward slashes: ${inputPath}`);
@@ -8,10 +7,6 @@ export const assertPortableRelativePath = (inputPath) => {
8
7
  if (path.isAbsolute(inputPath)) {
9
8
  throw new SpawnfileError("validation_error", `Absolute paths are not allowed: ${inputPath}`);
10
9
  }
11
- const segments = inputPath.split("/");
12
- if (segments.includes(INVALID_PATH_SEGMENT)) {
13
- throw new SpawnfileError("validation_error", `Path traversal is not allowed: ${inputPath}`);
14
- }
15
10
  };
16
11
  export const getCanonicalManifestPath = (filePath) => path.resolve(filePath);
17
12
  export const getManifestPath = (inputPath) => path.basename(inputPath) === "Spawnfile"
@@ -21,10 +16,6 @@ export const getProjectRoot = (manifestPath) => path.dirname(manifestPath);
21
16
  export const resolveProjectPath = (manifestPath, relativePath) => {
22
17
  assertPortableRelativePath(relativePath);
23
18
  const projectRoot = getProjectRoot(manifestPath);
24
- const resolved = path.resolve(projectRoot, relativePath);
25
- if (!resolved.startsWith(projectRoot + path.sep) && resolved !== projectRoot) {
26
- throw new SpawnfileError("validation_error", `Path escapes project root: ${relativePath}`);
27
- }
28
- return resolved;
19
+ return path.resolve(projectRoot, relativePath);
29
20
  };
30
21
  export const toPosixPath = (value) => value.split(path.sep).join("/");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawnfile",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Canonical source compiler for autonomous agents and teams.",
5
5
  "license": "MIT",
6
6
  "type": "module",