tourdiff 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/LICENSE +21 -0
- package/README.md +64 -0
- package/package.json +75 -0
- package/scripts/cli.cjs +43 -0
- package/scripts/resolveBinary.cjs +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Almas Akchabayev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# tour
|
|
2
|
+
|
|
3
|
+
Local code review tool with AI annotations: a TUI and a webapp over a pinned git diff. Agents author annotations through a CLI; humans read them.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i -g tourdiff
|
|
9
|
+
# or
|
|
10
|
+
bun add -g tourdiff
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Verify:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
tour --version
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
cd your-repo
|
|
23
|
+
tour create --head HEAD # tour the latest commit
|
|
24
|
+
tour # open the TUI
|
|
25
|
+
tour serve --open # or open the webapp at http://127.0.0.1:7777
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Tours live in `.tour/<id>/` (auto-gitignored on first create). Each holds a `tour.toml` and an append-only `annotations.jsonl`.
|
|
29
|
+
|
|
30
|
+
## For agents
|
|
31
|
+
|
|
32
|
+
No global install needed in foreign repos:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
bunx tourdiff create --head HEAD --json
|
|
36
|
+
bunx tourdiff annotate <id> --file src/foo.ts --side additions --line 12 --body "..."
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or via npm:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npx -y tourdiff create --head HEAD --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
tour create --head <ref> [--base <ref>] [--title <s>] [--json]
|
|
49
|
+
tour annotate <id> --file <f> --side additions|deletions --line <n[-m]> --body <b> [--author <a>] [--json]
|
|
50
|
+
tour annotate <id> --batch - # read JSONL annotations from stdin
|
|
51
|
+
tour list [--status open|closed|all] [--json]
|
|
52
|
+
tour show <id> [--json]
|
|
53
|
+
tour close <id> # mark closed; keeps files
|
|
54
|
+
tour delete <id> # remove the tour
|
|
55
|
+
tour prune --older-than 30d # bulk-delete by age
|
|
56
|
+
tour tui [<id>] # explicit TUI launch
|
|
57
|
+
tour serve [--port 7777] [--open] [<id>] # webapp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`--head WIP` snapshots uncommitted work to a synthetic commit so the diff stays pinned.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT — see [LICENSE](./LICENSE).
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tourdiff",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Local code review tool with AI annotations: TUI + webapp over a pinned git diff.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Almas Akchabayev",
|
|
8
|
+
"homepage": "https://github.com/a9a4k/tour#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/a9a4k/tour.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/a9a4k/tour/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"code-review",
|
|
18
|
+
"diff",
|
|
19
|
+
"git",
|
|
20
|
+
"annotations",
|
|
21
|
+
"ai",
|
|
22
|
+
"agents",
|
|
23
|
+
"tui",
|
|
24
|
+
"cli"
|
|
25
|
+
],
|
|
26
|
+
"bin": {
|
|
27
|
+
"tour": "scripts/cli.cjs"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"scripts/cli.cjs",
|
|
31
|
+
"scripts/resolveBinary.cjs",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"cli": "bun src/main.ts",
|
|
40
|
+
"build:darwin-arm64": "bun scripts/build-binary.ts bun-darwin-arm64 dist/binaries/darwin-arm64/tour",
|
|
41
|
+
"build:darwin-x64": "bun scripts/build-binary.ts bun-darwin-x64 dist/binaries/darwin-x64/tour",
|
|
42
|
+
"build:linux-arm64": "bun scripts/build-binary.ts bun-linux-arm64 dist/binaries/linux-arm64/tour",
|
|
43
|
+
"build:linux-x64": "bun scripts/build-binary.ts bun-linux-x64 dist/binaries/linux-x64/tour",
|
|
44
|
+
"build:windows-x64": "bun scripts/build-binary.ts bun-windows-x64 dist/binaries/windows-x64/tour.exe",
|
|
45
|
+
"build:all": "bun run build:darwin-arm64 && bun run build:darwin-x64 && bun run build:linux-arm64 && bun run build:linux-x64 && bun run build:windows-x64",
|
|
46
|
+
"assemble": "bun scripts/assemble-packages.ts"
|
|
47
|
+
},
|
|
48
|
+
"optionalDependencies": {
|
|
49
|
+
"tourdiff-darwin-arm64": "0.1.0",
|
|
50
|
+
"tourdiff-darwin-x64": "0.1.0",
|
|
51
|
+
"tourdiff-linux-arm64": "0.1.0",
|
|
52
|
+
"tourdiff-linux-x64": "0.1.0",
|
|
53
|
+
"tourdiff-windows-x64": "0.1.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@ai-hero/sandcastle": "^0.5.10",
|
|
57
|
+
"@opentui/react": "^0.2.5",
|
|
58
|
+
"@pierre/diffs": "^1.1.21",
|
|
59
|
+
"@types/node": "^22.0.0",
|
|
60
|
+
"@types/react": "^19.2.0",
|
|
61
|
+
"@types/react-dom": "^19.0.0",
|
|
62
|
+
"@types/react-reconciler": "^0.33.0",
|
|
63
|
+
"hunkdiff": "^0.10.0",
|
|
64
|
+
"mermaid": "^11.14.0",
|
|
65
|
+
"react": "^19.2.0",
|
|
66
|
+
"react-dom": "^19.0.0",
|
|
67
|
+
"react-markdown": "^10.1.0",
|
|
68
|
+
"react-reconciler": "^0.33.0",
|
|
69
|
+
"remark-gfm": "^4.0.1",
|
|
70
|
+
"smol-toml": "^1.6.1",
|
|
71
|
+
"tsx": "^4.19.0",
|
|
72
|
+
"typescript": "^5.8.0",
|
|
73
|
+
"vitest": "^3.2.1"
|
|
74
|
+
}
|
|
75
|
+
}
|
package/scripts/cli.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("node:child_process");
|
|
4
|
+
const { resolveBinaryPath } = require("./resolveBinary.cjs");
|
|
5
|
+
|
|
6
|
+
let binaryPath;
|
|
7
|
+
try {
|
|
8
|
+
binaryPath = resolveBinaryPath();
|
|
9
|
+
} catch {
|
|
10
|
+
console.error(`tour: no prebuilt binary for ${process.platform}-${process.arch}.`);
|
|
11
|
+
console.error(`Supported: darwin-arm64, darwin-x64, linux-arm64, linux-x64, windows-x64.`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const rawArgs = process.argv.slice(2);
|
|
16
|
+
const cleanedArgs = rawArgs.filter((arg) => {
|
|
17
|
+
if (arg === binaryPath) return false;
|
|
18
|
+
try {
|
|
19
|
+
const pattern = /node_modules[/\\]tourdiff-(darwin|linux|windows)-[^/\\]+[/\\]tour(\.exe)?$/i;
|
|
20
|
+
return !pattern.test(arg);
|
|
21
|
+
} catch {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const child = spawn(binaryPath, cleanedArgs, {
|
|
27
|
+
stdio: "inherit",
|
|
28
|
+
windowsHide: true,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
child.on("exit", (code) => {
|
|
32
|
+
process.exit(code || 0);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
child.on("error", (err) => {
|
|
36
|
+
if (err.code === "ENOENT") {
|
|
37
|
+
console.error(`tour: binary not found at ${binaryPath}`);
|
|
38
|
+
console.error(`Re-install for your platform (${process.platform}-${process.arch}).`);
|
|
39
|
+
} else {
|
|
40
|
+
console.error("tour: failed to start:", err);
|
|
41
|
+
}
|
|
42
|
+
process.exit(1);
|
|
43
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function mapPlatform(platform = process.platform) {
|
|
2
|
+
switch (platform) {
|
|
3
|
+
case "win32":
|
|
4
|
+
return "windows";
|
|
5
|
+
case "darwin":
|
|
6
|
+
case "linux":
|
|
7
|
+
return platform;
|
|
8
|
+
default:
|
|
9
|
+
return platform;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function mapArch(arch = process.arch) {
|
|
14
|
+
switch (arch) {
|
|
15
|
+
case "x64":
|
|
16
|
+
case "arm64":
|
|
17
|
+
return arch;
|
|
18
|
+
default:
|
|
19
|
+
return arch;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getPackageName(platform = process.platform, arch = process.arch) {
|
|
24
|
+
return `tourdiff-${mapPlatform(platform)}-${mapArch(arch)}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function resolveBinaryPath(platform = process.platform, arch = process.arch) {
|
|
28
|
+
const packageName = getPackageName(platform, arch);
|
|
29
|
+
const binary = `tour${platform === "win32" ? ".exe" : ""}`;
|
|
30
|
+
return require.resolve(`${packageName}/${binary}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
module.exports = { getPackageName, resolveBinaryPath };
|