@in-the-loop-labs/pair-review 3.3.7 → 3.4.1
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/package.json +2 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
- package/public/css/styles.css +14 -2
- package/public/index.html +1 -0
- package/public/js/components/UpdateBanner.js +143 -0
- package/public/js/index.js +43 -0
- package/public/js/modules/diff-renderer.js +3 -0
- package/public/local.html +2 -0
- package/public/pr.html +2 -0
- package/public/setup.html +1 -0
- package/src/config.js +35 -21
- package/src/database.js +14 -0
- package/src/git/fetch-helpers.js +29 -0
- package/src/git/worktree-pool-lifecycle.js +16 -5
- package/src/git/worktree.js +9 -8
- package/src/local-review.js +3 -0
- package/src/main.js +39 -23
- package/src/mcp-stdio.js +7 -0
- package/src/routes/config.js +55 -1
- package/src/routes/local.js +7 -0
- package/src/routes/setup.js +7 -0
- package/src/routes/stack-analysis.js +1 -1
- package/src/server.js +51 -9
- package/src/setup/local-setup.js +5 -1
- package/src/setup/pr-setup.js +7 -4
- package/src/single-port.js +193 -0
- package/src/utils/local-path-input.js +44 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright 2026 Tim Perkins (tjwp) | SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
const LOCAL_REVIEW_PATH_URL_ERROR = 'Local reviews require a filesystem path, not a URL. Pass GitHub or Graphite URLs as PR review inputs instead.';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Detect inputs that are URLs or remote-style Git URLs rather than filesystem paths.
|
|
7
|
+
* This intentionally checks only unambiguous URL forms so normal absolute,
|
|
8
|
+
* relative, tilde, and Windows paths continue to work.
|
|
9
|
+
*
|
|
10
|
+
* @param {unknown} input
|
|
11
|
+
* @returns {boolean}
|
|
12
|
+
*/
|
|
13
|
+
function isUrlLikeLocalReviewPath(input) {
|
|
14
|
+
if (typeof input !== 'string') return false;
|
|
15
|
+
|
|
16
|
+
const value = input.trim();
|
|
17
|
+
if (!value) return false;
|
|
18
|
+
|
|
19
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(value)) return true;
|
|
20
|
+
if (/^(?:github\.com|app\.graphite\.(?:dev|com))\//i.test(value)) return true;
|
|
21
|
+
// Treat only a leading user@host:path token as SSH remote syntax; if a
|
|
22
|
+
// directory prefix contains @ and : it should remain a filesystem path.
|
|
23
|
+
if (/^[^@/\\\s]+@[^:/\\\s]+:[^\s]+$/.test(value)) return true;
|
|
24
|
+
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Throw a user-facing error when a local review path is actually a URL.
|
|
30
|
+
*
|
|
31
|
+
* @param {unknown} input
|
|
32
|
+
* @throws {Error}
|
|
33
|
+
*/
|
|
34
|
+
function rejectUrlLikeLocalReviewPath(input) {
|
|
35
|
+
if (isUrlLikeLocalReviewPath(input)) {
|
|
36
|
+
throw new Error(LOCAL_REVIEW_PATH_URL_ERROR);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = {
|
|
41
|
+
LOCAL_REVIEW_PATH_URL_ERROR,
|
|
42
|
+
isUrlLikeLocalReviewPath,
|
|
43
|
+
rejectUrlLikeLocalReviewPath
|
|
44
|
+
};
|