@mr-tabata/mrcr 0.0.0-stage → 1.12.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -2
  3. package/bin/mrcr.js +63 -0
  4. package/package.json +31 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hitoshi
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 CHANGED
@@ -1,3 +1,35 @@
1
- # Temporary Holding Version
1
+ # @mr-tabata/mrcr
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ AI code review for your uncommitted git changes, from the command line. This package is a small launcher
4
+ for the [MrCodeReview](https://github.com/MR-TABATA/MrCodeReview) `mrcr` CLI.
5
+
6
+ - **macOS only** for now. The binary is universal (Apple Silicon and Intel); it has been tested on Apple Silicon only.
7
+ On other systems it prints a message and exits with code 1.
8
+ - The launcher has no install scripts. The binary comes from the `@mr-tabata/mrcr-darwin` package on npm.
9
+
10
+ ```sh
11
+ npx @mr-tabata/mrcr@<version> --help
12
+ ```
13
+
14
+ ## Use as an MCP server
15
+
16
+ Pin the version. Without a version, `npx` runs the latest code on every start.
17
+
18
+ ```json
19
+ {
20
+ "mcpServers": {
21
+ "mrcodereview": {
22
+ "command": "npx",
23
+ "args": ["-y", "@mr-tabata/mrcr@<version>", "mcp"]
24
+ }
25
+ }
26
+ }
27
+ ```
28
+
29
+ `npx @mr-tabata/mrcr@<version> mcp setup` writes this entry for you (agy), and prints the commands for Claude Code and VS Code.
30
+ Update `<version>` yourself when you upgrade; the review database is upgraded by newer versions, and an older pinned
31
+ version refuses to open a newer database ("update this app").
32
+
33
+ ## More
34
+
35
+ Documentation, the desktop app and the issue tracker: <https://github.com/MR-TABATA/MrCodeReview>. MIT license.
package/bin/mrcr.js ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+ // mrcr の起動役。プラットフォーム別パッケージに入っているバイナリを、そのまま起動する。
3
+ //
4
+ // 守ること:
5
+ // - **標準出力に何も書かない。** `mrcr mcp` は標準入出力の JSON-RPC なので、1 バイトでも足すと壊れる。案内は標準エラーへ。
6
+ // - 標準入出力はそのまま渡す(stdio: 'inherit')。終了コードとシグナルを中継する。
7
+ // - インストール時に、npm 以外へ通信しない(postinstall は持たない)。
8
+ 'use strict';
9
+
10
+ const { spawn } = require('node:child_process');
11
+ const path = require('node:path');
12
+
13
+ // 対応するプラットフォーム別パッケージ。増やすときは、ここと optionalDependencies に足す。
14
+ const PACKAGES = {
15
+ darwin: '@mr-tabata/mrcr-darwin',
16
+ };
17
+
18
+ function fail(message) {
19
+ process.stderr.write(`mrcr: ${message}\n`);
20
+ process.exit(1);
21
+ }
22
+
23
+ const name = PACKAGES[process.platform];
24
+ if (!name) {
25
+ fail(
26
+ `この OS(${process.platform})には、まだ対応していません(対応: macOS)。\n` +
27
+ 'Releases: https://github.com/MR-TABATA/MrCodeReview/releases'
28
+ );
29
+ }
30
+
31
+ let binary;
32
+ try {
33
+ binary = path.join(path.dirname(require.resolve(`${name}/package.json`)), 'bin', 'mrcr');
34
+ } catch {
35
+ fail(
36
+ `実行ファイルのパッケージ(${name})が見つかりません。\n` +
37
+ '`--no-optional` や `--omit=optional` でインストールしていないか確認してください。\n' +
38
+ 'Homebrew でも入れられます: brew install mr-tabata/tap/mrcr'
39
+ );
40
+ }
41
+
42
+ // 設定を書く側(mrcr mcp setup)が、npx 経由だと分かるようにする(実行ファイルは npx のキャッシュの中にあり、あとで消えうる)
43
+ const child = spawn(binary, process.argv.slice(2), {
44
+ stdio: 'inherit',
45
+ env: { ...process.env, MRCR_VIA_NPX: '1' },
46
+ });
47
+
48
+ for (const sig of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
49
+ process.on(sig, () => {
50
+ if (!child.killed) child.kill(sig);
51
+ });
52
+ }
53
+
54
+ child.on('error', (e) => fail(`起動できませんでした(${binary}): ${e.message}`));
55
+ child.on('exit', (code, signal) => {
56
+ if (signal) {
57
+ // 子がシグナルで終わったときは、自分も同じシグナルで終わる(終了コードの規約)
58
+ process.removeAllListeners(signal);
59
+ process.kill(process.pid, signal);
60
+ return;
61
+ }
62
+ process.exit(code ?? 1);
63
+ });
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@mr-tabata/mrcr",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.12.0",
4
+ "description": "AI code review CLI on your uncommitted changes (npx launcher)",
5
+ "license": "MIT",
6
+ "homepage": "https://mrktools.app/en/codereview/",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/MR-TABATA/MrCodeReview.git"
10
+ },
11
+ "bin": {
12
+ "mrcr": "bin/mrcr.js"
13
+ },
14
+ "files": [
15
+ "bin/mrcr.js"
16
+ ],
17
+ "engines": {
18
+ "node": ">=18"
19
+ },
20
+ "optionalDependencies": {
21
+ "@mr-tabata/mrcr-darwin": "1.12.0"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "keywords": [
27
+ "code-review",
28
+ "ai",
29
+ "cli",
30
+ "mcp",
31
+ "git"
32
+ ]
33
+ }