@code-sentinel-cli/code-sentinel-cli 3.0.8 → 3.0.10
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 +34364 -18689
- package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.prompt.md +10 -8
- package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.rule.yaml +10 -5
- package/dist/builtin-rules/static/angular/template-dom-xss.rule.js +26 -3
- package/dist/builtin-rules/static/spring-boot/no-command-injection.rule.js +7 -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 +1 -1
- package/dist/builtin-rules/static/spring-boot/no-sql-string-concat.rule.js +30 -4
- package/dist/builtin-rules/static/spring-boot/no-ssrf.rule.js +1 -1
- package/dist/index.d.ts +284 -32
- package/dist/index.js +34582 -18907
- package/package.json +1 -1
- package/templates/ci/github-actions.yml +60 -2
- package/templates/ci/gitlab-ci.yml +51 -2
package/dist/index.d.ts
CHANGED
|
@@ -278,14 +278,14 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
278
278
|
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
279
279
|
}, "strip", z.ZodTypeAny, {
|
|
280
280
|
options?: Record<string, unknown> | undefined;
|
|
281
|
+
enabled?: boolean | undefined;
|
|
281
282
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
282
283
|
confidence?: number | undefined;
|
|
283
|
-
enabled?: boolean | undefined;
|
|
284
284
|
}, {
|
|
285
285
|
options?: Record<string, unknown> | undefined;
|
|
286
|
+
enabled?: boolean | undefined;
|
|
286
287
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
287
288
|
confidence?: number | undefined;
|
|
288
|
-
enabled?: boolean | undefined;
|
|
289
289
|
}>>>;
|
|
290
290
|
/**
|
|
291
291
|
* Per-path override blocks (Phase 12.5). Each entry binds a glob
|
|
@@ -314,29 +314,29 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
314
314
|
severity: z.ZodOptional<z.ZodEnum<["info", "warning", "error", "blocker"]>>;
|
|
315
315
|
confidence: z.ZodOptional<z.ZodNumber>;
|
|
316
316
|
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
enabled?: boolean | undefined;
|
|
317
318
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
318
319
|
confidence?: number | undefined;
|
|
319
|
-
enabled?: boolean | undefined;
|
|
320
320
|
}, {
|
|
321
|
+
enabled?: boolean | undefined;
|
|
321
322
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
322
323
|
confidence?: number | undefined;
|
|
323
|
-
enabled?: boolean | undefined;
|
|
324
324
|
}>>>;
|
|
325
325
|
}, "strip", z.ZodTypeAny, {
|
|
326
326
|
paths: string[];
|
|
327
327
|
disabled?: string[] | undefined;
|
|
328
328
|
overrides?: Record<string, {
|
|
329
|
+
enabled?: boolean | undefined;
|
|
329
330
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
330
331
|
confidence?: number | undefined;
|
|
331
|
-
enabled?: boolean | undefined;
|
|
332
332
|
}> | undefined;
|
|
333
333
|
}, {
|
|
334
334
|
paths: string[];
|
|
335
335
|
disabled?: string[] | undefined;
|
|
336
336
|
overrides?: Record<string, {
|
|
337
|
+
enabled?: boolean | undefined;
|
|
337
338
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
338
339
|
confidence?: number | undefined;
|
|
339
|
-
enabled?: boolean | undefined;
|
|
340
340
|
}> | undefined;
|
|
341
341
|
}>, "many">>;
|
|
342
342
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -346,17 +346,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
346
346
|
projectCustomExecution: ("local" | "ci")[];
|
|
347
347
|
overrides: Record<string, {
|
|
348
348
|
options?: Record<string, unknown> | undefined;
|
|
349
|
+
enabled?: boolean | undefined;
|
|
349
350
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
350
351
|
confidence?: number | undefined;
|
|
351
|
-
enabled?: boolean | undefined;
|
|
352
352
|
}>;
|
|
353
353
|
pathOverrides: {
|
|
354
354
|
paths: string[];
|
|
355
355
|
disabled?: string[] | undefined;
|
|
356
356
|
overrides?: Record<string, {
|
|
357
|
+
enabled?: boolean | undefined;
|
|
357
358
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
358
359
|
confidence?: number | undefined;
|
|
359
|
-
enabled?: boolean | undefined;
|
|
360
360
|
}> | undefined;
|
|
361
361
|
}[];
|
|
362
362
|
}, {
|
|
@@ -366,17 +366,17 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
366
366
|
projectCustomExecution?: ("local" | "ci")[] | undefined;
|
|
367
367
|
overrides?: Record<string, {
|
|
368
368
|
options?: Record<string, unknown> | undefined;
|
|
369
|
+
enabled?: boolean | undefined;
|
|
369
370
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
370
371
|
confidence?: number | undefined;
|
|
371
|
-
enabled?: boolean | undefined;
|
|
372
372
|
}> | undefined;
|
|
373
373
|
pathOverrides?: {
|
|
374
374
|
paths: string[];
|
|
375
375
|
disabled?: string[] | undefined;
|
|
376
376
|
overrides?: Record<string, {
|
|
377
|
+
enabled?: boolean | undefined;
|
|
377
378
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
378
379
|
confidence?: number | undefined;
|
|
379
|
-
enabled?: boolean | undefined;
|
|
380
380
|
}> | undefined;
|
|
381
381
|
}[] | undefined;
|
|
382
382
|
}>>;
|
|
@@ -627,12 +627,12 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
627
627
|
}, "strip", z.ZodTypeAny, {
|
|
628
628
|
format: "json" | "markdown" | "markdown-compact" | "sarif";
|
|
629
629
|
output: string;
|
|
630
|
-
groupBy: "
|
|
630
|
+
groupBy: "severity" | "file" | "rule" | "category";
|
|
631
631
|
includeSnippets: boolean;
|
|
632
632
|
}, {
|
|
633
633
|
format?: "json" | "markdown" | "markdown-compact" | "sarif" | undefined;
|
|
634
634
|
output?: string | undefined;
|
|
635
|
-
groupBy?: "
|
|
635
|
+
groupBy?: "severity" | "file" | "rule" | "category" | undefined;
|
|
636
636
|
includeSnippets?: boolean | undefined;
|
|
637
637
|
}>>;
|
|
638
638
|
review: z.ZodDefault<z.ZodObject<{
|
|
@@ -999,7 +999,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
999
999
|
* `${ENV_VAR}` interpolation for the token so secrets stay out of the file.
|
|
1000
1000
|
*/
|
|
1001
1001
|
dashboard: z.ZodDefault<z.ZodObject<{
|
|
1002
|
-
/** Base URL of the @code-sentinel/server instance, e.g. `https://
|
|
1002
|
+
/** Base URL of the @code-sentinel/server instance, e.g. `https://codesentinel.vtscloud.vn`. */
|
|
1003
1003
|
serverUrl: z.ZodOptional<z.ZodString>;
|
|
1004
1004
|
/** Project-scoped bearer token for `POST /api/runs`. */
|
|
1005
1005
|
token: z.ZodOptional<z.ZodString>;
|
|
@@ -1007,12 +1007,154 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1007
1007
|
projectId: z.ZodOptional<z.ZodString>;
|
|
1008
1008
|
}, "strip", z.ZodTypeAny, {
|
|
1009
1009
|
serverUrl?: string | undefined;
|
|
1010
|
-
projectId?: string | undefined;
|
|
1011
1010
|
token?: string | undefined;
|
|
1011
|
+
projectId?: string | undefined;
|
|
1012
1012
|
}, {
|
|
1013
1013
|
serverUrl?: string | undefined;
|
|
1014
|
-
projectId?: string | undefined;
|
|
1015
1014
|
token?: string | undefined;
|
|
1015
|
+
projectId?: string | undefined;
|
|
1016
|
+
}>>;
|
|
1017
|
+
/**
|
|
1018
|
+
* Pentest Coverage Layer settings ([ADR-0057]).
|
|
1019
|
+
*
|
|
1020
|
+
* `policy` holds the THRESHOLDS a project is audited against — password length, OTP lifetime,
|
|
1021
|
+
* lockout counts, session timeouts. They are policy, not engineering: they differ per project and
|
|
1022
|
+
* per contract, so hard-coding them would either fail compliant projects or pass non-compliant
|
|
1023
|
+
* ones. Every field is optional and falls back to the documented default, so a project sets only
|
|
1024
|
+
* what its own regulation states.
|
|
1025
|
+
*
|
|
1026
|
+
* Positive-number validation only. A project that genuinely wants a 5-minute idle timeout is
|
|
1027
|
+
* making a policy choice, not a mistake, so the schema does not second-guess the value.
|
|
1028
|
+
*/
|
|
1029
|
+
pentest: z.ZodDefault<z.ZodObject<{
|
|
1030
|
+
policy: z.ZodDefault<z.ZodObject<{
|
|
1031
|
+
password: z.ZodOptional<z.ZodObject<{
|
|
1032
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
1033
|
+
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
1034
|
+
historyCount: z.ZodOptional<z.ZodNumber>;
|
|
1035
|
+
}, "strip", z.ZodTypeAny, {
|
|
1036
|
+
minLength?: number | undefined;
|
|
1037
|
+
maxAgeDays?: number | undefined;
|
|
1038
|
+
historyCount?: number | undefined;
|
|
1039
|
+
}, {
|
|
1040
|
+
minLength?: number | undefined;
|
|
1041
|
+
maxAgeDays?: number | undefined;
|
|
1042
|
+
historyCount?: number | undefined;
|
|
1043
|
+
}>>;
|
|
1044
|
+
lockout: z.ZodOptional<z.ZodObject<{
|
|
1045
|
+
captchaAfterFailures: z.ZodOptional<z.ZodNumber>;
|
|
1046
|
+
}, "strip", z.ZodTypeAny, {
|
|
1047
|
+
captchaAfterFailures?: number | undefined;
|
|
1048
|
+
}, {
|
|
1049
|
+
captchaAfterFailures?: number | undefined;
|
|
1050
|
+
}>>;
|
|
1051
|
+
otp: z.ZodOptional<z.ZodObject<{
|
|
1052
|
+
ttlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1053
|
+
maxWrongPerDay: z.ZodOptional<z.ZodNumber>;
|
|
1054
|
+
singleValidAtATime: z.ZodOptional<z.ZodBoolean>;
|
|
1055
|
+
}, "strip", z.ZodTypeAny, {
|
|
1056
|
+
ttlSeconds?: number | undefined;
|
|
1057
|
+
maxWrongPerDay?: number | undefined;
|
|
1058
|
+
singleValidAtATime?: boolean | undefined;
|
|
1059
|
+
}, {
|
|
1060
|
+
ttlSeconds?: number | undefined;
|
|
1061
|
+
maxWrongPerDay?: number | undefined;
|
|
1062
|
+
singleValidAtATime?: boolean | undefined;
|
|
1063
|
+
}>>;
|
|
1064
|
+
session: z.ZodOptional<z.ZodObject<{
|
|
1065
|
+
idleTimeoutMinutes: z.ZodOptional<z.ZodNumber>;
|
|
1066
|
+
absoluteTimeoutHours: z.ZodOptional<z.ZodNumber>;
|
|
1067
|
+
tokenBits: z.ZodOptional<z.ZodNumber>;
|
|
1068
|
+
}, "strip", z.ZodTypeAny, {
|
|
1069
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1070
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1071
|
+
tokenBits?: number | undefined;
|
|
1072
|
+
}, {
|
|
1073
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1074
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1075
|
+
tokenBits?: number | undefined;
|
|
1076
|
+
}>>;
|
|
1077
|
+
}, "strip", z.ZodTypeAny, {
|
|
1078
|
+
password?: {
|
|
1079
|
+
minLength?: number | undefined;
|
|
1080
|
+
maxAgeDays?: number | undefined;
|
|
1081
|
+
historyCount?: number | undefined;
|
|
1082
|
+
} | undefined;
|
|
1083
|
+
lockout?: {
|
|
1084
|
+
captchaAfterFailures?: number | undefined;
|
|
1085
|
+
} | undefined;
|
|
1086
|
+
otp?: {
|
|
1087
|
+
ttlSeconds?: number | undefined;
|
|
1088
|
+
maxWrongPerDay?: number | undefined;
|
|
1089
|
+
singleValidAtATime?: boolean | undefined;
|
|
1090
|
+
} | undefined;
|
|
1091
|
+
session?: {
|
|
1092
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1093
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1094
|
+
tokenBits?: number | undefined;
|
|
1095
|
+
} | undefined;
|
|
1096
|
+
}, {
|
|
1097
|
+
password?: {
|
|
1098
|
+
minLength?: number | undefined;
|
|
1099
|
+
maxAgeDays?: number | undefined;
|
|
1100
|
+
historyCount?: number | undefined;
|
|
1101
|
+
} | undefined;
|
|
1102
|
+
lockout?: {
|
|
1103
|
+
captchaAfterFailures?: number | undefined;
|
|
1104
|
+
} | undefined;
|
|
1105
|
+
otp?: {
|
|
1106
|
+
ttlSeconds?: number | undefined;
|
|
1107
|
+
maxWrongPerDay?: number | undefined;
|
|
1108
|
+
singleValidAtATime?: boolean | undefined;
|
|
1109
|
+
} | undefined;
|
|
1110
|
+
session?: {
|
|
1111
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1112
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1113
|
+
tokenBits?: number | undefined;
|
|
1114
|
+
} | undefined;
|
|
1115
|
+
}>>;
|
|
1116
|
+
}, "strip", z.ZodTypeAny, {
|
|
1117
|
+
policy: {
|
|
1118
|
+
password?: {
|
|
1119
|
+
minLength?: number | undefined;
|
|
1120
|
+
maxAgeDays?: number | undefined;
|
|
1121
|
+
historyCount?: number | undefined;
|
|
1122
|
+
} | undefined;
|
|
1123
|
+
lockout?: {
|
|
1124
|
+
captchaAfterFailures?: number | undefined;
|
|
1125
|
+
} | undefined;
|
|
1126
|
+
otp?: {
|
|
1127
|
+
ttlSeconds?: number | undefined;
|
|
1128
|
+
maxWrongPerDay?: number | undefined;
|
|
1129
|
+
singleValidAtATime?: boolean | undefined;
|
|
1130
|
+
} | undefined;
|
|
1131
|
+
session?: {
|
|
1132
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1133
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1134
|
+
tokenBits?: number | undefined;
|
|
1135
|
+
} | undefined;
|
|
1136
|
+
};
|
|
1137
|
+
}, {
|
|
1138
|
+
policy?: {
|
|
1139
|
+
password?: {
|
|
1140
|
+
minLength?: number | undefined;
|
|
1141
|
+
maxAgeDays?: number | undefined;
|
|
1142
|
+
historyCount?: number | undefined;
|
|
1143
|
+
} | undefined;
|
|
1144
|
+
lockout?: {
|
|
1145
|
+
captchaAfterFailures?: number | undefined;
|
|
1146
|
+
} | undefined;
|
|
1147
|
+
otp?: {
|
|
1148
|
+
ttlSeconds?: number | undefined;
|
|
1149
|
+
maxWrongPerDay?: number | undefined;
|
|
1150
|
+
singleValidAtATime?: boolean | undefined;
|
|
1151
|
+
} | undefined;
|
|
1152
|
+
session?: {
|
|
1153
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1154
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1155
|
+
tokenBits?: number | undefined;
|
|
1156
|
+
} | undefined;
|
|
1157
|
+
} | undefined;
|
|
1016
1158
|
}>>;
|
|
1017
1159
|
}, "strip", z.ZodTypeAny, {
|
|
1018
1160
|
rules: {
|
|
@@ -1022,21 +1164,21 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1022
1164
|
projectCustomExecution: ("local" | "ci")[];
|
|
1023
1165
|
overrides: Record<string, {
|
|
1024
1166
|
options?: Record<string, unknown> | undefined;
|
|
1167
|
+
enabled?: boolean | undefined;
|
|
1025
1168
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1026
1169
|
confidence?: number | undefined;
|
|
1027
|
-
enabled?: boolean | undefined;
|
|
1028
1170
|
}>;
|
|
1029
1171
|
pathOverrides: {
|
|
1030
1172
|
paths: string[];
|
|
1031
1173
|
disabled?: string[] | undefined;
|
|
1032
1174
|
overrides?: Record<string, {
|
|
1175
|
+
enabled?: boolean | undefined;
|
|
1033
1176
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1034
1177
|
confidence?: number | undefined;
|
|
1035
|
-
enabled?: boolean | undefined;
|
|
1036
1178
|
}> | undefined;
|
|
1037
1179
|
}[];
|
|
1038
1180
|
};
|
|
1039
|
-
mode: "
|
|
1181
|
+
mode: "auto" | "economy" | "balanced" | "performance";
|
|
1040
1182
|
include: string[];
|
|
1041
1183
|
exclude: string[];
|
|
1042
1184
|
ai: {
|
|
@@ -1089,7 +1231,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1089
1231
|
report: {
|
|
1090
1232
|
format: "json" | "markdown" | "markdown-compact" | "sarif";
|
|
1091
1233
|
output: string;
|
|
1092
|
-
groupBy: "
|
|
1234
|
+
groupBy: "severity" | "file" | "rule" | "category";
|
|
1093
1235
|
includeSnippets: boolean;
|
|
1094
1236
|
};
|
|
1095
1237
|
review: {
|
|
@@ -1167,8 +1309,30 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1167
1309
|
};
|
|
1168
1310
|
dashboard: {
|
|
1169
1311
|
serverUrl?: string | undefined;
|
|
1170
|
-
projectId?: string | undefined;
|
|
1171
1312
|
token?: string | undefined;
|
|
1313
|
+
projectId?: string | undefined;
|
|
1314
|
+
};
|
|
1315
|
+
pentest: {
|
|
1316
|
+
policy: {
|
|
1317
|
+
password?: {
|
|
1318
|
+
minLength?: number | undefined;
|
|
1319
|
+
maxAgeDays?: number | undefined;
|
|
1320
|
+
historyCount?: number | undefined;
|
|
1321
|
+
} | undefined;
|
|
1322
|
+
lockout?: {
|
|
1323
|
+
captchaAfterFailures?: number | undefined;
|
|
1324
|
+
} | undefined;
|
|
1325
|
+
otp?: {
|
|
1326
|
+
ttlSeconds?: number | undefined;
|
|
1327
|
+
maxWrongPerDay?: number | undefined;
|
|
1328
|
+
singleValidAtATime?: boolean | undefined;
|
|
1329
|
+
} | undefined;
|
|
1330
|
+
session?: {
|
|
1331
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1332
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1333
|
+
tokenBits?: number | undefined;
|
|
1334
|
+
} | undefined;
|
|
1335
|
+
};
|
|
1172
1336
|
};
|
|
1173
1337
|
}, {
|
|
1174
1338
|
rules?: {
|
|
@@ -1178,21 +1342,21 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1178
1342
|
projectCustomExecution?: ("local" | "ci")[] | undefined;
|
|
1179
1343
|
overrides?: Record<string, {
|
|
1180
1344
|
options?: Record<string, unknown> | undefined;
|
|
1345
|
+
enabled?: boolean | undefined;
|
|
1181
1346
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1182
1347
|
confidence?: number | undefined;
|
|
1183
|
-
enabled?: boolean | undefined;
|
|
1184
1348
|
}> | undefined;
|
|
1185
1349
|
pathOverrides?: {
|
|
1186
1350
|
paths: string[];
|
|
1187
1351
|
disabled?: string[] | undefined;
|
|
1188
1352
|
overrides?: Record<string, {
|
|
1353
|
+
enabled?: boolean | undefined;
|
|
1189
1354
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1190
1355
|
confidence?: number | undefined;
|
|
1191
|
-
enabled?: boolean | undefined;
|
|
1192
1356
|
}> | undefined;
|
|
1193
1357
|
}[] | undefined;
|
|
1194
1358
|
} | undefined;
|
|
1195
|
-
mode?: "
|
|
1359
|
+
mode?: "auto" | "economy" | "balanced" | "performance" | undefined;
|
|
1196
1360
|
include?: string[] | undefined;
|
|
1197
1361
|
exclude?: string[] | undefined;
|
|
1198
1362
|
ai?: {
|
|
@@ -1245,7 +1409,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1245
1409
|
report?: {
|
|
1246
1410
|
format?: "json" | "markdown" | "markdown-compact" | "sarif" | undefined;
|
|
1247
1411
|
output?: string | undefined;
|
|
1248
|
-
groupBy?: "
|
|
1412
|
+
groupBy?: "severity" | "file" | "rule" | "category" | undefined;
|
|
1249
1413
|
includeSnippets?: boolean | undefined;
|
|
1250
1414
|
} | undefined;
|
|
1251
1415
|
review?: {
|
|
@@ -1323,8 +1487,30 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1323
1487
|
} | undefined;
|
|
1324
1488
|
dashboard?: {
|
|
1325
1489
|
serverUrl?: string | undefined;
|
|
1326
|
-
projectId?: string | undefined;
|
|
1327
1490
|
token?: string | undefined;
|
|
1491
|
+
projectId?: string | undefined;
|
|
1492
|
+
} | undefined;
|
|
1493
|
+
pentest?: {
|
|
1494
|
+
policy?: {
|
|
1495
|
+
password?: {
|
|
1496
|
+
minLength?: number | undefined;
|
|
1497
|
+
maxAgeDays?: number | undefined;
|
|
1498
|
+
historyCount?: number | undefined;
|
|
1499
|
+
} | undefined;
|
|
1500
|
+
lockout?: {
|
|
1501
|
+
captchaAfterFailures?: number | undefined;
|
|
1502
|
+
} | undefined;
|
|
1503
|
+
otp?: {
|
|
1504
|
+
ttlSeconds?: number | undefined;
|
|
1505
|
+
maxWrongPerDay?: number | undefined;
|
|
1506
|
+
singleValidAtATime?: boolean | undefined;
|
|
1507
|
+
} | undefined;
|
|
1508
|
+
session?: {
|
|
1509
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1510
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1511
|
+
tokenBits?: number | undefined;
|
|
1512
|
+
} | undefined;
|
|
1513
|
+
} | undefined;
|
|
1328
1514
|
} | undefined;
|
|
1329
1515
|
}>, {
|
|
1330
1516
|
rules: {
|
|
@@ -1334,21 +1520,21 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1334
1520
|
projectCustomExecution: ("local" | "ci")[];
|
|
1335
1521
|
overrides: Record<string, {
|
|
1336
1522
|
options?: Record<string, unknown> | undefined;
|
|
1523
|
+
enabled?: boolean | undefined;
|
|
1337
1524
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1338
1525
|
confidence?: number | undefined;
|
|
1339
|
-
enabled?: boolean | undefined;
|
|
1340
1526
|
}>;
|
|
1341
1527
|
pathOverrides: {
|
|
1342
1528
|
paths: string[];
|
|
1343
1529
|
disabled?: string[] | undefined;
|
|
1344
1530
|
overrides?: Record<string, {
|
|
1531
|
+
enabled?: boolean | undefined;
|
|
1345
1532
|
severity?: "info" | "warning" | "error" | "blocker" | undefined;
|
|
1346
1533
|
confidence?: number | undefined;
|
|
1347
|
-
enabled?: boolean | undefined;
|
|
1348
1534
|
}> | undefined;
|
|
1349
1535
|
}[];
|
|
1350
1536
|
};
|
|
1351
|
-
mode: "
|
|
1537
|
+
mode: "auto" | "economy" | "balanced" | "performance";
|
|
1352
1538
|
include: string[];
|
|
1353
1539
|
exclude: string[];
|
|
1354
1540
|
ai: {
|
|
@@ -1401,7 +1587,7 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1401
1587
|
report: {
|
|
1402
1588
|
format: "json" | "markdown" | "markdown-compact" | "sarif";
|
|
1403
1589
|
output: string;
|
|
1404
|
-
groupBy: "
|
|
1590
|
+
groupBy: "severity" | "file" | "rule" | "category";
|
|
1405
1591
|
includeSnippets: boolean;
|
|
1406
1592
|
};
|
|
1407
1593
|
review: {
|
|
@@ -1479,8 +1665,30 @@ declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1479
1665
|
};
|
|
1480
1666
|
dashboard: {
|
|
1481
1667
|
serverUrl?: string | undefined;
|
|
1482
|
-
projectId?: string | undefined;
|
|
1483
1668
|
token?: string | undefined;
|
|
1669
|
+
projectId?: string | undefined;
|
|
1670
|
+
};
|
|
1671
|
+
pentest: {
|
|
1672
|
+
policy: {
|
|
1673
|
+
password?: {
|
|
1674
|
+
minLength?: number | undefined;
|
|
1675
|
+
maxAgeDays?: number | undefined;
|
|
1676
|
+
historyCount?: number | undefined;
|
|
1677
|
+
} | undefined;
|
|
1678
|
+
lockout?: {
|
|
1679
|
+
captchaAfterFailures?: number | undefined;
|
|
1680
|
+
} | undefined;
|
|
1681
|
+
otp?: {
|
|
1682
|
+
ttlSeconds?: number | undefined;
|
|
1683
|
+
maxWrongPerDay?: number | undefined;
|
|
1684
|
+
singleValidAtATime?: boolean | undefined;
|
|
1685
|
+
} | undefined;
|
|
1686
|
+
session?: {
|
|
1687
|
+
idleTimeoutMinutes?: number | undefined;
|
|
1688
|
+
absoluteTimeoutHours?: number | undefined;
|
|
1689
|
+
tokenBits?: number | undefined;
|
|
1690
|
+
} | undefined;
|
|
1691
|
+
};
|
|
1484
1692
|
};
|
|
1485
1693
|
}, unknown>;
|
|
1486
1694
|
type CodeReviewConfig = z.infer<typeof codeReviewConfigSchema>;
|
|
@@ -1653,7 +1861,7 @@ declare const runProjectUnlink: (options?: ProjectUnlinkOptions) => Promise<numb
|
|
|
1653
1861
|
|
|
1654
1862
|
type ReadinessLevel = 'pass' | 'warn' | 'fail';
|
|
1655
1863
|
interface LocalReadinessCheck {
|
|
1656
|
-
readonly id: 'git-repository' | 'workspace-link' | 'remote-parity' | 'config' | 'policy' | 'pending-push';
|
|
1864
|
+
readonly id: 'git-repository' | 'workspace-link' | 'remote-parity' | 'config' | 'policy' | 'rules-sync' | 'pending-push';
|
|
1657
1865
|
readonly level: ReadinessLevel;
|
|
1658
1866
|
readonly message: string;
|
|
1659
1867
|
}
|
|
@@ -1663,17 +1871,49 @@ interface LocalReadiness {
|
|
|
1663
1871
|
readonly checks: readonly LocalReadinessCheck[];
|
|
1664
1872
|
readonly project: ProjectStatus;
|
|
1665
1873
|
readonly effectiveConfigHash?: string;
|
|
1874
|
+
/** Present when the workspace is linked and the Dashboard policy resolved. */
|
|
1875
|
+
readonly dashboardPolicy?: {
|
|
1876
|
+
readonly effectiveConfigHash: string;
|
|
1877
|
+
readonly policyRevision: string;
|
|
1878
|
+
};
|
|
1879
|
+
/** Present when the linked project's rule bundle was compared. */
|
|
1880
|
+
readonly rulesSync?: {
|
|
1881
|
+
readonly localChecksum: string;
|
|
1882
|
+
readonly dashboardChecksum: string;
|
|
1883
|
+
};
|
|
1666
1884
|
}
|
|
1667
1885
|
declare const getLocalReadiness: (input?: {
|
|
1668
1886
|
readonly path?: string;
|
|
1669
1887
|
readonly configPath?: string;
|
|
1670
1888
|
readonly projectStatus?: () => Promise<ProjectStatus>;
|
|
1671
1889
|
readonly gitRepository?: () => Promise<boolean>;
|
|
1890
|
+
/** Test seam; production callers resolve policy over the authenticated Dashboard client. */
|
|
1891
|
+
readonly resolveOnlinePolicy?: (args: {
|
|
1892
|
+
readonly serverUrl: string;
|
|
1893
|
+
readonly projectId: string;
|
|
1894
|
+
readonly codebaseId: string;
|
|
1895
|
+
readonly repositoryConfig: Record<string, unknown>;
|
|
1896
|
+
readonly repositoryConfigHash: string;
|
|
1897
|
+
}) => Promise<{
|
|
1898
|
+
readonly effectiveConfigHash: string;
|
|
1899
|
+
readonly policyRevision: string;
|
|
1900
|
+
}>;
|
|
1901
|
+
/** Test seam; production callers fetch the Dashboard rule export bundle. */
|
|
1902
|
+
readonly resolveRulesBundle?: (args: {
|
|
1903
|
+
readonly projectId: string;
|
|
1904
|
+
readonly serverUrl: string;
|
|
1905
|
+
}) => Promise<{
|
|
1906
|
+
readonly checksum: string;
|
|
1907
|
+
}>;
|
|
1908
|
+
/** Skip every Dashboard round-trip; local checks still run (CS-12). */
|
|
1909
|
+
readonly offline?: boolean;
|
|
1672
1910
|
}) => Promise<LocalReadiness>;
|
|
1673
1911
|
interface LocalReadinessOptions {
|
|
1674
1912
|
readonly path?: string;
|
|
1675
1913
|
readonly configPath?: string;
|
|
1676
1914
|
readonly json?: boolean;
|
|
1915
|
+
/** Skip the Dashboard round-trips; local checks still run (CS-12). */
|
|
1916
|
+
readonly offline?: boolean;
|
|
1677
1917
|
readonly write?: (line: string) => void;
|
|
1678
1918
|
/** Test seam; production callers use the local observation implementation. */
|
|
1679
1919
|
readonly readiness?: () => Promise<LocalReadiness>;
|
|
@@ -2088,7 +2328,10 @@ interface AutomationTokenOptions {
|
|
|
2088
2328
|
declare const runAutomationTokenList: (options: AutomationTokenOptions) => Promise<number>;
|
|
2089
2329
|
interface AutomationTokenCreateOptions extends AutomationTokenOptions {
|
|
2090
2330
|
readonly name: string;
|
|
2331
|
+
/** ISO-8601 expiry; mutually exclusive with maxAgeDays. */
|
|
2091
2332
|
readonly expiresAt?: string;
|
|
2333
|
+
/** Lifetime in whole days (1..90); mutually exclusive with expiresAt. */
|
|
2334
|
+
readonly maxAgeDays?: number;
|
|
2092
2335
|
readonly yes?: boolean;
|
|
2093
2336
|
readonly confirm?: (input: {
|
|
2094
2337
|
message: string;
|
|
@@ -2116,6 +2359,7 @@ declare const runAutomationTokenRevoke: (options: AutomationTokenRevokeOptions)
|
|
|
2116
2359
|
* - disable: append the rule id to `rules.disabled` (idempotent).
|
|
2117
2360
|
* Validates the id exists.
|
|
2118
2361
|
*/
|
|
2362
|
+
|
|
2119
2363
|
interface RuleListOptions {
|
|
2120
2364
|
readonly path?: string;
|
|
2121
2365
|
/** Explicit config file. When set, skips user-global/project config discovery. */
|
|
@@ -2275,6 +2519,12 @@ interface LoadConfigOptions {
|
|
|
2275
2519
|
readonly configPath?: string;
|
|
2276
2520
|
/** Skip the user-global ~/.codereviewrc lookup. */
|
|
2277
2521
|
readonly noUserConfig?: boolean;
|
|
2522
|
+
/**
|
|
2523
|
+
* Keep unresolved placeholders as empty strings instead of failing config
|
|
2524
|
+
* loading. Intended only for commands that do not consume those settings
|
|
2525
|
+
* (for example static `cs assess` with an unused AI provider secret).
|
|
2526
|
+
*/
|
|
2527
|
+
readonly allowMissingEnv?: boolean;
|
|
2278
2528
|
}
|
|
2279
2529
|
interface LoadedConfig {
|
|
2280
2530
|
readonly config: CodeReviewConfig;
|
|
@@ -2289,6 +2539,8 @@ declare const createRemoteConfigClient: (input: {
|
|
|
2289
2539
|
readonly token?: string;
|
|
2290
2540
|
readonly getToken?: () => string | undefined;
|
|
2291
2541
|
readonly onUnauthorized?: () => Promise<boolean>;
|
|
2542
|
+
/** Overrides the client default (10s). Short-lived diagnostics pass a smaller budget. */
|
|
2543
|
+
readonly timeoutMs?: number;
|
|
2292
2544
|
}) => CliApiClient;
|
|
2293
2545
|
|
|
2294
2546
|
/**
|
|
@@ -2350,7 +2602,7 @@ interface PrReviewRuntimeOptions {
|
|
|
2350
2602
|
readonly scope?: ReviewScope;
|
|
2351
2603
|
readonly minSeverity?: Severity;
|
|
2352
2604
|
readonly minConfidence?: number;
|
|
2353
|
-
readonly reportFormat?: 'md' | 'json' | 'both';
|
|
2605
|
+
readonly reportFormat?: 'md' | 'json' | 'sarif' | 'both';
|
|
2354
2606
|
readonly output?: string;
|
|
2355
2607
|
readonly silent: boolean;
|
|
2356
2608
|
readonly noUi?: boolean;
|