lookover 0.0.0 → 0.2.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 -202
- package/README.md +114 -7
- package/bin/lookover.js +70 -0
- package/package.json +27 -9
package/LICENSE
CHANGED
|
@@ -1,202 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
-
exercising permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
-
including but not limited to software source code, documentation
|
|
29
|
-
source, and configuration files.
|
|
30
|
-
|
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
|
32
|
-
transformation or translation of a Source form, including but
|
|
33
|
-
not limited to compiled object code, generated documentation,
|
|
34
|
-
and conversions to other media types.
|
|
35
|
-
|
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
-
Object form, made available under the License, as indicated by a
|
|
38
|
-
copyright notice that is included in or attached to the work
|
|
39
|
-
(an example is provided in the Appendix below).
|
|
40
|
-
|
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
-
the Work and Derivative Works thereof.
|
|
48
|
-
|
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
|
50
|
-
the original version of the Work and any modifications or additions
|
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
-
|
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
-
subsequently incorporated within the Work.
|
|
66
|
-
|
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
|
73
|
-
|
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
-
where such license applies only to those patent claims licensable
|
|
80
|
-
by such Contributor that are necessarily infringed by their
|
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
-
institute patent litigation against any entity (including a
|
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
-
or contributory patent infringement, then any patent licenses
|
|
87
|
-
granted to You under this License for that Work shall terminate
|
|
88
|
-
as of the date such litigation is filed.
|
|
89
|
-
|
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
-
modifications, and in Source or Object form, provided that You
|
|
93
|
-
meet the following conditions:
|
|
94
|
-
|
|
95
|
-
(a) You must give any other recipients of the Work or
|
|
96
|
-
Derivative Works a copy of this License; and
|
|
97
|
-
|
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
|
99
|
-
stating that You changed the files; and
|
|
100
|
-
|
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
|
103
|
-
attribution notices from the Source form of the Work,
|
|
104
|
-
excluding those notices that do not pertain to any part of
|
|
105
|
-
the Derivative Works; and
|
|
106
|
-
|
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
|
109
|
-
include a readable copy of the attribution notices contained
|
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
|
112
|
-
of the following places: within a NOTICE text file distributed
|
|
113
|
-
as part of the Derivative Works; within the Source form or
|
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
|
115
|
-
within a display generated by the Derivative Works, if and
|
|
116
|
-
wherever such third-party notices normally appear. The contents
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
-
|
|
181
|
-
To apply the Apache License to your work, attach the following
|
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
-
replaced with your own identifying information. (Don't include
|
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
-
comment syntax for the file format. We also recommend that a
|
|
186
|
-
file or class name and description of purpose be included on the
|
|
187
|
-
same "printed page" as the copyright notice for easier
|
|
188
|
-
identification within third-party archives.
|
|
189
|
-
|
|
190
|
-
Copyright [yyyy] [name of copyright owner]
|
|
191
|
-
|
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
-
you may not use this file except in compliance with the License.
|
|
194
|
-
You may obtain a copy of the License at
|
|
195
|
-
|
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
-
|
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
-
See the License for the specific language governing permissions and
|
|
202
|
-
limitations under the License.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Samuel Asensi (sasensi)
|
|
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,11 +1,118 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Lookover
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A second look before merge. Lookover reviews your GitHub pull requests with Claude and ChatGPT, on the subscriptions you already pay for. It runs on your own computer, posts its review on the pull request, and is built for coding agents: the agent waits for the review, fixes what it found, pushes, and asks again until nothing is left.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Lookover is in 0.x: it works, and it changes. What it doesn't do yet is below.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Runs the official `claude` and `codex` on your own machine or server. No extra cost per review.
|
|
9
|
-
- Built for coding agents: they wait for the review, fix what it found and push again until it is ready to merge.
|
|
7
|
+
The docs are at [lookover.dev](https://lookover.dev/docs/).
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
- **Reviews each pull request you open,** when it is ready for review. Optionally after every push, when you comment `/lookover review`, or when you click "Review now" in the app.
|
|
12
|
+
- **Finds, then confirms.** One AI looks for problems, the other checks each one before it is posted. Use Claude, ChatGPT or both.
|
|
13
|
+
- **Posts one review on GitHub:** inline comments placed on the diff, one summary comment that stays up to date, and a check on each commit with its findings in a form a program can read.
|
|
14
|
+
- **Reads the threads on the next round.** A finding you fixed has its thread resolved; a finding is never posted twice; a reply you wrote is answered.
|
|
15
|
+
- **Follows your rules:** `REVIEW.md`, `AGENTS.md` and `CLAUDE.md`, read from the default branch.
|
|
16
|
+
- **Shows what is happening** in an app in your browser: the queue, each review and its rounds, each AI and its sign-in, the logs, and the settings.
|
|
17
|
+
|
|
18
|
+
## What you need
|
|
19
|
+
|
|
20
|
+
- A Claude subscription (Pro or Max) with the [`claude`](https://docs.anthropic.com/en/docs/claude-code) CLI, a ChatGPT subscription (Plus or Pro) with the [`codex`](https://github.com/openai/codex) CLI, or both. Install them; Lookover's setup signs you in to each.
|
|
21
|
+
- `git` and the [`gh`](https://cli.github.com) CLI on your PATH.
|
|
22
|
+
- Node.js 18 or later and npm, to install Lookover.
|
|
23
|
+
- A GitHub account. Lookover reviews the repositories of your personal account, or of an organisation you belong to.
|
|
24
|
+
- Windows, macOS or Linux, on x64 or arm64 (Windows: x64).
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install -g lookover
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
npm installs the one executable your platform needs and puts `lookover` on your PATH. Nothing runs at install: there is no install script, so `--ignore-scripts` changes nothing.
|
|
33
|
+
|
|
34
|
+
## First run
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
lookover start
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Lookover starts in the background and opens in your browser. Close the terminal whenever you like: it keeps running, and starts again each time you log in (Settings turns that off).
|
|
41
|
+
|
|
42
|
+
The setup takes a few minutes, one step at a time:
|
|
43
|
+
|
|
44
|
+
1. **AI.** Sign in to Claude, Codex or both.
|
|
45
|
+
2. **GitHub.** "Create your App" makes a GitHub App on your account or your organisation; then pick the repositories it may see. The App is how Lookover reads pull requests and posts its reviews, under its own name.
|
|
46
|
+
3. **Repositories.** Pick the ones to review.
|
|
47
|
+
4. **First review.** Pick an open pull request, or preview a review that posts nothing.
|
|
48
|
+
5. **Your coding agent.** Install the skill, below.
|
|
49
|
+
|
|
50
|
+
The other commands:
|
|
51
|
+
|
|
52
|
+
| Command | What it does |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `lookover open` | Opens the app with a new one-time link. `--no-open` prints the link instead |
|
|
55
|
+
| `lookover status` | Running or stopped, its address, data folder and version. Exit 0 running, 3 stopped |
|
|
56
|
+
| `lookover stop` | Stops it |
|
|
57
|
+
| `lookover help` | Every command and its options |
|
|
58
|
+
|
|
59
|
+
To update, stop it first: on Windows the running program holds its file open.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
lookover stop
|
|
63
|
+
npm update -g lookover
|
|
64
|
+
lookover start
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## The agent loop
|
|
68
|
+
|
|
69
|
+
A coding agent that pushes to a pull request can run the review loop itself:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
lookover wait # asks for a review of the pushed commit, waits for it
|
|
73
|
+
lookover feedback # the findings waiting on you, each with its thread
|
|
74
|
+
lookover reply F3 wont-fix "The value is checked by the caller."
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`lookover wait` exits 0 when there is nothing to fix and 3 when there is; 4 means a person is needed. `lookover reply` answers a finding: `fixed`, `wont-fix`, `disputed`, `deferred` or `question`. The next round reads the answer.
|
|
78
|
+
|
|
79
|
+
Setup's last step, or Settings › Your coding agent, installs the `lookover-review-loop` skill for Claude Code and Codex. It teaches the agent the loop, and calls Lookover by its full path, so the agent needs nothing on its PATH. Then tell your agent: "Get pull request #12 through Lookover's review: fix what it found and push."
|
|
80
|
+
|
|
81
|
+
## What it doesn't do yet
|
|
82
|
+
|
|
83
|
+
- **GitHub only** (github.com), one App per Lookover. No GitLab, Bitbucket or GitHub Enterprise Server.
|
|
84
|
+
- **Subscriptions only,** through the `claude` and `codex` CLIs. No API keys, no other AI.
|
|
85
|
+
- **Your own pull requests.** Another author's pull request is reviewed when you ask, by Claude alone. A fork's is never reviewed by itself: ask with `/lookover review`, and Claude reviews it.
|
|
86
|
+
- **On your computer only.** No server mode yet.
|
|
87
|
+
- **Windows is where Lookover is used day to day.** macOS and Linux pass each release's tests and a start on a real runner, and have had little use beyond that.
|
|
88
|
+
- **No Alpine and other musl Linux:** Lookover's Linux executables need glibc.
|
|
89
|
+
- **No signed executables in 0.x.** npm's provenance says where each one was built.
|
|
90
|
+
- A console window flashes for a moment at login on Windows, while Lookover starts.
|
|
91
|
+
- A post that fails can't be retried from the app yet.
|
|
92
|
+
- A hand edit to a settings file counts from the next start.
|
|
93
|
+
|
|
94
|
+
## Security
|
|
95
|
+
|
|
96
|
+
- **What runs where.** Lookover runs on your computer, as you. It reviews with the official `claude` and `codex` CLIs, signed in through their own flows: Lookover never reads your subscription's tokens. It talks to GitHub, and to nothing else: no telemetry, no server of ours. On GitHub it acts as your App, except in two places that use your own `gh` login: the setup reads who you are and the organisations you administer, and `lookover wait` and `lookover reply` write as you.
|
|
97
|
+
- **What the AI may do.** Each review runs in a read-only sandbox, on a checkout of the pull request. On Windows, Codex's sandbox isn't elevated: accepted because Codex reviews only your own changes. Hooks, MCP servers and settings that a pull request brings are turned off. No GitHub token reaches the model.
|
|
98
|
+
- **What it posts.** The review, its inline comments, the summary comment and the check, on the pull request it reviewed, as your App. As you, when your coding agent runs them: `lookover wait`'s `/lookover review` comment and the threads it resolves once fixed, and `lookover reply`'s answers on a thread. Secrets in a known shape are taken out of what it posts and of its logs.
|
|
99
|
+
- **What it keeps.** Everything is in one data folder on your computer: the reviews, the settings, the logs. The App's private key is encrypted there, and the key that opens it is in your system's credential store. With no credential store (on some Linux systems), the private key is kept unencrypted in a file only you can open.
|
|
100
|
+
- **Forks are never reviewed by themselves,** so a stranger's code doesn't reach an AI unless you ask.
|
|
101
|
+
|
|
102
|
+
Found a vulnerability? Please report it privately, as [SECURITY.md](https://github.com/lookover-dev/lookover/blob/main/SECURITY.md) says, never in a public issue.
|
|
103
|
+
|
|
104
|
+
## Remove it
|
|
105
|
+
|
|
106
|
+
1. In Settings › Your coding agent, "Remove the skill".
|
|
107
|
+
2. In Settings, turn off "Start at login".
|
|
108
|
+
3. `lookover stop`, then `npm uninstall -g lookover`.
|
|
109
|
+
4. Delete Lookover's entry in your system's credential store: its name is `key.entry` in `github/app.json`, in the data folder (`lookover status` names the folder). With `"kept": "file"` there, there is no entry: the key is a file in that folder.
|
|
110
|
+
5. Delete the data folder, and the App on GitHub if you no longer want it.
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
|
|
114
|
+
Bugs and ideas are welcome in [issues](https://github.com/lookover-dev/lookover/issues). To build Lookover or send a change, read [CONTRIBUTING.md](https://github.com/lookover-dev/lookover/blob/main/CONTRIBUTING.md).
|
|
115
|
+
|
|
116
|
+
## Licence
|
|
117
|
+
|
|
118
|
+
[MIT](https://github.com/lookover-dev/lookover/blob/main/LICENSE), © 2026 Samuel Asensi.
|
package/bin/lookover.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @ts-check
|
|
3
|
+
// `lookover`, as `npm install -g lookover` installs it (ADR 0061): a launcher in plain Node, with no dependency and no
|
|
4
|
+
// build. npm installed, beside it, the one platform package (`@lookover/<platform>-<arch>`) whose `os` and `cpu` match
|
|
5
|
+
// this machine; this runs that package's executable with the same arguments and the same terminal, tells it who started
|
|
6
|
+
// it (`LOOKOVER_LAUNCHER`, this file's absolute path: the executable is then an npm install, and names `lookover`),
|
|
7
|
+
// passes SIGTERM on, and ends as it ends. It never downloads anything: when no package fits, it says which
|
|
8
|
+
// exist and how to reinstall.
|
|
9
|
+
"use strict";
|
|
10
|
+
|
|
11
|
+
const { spawn } = require("node:child_process");
|
|
12
|
+
const { existsSync, readFileSync } = require("node:fs");
|
|
13
|
+
const { constants } = require("node:os");
|
|
14
|
+
const { dirname, join } = require("node:path");
|
|
15
|
+
|
|
16
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
17
|
+
const executable = process.platform === "win32" ? "lookover.exe" : "lookover";
|
|
18
|
+
|
|
19
|
+
/** The executable of this machine's platform package, or null when npm installed none. */
|
|
20
|
+
function installed() {
|
|
21
|
+
try {
|
|
22
|
+
const manifest = require.resolve(`@lookover/${platform}/package.json`);
|
|
23
|
+
const file = join(dirname(manifest), executable);
|
|
24
|
+
return existsSync(file) ? file : null;
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The platforms Lookover is built for, from this package's own `optionalDependencies`. */
|
|
31
|
+
function platforms() {
|
|
32
|
+
const manifest = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf8"));
|
|
33
|
+
const wanted = manifest.optionalDependencies || {};
|
|
34
|
+
return Object.keys(wanted).map((name) => name.replace(/^@lookover\//, ""));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const file = installed();
|
|
38
|
+
if (file === null) {
|
|
39
|
+
console.error(
|
|
40
|
+
`Lookover found no executable for ${platform}. It is built for ${platforms().join(", ")}.\n` +
|
|
41
|
+
"If yours is one of them, npm skipped it: reinstall with\n npm install -g lookover --include=optional",
|
|
42
|
+
);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const child = spawn(file, process.argv.slice(2), {
|
|
47
|
+
stdio: "inherit",
|
|
48
|
+
env: { ...process.env, LOOKOVER_LAUNCHER: __filename },
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Ctrl+C already reaches the executable: the terminal sends it to the whole process group on Unix, and the console to
|
|
52
|
+
// every process attached on Windows. Passing it on would send it twice, so the launcher only waits for it to end.
|
|
53
|
+
process.on("SIGINT", () => {});
|
|
54
|
+
// A SIGTERM, though, names this process alone (`kill <pid>`): pass it on. Not on Windows, where Node never receives
|
|
55
|
+
// one and a kill would end the executable at once, unstopped.
|
|
56
|
+
if (process.platform !== "win32") process.on("SIGTERM", () => child.kill("SIGTERM"));
|
|
57
|
+
|
|
58
|
+
child.on("error", (error) => {
|
|
59
|
+
console.error(`Lookover couldn't start ${file}: ${error.message}`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
child.on("exit", (code, signal) => {
|
|
64
|
+
if (signal === null) process.exit(code ?? 1);
|
|
65
|
+
// Ended by a signal: end by the same one, so whoever started `lookover` sees it. Node ignores some (SIGPIPE), and
|
|
66
|
+
// then the launcher still ends, with the code a shell gives a process ended by that signal.
|
|
67
|
+
process.removeAllListeners(signal);
|
|
68
|
+
process.kill(process.pid, signal);
|
|
69
|
+
process.exit(128 + (constants.signals[signal] ?? 0));
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lookover",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A second look before merge:
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A second look before merge: Lookover reviews your GitHub pull requests with Claude and ChatGPT, on the subscriptions you already pay for.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-review",
|
|
7
7
|
"pull-request",
|
|
8
8
|
"github",
|
|
9
|
-
"ai",
|
|
10
9
|
"claude",
|
|
11
10
|
"codex",
|
|
12
|
-
"
|
|
11
|
+
"ai"
|
|
13
12
|
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/lookover-dev/lookover.git"
|
|
17
|
+
},
|
|
14
18
|
"homepage": "https://lookover.dev",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
19
|
+
"bugs": "https://github.com/lookover-dev/lookover/issues",
|
|
20
|
+
"bin": {
|
|
21
|
+
"lookover": "bin/lookover.js"
|
|
22
|
+
},
|
|
17
23
|
"files": [
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
"bin/lookover.js"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"optionalDependencies": {
|
|
33
|
+
"@lookover/win32-x64": "0.2.0",
|
|
34
|
+
"@lookover/darwin-arm64": "0.2.0",
|
|
35
|
+
"@lookover/darwin-x64": "0.2.0",
|
|
36
|
+
"@lookover/linux-x64": "0.2.0",
|
|
37
|
+
"@lookover/linux-arm64": "0.2.0"
|
|
38
|
+
}
|
|
21
39
|
}
|