@woladi/sortai 0.1.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/walker.js ADDED
@@ -0,0 +1,34 @@
1
+ import { promises as fs } from 'node:fs';
2
+ import path from 'node:path';
3
+ export async function walkFiles(root, cfg) {
4
+ const excluded = new Set(cfg.scan.excludeFolders);
5
+ const out = [];
6
+ async function walk(dir) {
7
+ let entries;
8
+ try {
9
+ entries = await fs.readdir(dir, { withFileTypes: true });
10
+ }
11
+ catch {
12
+ return;
13
+ }
14
+ for (const entry of entries) {
15
+ if (entry.name.startsWith('.'))
16
+ continue;
17
+ const full = path.join(dir, entry.name);
18
+ if (entry.isDirectory()) {
19
+ if (excluded.has(entry.name))
20
+ continue;
21
+ await walk(full);
22
+ }
23
+ else if (entry.isFile()) {
24
+ out.push(full);
25
+ }
26
+ }
27
+ }
28
+ await walk(root);
29
+ return out.sort();
30
+ }
31
+ export function isExcludedPath(p, cfg) {
32
+ const excluded = new Set(cfg.scan.excludeFolders);
33
+ return p.split(path.sep).some(part => excluded.has(part));
34
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@woladi/sortai",
3
+ "version": "0.1.0",
4
+ "description": "macOS CLI that walks a folder, OCRs files with Apple Vision, and writes inferred Finder tags + comments via local Ollama or a cloud LLM",
5
+ "type": "module",
6
+ "main": "./dist/cli.js",
7
+ "bin": {
8
+ "sortai": "dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "start": "node dist/cli.js",
18
+ "typecheck": "tsc --noEmit",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "keywords": [
22
+ "macos",
23
+ "ocr",
24
+ "apple-vision",
25
+ "ollama",
26
+ "tagging",
27
+ "finder-tags",
28
+ "automation",
29
+ "cli",
30
+ "ai"
31
+ ],
32
+ "author": "Adrian Wołczuk",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/woladi/sortai.git"
37
+ },
38
+ "homepage": "https://github.com/woladi/sortai#readme",
39
+ "bugs": {
40
+ "url": "https://github.com/woladi/sortai/issues"
41
+ },
42
+ "dependencies": {
43
+ "@anthropic-ai/sdk": "^0.30.1",
44
+ "@modelcontextprotocol/sdk": "^1.0.4",
45
+ "chalk": "^5.3.0",
46
+ "commander": "^12.1.0",
47
+ "macos-vision": "^1.4.0",
48
+ "ora": "^8.1.1",
49
+ "zod": "^3.23.8"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^20.19.39",
53
+ "typescript": "^5.4.5"
54
+ },
55
+ "engines": {
56
+ "node": ">=20.0.0"
57
+ },
58
+ "os": [
59
+ "darwin"
60
+ ]
61
+ }