Path set dedupe
path-set-dedupe · version 1.0.0 · File paths (lexical) · free, no key needed
Deduplicate an array of paths based on lexical equivalence while preserving first or last seen order.
Use when you need to: deduplicate paths · path dedup · remove duplicate paths.
Supported
- deduplicate paths
- path dedup
- remove duplicate paths
Not supported
- stat file
- filesystem access
Behavior
- Remove duplicate paths using normalized lexical equivalence. keep:"first" keeps first occurrence; keep:"last" keeps last. Output preserves original strings.
Input
paths(array of string, required): max items 10000format(one of "posix", "windows", "auto", optional)case_sensitive(boolean, optional)normalize(boolean, optional)keep(one of "first", "last", optional)
Output
deduped(array of string, optional)removed(integer, optional)format(string, optional)
Limits
- max paths: 10000
- max path bytes: 4096
Example
Request input:
{
"paths": [
"a/b.ts",
"a/b.ts",
"c.ts"
]
}
Response:
{
"result": {
"deduped": [
"a/b.ts",
"c.ts"
],
"removed": 1,
"format": "posix"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "path-set-dedupe",
"version": "1.0.0",
"input": {
"paths": [
"a/b.ts",
"a/b.ts",
"c.ts"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/path-set-dedupe/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"paths":["a/b.ts","a/b.ts","c.ts"]}'
The machine-readable contract is at /v1/tools/path-set-dedupe/versions/1.0.0.
CLI
node cli.mjs run path-set-dedupe 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Path set prefix strip: Strip a common directory prefix or base path from an array of paths lexically.
- Path set classify: Classify an array of file paths by file extension, depth histogram, and path format.
- Path set difference: Compute the set difference (A \ B) of two path collections using lexical path equivalence.
- 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.
- Path set ignore filter: Filter paths against gitignore-style rule lines (negation, comments, directory trailing slashes) lexically.