Path set difference
path-set-difference · version 1.0.0 · File paths (lexical) · free, no key needed
Compute the set difference (A \ B) of two path collections using lexical path equivalence.
Use when you need to: path set difference · set subtraction paths · diff path sets.
Supported
- path set difference
- set subtraction paths
- diff path sets
Not supported
- stat file
- filesystem access
Behavior
- Returns paths in a that are not in b, using normalized lexical equivalence. Preserves input order from a. Output paths are original (un-normalized) strings from a.
Input
a(array of string, required): max items 10000b(array of string, required): max items 10000format(one of "posix", "windows", "auto", optional)case_sensitive(boolean, optional)normalize(boolean, optional)
Output
difference(array of string, optional)count(integer, optional)format(string, optional)
Limits
- max paths: 10000
- max path bytes: 4096
Example
Request input:
{
"a": [
"a/b.ts",
"a/c.ts",
"d/e.ts"
],
"b": [
"a/c.ts",
"d/e.ts"
]
}
Response:
{
"result": {
"difference": [
"a/b.ts"
],
"count": 1,
"format": "posix"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "path-set-difference",
"version": "1.0.0",
"input": {
"a": [
"a/b.ts",
"a/c.ts",
"d/e.ts"
],
"b": [
"a/c.ts",
"d/e.ts"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/path-set-difference/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"a":["a/b.ts","a/c.ts","d/e.ts"],"b":["a/c.ts","d/e.ts"]}'
The machine-readable contract is at /v1/tools/path-set-difference/versions/1.0.0.
CLI
node cli.mjs run path-set-difference 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Path set intersection: Compute the set intersection of multiple path collections using lexical path equivalence.
- Path set union: Compute the set union of multiple path collections, normalized and deterministically sorted.
- Path set classify: Classify an array of file paths by file extension, depth histogram, and path format.
- Path set dedupe: Deduplicate an array of paths based on lexical equivalence while preserving first or last seen order.
- Path set glob filter: Filter an array of paths against glob patterns with inclusion and exclusion rules lexically without filesystem access.
- Path set hierarchy tree: Transform a flat array of file paths into a nested deterministic directory tree structure.