co-maintainer 0.7.2-beta.1 → 0.7.3
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/dist/package.json +2 -1
- package/dist/src/ai/anthropic.d.ts +1 -1
- package/dist/src/ai/anthropic.js +1 -1
- package/dist/src/ai/batch.d.ts +1 -1
- package/dist/src/ai/batch.js +3 -3
- package/dist/src/ai/copy_rule.d.ts +7 -0
- package/dist/src/ai/copy_rule.js +23 -0
- package/dist/src/ai/estimate.js +3 -3
- package/dist/src/ai/fake.js +2 -1
- package/dist/src/ai/mermaid.js +1 -0
- package/dist/src/ai/oauth/registry.d.ts +1 -1
- package/dist/src/ai/oauth/sign-in-with-chatgpt.d.ts +4 -4
- package/dist/src/ai/oauth/sign-in-with-chatgpt.js +6 -6
- package/dist/src/ai/openai.d.ts +3 -3
- package/dist/src/ai/openai.js +4 -4
- package/dist/src/ai/openrouter.d.ts +1 -1
- package/dist/src/ai/openrouter.js +1 -1
- package/dist/src/ai/pricing.js +1 -1
- package/dist/src/ai/provider.d.ts +2 -0
- package/dist/src/ai/provider.js +8 -2
- package/dist/src/ai/verify.d.ts +1 -1
- package/dist/src/ai/verify.js +1 -1
- package/dist/src/cli/args.js +1 -1
- package/dist/src/cli/command_json.d.ts +4 -2
- package/dist/src/cli/command_json.js +1 -0
- package/dist/src/cli/commands/config.d.ts +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/oauth.js +1 -1
- package/dist/src/cli/commands/probe.js +1 -1
- package/dist/src/cli/commands/review.js +2 -0
- package/dist/src/cli/commands/serve.d.ts +1 -1
- package/dist/src/cli/commands/serve.js +1 -1
- package/dist/src/cli/commands/set.d.ts +1 -1
- package/dist/src/cli/commands/set.js +23 -6
- package/dist/src/cli/commands/view.js +2 -2
- package/dist/src/cli/error.d.ts +1 -1
- package/dist/src/cli/error.js +1 -1
- package/dist/src/cli/pr_carry.d.ts +2 -0
- package/dist/src/cli/pr_carry.js +2 -2
- package/dist/src/cli/prompt.d.ts +2 -2
- package/dist/src/cli/prompt.js +3 -3
- package/dist/src/cli/review_args.js +2 -2
- package/dist/src/cli/review_carry.d.ts +3 -1
- package/dist/src/cli/review_carry.js +5 -3
- package/dist/src/cli/review_result.d.ts +13 -5
- package/dist/src/cli/review_result.js +19 -9
- package/dist/src/config.d.ts +20 -11
- package/dist/src/config.js +3 -3
- package/dist/src/github/app.d.ts +1 -1
- package/dist/src/github/app.js +1 -1
- package/dist/src/github/app_manifest.d.ts +1 -1
- package/dist/src/github/app_manifest.js +1 -1
- package/dist/src/github/client.d.ts +1 -1
- package/dist/src/github/client.js +1 -1
- package/dist/src/github/collect.d.ts +7 -1
- package/dist/src/github/collect.js +41 -16
- package/dist/src/github/gh.js +2 -2
- package/dist/src/github/jwt.d.ts +1 -1
- package/dist/src/github/jwt.js +1 -1
- package/dist/src/github/oauth.js +2 -2
- package/dist/src/knowledge/facts.js +3 -3
- package/dist/src/knowledge/guide.d.ts +24 -1
- package/dist/src/knowledge/guide.js +46 -16
- package/dist/src/knowledge/guide_ids.d.ts +9 -0
- package/dist/src/knowledge/guide_ids.js +26 -7
- package/dist/src/knowledge/probe.js +1 -1
- package/dist/src/knowledge/rule_changes.d.ts +18 -0
- package/dist/src/knowledge/rule_changes.js +41 -0
- package/dist/src/knowledge/rules.d.ts +11 -0
- package/dist/src/knowledge/rules.js +10 -1
- package/dist/src/knowledge/skill.js +1 -1
- package/dist/src/knowledge/stable_ids.d.ts +29 -0
- package/dist/src/knowledge/stable_ids.js +90 -0
- package/dist/src/knowledge/synthesis.d.ts +13 -1
- package/dist/src/knowledge/synthesis.js +94 -26
- package/dist/src/knowledge/types.d.ts +16 -0
- package/dist/src/local/carry_over_store.d.ts +1 -1
- package/dist/src/local/carry_over_store.js +1 -1
- package/dist/src/local/codegraph_prepare.js +1 -1
- package/dist/src/local/git_ops.js +1 -1
- package/dist/src/local/review_local.js +6 -5
- package/dist/src/local/review_lock.d.ts +1 -1
- package/dist/src/pr/checkout.d.ts +3 -3
- package/dist/src/pr/checkout.js +7 -7
- package/dist/src/pr/codegraph_tool_args.d.ts +1 -1
- package/dist/src/pr/codegraph_tool_args.js +1 -1
- package/dist/src/pr/findings.d.ts +3 -0
- package/dist/src/pr/findings.js +29 -10
- package/dist/src/pr/findings_json.d.ts +2 -2
- package/dist/src/pr/findings_json.js +15 -2
- package/dist/src/pr/github_revision.js +1 -1
- package/dist/src/pr/review_copy.d.ts +2 -3
- package/dist/src/pr/review_copy.js +2 -3
- package/dist/src/pr/reviewer.d.ts +7 -3
- package/dist/src/pr/reviewer.js +26 -26
- package/dist/src/pr/scope.d.ts +8 -8
- package/dist/src/pr/scope.js +4 -4
- package/dist/src/pr/snapshot.d.ts +2 -2
- package/dist/src/remote/client.js +4 -3
- package/dist/src/remote/schema.d.ts +1 -1
- package/dist/src/remote/schema.js +1 -1
- package/dist/src/remote/server/body.d.ts +1 -1
- package/dist/src/remote/server/body.js +1 -1
- package/dist/src/remote/server/guides.js +1 -1
- package/dist/src/remote/validate.js +1 -1
- package/dist/src/review/blocking.d.ts +3 -3
- package/dist/src/review/blocking.js +2 -2
- package/dist/src/review/carry_over.d.ts +9 -1
- package/dist/src/review/carry_over.js +10 -2
- package/dist/src/review/diagram.js +7 -6
- package/dist/src/review/engine.d.ts +1 -1
- package/dist/src/review/guides.js +1 -1
- package/dist/src/review/references.d.ts +68 -0
- package/dist/src/review/references.js +176 -0
- package/dist/src/review/system_prompt.d.ts +1 -1
- package/dist/src/review/system_prompt.js +1 -1
- package/dist/src/server/api/jobs.js +2 -2
- package/dist/src/server/api/repos.js +1 -1
- package/dist/src/server/app.js +1 -1
- package/dist/src/server/auth.d.ts +3 -3
- package/dist/src/server/auth.js +9 -4
- package/dist/src/server/http.js +5 -5
- package/dist/src/server/pages/activity.js +1 -1
- package/dist/src/server/pages/add_repo.js +1 -0
- package/dist/src/server/pages/client.d.ts +2 -2
- package/dist/src/server/pages/client.js +2 -2
- package/dist/src/server/pages/home.d.ts +1 -1
- package/dist/src/server/pages/home.js +1 -1
- package/dist/src/server/pages/icons.d.ts +1 -1
- package/dist/src/server/pages/icons.js +1 -1
- package/dist/src/server/pages/layout.d.ts +2 -2
- package/dist/src/server/pages/layout.js +3 -3
- package/dist/src/server/pages/pr.js +4 -0
- package/dist/src/server/pages/rate_limit_waits.js +2 -2
- package/dist/src/server/pages/references.d.ts +2 -0
- package/dist/src/server/pages/references.js +55 -0
- package/dist/src/server/pages/repo.js +26 -0
- package/dist/src/server/pages/repo_settings.js +1 -0
- package/dist/src/server/pages/router.js +3 -2
- package/dist/src/server/pages/styles.d.ts +2 -2
- package/dist/src/server/pages/styles.js +2 -2
- package/dist/src/server/pages/ui.d.ts +1 -1
- package/dist/src/server/pages/ui.js +2 -2
- package/dist/src/server/webhook/index.js +1 -1
- package/dist/src/services/clear.d.ts +2 -2
- package/dist/src/services/clear.js +2 -2
- package/dist/src/services/dashboard.d.ts +2 -0
- package/dist/src/services/dashboard.js +2 -0
- package/dist/src/services/probe.js +1 -1
- package/dist/src/services/push_review.js +4 -1
- package/dist/src/services/remote_review.js +5 -2
- package/dist/src/services/remote_review_abort.d.ts +1 -1
- package/dist/src/services/remote_review_abort.js +1 -1
- package/dist/src/services/remote_tokens.js +1 -1
- package/dist/src/services/replies.js +0 -2
- package/dist/src/services/review.d.ts +3 -5
- package/dist/src/services/review.js +43 -18
- package/dist/src/services/rules_build.d.ts +20 -1
- package/dist/src/services/rules_build.js +85 -6
- package/dist/src/services/setup.d.ts +2 -2
- package/dist/src/services/setup.js +36 -11
- package/dist/src/services/watch_comments.js +1 -2
- package/dist/src/services/watch_notes.js +1 -3
- package/dist/src/store/app_db.d.ts +1 -1
- package/dist/src/store/app_db.js +2 -2
- package/dist/src/store/findings.d.ts +2 -0
- package/dist/src/store/findings.js +3 -3
- package/dist/src/store/jobs.d.ts +2 -2
- package/dist/src/store/jobs.js +3 -3
- package/dist/src/store/migrations.d.ts +2 -2
- package/dist/src/store/migrations.js +35 -18
- package/dist/src/store/rows.d.ts +4 -2
- package/dist/src/store/rows.js +1 -1
- package/dist/src/store/rule_events.d.ts +15 -0
- package/dist/src/store/rule_events.js +20 -0
- package/dist/src/store/sessions.d.ts +1 -1
- package/dist/src/store/sessions.js +2 -2
- package/dist/src/store/sqlite.js +2 -2
- package/dist/src/tools/codegraph.d.ts +1 -1
- package/dist/src/tools/codegraph.js +3 -3
- package/dist/src/tools/codegraph_exec.d.ts +1 -1
- package/dist/src/tools/codegraph_exec.js +1 -1
- package/dist/src/types.d.ts +6 -2
- package/dist/src/util/keyed_lock.d.ts +1 -1
- package/dist/src/util/keyed_lock.js +1 -1
- package/dist/src/util/log.js +1 -1
- package/dist/src/util/redact.js +2 -1
- package/dist/src/util/run_summary.d.ts +3 -3
- package/dist/src/util/run_summary.js +3 -3
- package/dist/src/util/runtime.d.ts +4 -4
- package/dist/src/util/runtime.js +5 -5
- package/dist/src/util/time.d.ts +1 -1
- package/dist/src/util/time.js +1 -1
- package/package.json +2 -1
package/dist/src/util/log.js
CHANGED
|
@@ -34,7 +34,7 @@ export function startHeartbeat(phase) {
|
|
|
34
34
|
}, 15_000);
|
|
35
35
|
// Never keep the process alive on its own. A long operation holds
|
|
36
36
|
// the loop open through its own pending async work (a fetch, a child), so the
|
|
37
|
-
// heartbeat still fires
|
|
37
|
+
// heartbeat still fires, but once that work is gone the timer must not be the
|
|
38
38
|
// reason the process cannot drain and apply its exit code. Every call site
|
|
39
39
|
// used to clear this by hand on the success path only, so any thrown error
|
|
40
40
|
// leaked it and the CLI hung instead of exiting.
|
package/dist/src/util/redact.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Matches known secret shapes, not a generic "long random string"
|
|
2
|
-
* heuristic
|
|
2
|
+
* heuristic, too many false positives on commit SHAs and hashes. */
|
|
3
3
|
const PATTERNS = [
|
|
4
4
|
/gh[pousr]_[A-Za-z0-9]{20,}/g, // ghp_, gho_, ghu_, ghs_, ghr_ (classic GitHub PATs and tokens)
|
|
5
5
|
/github_pat_[A-Za-z0-9_]{20,}/g, // fine-grained GitHub PATs
|
|
@@ -28,5 +28,6 @@ export function outsideCode(text, clean) {
|
|
|
28
28
|
/** Dashboard and other human-readable copy. Secrets out, no dash, no
|
|
29
29
|
* semicolon. Code keeps its own punctuation or it stops compiling. */
|
|
30
30
|
export function safeCopy(text) {
|
|
31
|
+
// punctuation: code, this cleaner must name the semicolon it removes from AI text
|
|
31
32
|
return outsideCode(redact(text), (prose) => prose.replaceAll("\u2014", ", ").replaceAll(";", "."));
|
|
32
33
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* `Done in 21.0s · 3,125 in, 1,308 out tokens · $0.0016`
|
|
9
9
|
*
|
|
10
|
-
* stdout is untouched
|
|
10
|
+
* stdout is untouched. This is progress/diagnostic output, and mixing it into
|
|
11
11
|
* stdout would corrupt `--json` and any piped text. When the provider does not
|
|
12
12
|
* report a cost the dollar field is `cost unknown` rather than `$0.0000`.
|
|
13
13
|
*/
|
|
@@ -23,11 +23,11 @@ export type RunSummary = {
|
|
|
23
23
|
/** Why the cost is unknown, as a sentence. */
|
|
24
24
|
costNote?: string;
|
|
25
25
|
};
|
|
26
|
-
/** `21.0s`, `1.3s`, `2m 03s
|
|
26
|
+
/** `21.0s`, `1.3s`, `2m 03s`. One decimal below a minute, whole seconds above. */
|
|
27
27
|
export declare function formatDuration(ms: number): string;
|
|
28
28
|
/** The whole line, without a trailing newline. */
|
|
29
29
|
export declare function formatRunSummary(summary: RunSummary): string;
|
|
30
|
-
/** Formats and writes the summary. To stderr for the CLI
|
|
30
|
+
/** Formats and writes the summary. To stderr for the CLI. Inside a dashboard
|
|
31
31
|
* job (no stderr) it goes to the job log instead. It prints even when the run
|
|
32
32
|
* made no AI call, because a cache-hit `sync` that cost nothing is a fact the
|
|
33
33
|
* user asked for, not a reason to stay silent. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { hasLogSink, log } from "./log.js";
|
|
2
2
|
import { costReasonText, settle } from "./cost.js";
|
|
3
|
-
/** `3,125
|
|
3
|
+
/** `3,125`, grouped the way the numbers read in the docs. */
|
|
4
4
|
function group(value) {
|
|
5
5
|
return Math.round(value).toLocaleString("en-US");
|
|
6
6
|
}
|
|
7
|
-
/** `21.0s`, `1.3s`, `2m 03s
|
|
7
|
+
/** `21.0s`, `1.3s`, `2m 03s`. One decimal below a minute, whole seconds above. */
|
|
8
8
|
export function formatDuration(ms) {
|
|
9
9
|
const seconds = ms / 1000;
|
|
10
10
|
if (seconds < 60)
|
|
@@ -26,7 +26,7 @@ export function formatRunSummary(summary) {
|
|
|
26
26
|
: `$${summary.costUsd.toFixed(4)}`);
|
|
27
27
|
return parts.join(" · ");
|
|
28
28
|
}
|
|
29
|
-
/** Formats and writes the summary. To stderr for the CLI
|
|
29
|
+
/** Formats and writes the summary. To stderr for the CLI. Inside a dashboard
|
|
30
30
|
* job (no stderr) it goes to the job log instead. It prints even when the run
|
|
31
31
|
* made no AI call, because a cache-hit `sync` that cost nothing is a fact the
|
|
32
32
|
* user asked for, not a reason to stay silent. */
|
|
@@ -48,7 +48,7 @@ export declare function makeTempDirSync(options?: {
|
|
|
48
48
|
/** A uniquely named temp file (created empty), mirroring `Deno.makeTempFile`.
|
|
49
49
|
*
|
|
50
50
|
* `wx` fails on collision instead of truncating an existing file, so the retry
|
|
51
|
-
* loop preserves `mkdtemp`'s uniqueness without leaving a directory behind
|
|
51
|
+
* loop preserves `mkdtemp`'s uniqueness without leaving a directory behind,
|
|
52
52
|
* callers only ever delete the returned file. */
|
|
53
53
|
export declare function makeTempFile(options?: {
|
|
54
54
|
prefix?: string;
|
|
@@ -93,11 +93,11 @@ export declare function commandSpawn(command: string, options?: CommandOptions):
|
|
|
93
93
|
*
|
|
94
94
|
* Windows: `process.kill(pid, 0)` is unreliable (Node emulates signals and
|
|
95
95
|
* would terminate the target), so `tasklist` answers without touching it.
|
|
96
|
-
* POSIX: signal 0 checks existence without delivering
|
|
97
|
-
* while `EPERM` (or anything else) means it exists but is not ours
|
|
96
|
+
* POSIX: signal 0 checks existence without delivering, `ESRCH` means dead,
|
|
97
|
+
* while `EPERM` (or anything else) means it exists but is not ours, assume
|
|
98
98
|
* alive rather than risk two writers on the same database. */
|
|
99
99
|
/** Decides Windows PID liveness from a `tasklist` invocation. A matching row is
|
|
100
|
-
* CSV and starts with the quoted image name
|
|
100
|
+
* CSV and starts with the quoted image name. The "no tasks" notice is prose, so
|
|
101
101
|
* the distinction is locale-independent. A spawn failure or an empty body is
|
|
102
102
|
* indeterminate and reports alive: refusing to start beats letting a second
|
|
103
103
|
* writer take over a live lock. */
|
package/dist/src/util/runtime.js
CHANGED
|
@@ -16,7 +16,7 @@ export function isWindows() {
|
|
|
16
16
|
}
|
|
17
17
|
// Windows only: keep the current working directory out of the executable search
|
|
18
18
|
// path, so a `git.cmd` / `gh.exe` committed in a reviewed repository cannot run
|
|
19
|
-
// in place of the real tool. Set once at module load
|
|
19
|
+
// in place of the real tool. Set once at module load, before any child spawn,
|
|
20
20
|
// and inherited by every child process we start.
|
|
21
21
|
if (isWindows() && !process.env.NoDefaultCurrentDirectoryInExePath) {
|
|
22
22
|
process.env.NoDefaultCurrentDirectoryInExePath = "1";
|
|
@@ -117,7 +117,7 @@ export function makeTempDirSync(options) {
|
|
|
117
117
|
/** A uniquely named temp file (created empty), mirroring `Deno.makeTempFile`.
|
|
118
118
|
*
|
|
119
119
|
* `wx` fails on collision instead of truncating an existing file, so the retry
|
|
120
|
-
* loop preserves `mkdtemp`'s uniqueness without leaving a directory behind
|
|
120
|
+
* loop preserves `mkdtemp`'s uniqueness without leaving a directory behind,
|
|
121
121
|
* callers only ever delete the returned file. */
|
|
122
122
|
export async function makeTempFile(options) {
|
|
123
123
|
const prefix = options?.prefix ?? "cm-";
|
|
@@ -212,11 +212,11 @@ export function commandSpawn(command, options = {}) {
|
|
|
212
212
|
*
|
|
213
213
|
* Windows: `process.kill(pid, 0)` is unreliable (Node emulates signals and
|
|
214
214
|
* would terminate the target), so `tasklist` answers without touching it.
|
|
215
|
-
* POSIX: signal 0 checks existence without delivering
|
|
216
|
-
* while `EPERM` (or anything else) means it exists but is not ours
|
|
215
|
+
* POSIX: signal 0 checks existence without delivering, `ESRCH` means dead,
|
|
216
|
+
* while `EPERM` (or anything else) means it exists but is not ours, assume
|
|
217
217
|
* alive rather than risk two writers on the same database. */
|
|
218
218
|
/** Decides Windows PID liveness from a `tasklist` invocation. A matching row is
|
|
219
|
-
* CSV and starts with the quoted image name
|
|
219
|
+
* CSV and starts with the quoted image name. The "no tasks" notice is prose, so
|
|
220
220
|
* the distinction is locale-independent. A spawn failure or an empty body is
|
|
221
221
|
* indeterminate and reports alive: refusing to start beats letting a second
|
|
222
222
|
* writer take over a live lock. */
|
package/dist/src/util/time.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The one place every stored timestamp comes from. The
|
|
2
2
|
* "every timestamp is ISO8601 UTC" rule lives here instead of as a
|
|
3
|
-
* convention repeated at each call site
|
|
3
|
+
* convention repeated at each call site, `store/*` never calls
|
|
4
4
|
* `new Date().toISOString()` directly. */
|
|
5
5
|
export declare function nowIso(): string;
|
|
6
6
|
/** Short relative label for dashboard tables. Never emits a dash or
|
package/dist/src/util/time.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The one place every stored timestamp comes from. The
|
|
2
2
|
* "every timestamp is ISO8601 UTC" rule lives here instead of as a
|
|
3
|
-
* convention repeated at each call site
|
|
3
|
+
* convention repeated at each call site, `store/*` never calls
|
|
4
4
|
* `new Date().toISOString()` directly. */
|
|
5
5
|
export function nowIso() {
|
|
6
6
|
return new Date().toISOString();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "co-maintainer",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "An imitator of yours, A PR review tool like co-maintainer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"lint": "oxlint",
|
|
41
41
|
"fmt": "oxfmt --write .",
|
|
42
42
|
"fmt:check": "oxfmt --check .",
|
|
43
|
+
"punctuation": "node scripts/punctuation.ts",
|
|
43
44
|
"dev": "node --watch main.ts",
|
|
44
45
|
"probe": "node main.ts probe",
|
|
45
46
|
"init": "node main.ts init",
|