@diffclarity/companion 0.0.0-stage → 0.3.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/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2026 Wojtek Wrona. All rights reserved.
2
+
3
+ You may install and run this software (the DiffClarity companion, published on npm as @diffclarity/companion) to
4
+ connect your own coding agents to DiffClarity.
5
+
6
+ No other right is granted. You may not copy, modify, adapt, reuse any part of, distribute, sublicense or sell this
7
+ software or any part of it, except for the copies that installing and running it make on your own machine.
8
+
9
+ The software is provided "as is", without warranty of any kind, express or implied. In no event shall the author be
10
+ liable for any claim, damages or other liability arising from the software or its use.
11
+
12
+ The file dist/THIRD_PARTY_NOTICES.md lists the third-party packages included in this software. Each is under its own
13
+ licence, given there, and this notice does not restrict the rights those licences grant.
package/README.md CHANGED
@@ -1,3 +1,47 @@
1
- # Temporary Holding Version
1
+ # DiffClarity companion
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
+ Answers questions from a DiffClarity review with the coding agent you already use, on your machine: Claude Code (`claude`), Codex (`codex`) or opencode 2 (`opencode`). DiffClarity runs no agent and never sees your agent's credentials.
4
+
5
+ It needs Node 22.21 or later and one of those agents on your PATH, signed in.
6
+
7
+ ```sh
8
+ npx @diffclarity/companion@latest connect
9
+ ```
10
+
11
+ It connects to DiffClarity at `https://diffclarity.com`. For another DiffClarity, such as a local stage or your own deployment, name it with `--origin`, as the review's Assistant panel shows (`npx @diffclarity/companion@latest connect --origin https://diffclarity.example`); `disconnect` takes it too. Leaving out `--origin` and naming `https://diffclarity.com` are the same, and use the same saved access.
12
+
13
+ The first run opens your browser to allow the companion for one workspace. It then waits for questions from the review page's Ask tab and runs the agent you choose there, from an empty directory, with DiffClarity's tools as its only tools (Codex also keeps its own code execution, in its read-only sandbox). Keep it running while you review.
14
+
15
+ It prints each step. Once connected it says which workspace it answers for:
16
+
17
+ ```text
18
+ Found Claude Code 2.1.314, Codex 0.166.0.
19
+ Signed in.
20
+ Connecting to https://diffclarity.com…
21
+ Connection open. Waiting for DiffClarity to confirm it…
22
+ Connected to https://diffclarity.com for the workspace “Acme” with Claude Code, Codex. It answers questions asked in reviews of that workspace only. Ask in a review's Assistant panel; keep this running, and press Ctrl+C to stop.
23
+ ```
24
+
25
+ In a terminal, it names its tab "DiffClarity companion" instead of "node", and adds what it is doing: starting, waiting for you in the browser, connecting, answering, or that it can't connect. Rex also shows that as the tab's activity, and Ghostty and Windows Terminal as a progress indicator. When it stops, it clears its status and gives the title back. It writes none of this when its output goes to a pipe or a file, or in CI.
26
+
27
+ When it can't connect, it says which step failed and why, for example `DiffClarity didn't answer the connection within 20 s.` or `DiffClarity refused the connection (HTTP 401: …).`, then tries again after a pause that grows to a minute.
28
+
29
+ A companion answers in the workspaces you allowed it in, each over its own connection. To allow it in another too, stop it, run this and choose that workspace in the browser; it then answers in all of them:
30
+
31
+ ```sh
32
+ npx @diffclarity/companion@latest connect --add-workspace
33
+ ```
34
+
35
+ The companion keeps its access to each workspace in a file only you can read, under `~/.config/diffclarity`, one for each DiffClarity, and uses it each time it starts, without asking again. Account → Connected agents lists it once for each workspace; allowing it again in a workspace replaces that entry. `disconnect` forgets its access in every workspace but keeps its registration, so connecting again replaces this machine's entries rather than adding more; to end its access at once, remove it there too. An installed copy (`npm install --global @diffclarity/companion`) offers the same commands as `diffclarity connect` and `diffclarity disconnect`.
36
+
37
+ The package is one file for Node with no dependencies; the packages bundled into it are listed, with their licences, in `dist/THIRD_PARTY_NOTICES.md`. You may install and run it; see [LICENSE](LICENSE).
38
+
39
+ ## In this repository
40
+
41
+ Run it from a checkout with Bun, against the local development stack:
42
+
43
+ ```sh
44
+ bun apps/companion/src/main.ts connect --origin http://127.0.0.1:5198
45
+ ```
46
+
47
+ `bun run build` (in `apps/companion`) writes the published bundle to `dist/`; `src/node.test.ts` builds it and runs it with Node. How it works and what it may do: [agent access](../../docs/implementation/agent-access.md#the-companion). Releasing it: [publishing the companion](../../docs/implementation/agent-access.md#publishing-the-companion).
@@ -0,0 +1,319 @@
1
+ # Third-party notices
2
+
3
+ The DiffClarity companion's `main.js` includes the following packages, each under its own licence.
4
+
5
+ ## @modelcontextprotocol/sdk@1.32.2 (MIT)
6
+
7
+ ```text
8
+ MIT License
9
+
10
+ Copyright (c) 2024 Anthropic, PBC
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ ```
30
+
31
+ ## ajv-formats@3.0.1 (MIT)
32
+
33
+ ```text
34
+ MIT License
35
+
36
+ Copyright (c) 2020 Evgeny Poberezkin
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a copy
39
+ of this software and associated documentation files (the "Software"), to deal
40
+ in the Software without restriction, including without limitation the rights
41
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
42
+ copies of the Software, and to permit persons to whom the Software is
43
+ furnished to do so, subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in all
46
+ copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
53
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54
+ SOFTWARE.
55
+ ```
56
+
57
+ ## ajv@8.20.0 (MIT)
58
+
59
+ ```text
60
+ The MIT License (MIT)
61
+
62
+ Copyright (c) 2015-2021 Evgeny Poberezkin
63
+
64
+ Permission is hereby granted, free of charge, to any person obtaining a copy
65
+ of this software and associated documentation files (the "Software"), to deal
66
+ in the Software without restriction, including without limitation the rights
67
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
68
+ copies of the Software, and to permit persons to whom the Software is
69
+ furnished to do so, subject to the following conditions:
70
+
71
+ The above copyright notice and this permission notice shall be included in all
72
+ copies or substantial portions of the Software.
73
+
74
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
75
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
76
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
77
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
78
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
79
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
80
+ SOFTWARE.
81
+ ```
82
+
83
+ ## content-type@1.0.5 (MIT)
84
+
85
+ ```text
86
+ (The MIT License)
87
+
88
+ Copyright (c) 2015 Douglas Christopher Wilson
89
+
90
+ Permission is hereby granted, free of charge, to any person obtaining
91
+ a copy of this software and associated documentation files (the
92
+ 'Software'), to deal in the Software without restriction, including
93
+ without limitation the rights to use, copy, modify, merge, publish,
94
+ distribute, sublicense, and/or sell copies of the Software, and to
95
+ permit persons to whom the Software is furnished to do so, subject to
96
+ the following conditions:
97
+
98
+ The above copyright notice and this permission notice shall be
99
+ included in all copies or substantial portions of the Software.
100
+
101
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
102
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
103
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
104
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
105
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
106
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
107
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
108
+ ```
109
+
110
+ ## effect@4.1.2 (MIT)
111
+
112
+ ```text
113
+ MIT License
114
+
115
+ Copyright (c) 2023 Effectful Technologies Inc
116
+
117
+ Permission is hereby granted, free of charge, to any person obtaining a copy
118
+ of this software and associated documentation files (the "Software"), to deal
119
+ in the Software without restriction, including without limitation the rights
120
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
121
+ copies of the Software, and to permit persons to whom the Software is
122
+ furnished to do so, subject to the following conditions:
123
+
124
+ The above copyright notice and this permission notice shall be included in all
125
+ copies or substantial portions of the Software.
126
+
127
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
128
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
129
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
130
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
131
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
132
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
133
+ SOFTWARE.
134
+ ```
135
+
136
+ ## eventsource-parser@3.1.1 (MIT)
137
+
138
+ ```text
139
+ MIT License
140
+
141
+ Copyright (c) 2026 Espen Hovlandsdal <espen@hovlandsdal.com>
142
+
143
+ Permission is hereby granted, free of charge, to any person obtaining a copy
144
+ of this software and associated documentation files (the "Software"), to deal
145
+ in the Software without restriction, including without limitation the rights
146
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
147
+ copies of the Software, and to permit persons to whom the Software is
148
+ furnished to do so, subject to the following conditions:
149
+
150
+ The above copyright notice and this permission notice shall be included in all
151
+ copies or substantial portions of the Software.
152
+
153
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
154
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
155
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
156
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
157
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
158
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
159
+ SOFTWARE.
160
+ ```
161
+
162
+ ## fast-deep-equal@3.1.3 (MIT)
163
+
164
+ ```text
165
+ MIT License
166
+
167
+ Copyright (c) 2017 Evgeny Poberezkin
168
+
169
+ Permission is hereby granted, free of charge, to any person obtaining a copy
170
+ of this software and associated documentation files (the "Software"), to deal
171
+ in the Software without restriction, including without limitation the rights
172
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
173
+ copies of the Software, and to permit persons to whom the Software is
174
+ furnished to do so, subject to the following conditions:
175
+
176
+ The above copyright notice and this permission notice shall be included in all
177
+ copies or substantial portions of the Software.
178
+
179
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
180
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
181
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
182
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
183
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
184
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
185
+ SOFTWARE.
186
+ ```
187
+
188
+ ## fast-uri@3.1.9 (BSD-3-Clause)
189
+
190
+ ```text
191
+ Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
192
+ Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
193
+ All rights reserved.
194
+
195
+ Redistribution and use in source and binary forms, with or without
196
+ modification, are permitted provided that the following conditions are met:
197
+ * Redistributions of source code must retain the above copyright
198
+ notice, this list of conditions and the following disclaimer.
199
+ * Redistributions in binary form must reproduce the above copyright
200
+ notice, this list of conditions and the following disclaimer in the
201
+ documentation and/or other materials provided with the distribution.
202
+ * The names of any contributors may not be used to endorse or promote
203
+ products derived from this software without specific prior written
204
+ permission.
205
+
206
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
207
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
208
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
209
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
210
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
211
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
212
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
213
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
214
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
215
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
216
+
217
+ * * *
218
+
219
+ The complete list of contributors can be found at:
220
+ - https://github.com/garycourt/uri-js/graphs/contributors
221
+ ```
222
+
223
+ ## json-schema-traverse@1.0.0 (MIT)
224
+
225
+ ```text
226
+ MIT License
227
+
228
+ Copyright (c) 2017 Evgeny Poberezkin
229
+
230
+ Permission is hereby granted, free of charge, to any person obtaining a copy
231
+ of this software and associated documentation files (the "Software"), to deal
232
+ in the Software without restriction, including without limitation the rights
233
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
234
+ copies of the Software, and to permit persons to whom the Software is
235
+ furnished to do so, subject to the following conditions:
236
+
237
+ The above copyright notice and this permission notice shall be included in all
238
+ copies or substantial portions of the Software.
239
+
240
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
241
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
242
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
243
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
244
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
245
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
246
+ SOFTWARE.
247
+ ```
248
+
249
+ ## pkce-challenge@5.0.1 (MIT)
250
+
251
+ ```text
252
+ MIT License
253
+
254
+ Copyright (c) 2019
255
+
256
+ Permission is hereby granted, free of charge, to any person obtaining a copy
257
+ of this software and associated documentation files (the "Software"), to deal
258
+ in the Software without restriction, including without limitation the rights
259
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
260
+ copies of the Software, and to permit persons to whom the Software is
261
+ furnished to do so, subject to the following conditions:
262
+
263
+ The above copyright notice and this permission notice shall be included in all
264
+ copies or substantial portions of the Software.
265
+
266
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
267
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
268
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
269
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
270
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
271
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
272
+ SOFTWARE.
273
+ ```
274
+
275
+ ## zod-to-json-schema@3.25.2 (ISC)
276
+
277
+ ```text
278
+ ISC License
279
+
280
+ Copyright (c) 2020, Stefan Terdell
281
+
282
+ Permission to use, copy, modify, and/or distribute this software for any
283
+ purpose with or without fee is hereby granted, provided that the above
284
+ copyright notice and this permission notice appear in all copies.
285
+
286
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
287
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
288
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
289
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
290
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
291
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
292
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
293
+ ```
294
+
295
+ ## zod@4.6.7 (MIT)
296
+
297
+ ```text
298
+ MIT License
299
+
300
+ Copyright (c) 2025 Colin McDonnell
301
+
302
+ Permission is hereby granted, free of charge, to any person obtaining a copy
303
+ of this software and associated documentation files (the "Software"), to deal
304
+ in the Software without restriction, including without limitation the rights
305
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
306
+ copies of the Software, and to permit persons to whom the Software is
307
+ furnished to do so, subject to the following conditions:
308
+
309
+ The above copyright notice and this permission notice shall be included in all
310
+ copies or substantial portions of the Software.
311
+
312
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
313
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
314
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
315
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
316
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
317
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
318
+ SOFTWARE.
319
+ ```