co-maintainer 0.7.2-beta.1 → 0.7.2

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 (159) hide show
  1. package/dist/package.json +2 -1
  2. package/dist/src/ai/anthropic.d.ts +1 -1
  3. package/dist/src/ai/anthropic.js +1 -1
  4. package/dist/src/ai/batch.d.ts +1 -1
  5. package/dist/src/ai/batch.js +3 -3
  6. package/dist/src/ai/copy_rule.d.ts +7 -0
  7. package/dist/src/ai/copy_rule.js +23 -0
  8. package/dist/src/ai/estimate.js +3 -3
  9. package/dist/src/ai/fake.js +2 -1
  10. package/dist/src/ai/mermaid.js +1 -0
  11. package/dist/src/ai/oauth/registry.d.ts +1 -1
  12. package/dist/src/ai/oauth/sign-in-with-chatgpt.d.ts +4 -4
  13. package/dist/src/ai/oauth/sign-in-with-chatgpt.js +6 -6
  14. package/dist/src/ai/openai.d.ts +3 -3
  15. package/dist/src/ai/openai.js +4 -4
  16. package/dist/src/ai/openrouter.d.ts +1 -1
  17. package/dist/src/ai/openrouter.js +1 -1
  18. package/dist/src/ai/pricing.js +1 -1
  19. package/dist/src/ai/provider.d.ts +2 -0
  20. package/dist/src/ai/provider.js +8 -2
  21. package/dist/src/ai/verify.d.ts +1 -1
  22. package/dist/src/ai/verify.js +1 -1
  23. package/dist/src/cli/args.js +1 -1
  24. package/dist/src/cli/command_json.d.ts +1 -1
  25. package/dist/src/cli/commands/config.d.ts +1 -1
  26. package/dist/src/cli/commands/config.js +1 -1
  27. package/dist/src/cli/commands/oauth.js +1 -1
  28. package/dist/src/cli/commands/probe.js +1 -1
  29. package/dist/src/cli/commands/serve.d.ts +1 -1
  30. package/dist/src/cli/commands/serve.js +1 -1
  31. package/dist/src/cli/commands/set.d.ts +1 -1
  32. package/dist/src/cli/commands/set.js +4 -4
  33. package/dist/src/cli/commands/view.js +2 -2
  34. package/dist/src/cli/error.d.ts +1 -1
  35. package/dist/src/cli/error.js +1 -1
  36. package/dist/src/cli/prompt.d.ts +2 -2
  37. package/dist/src/cli/prompt.js +3 -3
  38. package/dist/src/cli/review_args.js +2 -2
  39. package/dist/src/cli/review_result.d.ts +3 -4
  40. package/dist/src/cli/review_result.js +5 -8
  41. package/dist/src/config.d.ts +11 -11
  42. package/dist/src/config.js +3 -3
  43. package/dist/src/github/app.d.ts +1 -1
  44. package/dist/src/github/app.js +1 -1
  45. package/dist/src/github/app_manifest.d.ts +1 -1
  46. package/dist/src/github/app_manifest.js +1 -1
  47. package/dist/src/github/client.d.ts +1 -1
  48. package/dist/src/github/client.js +1 -1
  49. package/dist/src/github/gh.js +2 -2
  50. package/dist/src/github/jwt.d.ts +1 -1
  51. package/dist/src/github/jwt.js +1 -1
  52. package/dist/src/github/oauth.js +2 -2
  53. package/dist/src/knowledge/facts.js +3 -3
  54. package/dist/src/knowledge/guide.js +7 -7
  55. package/dist/src/knowledge/probe.js +1 -1
  56. package/dist/src/knowledge/skill.js +1 -1
  57. package/dist/src/knowledge/synthesis.js +7 -7
  58. package/dist/src/local/carry_over_store.d.ts +1 -1
  59. package/dist/src/local/carry_over_store.js +1 -1
  60. package/dist/src/local/codegraph_prepare.js +1 -1
  61. package/dist/src/local/git_ops.js +1 -1
  62. package/dist/src/local/review_local.js +3 -3
  63. package/dist/src/local/review_lock.d.ts +1 -1
  64. package/dist/src/pr/checkout.d.ts +3 -3
  65. package/dist/src/pr/checkout.js +7 -7
  66. package/dist/src/pr/codegraph_tool_args.d.ts +1 -1
  67. package/dist/src/pr/codegraph_tool_args.js +1 -1
  68. package/dist/src/pr/findings.js +8 -9
  69. package/dist/src/pr/findings_json.d.ts +2 -2
  70. package/dist/src/pr/findings_json.js +1 -1
  71. package/dist/src/pr/github_revision.js +1 -1
  72. package/dist/src/pr/review_copy.d.ts +2 -3
  73. package/dist/src/pr/review_copy.js +2 -3
  74. package/dist/src/pr/reviewer.d.ts +3 -3
  75. package/dist/src/pr/reviewer.js +24 -26
  76. package/dist/src/pr/scope.d.ts +8 -8
  77. package/dist/src/pr/scope.js +4 -4
  78. package/dist/src/pr/snapshot.d.ts +2 -2
  79. package/dist/src/remote/client.js +3 -3
  80. package/dist/src/remote/schema.d.ts +1 -1
  81. package/dist/src/remote/schema.js +1 -1
  82. package/dist/src/remote/server/body.d.ts +1 -1
  83. package/dist/src/remote/server/body.js +1 -1
  84. package/dist/src/remote/server/guides.js +1 -1
  85. package/dist/src/remote/validate.js +1 -1
  86. package/dist/src/review/blocking.d.ts +3 -3
  87. package/dist/src/review/blocking.js +2 -2
  88. package/dist/src/review/carry_over.d.ts +1 -1
  89. package/dist/src/review/carry_over.js +2 -2
  90. package/dist/src/review/diagram.js +7 -6
  91. package/dist/src/review/engine.d.ts +1 -1
  92. package/dist/src/review/guides.js +1 -1
  93. package/dist/src/review/system_prompt.d.ts +1 -1
  94. package/dist/src/review/system_prompt.js +1 -1
  95. package/dist/src/server/api/jobs.js +2 -2
  96. package/dist/src/server/api/repos.js +1 -1
  97. package/dist/src/server/app.js +1 -1
  98. package/dist/src/server/auth.d.ts +3 -3
  99. package/dist/src/server/auth.js +9 -4
  100. package/dist/src/server/http.js +5 -5
  101. package/dist/src/server/pages/activity.js +1 -1
  102. package/dist/src/server/pages/add_repo.js +1 -0
  103. package/dist/src/server/pages/client.d.ts +2 -2
  104. package/dist/src/server/pages/client.js +2 -2
  105. package/dist/src/server/pages/home.d.ts +1 -1
  106. package/dist/src/server/pages/home.js +1 -1
  107. package/dist/src/server/pages/icons.d.ts +1 -1
  108. package/dist/src/server/pages/icons.js +1 -1
  109. package/dist/src/server/pages/layout.d.ts +2 -2
  110. package/dist/src/server/pages/layout.js +3 -3
  111. package/dist/src/server/pages/pr.js +2 -0
  112. package/dist/src/server/pages/rate_limit_waits.js +2 -2
  113. package/dist/src/server/pages/repo_settings.js +1 -0
  114. package/dist/src/server/pages/router.js +3 -2
  115. package/dist/src/server/pages/styles.d.ts +2 -2
  116. package/dist/src/server/pages/styles.js +2 -2
  117. package/dist/src/server/pages/ui.d.ts +1 -1
  118. package/dist/src/server/pages/ui.js +2 -2
  119. package/dist/src/server/webhook/index.js +1 -1
  120. package/dist/src/services/clear.d.ts +2 -2
  121. package/dist/src/services/clear.js +2 -2
  122. package/dist/src/services/probe.js +1 -1
  123. package/dist/src/services/remote_review_abort.d.ts +1 -1
  124. package/dist/src/services/remote_review_abort.js +1 -1
  125. package/dist/src/services/remote_tokens.js +1 -1
  126. package/dist/src/services/replies.js +0 -2
  127. package/dist/src/services/review.d.ts +3 -5
  128. package/dist/src/services/review.js +8 -10
  129. package/dist/src/services/setup.d.ts +2 -2
  130. package/dist/src/services/setup.js +9 -9
  131. package/dist/src/services/watch_comments.js +1 -2
  132. package/dist/src/services/watch_notes.js +1 -3
  133. package/dist/src/store/app_db.d.ts +1 -1
  134. package/dist/src/store/app_db.js +2 -2
  135. package/dist/src/store/jobs.d.ts +2 -2
  136. package/dist/src/store/jobs.js +3 -3
  137. package/dist/src/store/migrations.d.ts +2 -2
  138. package/dist/src/store/migrations.js +18 -18
  139. package/dist/src/store/rows.d.ts +2 -2
  140. package/dist/src/store/rows.js +1 -1
  141. package/dist/src/store/sessions.d.ts +1 -1
  142. package/dist/src/store/sessions.js +2 -2
  143. package/dist/src/store/sqlite.js +2 -2
  144. package/dist/src/tools/codegraph.d.ts +1 -1
  145. package/dist/src/tools/codegraph.js +3 -3
  146. package/dist/src/tools/codegraph_exec.d.ts +1 -1
  147. package/dist/src/tools/codegraph_exec.js +1 -1
  148. package/dist/src/types.d.ts +2 -2
  149. package/dist/src/util/keyed_lock.d.ts +1 -1
  150. package/dist/src/util/keyed_lock.js +1 -1
  151. package/dist/src/util/log.js +1 -1
  152. package/dist/src/util/redact.js +2 -1
  153. package/dist/src/util/run_summary.d.ts +3 -3
  154. package/dist/src/util/run_summary.js +3 -3
  155. package/dist/src/util/runtime.d.ts +4 -4
  156. package/dist/src/util/runtime.js +5 -5
  157. package/dist/src/util/time.d.ts +1 -1
  158. package/dist/src/util/time.js +1 -1
  159. package/package.json +2 -1
@@ -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; but once that work is gone the timer must not be the
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.
@@ -1,5 +1,5 @@
1
1
  /** Matches known secret shapes, not a generic "long random string"
2
- * heuristic — too many false positives on commit SHAs and hashes. */
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; this is progress/diagnostic output, and mixing it into
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`; one decimal below a minute, whole seconds above. */
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; inside a dashboard
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` — grouped the way the numbers read in the docs. */
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`; one decimal below a minute, whole seconds above. */
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; inside a dashboard
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; `ESRCH` means dead,
97
- * while `EPERM` (or anything else) means it exists but is not ours — assume
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; the "no tasks" notice is prose, so
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. */
@@ -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 — before any child spawn —
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; `ESRCH` means dead,
216
- * while `EPERM` (or anything else) means it exists but is not ours — assume
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; the "no tasks" notice is prose, so
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. */
@@ -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 — `store/*` never calls
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
@@ -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 — `store/*` never calls
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.2-beta.1",
3
+ "version": "0.7.2",
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",