@code-sentinel-cli/code-sentinel-cli 3.0.9 → 3.0.11
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/bin.js +38961 -19863
- package/dist/builtin-rules/ai/angular/api-service-contract-risk.rule.yaml +3 -3
- package/dist/builtin-rules/ai/angular/component-state-flow.rule.yaml +3 -3
- package/dist/builtin-rules/ai/angular/cross-feature-api-drift.prompt.md +0 -1
- package/dist/builtin-rules/ai/angular/cross-feature-api-drift.rule.yaml +3 -6
- package/dist/builtin-rules/ai/angular/cross-feature-route-permission-drift.prompt.md +0 -1
- package/dist/builtin-rules/ai/angular/cross-feature-route-permission-drift.rule.yaml +4 -8
- package/dist/builtin-rules/ai/angular/reactive-form-flow.rule.yaml +3 -3
- package/dist/builtin-rules/ai/angular/route-permission-flow.rule.yaml +3 -3
- package/dist/builtin-rules/ai/angular/rxjs-flow-risk.rule.yaml +3 -3
- package/dist/builtin-rules/ai/angular/template-contract-risk.rule.yaml +3 -3
- package/dist/builtin-rules/ai/flutter/dynamic-content-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/flutter/feature-state-flow-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/flutter/native-platform-consistency-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/flutter/network-auth-flow-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/flutter/ui-responsive-accessibility-risk.rule.yaml +0 -2
- package/dist/builtin-rules/ai/general/code-clarity.prompt.md +19 -2
- package/dist/builtin-rules/ai/general/code-clarity.rule.yaml +8 -3
- package/dist/builtin-rules/ai/spring-boot/business-invariant-risk.prompt.md +3 -3
- package/dist/builtin-rules/ai/spring-boot/business-invariant-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/cache-consistency-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/cross-feature-error-handling-drift.prompt.md +0 -1
- package/dist/builtin-rules/ai/spring-boot/cross-feature-error-handling-drift.rule.yaml +4 -10
- package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.prompt.md +9 -8
- package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.rule.yaml +12 -14
- package/dist/builtin-rules/ai/spring-boot/error-handling-completeness.prompt.md +4 -4
- package/dist/builtin-rules/ai/spring-boot/error-handling-completeness.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/event-publishing-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/io-boundary-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.prompt.md +3 -3
- package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/pagination-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/security-authorization-risk.rule.yaml +3 -3
- package/dist/builtin-rules/ai/spring-boot/security-mass-assignment-risk.rule.yaml +3 -3
- package/dist/builtin-rules/ai/spring-boot/security-redirect-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/security-sensitive-data-risk.rule.yaml +1 -2
- package/dist/builtin-rules/ai/spring-boot/transaction-loop-risk.rule.yaml +1 -2
- package/dist/builtin-rules/static/angular/button-accessible-name.rule.js +143 -0
- package/dist/builtin-rules/static/angular/component-prefix.rule.js +6 -2
- package/dist/builtin-rules/static/angular/img-alt-required.rule.js +3 -2
- package/dist/builtin-rules/static/angular/inject-pattern.rule.js +3 -2
- package/dist/builtin-rules/static/angular/lifecycle-method-required.rule.js +3 -2
- package/dist/builtin-rules/static/angular/no-leaky-subscription.rule.js +14 -5
- package/dist/builtin-rules/static/angular/onpush-required.rule.js +3 -2
- package/dist/builtin-rules/static/angular/template-dom-xss.rule.js +28 -4
- package/dist/builtin-rules/static/angular/trackby-required.rule.js +3 -2
- package/dist/builtin-rules/static/flutter/no-undisposed-resource.rule.js +143 -0
- package/dist/builtin-rules/static/general/file-too-long.rule.js +5 -4
- package/dist/builtin-rules/static/general/function-too-long.rule.js +46 -27
- package/dist/builtin-rules/static/general/no-code-injection.rule.js +8 -1
- package/dist/builtin-rules/static/general/no-console-log.rule.js +3 -2
- package/dist/builtin-rules/static/general/no-empty-catch.rule.yaml +14 -8
- package/dist/builtin-rules/static/general/no-hardcoded-vietnamese.rule.js +58 -0
- package/dist/builtin-rules/static/general/no-magic-number.rule.js +151 -8
- package/dist/builtin-rules/static/general/no-todo-comment.rule.js +88 -0
- package/dist/builtin-rules/static/general/no-unused-export.rule.js +53 -6
- package/dist/builtin-rules/static/spring-boot/no-command-injection.rule.js +14 -1
- package/dist/builtin-rules/static/spring-boot/no-path-traversal.rule.js +1 -1
- package/dist/builtin-rules/static/spring-boot/no-servlet-xss.rule.js +41 -0
- package/dist/builtin-rules/static/spring-boot/no-spel-injection.rule.js +8 -1
- package/dist/builtin-rules/static/spring-boot/no-sql-string-concat.rule.js +35 -4
- package/dist/builtin-rules/static/spring-boot/no-ssrf.rule.js +1 -1
- package/dist/builtin-rules/static/spring-boot/no-unzoned-datetime.rule.js +96 -0
- package/dist/builtin-rules/static/spring-boot/repository-naming.rule.yaml +4 -2
- package/dist/index.d.ts +316 -132
- package/dist/index.js +38952 -19854
- package/package.json +1 -1
- package/templates/ci/github-actions.yml +60 -2
- package/templates/ci/gitlab-ci.yml +51 -2
- package/dist/builtin-rules/static/general/no-todo-comment.rule.yaml +0 -30
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { CliApiClient } from '@code-sentinel/contracts';
|
|
4
|
-
import { AiGatePolicy, AiSkipGatePolicy, IParser, IRuleLoader, IAIClient, IAiExecutionTracker, IClusterAssembler, IClusterTreeBuilder, SourceFile, IAstDependencyGraphBuilder, ITaintAnalyzer, ITemplateComponentLinker, IReviewStore, ICacheStore, IReporter
|
|
4
|
+
import { AiGatePolicy, AiSkipGatePolicy, IParser, IRuleLoader, IAIClient, IAiExecutionTracker, IClusterAssembler, IClusterTreeBuilder, SourceFile, IAstDependencyGraphBuilder, ITaintAnalyzer, ITemplateComponentLinker, IReviewStore, ICacheStore, IReporter } from '@code-sentinel/core';
|
|
5
5
|
import { Instance } from 'ink';
|
|
6
6
|
import { TransactionBoundaryFact } from '@code-sentinel/ai-engine';
|
|
7
7
|
import { AiRuleExecutorCallback } from '@code-sentinel/rule-engine';
|
|
8
8
|
import { Logger, Clock, Result, ConfigInvalidError, IOError } from '@code-sentinel/shared';
|
|
9
9
|
import { DbHandle } from '@code-sentinel/storage';
|
|
10
|
-
import { Server } from 'node:http';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* commander setup. Wires CLI verbs to command handlers.
|
|
@@ -278,14 +277,14 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
278
277
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
279
278
|
}, "strip", z.ZodTypeAny, {
|
|
280
279
|
options?: Record<string, unknown> | undefined;
|
|
280
|
+
enabled?: boolean | undefined;
|
|
281
281
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
282
282
|
confidence?: number | undefined;
|
|
283
|
-
enabled?: boolean | undefined;
|
|
284
283
|
}, {
|
|
285
284
|
options?: Record<string, unknown> | undefined;
|
|
285
|
+
enabled?: boolean | undefined;
|
|
286
286
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
287
287
|
confidence?: number | undefined;
|
|
288
|
-
enabled?: boolean | undefined;
|
|
289
288
|
}>>>;
|
|
290
289
|
/**
|
|
291
290
|
* Per-path override blocks (Phase 12.5). Each entry binds a glob
|
|
@@ -314,29 +313,29 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
314
313
|
severity: z.ZodOptional<z.ZodEnum<["info", "warning", "error", "blocker"]>>;
|
|
315
314
|
confidence: z.ZodOptional<z.ZodNumber>;
|
|
316
315
|
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
enabled?: boolean | undefined;
|
|
317
317
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
318
318
|
confidence?: number | undefined;
|
|
319
|
-
enabled?: boolean | undefined;
|
|
320
319
|
}, {
|
|
320
|
+
enabled?: boolean | undefined;
|
|
321
321
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
322
322
|
confidence?: number | undefined;
|
|
323
|
-
enabled?: boolean | undefined;
|
|
324
323
|
}>>>;
|
|
325
324
|
}, "strip", z.ZodTypeAny, {
|
|
326
325
|
paths: string[];
|
|
327
326
|
disabled?: string[] | undefined;
|
|
328
327
|
overrides?: Record<string, {
|
|
328
|
+
enabled?: boolean | undefined;
|
|
329
329
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
330
330
|
confidence?: number | undefined;
|
|
331
|
-
enabled?: boolean | undefined;
|
|
332
331
|
}> | undefined;
|
|
333
332
|
}, {
|
|
334
333
|
paths: string[];
|
|
335
334
|
disabled?: string[] | undefined;
|
|
336
335
|
overrides?: Record<string, {
|
|
336
|
+
enabled?: boolean | undefined;
|
|
337
337
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
338
338
|
confidence?: number | undefined;
|
|
339
|
-
enabled?: boolean | undefined;
|
|
340
339
|
}> | undefined;
|
|
341
340
|
}>, "many">>;
|
|
342
341
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -346,17 +345,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
346
345
|
projectCustomExecution: ("local" | "ci")[];
|
|
347
346
|
overrides: Record<string, {
|
|
348
347
|
options?: Record<string, unknown> | undefined;
|
|
348
|
+
enabled?: boolean | undefined;
|
|
349
349
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
350
350
|
confidence?: number | undefined;
|
|
351
|
-
enabled?: boolean | undefined;
|
|
352
351
|
}>;
|
|
353
352
|
pathOverrides: {
|
|
354
353
|
paths: string[];
|
|
355
354
|
disabled?: string[] | undefined;
|
|
356
355
|
overrides?: Record<string, {
|
|
356
|
+
enabled?: boolean | undefined;
|
|
357
357
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
358
358
|
confidence?: number | undefined;
|
|
359
|
-
enabled?: boolean | undefined;
|
|
360
359
|
}> | undefined;
|
|
361
360
|
}[];
|
|
362
361
|
}, {
|
|
@@ -366,17 +365,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
366
365
|
projectCustomExecution?: ("local" | "ci")[] | undefined;
|
|
367
366
|
overrides?: Record<string, {
|
|
368
367
|
options?: Record<string, unknown> | undefined;
|
|
368
|
+
enabled?: boolean | undefined;
|
|
369
369
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
370
370
|
confidence?: number | undefined;
|
|
371
|
-
enabled?: boolean | undefined;
|
|
372
371
|
}> | undefined;
|
|
373
372
|
pathOverrides?: {
|
|
374
373
|
paths: string[];
|
|
375
374
|
disabled?: string[] | undefined;
|
|
376
375
|
overrides?: Record<string, {
|
|
376
|
+
enabled?: boolean | undefined;
|
|
377
377
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
378
378
|
confidence?: number | undefined;
|
|
379
|
-
enabled?: boolean | undefined;
|
|
380
379
|
}> | undefined;
|
|
381
380
|
}[] | undefined;
|
|
382
381
|
}>>;
|
|
@@ -627,12 +626,12 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
627
626
|
}, "strip", z.ZodTypeAny, {
|
|
628
627
|
format: "json" | "markdown" | "markdown-compact" | "sarif";
|
|
629
628
|
output: string;
|
|
630
|
-
groupBy: "
|
|
629
|
+
groupBy: "severity" | "file" | "rule" | "category";
|
|
631
630
|
includeSnippets: boolean;
|
|
632
631
|
}, {
|
|
633
632
|
format?: "json" | "markdown" | "markdown-compact" | "sarif" | undefined;
|
|
634
633
|
output?: string | undefined;
|
|
635
|
-
groupBy?: "
|
|
634
|
+
groupBy?: "severity" | "file" | "rule" | "category" | undefined;
|
|
636
635
|
includeSnippets?: boolean | undefined;
|
|
637
636
|
}>>;
|
|
638
637
|
review: z.ZodDefault<z.ZodObject<{
|
|
@@ -859,7 +858,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
859
858
|
aiDiffReview: z.ZodDefault<z.ZodBoolean>;
|
|
860
859
|
maxSupportFiles: z.ZodDefault<z.ZodNumber>;
|
|
861
860
|
diffChunkTokenBudget: z.ZodDefault<z.ZodNumber>;
|
|
862
|
-
maxAiCalls: z.ZodDefault<z.ZodNumber>;
|
|
863
861
|
codeQualityOutput: z.ZodDefault<z.ZodString>;
|
|
864
862
|
gitlabTokenEnv: z.ZodDefault<z.ZodString>;
|
|
865
863
|
cleanupExistingComments: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -920,7 +918,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
920
918
|
aiDiffReview: boolean;
|
|
921
919
|
maxSupportFiles: number;
|
|
922
920
|
diffChunkTokenBudget: number;
|
|
923
|
-
maxAiCalls: number;
|
|
924
921
|
codeQualityOutput: string;
|
|
925
922
|
gitlabTokenEnv: string;
|
|
926
923
|
cleanupExistingComments: boolean;
|
|
@@ -973,7 +970,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
973
970
|
aiDiffReview?: boolean | undefined;
|
|
974
971
|
maxSupportFiles?: number | undefined;
|
|
975
972
|
diffChunkTokenBudget?: number | undefined;
|
|
976
|
-
maxAiCalls?: number | undefined;
|
|
977
973
|
codeQualityOutput?: string | undefined;
|
|
978
974
|
gitlabTokenEnv?: string | undefined;
|
|
979
975
|
cleanupExistingComments?: boolean | undefined;
|
|
@@ -1007,12 +1003,177 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1007
1003
|
projectId: z.ZodOptional<z.ZodString>;
|
|
1008
1004
|
}, "strip", z.ZodTypeAny, {
|
|
1009
1005
|
serverUrl?: string | undefined;
|
|
1010
|
-
projectId?: string | undefined;
|
|
1011
1006
|
token?: string | undefined;
|
|
1007
|
+
projectId?: string | undefined;
|
|
1012
1008
|
}, {
|
|
1013
1009
|
serverUrl?: string | undefined;
|
|
1014
|
-
projectId?: string | undefined;
|
|
1015
1010
|
token?: string | undefined;
|
|
1011
|
+
projectId?: string | undefined;
|
|
1012
|
+
}>>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Pentest Coverage Layer settings ([ADR-0057]).
|
|
1015
|
+
*
|
|
1016
|
+
* `policy` holds the THRESHOLDS a project is audited against — password length, OTP lifetime,
|
|
1017
|
+
* lockout counts, session timeouts. They are policy, not engineering: they differ per project and
|
|
1018
|
+
* per contract, so hard-coding them would either fail compliant projects or pass non-compliant
|
|
1019
|
+
* ones. Every field is optional and falls back to the documented default, so a project sets only
|
|
1020
|
+
* what its own regulation states.
|
|
1021
|
+
*
|
|
1022
|
+
* Positive-number validation only. A project that genuinely wants a 5-minute idle timeout is
|
|
1023
|
+
* making a policy choice, not a mistake, so the schema does not second-guess the value.
|
|
1024
|
+
*
|
|
1025
|
+
* **Every threshold is also settable from an ENVIRONMENT VARIABLE** — `ttlSeconds:
|
|
1026
|
+
* "${CS_OTP_TTL}"` — which is what `policyInt` / `policyBool` exist for. See their doc comments
|
|
1027
|
+
* for why a plain `z.number()` silently made that impossible.
|
|
1028
|
+
*/
|
|
1029
|
+
pentest: z.ZodDefault<z.ZodObject<{
|
|
1030
|
+
policy: z.ZodDefault<z.ZodObject<{
|
|
1031
|
+
password: z.ZodOptional<z.ZodObject<{
|
|
1032
|
+
minLength: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1033
|
+
maxAgeDays: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1034
|
+
historyCount: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1035
|
+
}, "strip", z.ZodTypeAny, {
|
|
1036
|
+
minLength?: number | undefined;
|
|
1037
|
+
maxAgeDays?: number | undefined;
|
|
1038
|
+
historyCount?: number | undefined;
|
|
1039
|
+
}, {
|
|
1040
|
+
minLength?: string | number | undefined;
|
|
1041
|
+
maxAgeDays?: string | number | undefined;
|
|
1042
|
+
historyCount?: string | number | undefined;
|
|
1043
|
+
}>>;
|
|
1044
|
+
lockout: z.ZodOptional<z.ZodObject<{
|
|
1045
|
+
captchaAfterFailures: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1046
|
+
}, "strip", z.ZodTypeAny, {
|
|
1047
|
+
captchaAfterFailures?: number | undefined;
|
|
1048
|
+
}, {
|
|
1049
|
+
captchaAfterFailures?: string | number | undefined;
|
|
1050
|
+
}>>;
|
|
1051
|
+
otp: z.ZodOptional<z.ZodObject<{
|
|
1052
|
+
ttlSeconds: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1053
|
+
maxWrongPerDay: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1054
|
+
singleValidAtATime: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEnum<["true", "false", "1", "0"]>>, boolean, string>]>>;
|
|
1055
|
+
}, "strip", z.ZodTypeAny, {
|
|
1056
|
+
ttlSeconds?: number | undefined;
|
|
1057
|
+
maxWrongPerDay?: number | undefined;
|
|
1058
|
+
singleValidAtATime?: boolean | undefined;
|
|
1059
|
+
}, {
|
|
1060
|
+
ttlSeconds?: string | number | undefined;
|
|
1061
|
+
maxWrongPerDay?: string | number | undefined;
|
|
1062
|
+
singleValidAtATime?: string | boolean | undefined;
|
|
1063
|
+
}>>;
|
|
1064
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
1065
|
+
idleTimeoutMinutes: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1066
|
+
absoluteTimeoutHours: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1067
|
+
tokenBits: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1068
|
+
}, "strip", z.ZodTypeAny, {
|
|
1069
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1070
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1071
|
+
tokenBits?: number | undefined;
|
|
1072
|
+
}, {
|
|
1073
|
+
idleTimeoutMinutes?: string | number | undefined;
|
|
1074
|
+
absoluteTimeoutHours?: string | number | undefined;
|
|
1075
|
+
tokenBits?: string | number | undefined;
|
|
1076
|
+
}>>;
|
|
1077
|
+
dependency: z.ZodOptional<z.ZodObject<{
|
|
1078
|
+
minCvssScore: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>]>>;
|
|
1079
|
+
}, "strip", z.ZodTypeAny, {
|
|
1080
|
+
minCvssScore?: number | undefined;
|
|
1081
|
+
}, {
|
|
1082
|
+
minCvssScore?: string | number | undefined;
|
|
1083
|
+
}>>;
|
|
1084
|
+
}, "strip", z.ZodTypeAny, {
|
|
1085
|
+
password?: {
|
|
1086
|
+
minLength?: number | undefined;
|
|
1087
|
+
maxAgeDays?: number | undefined;
|
|
1088
|
+
historyCount?: number | undefined;
|
|
1089
|
+
} | undefined;
|
|
1090
|
+
lockout?: {
|
|
1091
|
+
captchaAfterFailures?: number | undefined;
|
|
1092
|
+
} | undefined;
|
|
1093
|
+
otp?: {
|
|
1094
|
+
ttlSeconds?: number | undefined;
|
|
1095
|
+
maxWrongPerDay?: number | undefined;
|
|
1096
|
+
singleValidAtATime?: boolean | undefined;
|
|
1097
|
+
} | undefined;
|
|
1098
|
+
session?: {
|
|
1099
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1100
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1101
|
+
tokenBits?: number | undefined;
|
|
1102
|
+
} | undefined;
|
|
1103
|
+
dependency?: {
|
|
1104
|
+
minCvssScore?: number | undefined;
|
|
1105
|
+
} | undefined;
|
|
1106
|
+
}, {
|
|
1107
|
+
password?: {
|
|
1108
|
+
minLength?: string | number | undefined;
|
|
1109
|
+
maxAgeDays?: string | number | undefined;
|
|
1110
|
+
historyCount?: string | number | undefined;
|
|
1111
|
+
} | undefined;
|
|
1112
|
+
lockout?: {
|
|
1113
|
+
captchaAfterFailures?: string | number | undefined;
|
|
1114
|
+
} | undefined;
|
|
1115
|
+
otp?: {
|
|
1116
|
+
ttlSeconds?: string | number | undefined;
|
|
1117
|
+
maxWrongPerDay?: string | number | undefined;
|
|
1118
|
+
singleValidAtATime?: string | boolean | undefined;
|
|
1119
|
+
} | undefined;
|
|
1120
|
+
session?: {
|
|
1121
|
+
idleTimeoutMinutes?: string | number | undefined;
|
|
1122
|
+
absoluteTimeoutHours?: string | number | undefined;
|
|
1123
|
+
tokenBits?: string | number | undefined;
|
|
1124
|
+
} | undefined;
|
|
1125
|
+
dependency?: {
|
|
1126
|
+
minCvssScore?: string | number | undefined;
|
|
1127
|
+
} | undefined;
|
|
1128
|
+
}>>;
|
|
1129
|
+
}, "strip", z.ZodTypeAny, {
|
|
1130
|
+
policy: {
|
|
1131
|
+
password?: {
|
|
1132
|
+
minLength?: number | undefined;
|
|
1133
|
+
maxAgeDays?: number | undefined;
|
|
1134
|
+
historyCount?: number | undefined;
|
|
1135
|
+
} | undefined;
|
|
1136
|
+
lockout?: {
|
|
1137
|
+
captchaAfterFailures?: number | undefined;
|
|
1138
|
+
} | undefined;
|
|
1139
|
+
otp?: {
|
|
1140
|
+
ttlSeconds?: number | undefined;
|
|
1141
|
+
maxWrongPerDay?: number | undefined;
|
|
1142
|
+
singleValidAtATime?: boolean | undefined;
|
|
1143
|
+
} | undefined;
|
|
1144
|
+
session?: {
|
|
1145
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1146
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1147
|
+
tokenBits?: number | undefined;
|
|
1148
|
+
} | undefined;
|
|
1149
|
+
dependency?: {
|
|
1150
|
+
minCvssScore?: number | undefined;
|
|
1151
|
+
} | undefined;
|
|
1152
|
+
};
|
|
1153
|
+
}, {
|
|
1154
|
+
policy?: {
|
|
1155
|
+
password?: {
|
|
1156
|
+
minLength?: string | number | undefined;
|
|
1157
|
+
maxAgeDays?: string | number | undefined;
|
|
1158
|
+
historyCount?: string | number | undefined;
|
|
1159
|
+
} | undefined;
|
|
1160
|
+
lockout?: {
|
|
1161
|
+
captchaAfterFailures?: string | number | undefined;
|
|
1162
|
+
} | undefined;
|
|
1163
|
+
otp?: {
|
|
1164
|
+
ttlSeconds?: string | number | undefined;
|
|
1165
|
+
maxWrongPerDay?: string | number | undefined;
|
|
1166
|
+
singleValidAtATime?: string | boolean | undefined;
|
|
1167
|
+
} | undefined;
|
|
1168
|
+
session?: {
|
|
1169
|
+
idleTimeoutMinutes?: string | number | undefined;
|
|
1170
|
+
absoluteTimeoutHours?: string | number | undefined;
|
|
1171
|
+
tokenBits?: string | number | undefined;
|
|
1172
|
+
} | undefined;
|
|
1173
|
+
dependency?: {
|
|
1174
|
+
minCvssScore?: string | number | undefined;
|
|
1175
|
+
} | undefined;
|
|
1176
|
+
} | undefined;
|
|
1016
1177
|
}>>;
|
|
1017
1178
|
}, "strip", z.ZodTypeAny, {
|
|
1018
1179
|
rules: {
|
|
@@ -1022,21 +1183,21 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1022
1183
|
projectCustomExecution: ("local" | "ci")[];
|
|
1023
1184
|
overrides: Record<string, {
|
|
1024
1185
|
options?: Record<string, unknown> | undefined;
|
|
1186
|
+
enabled?: boolean | undefined;
|
|
1025
1187
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1026
1188
|
confidence?: number | undefined;
|
|
1027
|
-
enabled?: boolean | undefined;
|
|
1028
1189
|
}>;
|
|
1029
1190
|
pathOverrides: {
|
|
1030
1191
|
paths: string[];
|
|
1031
1192
|
disabled?: string[] | undefined;
|
|
1032
1193
|
overrides?: Record<string, {
|
|
1194
|
+
enabled?: boolean | undefined;
|
|
1033
1195
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1034
1196
|
confidence?: number | undefined;
|
|
1035
|
-
enabled?: boolean | undefined;
|
|
1036
1197
|
}> | undefined;
|
|
1037
1198
|
}[];
|
|
1038
1199
|
};
|
|
1039
|
-
mode: "
|
|
1200
|
+
mode: "auto" | "economy" | "balanced" | "performance";
|
|
1040
1201
|
include: string[];
|
|
1041
1202
|
exclude: string[];
|
|
1042
1203
|
ai: {
|
|
@@ -1089,7 +1250,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1089
1250
|
report: {
|
|
1090
1251
|
format: "json" | "markdown" | "markdown-compact" | "sarif";
|
|
1091
1252
|
output: string;
|
|
1092
|
-
groupBy: "
|
|
1253
|
+
groupBy: "severity" | "file" | "rule" | "category";
|
|
1093
1254
|
includeSnippets: boolean;
|
|
1094
1255
|
};
|
|
1095
1256
|
review: {
|
|
@@ -1151,7 +1312,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1151
1312
|
aiDiffReview: boolean;
|
|
1152
1313
|
maxSupportFiles: number;
|
|
1153
1314
|
diffChunkTokenBudget: number;
|
|
1154
|
-
maxAiCalls: number;
|
|
1155
1315
|
codeQualityOutput: string;
|
|
1156
1316
|
gitlabTokenEnv: string;
|
|
1157
1317
|
cleanupExistingComments: boolean;
|
|
@@ -1167,8 +1327,33 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1167
1327
|
};
|
|
1168
1328
|
dashboard: {
|
|
1169
1329
|
serverUrl?: string | undefined;
|
|
1170
|
-
projectId?: string | undefined;
|
|
1171
1330
|
token?: string | undefined;
|
|
1331
|
+
projectId?: string | undefined;
|
|
1332
|
+
};
|
|
1333
|
+
pentest: {
|
|
1334
|
+
policy: {
|
|
1335
|
+
password?: {
|
|
1336
|
+
minLength?: number | undefined;
|
|
1337
|
+
maxAgeDays?: number | undefined;
|
|
1338
|
+
historyCount?: number | undefined;
|
|
1339
|
+
} | undefined;
|
|
1340
|
+
lockout?: {
|
|
1341
|
+
captchaAfterFailures?: number | undefined;
|
|
1342
|
+
} | undefined;
|
|
1343
|
+
otp?: {
|
|
1344
|
+
ttlSeconds?: number | undefined;
|
|
1345
|
+
maxWrongPerDay?: number | undefined;
|
|
1346
|
+
singleValidAtATime?: boolean | undefined;
|
|
1347
|
+
} | undefined;
|
|
1348
|
+
session?: {
|
|
1349
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1350
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1351
|
+
tokenBits?: number | undefined;
|
|
1352
|
+
} | undefined;
|
|
1353
|
+
dependency?: {
|
|
1354
|
+
minCvssScore?: number | undefined;
|
|
1355
|
+
} | undefined;
|
|
1356
|
+
};
|
|
1172
1357
|
};
|
|
1173
1358
|
}, {
|
|
1174
1359
|
rules?: {
|
|
@@ -1178,21 +1363,21 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1178
1363
|
projectCustomExecution?: ("local" | "ci")[] | undefined;
|
|
1179
1364
|
overrides?: Record<string, {
|
|
1180
1365
|
options?: Record<string, unknown> | undefined;
|
|
1366
|
+
enabled?: boolean | undefined;
|
|
1181
1367
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1182
1368
|
confidence?: number | undefined;
|
|
1183
|
-
enabled?: boolean | undefined;
|
|
1184
1369
|
}> | undefined;
|
|
1185
1370
|
pathOverrides?: {
|
|
1186
1371
|
paths: string[];
|
|
1187
1372
|
disabled?: string[] | undefined;
|
|
1188
1373
|
overrides?: Record<string, {
|
|
1374
|
+
enabled?: boolean | undefined;
|
|
1189
1375
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1190
1376
|
confidence?: number | undefined;
|
|
1191
|
-
enabled?: boolean | undefined;
|
|
1192
1377
|
}> | undefined;
|
|
1193
1378
|
}[] | undefined;
|
|
1194
1379
|
} | undefined;
|
|
1195
|
-
mode?: "
|
|
1380
|
+
mode?: "auto" | "economy" | "balanced" | "performance" | undefined;
|
|
1196
1381
|
include?: string[] | undefined;
|
|
1197
1382
|
exclude?: string[] | undefined;
|
|
1198
1383
|
ai?: {
|
|
@@ -1245,7 +1430,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1245
1430
|
report?: {
|
|
1246
1431
|
format?: "json" | "markdown" | "markdown-compact" | "sarif" | undefined;
|
|
1247
1432
|
output?: string | undefined;
|
|
1248
|
-
groupBy?: "
|
|
1433
|
+
groupBy?: "severity" | "file" | "rule" | "category" | undefined;
|
|
1249
1434
|
includeSnippets?: boolean | undefined;
|
|
1250
1435
|
} | undefined;
|
|
1251
1436
|
review?: {
|
|
@@ -1307,7 +1492,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1307
1492
|
aiDiffReview?: boolean | undefined;
|
|
1308
1493
|
maxSupportFiles?: number | undefined;
|
|
1309
1494
|
diffChunkTokenBudget?: number | undefined;
|
|
1310
|
-
maxAiCalls?: number | undefined;
|
|
1311
1495
|
codeQualityOutput?: string | undefined;
|
|
1312
1496
|
gitlabTokenEnv?: string | undefined;
|
|
1313
1497
|
cleanupExistingComments?: boolean | undefined;
|
|
@@ -1323,8 +1507,33 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1323
1507
|
} | undefined;
|
|
1324
1508
|
dashboard?: {
|
|
1325
1509
|
serverUrl?: string | undefined;
|
|
1326
|
-
projectId?: string | undefined;
|
|
1327
1510
|
token?: string | undefined;
|
|
1511
|
+
projectId?: string | undefined;
|
|
1512
|
+
} | undefined;
|
|
1513
|
+
pentest?: {
|
|
1514
|
+
policy?: {
|
|
1515
|
+
password?: {
|
|
1516
|
+
minLength?: string | number | undefined;
|
|
1517
|
+
maxAgeDays?: string | number | undefined;
|
|
1518
|
+
historyCount?: string | number | undefined;
|
|
1519
|
+
} | undefined;
|
|
1520
|
+
lockout?: {
|
|
1521
|
+
captchaAfterFailures?: string | number | undefined;
|
|
1522
|
+
} | undefined;
|
|
1523
|
+
otp?: {
|
|
1524
|
+
ttlSeconds?: string | number | undefined;
|
|
1525
|
+
maxWrongPerDay?: string | number | undefined;
|
|
1526
|
+
singleValidAtATime?: string | boolean | undefined;
|
|
1527
|
+
} | undefined;
|
|
1528
|
+
session?: {
|
|
1529
|
+
idleTimeoutMinutes?: string | number | undefined;
|
|
1530
|
+
absoluteTimeoutHours?: string | number | undefined;
|
|
1531
|
+
tokenBits?: string | number | undefined;
|
|
1532
|
+
} | undefined;
|
|
1533
|
+
dependency?: {
|
|
1534
|
+
minCvssScore?: string | number | undefined;
|
|
1535
|
+
} | undefined;
|
|
1536
|
+
} | undefined;
|
|
1328
1537
|
} | undefined;
|
|
1329
1538
|
}>, {
|
|
1330
1539
|
rules: {
|
|
@@ -1334,21 +1543,21 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1334
1543
|
projectCustomExecution: ("local" | "ci")[];
|
|
1335
1544
|
overrides: Record<string, {
|
|
1336
1545
|
options?: Record<string, unknown> | undefined;
|
|
1546
|
+
enabled?: boolean | undefined;
|
|
1337
1547
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1338
1548
|
confidence?: number | undefined;
|
|
1339
|
-
enabled?: boolean | undefined;
|
|
1340
1549
|
}>;
|
|
1341
1550
|
pathOverrides: {
|
|
1342
1551
|
paths: string[];
|
|
1343
1552
|
disabled?: string[] | undefined;
|
|
1344
1553
|
overrides?: Record<string, {
|
|
1554
|
+
enabled?: boolean | undefined;
|
|
1345
1555
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1346
1556
|
confidence?: number | undefined;
|
|
1347
|
-
enabled?: boolean | undefined;
|
|
1348
1557
|
}> | undefined;
|
|
1349
1558
|
}[];
|
|
1350
1559
|
};
|
|
1351
|
-
mode: "
|
|
1560
|
+
mode: "auto" | "economy" | "balanced" | "performance";
|
|
1352
1561
|
include: string[];
|
|
1353
1562
|
exclude: string[];
|
|
1354
1563
|
ai: {
|
|
@@ -1401,7 +1610,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1401
1610
|
report: {
|
|
1402
1611
|
format: "json" | "markdown" | "markdown-compact" | "sarif";
|
|
1403
1612
|
output: string;
|
|
1404
|
-
groupBy: "
|
|
1613
|
+
groupBy: "severity" | "file" | "rule" | "category";
|
|
1405
1614
|
includeSnippets: boolean;
|
|
1406
1615
|
};
|
|
1407
1616
|
review: {
|
|
@@ -1463,7 +1672,6 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1463
1672
|
aiDiffReview: boolean;
|
|
1464
1673
|
maxSupportFiles: number;
|
|
1465
1674
|
diffChunkTokenBudget: number;
|
|
1466
|
-
maxAiCalls: number;
|
|
1467
1675
|
codeQualityOutput: string;
|
|
1468
1676
|
gitlabTokenEnv: string;
|
|
1469
1677
|
cleanupExistingComments: boolean;
|
|
@@ -1479,8 +1687,33 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1479
1687
|
};
|
|
1480
1688
|
dashboard: {
|
|
1481
1689
|
serverUrl?: string | undefined;
|
|
1482
|
-
projectId?: string | undefined;
|
|
1483
1690
|
token?: string | undefined;
|
|
1691
|
+
projectId?: string | undefined;
|
|
1692
|
+
};
|
|
1693
|
+
pentest: {
|
|
1694
|
+
policy: {
|
|
1695
|
+
password?: {
|
|
1696
|
+
minLength?: number | undefined;
|
|
1697
|
+
maxAgeDays?: number | undefined;
|
|
1698
|
+
historyCount?: number | undefined;
|
|
1699
|
+
} | undefined;
|
|
1700
|
+
lockout?: {
|
|
1701
|
+
captchaAfterFailures?: number | undefined;
|
|
1702
|
+
} | undefined;
|
|
1703
|
+
otp?: {
|
|
1704
|
+
ttlSeconds?: number | undefined;
|
|
1705
|
+
maxWrongPerDay?: number | undefined;
|
|
1706
|
+
singleValidAtATime?: boolean | undefined;
|
|
1707
|
+
} | undefined;
|
|
1708
|
+
session?: {
|
|
1709
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1710
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1711
|
+
tokenBits?: number | undefined;
|
|
1712
|
+
} | undefined;
|
|
1713
|
+
dependency?: {
|
|
1714
|
+
minCvssScore?: number | undefined;
|
|
1715
|
+
} | undefined;
|
|
1716
|
+
};
|
|
1484
1717
|
};
|
|
1485
1718
|
}, unknown>;
|
|
1486
1719
|
type CodeReviewConfig = z.infer<typeof codeReviewConfigSchema>;
|
|
@@ -1653,7 +1886,7 @@ declare const runProjectUnlink: (options?: ProjectUnlinkOptions) => Promise<numb
|
|
|
1653
1886
|
|
|
1654
1887
|
type ReadinessLevel = 'pass' | 'warn' | 'fail';
|
|
1655
1888
|
interface LocalReadinessCheck {
|
|
1656
|
-
readonly id: 'git-repository' | 'workspace-link' | 'remote-parity' | 'config' | 'policy' | 'pending-push';
|
|
1889
|
+
readonly id: 'git-repository' | 'workspace-link' | 'remote-parity' | 'config' | 'policy' | 'rules-sync' | 'pending-push';
|
|
1657
1890
|
readonly level: ReadinessLevel;
|
|
1658
1891
|
readonly message: string;
|
|
1659
1892
|
}
|
|
@@ -1663,17 +1896,49 @@ interface LocalReadiness {
|
|
|
1663
1896
|
readonly checks: readonly LocalReadinessCheck[];
|
|
1664
1897
|
readonly project: ProjectStatus;
|
|
1665
1898
|
readonly effectiveConfigHash?: string;
|
|
1899
|
+
/** Present when the workspace is linked and the Dashboard policy resolved. */
|
|
1900
|
+
readonly dashboardPolicy?: {
|
|
1901
|
+
readonly effectiveConfigHash: string;
|
|
1902
|
+
readonly policyRevision: string;
|
|
1903
|
+
};
|
|
1904
|
+
/** Present when the linked project's rule bundle was compared. */
|
|
1905
|
+
readonly rulesSync?: {
|
|
1906
|
+
readonly localChecksum: string;
|
|
1907
|
+
readonly dashboardChecksum: string;
|
|
1908
|
+
};
|
|
1666
1909
|
}
|
|
1667
1910
|
declare const getLocalReadiness: (input?: {
|
|
1668
1911
|
readonly path?: string;
|
|
1669
1912
|
readonly configPath?: string;
|
|
1670
1913
|
readonly projectStatus?: () => Promise<ProjectStatus>;
|
|
1671
1914
|
readonly gitRepository?: () => Promise<boolean>;
|
|
1915
|
+
/** Test seam; production callers resolve policy over the authenticated Dashboard client. */
|
|
1916
|
+
readonly resolveOnlinePolicy?: (args: {
|
|
1917
|
+
readonly serverUrl: string;
|
|
1918
|
+
readonly projectId: string;
|
|
1919
|
+
readonly codebaseId: string;
|
|
1920
|
+
readonly repositoryConfig: Record<string, unknown>;
|
|
1921
|
+
readonly repositoryConfigHash: string;
|
|
1922
|
+
}) => Promise<{
|
|
1923
|
+
readonly effectiveConfigHash: string;
|
|
1924
|
+
readonly policyRevision: string;
|
|
1925
|
+
}>;
|
|
1926
|
+
/** Test seam; production callers fetch the Dashboard rule export bundle. */
|
|
1927
|
+
readonly resolveRulesBundle?: (args: {
|
|
1928
|
+
readonly projectId: string;
|
|
1929
|
+
readonly serverUrl: string;
|
|
1930
|
+
}) => Promise<{
|
|
1931
|
+
readonly checksum: string;
|
|
1932
|
+
}>;
|
|
1933
|
+
/** Skip every Dashboard round-trip; local checks still run (CS-12). */
|
|
1934
|
+
readonly offline?: boolean;
|
|
1672
1935
|
}) => Promise<LocalReadiness>;
|
|
1673
1936
|
interface LocalReadinessOptions {
|
|
1674
1937
|
readonly path?: string;
|
|
1675
1938
|
readonly configPath?: string;
|
|
1676
1939
|
readonly json?: boolean;
|
|
1940
|
+
/** Skip the Dashboard round-trips; local checks still run (CS-12). */
|
|
1941
|
+
readonly offline?: boolean;
|
|
1677
1942
|
readonly write?: (line: string) => void;
|
|
1678
1943
|
/** Test seam; production callers use the local observation implementation. */
|
|
1679
1944
|
readonly readiness?: () => Promise<LocalReadiness>;
|
|
@@ -2088,7 +2353,10 @@ interface AutomationTokenOptions {
|
|
|
2088
2353
|
declare const runAutomationTokenList: (options: AutomationTokenOptions) => Promise<number>;
|
|
2089
2354
|
interface AutomationTokenCreateOptions extends AutomationTokenOptions {
|
|
2090
2355
|
readonly name: string;
|
|
2356
|
+
/** ISO-8601 expiry; mutually exclusive with maxAgeDays. */
|
|
2091
2357
|
readonly expiresAt?: string;
|
|
2358
|
+
/** Lifetime in whole days (1..90); mutually exclusive with expiresAt. */
|
|
2359
|
+
readonly maxAgeDays?: number;
|
|
2092
2360
|
readonly yes?: boolean;
|
|
2093
2361
|
readonly confirm?: (input: {
|
|
2094
2362
|
message: string;
|
|
@@ -2116,6 +2384,7 @@ declare const runAutomationTokenRevoke: (options: AutomationTokenRevokeOptions)
|
|
|
2116
2384
|
* - disable: append the rule id to `rules.disabled` (idempotent).
|
|
2117
2385
|
* Validates the id exists.
|
|
2118
2386
|
*/
|
|
2387
|
+
|
|
2119
2388
|
interface RuleListOptions {
|
|
2120
2389
|
readonly path?: string;
|
|
2121
2390
|
/** Explicit config file. When set, skips user-global/project config discovery. */
|
|
@@ -2275,6 +2544,12 @@ interface LoadConfigOptions {
|
|
|
2275
2544
|
readonly configPath?: string;
|
|
2276
2545
|
/** Skip the user-global ~/.codereviewrc lookup. */
|
|
2277
2546
|
readonly noUserConfig?: boolean;
|
|
2547
|
+
/**
|
|
2548
|
+
* Keep unresolved placeholders as empty strings instead of failing config
|
|
2549
|
+
* loading. Intended only for commands that do not consume those settings
|
|
2550
|
+
* (for example static `cs assess` with an unused AI provider secret).
|
|
2551
|
+
*/
|
|
2552
|
+
readonly allowMissingEnv?: boolean;
|
|
2278
2553
|
}
|
|
2279
2554
|
interface LoadedConfig {
|
|
2280
2555
|
readonly config: CodeReviewConfig;
|
|
@@ -2289,6 +2564,8 @@ declare const createRemoteConfigClient: (input: {
|
|
|
2289
2564
|
readonly token?: string;
|
|
2290
2565
|
readonly getToken?: () => string | undefined;
|
|
2291
2566
|
readonly onUnauthorized?: () => Promise<boolean>;
|
|
2567
|
+
/** Overrides the client default (10s). Short-lived diagnostics pass a smaller budget. */
|
|
2568
|
+
readonly timeoutMs?: number;
|
|
2292
2569
|
}) => CliApiClient;
|
|
2293
2570
|
|
|
2294
2571
|
/**
|
|
@@ -2330,97 +2607,4 @@ declare const EXIT: {
|
|
|
2330
2607
|
};
|
|
2331
2608
|
type ExitCode = (typeof EXIT)[keyof typeof EXIT];
|
|
2332
2609
|
|
|
2333
|
-
|
|
2334
|
-
readonly baseUrl: string;
|
|
2335
|
-
readonly projectPath: string;
|
|
2336
|
-
readonly iid: number;
|
|
2337
|
-
readonly webUrl?: string;
|
|
2338
|
-
}
|
|
2339
|
-
interface PrReviewRuntimeOptions {
|
|
2340
|
-
readonly invocationRoot: string;
|
|
2341
|
-
readonly configPath?: string;
|
|
2342
|
-
readonly pr: string;
|
|
2343
|
-
readonly post: boolean;
|
|
2344
|
-
readonly maxInlineComments?: number;
|
|
2345
|
-
readonly summaryOnly: boolean;
|
|
2346
|
-
readonly prWorkspace?: string;
|
|
2347
|
-
readonly prAiStrategy?: CodeReviewConfig['prReview']['aiStrategy'];
|
|
2348
|
-
readonly aiOff: boolean;
|
|
2349
|
-
readonly mode?: Mode | 'auto';
|
|
2350
|
-
readonly scope?: ReviewScope;
|
|
2351
|
-
readonly minSeverity?: Severity;
|
|
2352
|
-
readonly minConfidence?: number;
|
|
2353
|
-
readonly reportFormat?: 'md' | 'json' | 'both';
|
|
2354
|
-
readonly output?: string;
|
|
2355
|
-
readonly silent: boolean;
|
|
2356
|
-
readonly noUi?: boolean;
|
|
2357
|
-
readonly compact?: boolean;
|
|
2358
|
-
readonly full?: boolean;
|
|
2359
|
-
readonly noBaseline?: boolean;
|
|
2360
|
-
readonly extraInstructions?: string;
|
|
2361
|
-
readonly numMaxFindings?: number;
|
|
2362
|
-
readonly aiTimeoutMs?: number;
|
|
2363
|
-
readonly rules?: readonly string[];
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
type PrReviewRunner = (options: PrReviewRuntimeOptions) => Promise<number>;
|
|
2367
|
-
interface GitLabWebhookJob {
|
|
2368
|
-
readonly key: string;
|
|
2369
|
-
readonly mrUrl: string;
|
|
2370
|
-
readonly target: GitLabMrTarget;
|
|
2371
|
-
readonly eventId: string;
|
|
2372
|
-
}
|
|
2373
|
-
type GitLabWebhookParseResult = {
|
|
2374
|
-
readonly kind: 'accepted';
|
|
2375
|
-
readonly job: GitLabWebhookJob;
|
|
2376
|
-
} | {
|
|
2377
|
-
readonly kind: 'ignored';
|
|
2378
|
-
readonly reason: string;
|
|
2379
|
-
} | {
|
|
2380
|
-
readonly kind: 'invalid';
|
|
2381
|
-
readonly reason: string;
|
|
2382
|
-
};
|
|
2383
|
-
type GitLabWebhookQueueStatus = 'started' | 'queued' | 'deduped';
|
|
2384
|
-
interface GitLabWebhookQueueEnqueueResult {
|
|
2385
|
-
readonly status: GitLabWebhookQueueStatus;
|
|
2386
|
-
readonly key: string;
|
|
2387
|
-
}
|
|
2388
|
-
interface GitLabWebhookQueue {
|
|
2389
|
-
enqueue(job: GitLabWebhookJob): GitLabWebhookQueueEnqueueResult;
|
|
2390
|
-
onIdle(): Promise<void>;
|
|
2391
|
-
}
|
|
2392
|
-
interface CreateGitLabWebhookQueueOptions {
|
|
2393
|
-
readonly reviewRoot: string;
|
|
2394
|
-
readonly runner?: PrReviewRunner;
|
|
2395
|
-
readonly post: boolean;
|
|
2396
|
-
readonly aiOff?: boolean;
|
|
2397
|
-
readonly minSeverity?: Severity;
|
|
2398
|
-
readonly minConfidence?: number;
|
|
2399
|
-
readonly reportFormat?: 'md' | 'json' | 'both';
|
|
2400
|
-
readonly outputRoot?: string;
|
|
2401
|
-
}
|
|
2402
|
-
interface CreateGitLabWebhookServerOptions {
|
|
2403
|
-
readonly path: string;
|
|
2404
|
-
readonly secret: string;
|
|
2405
|
-
readonly queue: GitLabWebhookQueue;
|
|
2406
|
-
readonly allowNoteCommand?: boolean;
|
|
2407
|
-
}
|
|
2408
|
-
interface RunGitLabWebhookOptions {
|
|
2409
|
-
readonly host?: string;
|
|
2410
|
-
readonly port?: number;
|
|
2411
|
-
readonly path?: string;
|
|
2412
|
-
readonly reviewRoot?: string;
|
|
2413
|
-
readonly secretEnv?: string;
|
|
2414
|
-
readonly allowNoteCommand?: boolean;
|
|
2415
|
-
readonly post?: boolean;
|
|
2416
|
-
readonly aiOff?: boolean;
|
|
2417
|
-
readonly minSeverity?: Severity;
|
|
2418
|
-
readonly minConfidence?: number;
|
|
2419
|
-
readonly reportFormat?: 'md' | 'json' | 'both';
|
|
2420
|
-
}
|
|
2421
|
-
declare const createGitLabWebhookQueue: (options: CreateGitLabWebhookQueueOptions) => GitLabWebhookQueue;
|
|
2422
|
-
declare const parseGitLabMergeRequestWebhook: (payload: unknown, eventId: string) => GitLabWebhookParseResult;
|
|
2423
|
-
declare const createGitLabWebhookServer: (options: CreateGitLabWebhookServerOptions) => Server;
|
|
2424
|
-
declare const runGitLabWebhook: (options?: RunGitLabWebhookOptions) => Promise<number>;
|
|
2425
|
-
|
|
2426
|
-
export { type AuthLoginOptions, type AutomationTokenCreateOptions, type AutomationTokenOptions, type AutomationTokenRevokeOptions, type BuildContainerOptions, type CliBuildMetadata, type CodeReviewConfig, type ConfigEffectiveOptions, type Container, EXIT, type ExitCode, FileProtectedRetryStore, FileWorkspaceLinkStore, type FindFilesOptions, type GitLabWebhookJob, type GitLabWebhookQueue, type HistoryDiffOptions, type HistoryListOptions, type ICredentialStore, InMemoryCredentialStore, InMemoryRetryKeyProvider, type InitOptions, LinuxSecretServiceStore, type LoadedConfig, type LocalEffectiveConfig, type LocalReadiness, type LocalReadinessCheck, MacOsKeychainCredentialStore, type PendingPushRetry, type ProjectConfigApplyOptions, type ProjectConfigShowOptions, type ProjectSetupOptions, type ProjectSetupPrompts, type ProjectStatus, type ProjectStatusOptions, type ProjectUnlinkOptions, type ResultsExportOptions, type ResultsOptions, type ResultsShowOptions, type ReviewOptions, type RuleListOptions, type RunGitLabWebhookOptions, type StoredCredential, WindowsCredentialManagerStore, type WorkspaceLinkState, buildContainer, buildProgram, codeReviewConfigSchema, createGitLabWebhookQueue, createGitLabWebhookServer, createPlatformCredentialStore, createPlatformRetryKeyProvider, createPlatformSecretStore, createRemoteConfigClient, findFiles, getCliBuildMetadata, getLocalEffectiveConfig, getLocalProjectStatus, getLocalReadiness, getProjectStatus, loadConfig, main, parseGitLabMergeRequestWebhook, repositoryConfigFromLocalConfig, runAuthLogin, runAuthLogout, runAuthStatus, runAutomationTokenCreate, runAutomationTokenList, runAutomationTokenRevoke, runConfigEffective, runDoctor, runGitLabWebhook, runHistoryDiff, runHistoryList, runInit, runProjectConfigApply, runProjectConfigPull, runProjectConfigShow, runProjectLink, runProjectList, runProjectSetup, runProjectStatus, runProjectUnlink, runQuickstart, runResults, runResultsExport, runResultsShow, runReview, runRuleList };
|
|
2610
|
+
export { type AuthLoginOptions, type AutomationTokenCreateOptions, type AutomationTokenOptions, type AutomationTokenRevokeOptions, type BuildContainerOptions, type CliBuildMetadata, type CodeReviewConfig, type ConfigEffectiveOptions, type Container, EXIT, type ExitCode, FileProtectedRetryStore, FileWorkspaceLinkStore, type FindFilesOptions, type HistoryDiffOptions, type HistoryListOptions, type ICredentialStore, InMemoryCredentialStore, InMemoryRetryKeyProvider, type InitOptions, LinuxSecretServiceStore, type LoadedConfig, type LocalEffectiveConfig, type LocalReadiness, type LocalReadinessCheck, MacOsKeychainCredentialStore, type PendingPushRetry, type ProjectConfigApplyOptions, type ProjectConfigShowOptions, type ProjectSetupOptions, type ProjectSetupPrompts, type ProjectStatus, type ProjectStatusOptions, type ProjectUnlinkOptions, type ResultsExportOptions, type ResultsOptions, type ResultsShowOptions, type ReviewOptions, type RuleListOptions, type StoredCredential, WindowsCredentialManagerStore, type WorkspaceLinkState, buildContainer, buildProgram, codeReviewConfigSchema, createPlatformCredentialStore, createPlatformRetryKeyProvider, createPlatformSecretStore, createRemoteConfigClient, findFiles, getCliBuildMetadata, getLocalEffectiveConfig, getLocalProjectStatus, getLocalReadiness, getProjectStatus, loadConfig, main, repositoryConfigFromLocalConfig, runAuthLogin, runAuthLogout, runAuthStatus, runAutomationTokenCreate, runAutomationTokenList, runAutomationTokenRevoke, runConfigEffective, runDoctor, runHistoryDiff, runHistoryList, runInit, runProjectConfigApply, runProjectConfigPull, runProjectConfigShow, runProjectLink, runProjectList, runProjectSetup, runProjectStatus, runProjectUnlink, runQuickstart, runResults, runResultsExport, runResultsShow, runReview, runRuleList };
|