@code-sentinel-cli/code-sentinel-cli 3.0.3 → 3.0.5
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/README.md +1 -1
- package/dist/bin.js +1191 -816
- package/dist/builtin-rules/ai/angular/api-service-contract-risk.prompt.md +71 -0
- package/dist/builtin-rules/ai/angular/api-service-contract-risk.rule.yaml +22 -0
- package/dist/builtin-rules/ai/angular/component-state-flow.prompt.md +79 -0
- package/dist/builtin-rules/ai/angular/component-state-flow.rule.yaml +26 -0
- package/dist/builtin-rules/ai/angular/cross-feature-api-drift.prompt.md +70 -0
- package/dist/builtin-rules/ai/angular/cross-feature-api-drift.rule.yaml +42 -0
- package/dist/builtin-rules/ai/angular/cross-feature-route-permission-drift.prompt.md +73 -0
- package/dist/builtin-rules/ai/angular/cross-feature-route-permission-drift.rule.yaml +50 -0
- package/dist/builtin-rules/ai/angular/reactive-form-flow.prompt.md +82 -0
- package/dist/builtin-rules/ai/angular/reactive-form-flow.rule.yaml +23 -0
- package/dist/builtin-rules/ai/angular/route-permission-flow.prompt.md +80 -0
- package/dist/builtin-rules/ai/angular/route-permission-flow.rule.yaml +23 -0
- package/dist/builtin-rules/ai/angular/rxjs-flow-risk.prompt.md +82 -0
- package/dist/builtin-rules/ai/angular/rxjs-flow-risk.rule.yaml +24 -0
- package/dist/builtin-rules/ai/angular/template-contract-risk.prompt.md +80 -0
- package/dist/builtin-rules/ai/angular/template-contract-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/flutter/dynamic-content-risk.prompt.md +55 -0
- package/dist/builtin-rules/ai/flutter/dynamic-content-risk.rule.yaml +18 -0
- package/dist/builtin-rules/ai/flutter/feature-state-flow-risk.prompt.md +58 -0
- package/dist/builtin-rules/ai/flutter/feature-state-flow-risk.rule.yaml +18 -0
- package/dist/builtin-rules/ai/flutter/native-platform-consistency-risk.prompt.md +56 -0
- package/dist/builtin-rules/ai/flutter/native-platform-consistency-risk.rule.yaml +18 -0
- package/dist/builtin-rules/ai/flutter/network-auth-flow-risk.prompt.md +57 -0
- package/dist/builtin-rules/ai/flutter/network-auth-flow-risk.rule.yaml +19 -0
- package/dist/builtin-rules/ai/flutter/ui-responsive-accessibility-risk.prompt.md +60 -0
- package/dist/builtin-rules/ai/flutter/ui-responsive-accessibility-risk.rule.yaml +18 -0
- package/dist/builtin-rules/ai/general/code-clarity.prompt.md +57 -0
- package/dist/builtin-rules/ai/general/code-clarity.rule.yaml +20 -0
- package/dist/builtin-rules/ai/spring-boot/business-invariant-risk.prompt.md +86 -0
- package/dist/builtin-rules/ai/spring-boot/business-invariant-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/cache-consistency-risk.prompt.md +80 -0
- package/dist/builtin-rules/ai/spring-boot/cache-consistency-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/cross-feature-error-handling-drift.prompt.md +76 -0
- package/dist/builtin-rules/ai/spring-boot/cross-feature-error-handling-drift.rule.yaml +63 -0
- package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.prompt.md +85 -0
- package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.rule.yaml +68 -0
- package/dist/builtin-rules/ai/spring-boot/error-handling-completeness.prompt.md +121 -0
- package/dist/builtin-rules/ai/spring-boot/error-handling-completeness.rule.yaml +84 -0
- package/dist/builtin-rules/ai/spring-boot/event-publishing-risk.prompt.md +80 -0
- package/dist/builtin-rules/ai/spring-boot/event-publishing-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/io-boundary-risk.prompt.md +78 -0
- package/dist/builtin-rules/ai/spring-boot/io-boundary-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.prompt.md +83 -0
- package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/pagination-risk.prompt.md +81 -0
- package/dist/builtin-rules/ai/spring-boot/pagination-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/security-authorization-risk.prompt.md +75 -0
- package/dist/builtin-rules/ai/spring-boot/security-authorization-risk.rule.yaml +26 -0
- package/dist/builtin-rules/ai/spring-boot/security-mass-assignment-risk.prompt.md +75 -0
- package/dist/builtin-rules/ai/spring-boot/security-mass-assignment-risk.rule.yaml +24 -0
- package/dist/builtin-rules/ai/spring-boot/security-redirect-risk.prompt.md +74 -0
- package/dist/builtin-rules/ai/spring-boot/security-redirect-risk.rule.yaml +24 -0
- package/dist/builtin-rules/ai/spring-boot/security-sensitive-data-risk.prompt.md +75 -0
- package/dist/builtin-rules/ai/spring-boot/security-sensitive-data-risk.rule.yaml +25 -0
- package/dist/builtin-rules/ai/spring-boot/transaction-loop-risk.prompt.md +78 -0
- package/dist/builtin-rules/ai/spring-boot/transaction-loop-risk.rule.yaml +25 -0
- package/dist/builtin-rules/static/angular/component-prefix.rule.js +78 -0
- package/dist/builtin-rules/static/angular/image-control-alt-required.rule.js +105 -0
- package/dist/builtin-rules/static/angular/img-alt-required.rule.js +96 -0
- package/dist/builtin-rules/static/angular/inject-pattern.rule.js +47 -0
- package/dist/builtin-rules/static/angular/lifecycle-method-required.rule.js +59 -0
- package/dist/builtin-rules/static/angular/no-any-type.rule.yaml +55 -0
- package/dist/builtin-rules/static/angular/no-direct-dom-access.rule.js +191 -0
- package/dist/builtin-rules/static/angular/no-dom-xss.rule.js +48 -0
- package/dist/builtin-rules/static/angular/no-leaky-subscription.rule.js +197 -0
- package/dist/builtin-rules/static/angular/no-ngmodule.rule.yaml +44 -0
- package/dist/builtin-rules/static/angular/no-non-null-asserted-optional-chain.rule.js +53 -0
- package/dist/builtin-rules/static/angular/no-uncalled-signal-in-condition.rule.js +112 -0
- package/dist/builtin-rules/static/angular/observable-naming.rule.js +85 -0
- package/dist/builtin-rules/static/angular/onpush-required.rule.js +70 -0
- package/dist/builtin-rules/static/angular/standalone-component-required.rule.js +65 -0
- package/dist/builtin-rules/static/angular/template-dom-xss.rule.js +112 -0
- package/dist/builtin-rules/static/angular/template-syntax-modern.rule.js +154 -0
- package/dist/builtin-rules/static/angular/trackby-required.rule.js +66 -0
- package/dist/builtin-rules/static/flutter/android-exported-component.rule.js +75 -0
- package/dist/builtin-rules/static/flutter/android-manifest-hardening.rule.js +117 -0
- package/dist/builtin-rules/static/flutter/android-sensitive-permissions.rule.js +87 -0
- package/dist/builtin-rules/static/flutter/debug-tooling-release-risk.rule.js +90 -0
- package/dist/builtin-rules/static/flutter/dynamic-archive-risk.rule.js +96 -0
- package/dist/builtin-rules/static/flutter/hive-sensitive-storage.rule.js +77 -0
- package/dist/builtin-rules/static/flutter/ios-privacy-hardening.rule.js +119 -0
- package/dist/builtin-rules/static/flutter/packaged-env-risk.rule.js +95 -0
- package/dist/builtin-rules/static/flutter/sensitive-log-leak.rule.js +94 -0
- package/dist/builtin-rules/static/flutter/webview-bridge-guard.rule.js +102 -0
- package/dist/builtin-rules/static/general/file-too-long.rule.js +41 -0
- package/dist/builtin-rules/static/general/function-too-long.rule.js +72 -0
- package/dist/builtin-rules/static/general/no-circular-import.rule.js +39 -0
- package/dist/builtin-rules/static/general/no-code-injection.rule.js +48 -0
- package/dist/builtin-rules/static/general/no-console-log.rule.js +110 -0
- package/dist/builtin-rules/static/general/no-empty-catch.rule.yaml +56 -0
- package/dist/builtin-rules/static/general/no-hardcoded-secret.rule.js +517 -0
- package/dist/builtin-rules/static/general/no-magic-number.rule.js +78 -0
- package/dist/builtin-rules/static/general/no-open-redirect.rule.js +46 -0
- package/dist/builtin-rules/static/general/no-todo-comment.rule.yaml +30 -0
- package/dist/builtin-rules/static/general/no-unresolved-import-symbol.rule.js +80 -0
- package/dist/builtin-rules/static/general/no-unused-export.rule.js +140 -0
- package/dist/builtin-rules/static/spring-boot/no-autowired-field.rule.js +162 -0
- package/dist/builtin-rules/static/spring-boot/no-business-logic-in-controller.rule.js +94 -0
- package/dist/builtin-rules/static/spring-boot/no-command-injection.rule.js +47 -0
- package/dist/builtin-rules/static/spring-boot/no-entity-in-controller.rule.yaml +52 -0
- package/dist/builtin-rules/static/spring-boot/no-nplus1-query-in-loop.rule.js +106 -0
- package/dist/builtin-rules/static/spring-boot/no-path-traversal.rule.js +47 -0
- package/dist/builtin-rules/static/spring-boot/no-spel-injection.rule.js +41 -0
- package/dist/builtin-rules/static/spring-boot/no-sql-string-concat.rule.js +194 -0
- package/dist/builtin-rules/static/spring-boot/no-ssrf.rule.js +49 -0
- package/dist/builtin-rules/static/spring-boot/no-transactional-self-invocation.rule.js +142 -0
- package/dist/builtin-rules/static/spring-boot/no-unclosed-resource.rule.js +108 -0
- package/dist/builtin-rules/static/spring-boot/no-unsafe-shared-formatter.rule.js +118 -0
- package/dist/builtin-rules/static/spring-boot/repository-naming.rule.yaml +42 -0
- package/dist/builtin-rules/static/spring-boot/restful-naming.rule.yaml +39 -0
- package/dist/builtin-rules/static/spring-boot/transaction-on-service.rule.yaml +58 -0
- package/dist/builtin-rules/static/spring-boot/validate-input.rule.js +123 -0
- package/dist/builtin-rules/vauthz/static/spring-boot/require-authz-check.rule.js +101 -0
- package/dist/index.d.ts +225 -48
- package/dist/index.js +1190 -815
- package/node_modules/@code-sentinel/core/index.js +55 -0
- package/node_modules/@code-sentinel/core/package.json +6 -0
- package/node_modules/@code-sentinel/parsers/index.js +13 -0
- package/node_modules/@code-sentinel/parsers/package.json +6 -0
- package/package.json +34 -29
- package/src/migrations/0000_initial.sql +62 -0
- package/src/migrations/0001_add_confidence.sql +7 -0
- package/src/migrations/0002_add_ai_stats.sql +21 -0
- package/src/migrations/0003_add_fix_recipe.sql +29 -0
- package/src/migrations/0004_add_ast_graph.sql +61 -0
- package/src/migrations/0005_add_project_id.sql +1 -0
- package/src/migrations/0006_add_ai_model.sql +5 -0
- package/src/migrations/0006_add_rule_results.sql +1 -0
- package/src/migrations/0007_add_finding_metadata.sql +4 -0
- package/src/migrations/0008_add_coverage.sql +2 -0
- package/src/migrations/0009_run_provenance.sql +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -78,19 +78,31 @@ type DeviceAuthorizationPoll = {
|
|
|
78
78
|
} | {
|
|
79
79
|
readonly status: 'approved';
|
|
80
80
|
readonly accessToken: string;
|
|
81
|
+
readonly refreshToken: string;
|
|
81
82
|
readonly subject: string;
|
|
82
83
|
readonly expiresIn: number;
|
|
83
84
|
} | {
|
|
84
85
|
readonly status: 'expired';
|
|
85
86
|
};
|
|
87
|
+
type DeviceCredentialRefresh = {
|
|
88
|
+
readonly status: 'approved';
|
|
89
|
+
readonly accessToken: string;
|
|
90
|
+
readonly refreshToken: string;
|
|
91
|
+
readonly subject: string;
|
|
92
|
+
readonly expiresIn: number;
|
|
93
|
+
} | {
|
|
94
|
+
readonly status: 'invalid';
|
|
95
|
+
};
|
|
86
96
|
declare const startDeviceAuthorization: (serverUrl: string, fetchFn?: typeof fetch) => Promise<DeviceAuthorizationStart>;
|
|
87
97
|
declare const pollDeviceAuthorization: (serverUrl: string, deviceCode: string, fetchFn?: typeof fetch) => Promise<DeviceAuthorizationPoll>;
|
|
98
|
+
declare const refreshDeviceCredential: (serverUrl: string, refreshToken: string, fetchFn?: typeof fetch) => Promise<DeviceCredentialRefresh>;
|
|
88
99
|
declare const revokeDeviceCredential: (serverUrl: string, accessToken: string, fetchFn?: typeof fetch) => Promise<void>;
|
|
89
100
|
|
|
90
101
|
interface AuthCommandDependencies {
|
|
91
102
|
readonly store: ICredentialStore;
|
|
92
103
|
readonly start: typeof startDeviceAuthorization;
|
|
93
104
|
readonly poll: typeof pollDeviceAuthorization;
|
|
105
|
+
readonly refresh: typeof refreshDeviceCredential;
|
|
94
106
|
readonly revoke: typeof revokeDeviceCredential;
|
|
95
107
|
readonly openBrowser: (url: string) => Promise<void>;
|
|
96
108
|
readonly sleep: (milliseconds: number) => Promise<void>;
|
|
@@ -106,7 +118,7 @@ interface AuthLoginOptions {
|
|
|
106
118
|
declare const runAuthLogin: (options: AuthLoginOptions) => Promise<number>;
|
|
107
119
|
declare const runAuthStatus: (input: {
|
|
108
120
|
readonly server: string;
|
|
109
|
-
readonly dependencies?: Pick<AuthCommandDependencies, "store" | "now">;
|
|
121
|
+
readonly dependencies?: Pick<AuthCommandDependencies, "store" | "now" | "refresh">;
|
|
110
122
|
readonly write?: (line: string) => void;
|
|
111
123
|
}) => Promise<number>;
|
|
112
124
|
declare const runAuthLogout: (input: {
|
|
@@ -219,7 +231,7 @@ declare const runInit: (options?: InitOptions) => Promise<number>;
|
|
|
219
231
|
* validates the *final merged* config.
|
|
220
232
|
*/
|
|
221
233
|
|
|
222
|
-
declare const codeReviewConfigSchema: z.ZodObject<{
|
|
234
|
+
declare const codeReviewConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
223
235
|
mode: z.ZodDefault<z.ZodEnum<["auto", "economy", "balanced", "performance"]>>;
|
|
224
236
|
include: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
225
237
|
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -378,12 +390,28 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
378
390
|
* optional Bearer auth). Underlying impl is the Vercel AI SDK; see
|
|
379
391
|
* ADR-0011.
|
|
380
392
|
*/
|
|
381
|
-
provider: z.ZodDefault<z.ZodEnum<["ollama", "gemini", "groq", "viettel-netmind", "opencode-go", "
|
|
382
|
-
fallback: z.ZodDefault<z.ZodArray<z.ZodEnum<["ollama", "gemini", "groq", "viettel-netmind", "opencode-go", "
|
|
393
|
+
provider: z.ZodDefault<z.ZodEnum<["ollama", "gemini", "groq", "viettel-netmind", "opencode-go", "openai-compatible", "none"]>>;
|
|
394
|
+
fallback: z.ZodDefault<z.ZodArray<z.ZodEnum<["ollama", "gemini", "groq", "viettel-netmind", "opencode-go", "openai-compatible"]>, "many">>;
|
|
383
395
|
temperature: z.ZodDefault<z.ZodNumber>;
|
|
384
396
|
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
385
397
|
tokenBudgetWarn: z.ZodDefault<z.ZodNumber>;
|
|
386
398
|
clusterTokenBudget: z.ZodDefault<z.ZodNumber>;
|
|
399
|
+
adaptiveRetry: z.ZodDefault<z.ZodObject<{
|
|
400
|
+
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
401
|
+
contextReductionFactor: z.ZodDefault<z.ZodNumber>;
|
|
402
|
+
timeoutMultiplier: z.ZodDefault<z.ZodNumber>;
|
|
403
|
+
maxDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
404
|
+
}, "strip", z.ZodTypeAny, {
|
|
405
|
+
maxRetries: number;
|
|
406
|
+
contextReductionFactor: number;
|
|
407
|
+
timeoutMultiplier: number;
|
|
408
|
+
maxDelayMs: number;
|
|
409
|
+
}, {
|
|
410
|
+
maxRetries?: number | undefined;
|
|
411
|
+
contextReductionFactor?: number | undefined;
|
|
412
|
+
timeoutMultiplier?: number | undefined;
|
|
413
|
+
maxDelayMs?: number | undefined;
|
|
414
|
+
}>>;
|
|
387
415
|
/**
|
|
388
416
|
* AI-resilience re-run ([ADR-0029]). After the main pass, AI rules whose
|
|
389
417
|
* invocations were skipped for a RETRYABLE reason (provider down / parse
|
|
@@ -470,19 +498,6 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
470
498
|
baseUrl?: string | undefined;
|
|
471
499
|
apiKey?: string | undefined;
|
|
472
500
|
}>>;
|
|
473
|
-
freemodel: z.ZodDefault<z.ZodObject<{
|
|
474
|
-
baseUrl: z.ZodDefault<z.ZodString>;
|
|
475
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
476
|
-
model: z.ZodDefault<z.ZodString>;
|
|
477
|
-
}, "strip", z.ZodTypeAny, {
|
|
478
|
-
model: string;
|
|
479
|
-
baseUrl: string;
|
|
480
|
-
apiKey?: string | undefined;
|
|
481
|
-
}, {
|
|
482
|
-
model?: string | undefined;
|
|
483
|
-
baseUrl?: string | undefined;
|
|
484
|
-
apiKey?: string | undefined;
|
|
485
|
-
}>>;
|
|
486
501
|
/**
|
|
487
502
|
* Generic OpenAI-compatible escape hatch (LM Studio, vLLM, custom
|
|
488
503
|
* self-hosted gateways, OpenRouter, Together, Anyscale, ...).
|
|
@@ -519,17 +534,18 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
519
534
|
model: string;
|
|
520
535
|
apiKey?: string | undefined;
|
|
521
536
|
};
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
baseUrl: string;
|
|
525
|
-
apiKey?: string | undefined;
|
|
526
|
-
};
|
|
527
|
-
provider: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible" | "none";
|
|
528
|
-
fallback: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible")[];
|
|
537
|
+
provider: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible" | "none";
|
|
538
|
+
fallback: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible")[];
|
|
529
539
|
temperature: number;
|
|
530
540
|
timeoutMs: number;
|
|
531
541
|
tokenBudgetWarn: number;
|
|
532
542
|
clusterTokenBudget: number;
|
|
543
|
+
adaptiveRetry: {
|
|
544
|
+
maxRetries: number;
|
|
545
|
+
contextReductionFactor: number;
|
|
546
|
+
timeoutMultiplier: number;
|
|
547
|
+
maxDelayMs: number;
|
|
548
|
+
};
|
|
533
549
|
skipRerun: {
|
|
534
550
|
maxPasses: number;
|
|
535
551
|
delayMs: number;
|
|
@@ -564,17 +580,18 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
564
580
|
model?: string | undefined;
|
|
565
581
|
apiKey?: string | undefined;
|
|
566
582
|
} | undefined;
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
baseUrl?: string | undefined;
|
|
570
|
-
apiKey?: string | undefined;
|
|
571
|
-
} | undefined;
|
|
572
|
-
provider?: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible" | "none" | undefined;
|
|
573
|
-
fallback?: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible")[] | undefined;
|
|
583
|
+
provider?: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible" | "none" | undefined;
|
|
584
|
+
fallback?: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible")[] | undefined;
|
|
574
585
|
temperature?: number | undefined;
|
|
575
586
|
timeoutMs?: number | undefined;
|
|
576
587
|
tokenBudgetWarn?: number | undefined;
|
|
577
588
|
clusterTokenBudget?: number | undefined;
|
|
589
|
+
adaptiveRetry?: {
|
|
590
|
+
maxRetries?: number | undefined;
|
|
591
|
+
contextReductionFactor?: number | undefined;
|
|
592
|
+
timeoutMultiplier?: number | undefined;
|
|
593
|
+
maxDelayMs?: number | undefined;
|
|
594
|
+
} | undefined;
|
|
578
595
|
skipRerun?: {
|
|
579
596
|
maxPasses?: number | undefined;
|
|
580
597
|
delayMs?: number | undefined;
|
|
@@ -982,7 +999,7 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
982
999
|
* `${ENV_VAR}` interpolation for the token so secrets stay out of the file.
|
|
983
1000
|
*/
|
|
984
1001
|
dashboard: z.ZodDefault<z.ZodObject<{
|
|
985
|
-
/** Base URL of the @code-sentinel/server instance, e.g. `https://
|
|
1002
|
+
/** Base URL of the @code-sentinel/server instance, e.g. `https://example.invalid/code-sentinel-dashboard`. */
|
|
986
1003
|
serverUrl: z.ZodOptional<z.ZodString>;
|
|
987
1004
|
/** Project-scoped bearer token for `POST /api/runs`. */
|
|
988
1005
|
token: z.ZodOptional<z.ZodString>;
|
|
@@ -1036,17 +1053,18 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
1036
1053
|
model: string;
|
|
1037
1054
|
apiKey?: string | undefined;
|
|
1038
1055
|
};
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
baseUrl: string;
|
|
1042
|
-
apiKey?: string | undefined;
|
|
1043
|
-
};
|
|
1044
|
-
provider: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible" | "none";
|
|
1045
|
-
fallback: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible")[];
|
|
1056
|
+
provider: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible" | "none";
|
|
1057
|
+
fallback: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible")[];
|
|
1046
1058
|
temperature: number;
|
|
1047
1059
|
timeoutMs: number;
|
|
1048
1060
|
tokenBudgetWarn: number;
|
|
1049
1061
|
clusterTokenBudget: number;
|
|
1062
|
+
adaptiveRetry: {
|
|
1063
|
+
maxRetries: number;
|
|
1064
|
+
contextReductionFactor: number;
|
|
1065
|
+
timeoutMultiplier: number;
|
|
1066
|
+
maxDelayMs: number;
|
|
1067
|
+
};
|
|
1050
1068
|
skipRerun: {
|
|
1051
1069
|
maxPasses: number;
|
|
1052
1070
|
delayMs: number;
|
|
@@ -1191,17 +1209,18 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
1191
1209
|
model?: string | undefined;
|
|
1192
1210
|
apiKey?: string | undefined;
|
|
1193
1211
|
} | undefined;
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
baseUrl?: string | undefined;
|
|
1197
|
-
apiKey?: string | undefined;
|
|
1198
|
-
} | undefined;
|
|
1199
|
-
provider?: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible" | "none" | undefined;
|
|
1200
|
-
fallback?: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "freemodel" | "openai-compatible")[] | undefined;
|
|
1212
|
+
provider?: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible" | "none" | undefined;
|
|
1213
|
+
fallback?: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible")[] | undefined;
|
|
1201
1214
|
temperature?: number | undefined;
|
|
1202
1215
|
timeoutMs?: number | undefined;
|
|
1203
1216
|
tokenBudgetWarn?: number | undefined;
|
|
1204
1217
|
clusterTokenBudget?: number | undefined;
|
|
1218
|
+
adaptiveRetry?: {
|
|
1219
|
+
maxRetries?: number | undefined;
|
|
1220
|
+
contextReductionFactor?: number | undefined;
|
|
1221
|
+
timeoutMultiplier?: number | undefined;
|
|
1222
|
+
maxDelayMs?: number | undefined;
|
|
1223
|
+
} | undefined;
|
|
1205
1224
|
skipRerun?: {
|
|
1206
1225
|
maxPasses?: number | undefined;
|
|
1207
1226
|
delayMs?: number | undefined;
|
|
@@ -1307,7 +1326,163 @@ declare const codeReviewConfigSchema: z.ZodObject<{
|
|
|
1307
1326
|
projectId?: string | undefined;
|
|
1308
1327
|
token?: string | undefined;
|
|
1309
1328
|
} | undefined;
|
|
1310
|
-
}
|
|
1329
|
+
}>, {
|
|
1330
|
+
mode: "economy" | "balanced" | "performance" | "auto";
|
|
1331
|
+
include: string[];
|
|
1332
|
+
exclude: string[];
|
|
1333
|
+
rules: {
|
|
1334
|
+
enabled: string[];
|
|
1335
|
+
disabled: string[];
|
|
1336
|
+
packs: string[];
|
|
1337
|
+
projectCustomExecution: ("local" | "ci")[];
|
|
1338
|
+
overrides: Record<string, {
|
|
1339
|
+
options?: Record<string, unknown> | undefined;
|
|
1340
|
+
severity?: "error" | "info" | "warning" | "blocker" | undefined;
|
|
1341
|
+
confidence?: number | undefined;
|
|
1342
|
+
enabled?: boolean | undefined;
|
|
1343
|
+
}>;
|
|
1344
|
+
pathOverrides: {
|
|
1345
|
+
paths: string[];
|
|
1346
|
+
disabled?: string[] | undefined;
|
|
1347
|
+
overrides?: Record<string, {
|
|
1348
|
+
severity?: "error" | "info" | "warning" | "blocker" | undefined;
|
|
1349
|
+
confidence?: number | undefined;
|
|
1350
|
+
enabled?: boolean | undefined;
|
|
1351
|
+
}> | undefined;
|
|
1352
|
+
}[];
|
|
1353
|
+
};
|
|
1354
|
+
ai: {
|
|
1355
|
+
ollama: {
|
|
1356
|
+
model: string;
|
|
1357
|
+
temperature: number;
|
|
1358
|
+
baseUrl: string;
|
|
1359
|
+
};
|
|
1360
|
+
gemini: {
|
|
1361
|
+
model: string;
|
|
1362
|
+
apiKey?: string | undefined;
|
|
1363
|
+
};
|
|
1364
|
+
groq: {
|
|
1365
|
+
model: string;
|
|
1366
|
+
apiKey?: string | undefined;
|
|
1367
|
+
};
|
|
1368
|
+
provider: "ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible" | "none";
|
|
1369
|
+
fallback: ("ollama" | "gemini" | "groq" | "viettel-netmind" | "opencode-go" | "openai-compatible")[];
|
|
1370
|
+
temperature: number;
|
|
1371
|
+
timeoutMs: number;
|
|
1372
|
+
tokenBudgetWarn: number;
|
|
1373
|
+
clusterTokenBudget: number;
|
|
1374
|
+
adaptiveRetry: {
|
|
1375
|
+
maxRetries: number;
|
|
1376
|
+
contextReductionFactor: number;
|
|
1377
|
+
timeoutMultiplier: number;
|
|
1378
|
+
maxDelayMs: number;
|
|
1379
|
+
};
|
|
1380
|
+
skipRerun: {
|
|
1381
|
+
maxPasses: number;
|
|
1382
|
+
delayMs: number;
|
|
1383
|
+
};
|
|
1384
|
+
viettelNetmind: {
|
|
1385
|
+
model: string;
|
|
1386
|
+
baseUrl: string;
|
|
1387
|
+
apiKey?: string | undefined;
|
|
1388
|
+
};
|
|
1389
|
+
opencodeGo: {
|
|
1390
|
+
model: string;
|
|
1391
|
+
baseUrl: string;
|
|
1392
|
+
apiKey?: string | undefined;
|
|
1393
|
+
};
|
|
1394
|
+
openaiCompatible: {
|
|
1395
|
+
name: string;
|
|
1396
|
+
model?: string | undefined;
|
|
1397
|
+
baseUrl?: string | undefined;
|
|
1398
|
+
apiKey?: string | undefined;
|
|
1399
|
+
};
|
|
1400
|
+
};
|
|
1401
|
+
report: {
|
|
1402
|
+
format: "markdown" | "markdown-compact" | "json" | "sarif";
|
|
1403
|
+
output: string;
|
|
1404
|
+
groupBy: "file" | "severity" | "category" | "rule";
|
|
1405
|
+
includeSnippets: boolean;
|
|
1406
|
+
};
|
|
1407
|
+
review: {
|
|
1408
|
+
minSeverity: "error" | "info" | "warning" | "blocker";
|
|
1409
|
+
baseline: "ignore" | "apply";
|
|
1410
|
+
extraInstructions: string;
|
|
1411
|
+
profile: {
|
|
1412
|
+
name: "fast" | "deep";
|
|
1413
|
+
ai: "disabled" | "advisory" | "blocking";
|
|
1414
|
+
maxBudgetMs?: number | undefined;
|
|
1415
|
+
};
|
|
1416
|
+
gate: {
|
|
1417
|
+
aiPolicy: "advisory" | "blocking" | "high-confidence";
|
|
1418
|
+
aiMinConfidence: number;
|
|
1419
|
+
aiSkipPolicy: "ignore" | "warn" | "fail";
|
|
1420
|
+
};
|
|
1421
|
+
};
|
|
1422
|
+
prReview: {
|
|
1423
|
+
minSeverity: "error" | "info" | "warning" | "blocker";
|
|
1424
|
+
maxInlineComments: number;
|
|
1425
|
+
minConfidence: number;
|
|
1426
|
+
applyBaseline: boolean;
|
|
1427
|
+
aiStrategy: "adaptive" | "diff-only" | "grouped" | "specialized" | "targeted";
|
|
1428
|
+
diffReview: {
|
|
1429
|
+
enabled: boolean;
|
|
1430
|
+
maxChunkCalls: number;
|
|
1431
|
+
};
|
|
1432
|
+
primarySelection: {
|
|
1433
|
+
enabled: boolean;
|
|
1434
|
+
maxPrimaryFiles: number;
|
|
1435
|
+
minRiskScore: number;
|
|
1436
|
+
includeLayers: ("unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry")[];
|
|
1437
|
+
excludePatterns: string[];
|
|
1438
|
+
};
|
|
1439
|
+
groupedRules: {
|
|
1440
|
+
enabled: boolean;
|
|
1441
|
+
maxGroupsPerFile: number;
|
|
1442
|
+
maxRulesPerGroup: number;
|
|
1443
|
+
};
|
|
1444
|
+
specializedRules: {
|
|
1445
|
+
enabled: boolean;
|
|
1446
|
+
maxCalls: number;
|
|
1447
|
+
};
|
|
1448
|
+
riskScoring: {
|
|
1449
|
+
layer: Partial<Record<"unknown" | "service" | "pipe" | "controller" | "repository" | "dto" | "entity" | "mapper" | "component" | "ng-service" | "module" | "directive" | "model" | "test" | "config" | "generated" | "entry", number>>;
|
|
1450
|
+
signals: {
|
|
1451
|
+
hasTransactional: number;
|
|
1452
|
+
hasDbWrite: number;
|
|
1453
|
+
hasLoopWithDbCall: number;
|
|
1454
|
+
hasUserIdOrTenantId: number;
|
|
1455
|
+
hasPermissionCheck: number;
|
|
1456
|
+
hasExternalIO: number;
|
|
1457
|
+
hasExceptionHandlingChange: number;
|
|
1458
|
+
hasMoneyOrStatusLogic: number;
|
|
1459
|
+
hasDiffReviewFinding: number;
|
|
1460
|
+
};
|
|
1461
|
+
};
|
|
1462
|
+
aiRules: boolean;
|
|
1463
|
+
aiDiffReview: boolean;
|
|
1464
|
+
maxSupportFiles: number;
|
|
1465
|
+
diffChunkTokenBudget: number;
|
|
1466
|
+
maxAiCalls: number;
|
|
1467
|
+
codeQualityOutput: string;
|
|
1468
|
+
gitlabTokenEnv: string;
|
|
1469
|
+
cleanupExistingComments: boolean;
|
|
1470
|
+
excludes: {
|
|
1471
|
+
generated: boolean;
|
|
1472
|
+
lockfiles: boolean;
|
|
1473
|
+
minified: boolean;
|
|
1474
|
+
};
|
|
1475
|
+
};
|
|
1476
|
+
storage: {
|
|
1477
|
+
dbPath: string;
|
|
1478
|
+
retainRuns: number;
|
|
1479
|
+
};
|
|
1480
|
+
dashboard: {
|
|
1481
|
+
serverUrl?: string | undefined;
|
|
1482
|
+
projectId?: string | undefined;
|
|
1483
|
+
token?: string | undefined;
|
|
1484
|
+
};
|
|
1485
|
+
}, unknown>;
|
|
1311
1486
|
type CodeReviewConfig = z.infer<typeof codeReviewConfigSchema>;
|
|
1312
1487
|
|
|
1313
1488
|
interface LocalEffectiveConfig {
|
|
@@ -1523,7 +1698,7 @@ declare const runQuickstart: (options?: LocalReadinessOptions) => Promise<number
|
|
|
1523
1698
|
*/
|
|
1524
1699
|
type Mode = 'economy' | 'balanced' | 'performance';
|
|
1525
1700
|
|
|
1526
|
-
type ApiKeyAiProvider = 'gemini' | 'groq' | 'viettel-netmind' | 'opencode-go'
|
|
1701
|
+
type ApiKeyAiProvider = 'gemini' | 'groq' | 'viettel-netmind' | 'opencode-go';
|
|
1527
1702
|
interface MissingAiCredential {
|
|
1528
1703
|
readonly provider: ApiKeyAiProvider;
|
|
1529
1704
|
readonly displayName: string;
|
|
@@ -2112,6 +2287,8 @@ declare const loadConfig: (options?: LoadConfigOptions) => Promise<Result<Loaded
|
|
|
2112
2287
|
declare const createRemoteConfigClient: (input: {
|
|
2113
2288
|
readonly serverUrl: string;
|
|
2114
2289
|
readonly token?: string;
|
|
2290
|
+
readonly getToken?: () => string | undefined;
|
|
2291
|
+
readonly onUnauthorized?: () => Promise<boolean>;
|
|
2115
2292
|
}) => CliApiClient;
|
|
2116
2293
|
|
|
2117
2294
|
/**
|