co-maintainer 0.5.0-beta.1 → 0.5.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 -21
- package/README.md +8 -8
- package/dist/package.json +1 -1
- package/dist/src/cli/args.js +1 -1
- package/dist/src/cli/commands/registry.d.ts +7 -2
- package/dist/src/cli/commands/registry.js +17 -4
- package/dist/src/cli/commands/view.js +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Murat Kirazkaya
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Murat Kirazkaya
|
|
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
|
@@ -91,14 +91,14 @@ the PRs are kept as defect-free controls, so precision is measurable too, not
|
|
|
91
91
|
just recall. Full breakdown, per-PR results, and methodology:
|
|
92
92
|
[`benchmark/core_v3/README.md`](benchmark/core_v3/README.md).
|
|
93
93
|
|
|
94
|
-
| metric | value | context
|
|
95
|
-
| ------------- | ----------------------------- |
|
|
96
|
-
| PRs reviewed | 30 (14 defective, 16 control) | one target repo
|
|
97
|
-
| F1 | 0.500 | against seeded defects only
|
|
98
|
-
| Precision | 0.353 | 1.00
|
|
99
|
-
| Recall | 0.857 | 12 of 14 defects found
|
|
100
|
-
| Avg cost / PR | $0.0045 | low and high model together
|
|
101
|
-
| Avg time / PR | 28.9s | sequential, no concurrency
|
|
94
|
+
| metric | value | context |
|
|
95
|
+
| ------------- | ----------------------------- | ---------------------------------- |
|
|
96
|
+
| PRs reviewed | 30 (14 defective, 16 control) | one target repo |
|
|
97
|
+
| F1 | 0.500 | against seeded defects only |
|
|
98
|
+
| Precision | 0.353 | 1.00 false positive per control PR |
|
|
99
|
+
| Recall | 0.857 | 12 of 14 defects found |
|
|
100
|
+
| Avg cost / PR | $0.0045 | low and high model together |
|
|
101
|
+
| Avg time / PR | 28.9s | sequential, no concurrency |
|
|
102
102
|
|
|
103
103
|
## Development
|
|
104
104
|
|
package/dist/package.json
CHANGED
package/dist/src/cli/args.js
CHANGED
|
@@ -164,7 +164,7 @@ export async function parseArgs(args) {
|
|
|
164
164
|
arg === "--only-request-changed-pr")
|
|
165
165
|
continue;
|
|
166
166
|
if (arg.startsWith("--") && !known)
|
|
167
|
-
die(unknownOptionMessage(arg));
|
|
167
|
+
die(unknownOptionMessage(arg, command));
|
|
168
168
|
}
|
|
169
169
|
const explicitAi = rest.some((arg) => arg.startsWith("--ai="));
|
|
170
170
|
const configuredAiRaw = env("CO_MAINTAINER_AI") ?? repoConfig.ai ?? config.ai;
|
|
@@ -46,8 +46,13 @@ export declare function levenshtein(a: string, b: string): number;
|
|
|
46
46
|
export declare function closest(input: string, candidates: string[], maxDistance?: number): string | undefined;
|
|
47
47
|
/** `prob` becomes `Unknown command: prob. Did you mean probe?`. */
|
|
48
48
|
export declare function unknownCommandMessage(input: string): string;
|
|
49
|
-
/** `--jsno` becomes `Unknown option: --jsno. Did you mean --json?`.
|
|
50
|
-
|
|
49
|
+
/** `--jsno` becomes `Unknown option: --jsno. Did you mean --json?`.
|
|
50
|
+
*
|
|
51
|
+
* When `command` is given the suggestion is drawn only from that command's own
|
|
52
|
+
* flags, so `review --review-blocking` cannot suggest a flag only `set` takes
|
|
53
|
+
* (N01, found in the beta run). Without a command the whole surface is fair
|
|
54
|
+
* game, which is all `view` and generic parsers need. */
|
|
55
|
+
export declare function unknownOptionMessage(input: string, command?: string): string;
|
|
51
56
|
/** The global help: every visible command with its one-line summary. */
|
|
52
57
|
export declare function renderGlobalHelp(): string;
|
|
53
58
|
/** One command's help: usage, flags grouped, examples, docs link. */
|
|
@@ -620,10 +620,18 @@ export function unknownCommandMessage(input) {
|
|
|
620
620
|
? `Unknown command: ${input}. Did you mean ${suggestion}?`
|
|
621
621
|
: `Unknown command: ${input}`;
|
|
622
622
|
}
|
|
623
|
-
/** `--jsno` becomes `Unknown option: --jsno. Did you mean --json?`.
|
|
624
|
-
|
|
623
|
+
/** `--jsno` becomes `Unknown option: --jsno. Did you mean --json?`.
|
|
624
|
+
*
|
|
625
|
+
* When `command` is given the suggestion is drawn only from that command's own
|
|
626
|
+
* flags, so `review --review-blocking` cannot suggest a flag only `set` takes
|
|
627
|
+
* (N01, found in the beta run). Without a command the whole surface is fair
|
|
628
|
+
* game, which is all `view` and generic parsers need. */
|
|
629
|
+
export function unknownOptionMessage(input, command) {
|
|
625
630
|
const flag = input.replace(/^--?/, "").split("=")[0] ?? "";
|
|
626
|
-
const
|
|
631
|
+
const scoped = command === undefined ? undefined : findCommand(command);
|
|
632
|
+
const candidates = scoped
|
|
633
|
+
? scoped.groups.flatMap((group) => group.flags.map((spec) => spec.name))
|
|
634
|
+
: COMMANDS.flatMap((command) => command.groups.flatMap((group) => group.flags.map((spec) => spec.name)));
|
|
627
635
|
const suggestion = closest(flag, [...new Set(candidates)]);
|
|
628
636
|
return suggestion
|
|
629
637
|
? `Unknown option: ${input}. Did you mean --${suggestion}?`
|
|
@@ -679,6 +687,11 @@ export function renderCommandHelp(name) {
|
|
|
679
687
|
}
|
|
680
688
|
return lines.join("\n");
|
|
681
689
|
}
|
|
690
|
+
/** A Markdown table cell cannot hold a raw `|`, or the column splits. Escaping
|
|
691
|
+
* it keeps values such as `--auth=gh|pat` in one cell. */
|
|
692
|
+
function cell(text) {
|
|
693
|
+
return text.replace(/\|/g, "\\|");
|
|
694
|
+
}
|
|
682
695
|
/** The registry as markdown, so CORE-81 can build the command reference from
|
|
683
696
|
* the same data the runtime help uses. */
|
|
684
697
|
export function registryToMarkdown() {
|
|
@@ -704,7 +717,7 @@ export function registryToMarkdown() {
|
|
|
704
717
|
const flagCell = flag.value
|
|
705
718
|
? `--${flag.name}=${flag.value}`
|
|
706
719
|
: `--${flag.name}`;
|
|
707
|
-
lines.push(`| \`${flagCell}\` | ${flag.default ?? ""} | ${flag.description} |`);
|
|
720
|
+
lines.push(`| \`${cell(flagCell)}\` | ${cell(flag.default ?? "")} | ${cell(flag.description)} |`);
|
|
708
721
|
}
|
|
709
722
|
}
|
|
710
723
|
lines.push("");
|
|
@@ -152,7 +152,7 @@ export async function runView(args) {
|
|
|
152
152
|
for (const arg of args) {
|
|
153
153
|
if (arg.startsWith("--") &&
|
|
154
154
|
!["--list", "--path", "--remote", "--help", "-h"].includes(arg)) {
|
|
155
|
-
throw new CliError("usage", unknownOptionMessage(arg));
|
|
155
|
+
throw new CliError("usage", unknownOptionMessage(arg, "view"));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
// The directory belongs to this machine, so it cannot answer for a server.
|