@codraoss/schema 0.9.4

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/api.d.ts ADDED
@@ -0,0 +1,71 @@
1
+ import { J as JobDetail, a as JobSummary, L as LlmProvider, M as ModelConfig, R as RepoConfigRecord, S as StatsPayload } from './schema-0fUkjd2C.js';
2
+ import 'zod';
3
+
4
+ type AuthSessionUser = {
5
+ githubUserId: number;
6
+ login: string;
7
+ name: string | null;
8
+ avatarUrl: string | null;
9
+ email: string | null;
10
+ signedInAt: string;
11
+ };
12
+ type JobsResponse = {
13
+ jobs: JobSummary[];
14
+ total: number;
15
+ };
16
+ type AuthSessionResponse = {
17
+ user: AuthSessionUser;
18
+ };
19
+ type AccountSettings = {
20
+ id: string;
21
+ githubUserId: number;
22
+ githubUsername: string;
23
+ accountName: string | null;
24
+ accountEmail: string | null;
25
+ timezone: string | null;
26
+ };
27
+ type AccountResponse = {
28
+ account: AccountSettings;
29
+ };
30
+ type UpdatesEmailStatus = 'pending' | 'subscribed';
31
+ type UpdatesEmailResponse = {
32
+ status: UpdatesEmailStatus;
33
+ email: string | null;
34
+ updatedAt: string | null;
35
+ };
36
+ type JobDetailResponse = {
37
+ job: JobDetail;
38
+ };
39
+ /** Per-file reconstructed diff/prompt text, fetched on demand (see GET /api/jobs/:id/diffs) --
40
+ diff_input isn't persisted in Postgres, so this comes from KV or a fresh GitHub fetch. Files
41
+ with no entry are unavailable (e.g. the underlying commits are gone). */
42
+ type JobDiffsResponse = {
43
+ diffs: Record<string, string>;
44
+ };
45
+ type RetryJobResponse = {
46
+ job: JobSummary;
47
+ };
48
+ type RepoConfigsResponse = {
49
+ repos: RepoConfigRecord[];
50
+ };
51
+ type RepoConfigResponse = {
52
+ repo: RepoConfigRecord;
53
+ };
54
+ type StatsResponse = {
55
+ stats: StatsPayload;
56
+ };
57
+ type SyncReposResponse = {
58
+ ok: boolean;
59
+ synced: string[];
60
+ };
61
+ type ModelConfigsResponse = {
62
+ providers: LlmProvider[];
63
+ configs: ModelConfig[];
64
+ syncErrors?: Array<{
65
+ providerId: string;
66
+ providerName: string;
67
+ error: string;
68
+ }>;
69
+ };
70
+
71
+ export type { AccountResponse, AccountSettings, AuthSessionResponse, AuthSessionUser, JobDetailResponse, JobDiffsResponse, JobsResponse, ModelConfigsResponse, RepoConfigResponse, RepoConfigsResponse, RetryJobResponse, StatsResponse, SyncReposResponse, UpdatesEmailResponse, UpdatesEmailStatus };
package/dist/api.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,20 @@
1
+ // src/review-limits.ts
2
+ var reviewSeverities = ["P0", "P1", "P2", "P3", "nit"];
3
+ var reviewConcurrencyLevels = ["low", "medium", "high", "max"];
4
+ var REVIEW_CONCURRENCY_LIMITS = {
5
+ low: 1,
6
+ medium: 2,
7
+ high: 3,
8
+ max: 4
9
+ };
10
+ var reviewMaxCommentsOptions = [5, 10, 15, 20];
11
+ var reviewMaxFilesRange = { min: 1, max: 500, default: 200 };
12
+
13
+ export {
14
+ reviewSeverities,
15
+ reviewConcurrencyLevels,
16
+ REVIEW_CONCURRENCY_LIMITS,
17
+ reviewMaxCommentsOptions,
18
+ reviewMaxFilesRange
19
+ };
20
+ //# sourceMappingURL=chunk-WTXH6CHA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/review-limits.ts"],"sourcesContent":["\nexport const reviewSeverities = ['P0', 'P1', 'P2', 'P3', 'nit'] as const;\n\nexport const reviewConcurrencyLevels = ['low', 'medium', 'high', 'max'] as const;\nexport type ReviewConcurrencyLevel = typeof reviewConcurrencyLevels[number];\n\nexport const REVIEW_CONCURRENCY_LIMITS: Record<ReviewConcurrencyLevel, number> = {\n low: 1,\n medium: 2,\n high: 3,\n max: 4,\n};\n\nexport const reviewMaxCommentsOptions = [5, 10, 15, 20] as const;\n\nexport const reviewMaxFilesRange = { min: 1, max: 500, default: 200 } as const;\n"],"mappings":";AACO,IAAM,mBAAmB,CAAC,MAAM,MAAM,MAAM,MAAM,KAAK;AAEvD,IAAM,0BAA0B,CAAC,OAAO,UAAU,QAAQ,KAAK;AAG/D,IAAM,4BAAoE;AAAA,EAC/E,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AACP;AAEO,IAAM,2BAA2B,CAAC,GAAG,IAAI,IAAI,EAAE;AAE/C,IAAM,sBAAsB,EAAE,KAAK,GAAG,KAAK,KAAK,SAAS,IAAI;","names":[]}
@@ -0,0 +1,101 @@
1
+ declare const feedbackGitHubWebhookEvents: readonly ["pull_request_review_comment", "pull_request_review_thread"];
2
+ type FeedbackGitHubWebhookEventName = typeof feedbackGitHubWebhookEvents[number];
3
+ declare function isFeedbackGitHubWebhookEvent(eventName: string): eventName is FeedbackGitHubWebhookEventName;
4
+ type GitHubReviewCommentPayload = {
5
+ id: number;
6
+ body: string | null;
7
+ path?: string | null;
8
+ line?: number | null;
9
+ user?: {
10
+ login?: string | null;
11
+ } | null;
12
+ };
13
+ type PullRequestReviewCommentWebhookPayload = {
14
+ action: 'created' | 'edited' | 'deleted';
15
+ installation?: {
16
+ id: number;
17
+ };
18
+ repository: {
19
+ owner: {
20
+ login: string;
21
+ };
22
+ name: string;
23
+ };
24
+ pull_request: {
25
+ number: number;
26
+ };
27
+ comment: GitHubReviewCommentPayload;
28
+ };
29
+ type PullRequestReviewThreadWebhookPayload = {
30
+ action: 'resolved' | 'unresolved';
31
+ installation?: {
32
+ id: number;
33
+ };
34
+ repository: {
35
+ owner: {
36
+ login: string;
37
+ };
38
+ name: string;
39
+ };
40
+ pull_request: {
41
+ number: number;
42
+ };
43
+ thread: {
44
+ node_id?: string;
45
+ comments: GitHubReviewCommentPayload[];
46
+ };
47
+ };
48
+ type FeedbackWebhookPayload = PullRequestReviewCommentWebhookPayload | PullRequestReviewThreadWebhookPayload;
49
+ type PullRequestWebhookPayload = {
50
+ action: 'opened' | 'synchronize' | 'ready_for_review' | 'reopened' | 'closed';
51
+ installation?: {
52
+ id: number;
53
+ };
54
+ repository: {
55
+ owner: {
56
+ login: string;
57
+ };
58
+ name: string;
59
+ };
60
+ pull_request: {
61
+ number: number;
62
+ title: string;
63
+ user: {
64
+ login: string;
65
+ };
66
+ head: {
67
+ sha: string;
68
+ ref: string;
69
+ };
70
+ base: {
71
+ sha: string;
72
+ ref: string;
73
+ };
74
+ draft: boolean;
75
+ body: string | null;
76
+ };
77
+ };
78
+ type IssueCommentWebhookPayload = {
79
+ action: 'created';
80
+ installation?: {
81
+ id: number;
82
+ };
83
+ repository: {
84
+ owner: {
85
+ login: string;
86
+ };
87
+ name: string;
88
+ };
89
+ issue: {
90
+ number: number;
91
+ pull_request?: {
92
+ url: string;
93
+ };
94
+ };
95
+ comment: {
96
+ body: string;
97
+ };
98
+ };
99
+ type GitHubWebhookPayload = FeedbackWebhookPayload | PullRequestWebhookPayload | IssueCommentWebhookPayload | Record<string, unknown>;
100
+
101
+ export { type FeedbackGitHubWebhookEventName, type FeedbackWebhookPayload, type GitHubReviewCommentPayload, type GitHubWebhookPayload, type IssueCommentWebhookPayload, type PullRequestReviewCommentWebhookPayload, type PullRequestReviewThreadWebhookPayload, type PullRequestWebhookPayload, feedbackGitHubWebhookEvents, isFeedbackGitHubWebhookEvent };
package/dist/github.js ADDED
@@ -0,0 +1,10 @@
1
+ // src/github.ts
2
+ var feedbackGitHubWebhookEvents = ["pull_request_review_comment", "pull_request_review_thread"];
3
+ function isFeedbackGitHubWebhookEvent(eventName) {
4
+ return feedbackGitHubWebhookEvents.includes(eventName);
5
+ }
6
+ export {
7
+ feedbackGitHubWebhookEvents,
8
+ isFeedbackGitHubWebhookEvent
9
+ };
10
+ //# sourceMappingURL=github.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/github.ts"],"sourcesContent":["\nexport const feedbackGitHubWebhookEvents = ['pull_request_review_comment', 'pull_request_review_thread'] as const;\n\nexport type FeedbackGitHubWebhookEventName = typeof feedbackGitHubWebhookEvents[number];\n\nexport function isFeedbackGitHubWebhookEvent(eventName: string): eventName is FeedbackGitHubWebhookEventName {\n return (feedbackGitHubWebhookEvents as readonly string[]).includes(eventName);\n}\n\nexport type GitHubReviewCommentPayload = {\n id: number;\n body: string | null;\n path?: string | null;\n line?: number | null;\n user?: { login?: string | null } | null;\n};\n\nexport type PullRequestReviewCommentWebhookPayload = {\n action: 'created' | 'edited' | 'deleted';\n installation?: { id: number };\n repository: { owner: { login: string }; name: string };\n pull_request: { number: number };\n comment: GitHubReviewCommentPayload;\n};\n\nexport type PullRequestReviewThreadWebhookPayload = {\n action: 'resolved' | 'unresolved';\n installation?: { id: number };\n repository: { owner: { login: string }; name: string };\n pull_request: { number: number };\n thread: { node_id?: string; comments: GitHubReviewCommentPayload[] };\n};\n\nexport type FeedbackWebhookPayload =\n | PullRequestReviewCommentWebhookPayload\n | PullRequestReviewThreadWebhookPayload;\n\nexport type PullRequestWebhookPayload = {\n action: 'opened' | 'synchronize' | 'ready_for_review' | 'reopened' | 'closed';\n installation?: { id: number };\n repository: {\n owner: { login: string };\n name: string;\n };\n pull_request: {\n number: number;\n title: string;\n user: { login: string };\n head: { sha: string; ref: string };\n base: { sha: string; ref: string };\n draft: boolean;\n body: string | null;\n };\n};\n\nexport type IssueCommentWebhookPayload = {\n action: 'created';\n installation?: { id: number };\n repository: {\n owner: { login: string };\n name: string;\n };\n issue: {\n number: number;\n pull_request?: {\n url: string;\n };\n };\n comment: {\n body: string;\n };\n};\n\nexport type GitHubWebhookPayload =\n | FeedbackWebhookPayload\n | PullRequestWebhookPayload\n | IssueCommentWebhookPayload\n | Record<string, unknown>;\n"],"mappings":";AACO,IAAM,8BAA8B,CAAC,+BAA+B,4BAA4B;AAIhG,SAAS,6BAA6B,WAAgE;AAC3G,SAAQ,4BAAkD,SAAS,SAAS;AAC9E;","names":[]}
package/dist/hex.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare function hexToBytes(hex: string): Uint8Array<ArrayBuffer>;
2
+ declare function randomHex(size?: number): string;
3
+
4
+ export { hexToBytes, randomHex };
package/dist/hex.js ADDED
@@ -0,0 +1,18 @@
1
+ // src/hex.ts
2
+ function hexToBytes(hex) {
3
+ const clean = hex.trim().toLowerCase();
4
+ const bytes = new Uint8Array(clean.length / 2);
5
+ for (let index = 0; index < clean.length; index += 2) {
6
+ bytes[index / 2] = Number.parseInt(clean.slice(index, index + 2), 16);
7
+ }
8
+ return bytes;
9
+ }
10
+ function randomHex(size = 32) {
11
+ const bytes = crypto.getRandomValues(new Uint8Array(size));
12
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
13
+ }
14
+ export {
15
+ hexToBytes,
16
+ randomHex
17
+ };
18
+ //# sourceMappingURL=hex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hex.ts"],"sourcesContent":["// Hex helpers, shared so the webhook verifier, the job store and the token minters agree.\n\n// Trims first: leading/trailing whitespace on a header-supplied value would shift every byte since length drives the slice offsets.\nexport function hexToBytes(hex: string) {\n const clean = hex.trim().toLowerCase();\n const bytes = new Uint8Array(clean.length / 2);\n\n for (let index = 0; index < clean.length; index += 2) {\n bytes[index / 2] = Number.parseInt(clean.slice(index, index + 2), 16);\n }\n\n return bytes;\n}\n\n// Cryptographically random hex, for OAuth state and session tokens.\nexport function randomHex(size = 32) {\n const bytes = crypto.getRandomValues(new Uint8Array(size));\n return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');\n}\n"],"mappings":";AAGO,SAAS,WAAW,KAAa;AACtC,QAAM,QAAQ,IAAI,KAAK,EAAE,YAAY;AACrC,QAAM,QAAQ,IAAI,WAAW,MAAM,SAAS,CAAC;AAE7C,WAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG;AACpD,UAAM,QAAQ,CAAC,IAAI,OAAO,SAAS,MAAM,MAAM,OAAO,QAAQ,CAAC,GAAG,EAAE;AAAA,EACtE;AAEA,SAAO;AACT;AAGO,SAAS,UAAU,OAAO,IAAI;AACnC,QAAM,QAAQ,OAAO,gBAAgB,IAAI,WAAW,IAAI,CAAC;AACzD,SAAO,MAAM,KAAK,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE;AAChF;","names":[]}
@@ -0,0 +1,219 @@
1
+ export { F as FileReviewRecord, J as JobDetail, b as JobStep, a as JobSummary, c as LlmApiFormat, L as LlmProvider, d as LlmProviderSecret, M as ModelConfig, P as ParsedReviewComment, R as RepoConfigRecord, e as ResolvedModelConfig, f as ReviewJobMessage, g as ReviewSettings, S as StatsPayload, h as batchReviewModelOutputSchema, i as fileReviewModelOutputSchema, j as findingLabelSchema, k as jobDetailSchema, l as jobStepSchema, m as jobSummarySchema, n as jobsQuerySchema, o as llmProviderSchema, p as modelConfigSchema, q as parsedReviewCommentSchema, r as repoConfigRecordSchema, s as reviewJobMessageSchema, t as reviewSettingsSchema, u as statsSchema } from './schema-0fUkjd2C.js';
2
+ export { REVIEW_CONCURRENCY_LIMITS, ReviewConcurrencyLevel, reviewConcurrencyLevels, reviewMaxCommentsOptions, reviewMaxFilesRange, reviewSeverities } from './review-limits.js';
3
+ import { z } from 'zod';
4
+
5
+ declare const reviewTriggers: readonly ["auto", "mention", "retry"];
6
+ declare const jobStatuses: readonly ["queued", "running", "done", "failed", "superseded", "cancelled", "stopped"];
7
+ declare const fileStatuses: readonly ["pending", "done", "skipped", "failed"];
8
+ declare const reviewVerdicts: readonly ["approve", "comment"];
9
+ declare const reviewCategories: readonly ["security", "bugs", "performance", "correctness", "quality"];
10
+ declare const llmApiFormats: readonly ["openai", "anthropic", "gemini", "cloudflare-workers-ai", "vertex"];
11
+
12
+ declare const claimTypes: readonly ["react_hook_missing_deps", "react_missing_cleanup", "missing_await", "unhandled_promise_rejection", "resource_leak", "null_or_undefined_deref", "sql_injection", "unsafe_dom_sink", "unsafe_dynamic_code", "insecure_randomness", "hardcoded_secret", "redos_regex", "swallowed_error", "mutable_default_arg", "destructive_migration", "external_version_claim", "other"];
13
+ type ClaimType = typeof claimTypes[number];
14
+ declare const CLAIM_TYPE_CATEGORY: Record<ClaimType, typeof reviewCategories[number]>;
15
+ declare function toClaimType(value: unknown): ClaimType;
16
+ declare const CLAIM_TYPE_DECIDABILITY: Record<ClaimType, 'diff_local' | 'needs_whole_file' | 'needs_external_facts'>;
17
+ declare const DEFAULT_DENIED_CLAIM_TYPES: ClaimType[];
18
+ declare const DEFAULT_SHADOW_RULE_IDS: readonly ["empty-catch", "debugger-statement", "focused-test", "dynamic-code-exec", "dynamic-html-sink", "mutable-default-arg", "destructive-migration", "hardcoded-secret", "insecure-random"];
19
+ declare const findingDispositions: readonly ["posted", "severity", "confidence", "suppression", "dedupe", "verify", "verify_unanswered", "rule_unverified", "cap", "unverifiable_passthrough"];
20
+ type FindingDisposition = typeof findingDispositions[number];
21
+
22
+ declare const reviewConfigSchema: z.ZodObject<{
23
+ on: z.ZodDefault<z.ZodArray<z.ZodEnum<{
24
+ opened: "opened";
25
+ synchronize: "synchronize";
26
+ ready_for_review: "ready_for_review";
27
+ reopened: "reopened";
28
+ closed: "closed";
29
+ }>>>;
30
+ ignore_drafts: z.ZodDefault<z.ZodBoolean>;
31
+ mention_trigger: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodString]>>;
32
+ skip_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
33
+ large_file_threshold_lines: z.ZodDefault<z.ZodNumber>;
34
+ max_diff_lines_per_file: z.ZodDefault<z.ZodNumber>;
35
+ batch_small_files: z.ZodDefault<z.ZodBoolean>;
36
+ max_total_diff_chars: z.ZodDefault<z.ZodNumber>;
37
+ max_comments: z.ZodDefault<z.ZodNumber>;
38
+ min_severity: z.ZodDefault<z.ZodEnum<{
39
+ P0: "P0";
40
+ P1: "P1";
41
+ P2: "P2";
42
+ P3: "P3";
43
+ nit: "nit";
44
+ }>>;
45
+ min_confidence: z.ZodDefault<z.ZodNumber>;
46
+ focus: z.ZodDefault<z.ZodArray<z.ZodEnum<{
47
+ security: "security";
48
+ bugs: "bugs";
49
+ performance: "performance";
50
+ correctness: "correctness";
51
+ quality: "quality";
52
+ }>>>;
53
+ deny_claim_types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
54
+ react_hook_missing_deps: "react_hook_missing_deps";
55
+ react_missing_cleanup: "react_missing_cleanup";
56
+ missing_await: "missing_await";
57
+ unhandled_promise_rejection: "unhandled_promise_rejection";
58
+ resource_leak: "resource_leak";
59
+ null_or_undefined_deref: "null_or_undefined_deref";
60
+ sql_injection: "sql_injection";
61
+ unsafe_dom_sink: "unsafe_dom_sink";
62
+ unsafe_dynamic_code: "unsafe_dynamic_code";
63
+ insecure_randomness: "insecure_randomness";
64
+ hardcoded_secret: "hardcoded_secret";
65
+ redos_regex: "redos_regex";
66
+ swallowed_error: "swallowed_error";
67
+ mutable_default_arg: "mutable_default_arg";
68
+ destructive_migration: "destructive_migration";
69
+ external_version_claim: "external_version_claim";
70
+ other: "other";
71
+ }>>>;
72
+ rules: z.ZodDefault<z.ZodObject<{
73
+ enabled: z.ZodDefault<z.ZodBoolean>;
74
+ disabled_rule_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
75
+ shadow_rule_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
76
+ }, z.core.$strip>>;
77
+ custom_rules: z.ZodDefault<z.ZodArray<z.ZodString>>;
78
+ labels: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
79
+ p1: z.ZodString;
80
+ p2: z.ZodString;
81
+ p3: z.ZodString;
82
+ }, z.core.$strip>]>>;
83
+ exec: z.ZodDefault<z.ZodObject<{
84
+ enabled: z.ZodDefault<z.ZodBoolean>;
85
+ on_file_types: z.ZodDefault<z.ZodArray<z.ZodString>>;
86
+ command: z.ZodDefault<z.ZodString>;
87
+ }, z.core.$strip>>;
88
+ }, z.core.$strip>;
89
+ declare const repoConfigSchema: z.ZodObject<{
90
+ review: z.ZodDefault<z.ZodObject<{
91
+ on: z.ZodDefault<z.ZodArray<z.ZodEnum<{
92
+ opened: "opened";
93
+ synchronize: "synchronize";
94
+ ready_for_review: "ready_for_review";
95
+ reopened: "reopened";
96
+ closed: "closed";
97
+ }>>>;
98
+ ignore_drafts: z.ZodDefault<z.ZodBoolean>;
99
+ mention_trigger: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodString]>>;
100
+ skip_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
101
+ large_file_threshold_lines: z.ZodDefault<z.ZodNumber>;
102
+ max_diff_lines_per_file: z.ZodDefault<z.ZodNumber>;
103
+ batch_small_files: z.ZodDefault<z.ZodBoolean>;
104
+ max_total_diff_chars: z.ZodDefault<z.ZodNumber>;
105
+ max_comments: z.ZodDefault<z.ZodNumber>;
106
+ min_severity: z.ZodDefault<z.ZodEnum<{
107
+ P0: "P0";
108
+ P1: "P1";
109
+ P2: "P2";
110
+ P3: "P3";
111
+ nit: "nit";
112
+ }>>;
113
+ min_confidence: z.ZodDefault<z.ZodNumber>;
114
+ focus: z.ZodDefault<z.ZodArray<z.ZodEnum<{
115
+ security: "security";
116
+ bugs: "bugs";
117
+ performance: "performance";
118
+ correctness: "correctness";
119
+ quality: "quality";
120
+ }>>>;
121
+ deny_claim_types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
122
+ react_hook_missing_deps: "react_hook_missing_deps";
123
+ react_missing_cleanup: "react_missing_cleanup";
124
+ missing_await: "missing_await";
125
+ unhandled_promise_rejection: "unhandled_promise_rejection";
126
+ resource_leak: "resource_leak";
127
+ null_or_undefined_deref: "null_or_undefined_deref";
128
+ sql_injection: "sql_injection";
129
+ unsafe_dom_sink: "unsafe_dom_sink";
130
+ unsafe_dynamic_code: "unsafe_dynamic_code";
131
+ insecure_randomness: "insecure_randomness";
132
+ hardcoded_secret: "hardcoded_secret";
133
+ redos_regex: "redos_regex";
134
+ swallowed_error: "swallowed_error";
135
+ mutable_default_arg: "mutable_default_arg";
136
+ destructive_migration: "destructive_migration";
137
+ external_version_claim: "external_version_claim";
138
+ other: "other";
139
+ }>>>;
140
+ rules: z.ZodDefault<z.ZodObject<{
141
+ enabled: z.ZodDefault<z.ZodBoolean>;
142
+ disabled_rule_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
143
+ shadow_rule_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
144
+ }, z.core.$strip>>;
145
+ custom_rules: z.ZodDefault<z.ZodArray<z.ZodString>>;
146
+ labels: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
147
+ p1: z.ZodString;
148
+ p2: z.ZodString;
149
+ p3: z.ZodString;
150
+ }, z.core.$strip>]>>;
151
+ exec: z.ZodDefault<z.ZodObject<{
152
+ enabled: z.ZodDefault<z.ZodBoolean>;
153
+ on_file_types: z.ZodDefault<z.ZodArray<z.ZodString>>;
154
+ command: z.ZodDefault<z.ZodString>;
155
+ }, z.core.$strip>>;
156
+ }, z.core.$strip>>;
157
+ model: z.ZodDefault<z.ZodObject<{
158
+ main: z.ZodDefault<z.ZodNullable<z.ZodString>>;
159
+ fallbacks: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>;
160
+ size_overrides: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
161
+ max_lines: z.ZodNumber;
162
+ model: z.ZodString;
163
+ fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
164
+ }, z.core.$strip>>>>;
165
+ }, z.core.$strip>>;
166
+ }, z.core.$strip>;
167
+ type RepoConfig = z.infer<typeof repoConfigSchema>;
168
+ declare function normalizeModelId(model: string): string;
169
+ declare function normalizeRepoModelConfig(model: RepoConfig['model']): RepoConfig['model'];
170
+ declare function normalizeRepoConfig(config: RepoConfig): RepoConfig;
171
+ declare const defaultRepoConfig: {
172
+ review: {
173
+ on: ("opened" | "synchronize" | "ready_for_review" | "reopened" | "closed")[];
174
+ ignore_drafts: boolean;
175
+ mention_trigger: string | false;
176
+ skip_files: string[];
177
+ large_file_threshold_lines: number;
178
+ max_diff_lines_per_file: number;
179
+ batch_small_files: boolean;
180
+ max_total_diff_chars: number;
181
+ max_comments: number;
182
+ min_severity: "P0" | "P1" | "P2" | "P3" | "nit";
183
+ min_confidence: number;
184
+ focus: ("security" | "bugs" | "performance" | "correctness" | "quality")[];
185
+ deny_claim_types: ("react_hook_missing_deps" | "react_missing_cleanup" | "missing_await" | "unhandled_promise_rejection" | "resource_leak" | "null_or_undefined_deref" | "sql_injection" | "unsafe_dom_sink" | "unsafe_dynamic_code" | "insecure_randomness" | "hardcoded_secret" | "redos_regex" | "swallowed_error" | "mutable_default_arg" | "destructive_migration" | "external_version_claim" | "other")[];
186
+ rules: {
187
+ enabled: boolean;
188
+ disabled_rule_ids: string[];
189
+ shadow_rule_ids: string[];
190
+ };
191
+ custom_rules: string[];
192
+ labels: false | {
193
+ p1: string;
194
+ p2: string;
195
+ p3: string;
196
+ };
197
+ exec: {
198
+ enabled: boolean;
199
+ on_file_types: string[];
200
+ command: string;
201
+ };
202
+ };
203
+ model: {
204
+ main: string | null;
205
+ fallbacks: string[] | null;
206
+ size_overrides?: {
207
+ max_lines: number;
208
+ model: string;
209
+ fallbacks?: string[] | undefined;
210
+ }[] | null | undefined;
211
+ };
212
+ };
213
+
214
+ declare const KIMI_K2_5_MODEL = "@cf/moonshotai/kimi-k2.5";
215
+ declare const KIMI_K2_6_MODEL = "@cf/moonshotai/kimi-k2.6";
216
+ declare const DEPRECATED_MODEL_ALIASES: Record<string, string>;
217
+ declare const REPO_CONFIG_CACHE_VERSION = "v7";
218
+
219
+ export { CLAIM_TYPE_CATEGORY, CLAIM_TYPE_DECIDABILITY, type ClaimType, DEFAULT_DENIED_CLAIM_TYPES, DEFAULT_SHADOW_RULE_IDS, DEPRECATED_MODEL_ALIASES, type FindingDisposition, KIMI_K2_5_MODEL, KIMI_K2_6_MODEL, REPO_CONFIG_CACHE_VERSION, type RepoConfig, claimTypes, defaultRepoConfig, fileStatuses, findingDispositions, jobStatuses, llmApiFormats, normalizeModelId, normalizeRepoConfig, normalizeRepoModelConfig, repoConfigSchema, reviewCategories, reviewConfigSchema, reviewTriggers, reviewVerdicts, toClaimType };