@kyo-so/cli 0.4.1 → 0.6.0
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/CHANGELOG.md +58 -0
- package/README.ja.md +55 -18
- package/README.md +59 -19
- package/README.zh-CN.md +55 -18
- package/dist/acp/FakeAgentManager.d.ts +13 -1
- package/dist/acp/prompts.d.ts +2 -1
- package/dist/aggregate/aggregateFindings.d.ts +5 -2
- package/dist/bin/kyoso.js +2112 -213
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/config/loadConfig.d.ts +8 -0
- package/dist/config/projectScope.d.ts +15 -0
- package/dist/config/schema.d.ts +9 -0
- package/dist/config/tomlConfigLoader.d.ts +1 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/types.d.ts +21 -1
- package/dist/core/verification.d.ts +24 -0
- package/dist/index.js +1996 -130
- package/dist/judge/prompt.d.ts +7 -2
- package/dist/judge/provider.d.ts +7 -1
- package/examples/claude-only.toml +2 -0
- package/examples/codex-only.toml +2 -0
- package/examples/kyoso.toml +11 -0
- package/package.json +2 -1
- package/examples/claude-only.config.ts +0 -9
- package/examples/codex-only.config.ts +0 -9
- package/examples/kyoso.config.ts +0 -22
package/dist/cli/doctor.d.ts
CHANGED
|
@@ -5,18 +5,26 @@ export type LoadConfigOptions = {
|
|
|
5
5
|
configPath?: string;
|
|
6
6
|
ignoreConfig?: boolean;
|
|
7
7
|
trustConfig?: boolean;
|
|
8
|
+
allowUnknownConfig?: boolean;
|
|
8
9
|
promptForTrust?: boolean;
|
|
9
10
|
trustStorePath?: string;
|
|
11
|
+
env?: NodeJS.ProcessEnv;
|
|
10
12
|
trustPrompt?: (config: {
|
|
11
13
|
configPath: string;
|
|
12
14
|
configHash: string;
|
|
13
15
|
}) => Promise<boolean>;
|
|
14
16
|
};
|
|
17
|
+
export type LoadedConfigSource = {
|
|
18
|
+
path: string;
|
|
19
|
+
layer: "global_toml" | "project_toml" | "project_ts";
|
|
20
|
+
};
|
|
15
21
|
export type LoadedConfig = {
|
|
16
22
|
config: KyosoConfig;
|
|
17
23
|
configPath?: string;
|
|
18
24
|
configHash?: string;
|
|
19
25
|
configTrustStatus: ConfigTrustStatus;
|
|
26
|
+
sources: LoadedConfigSource[];
|
|
20
27
|
warnings: string[];
|
|
21
28
|
};
|
|
22
29
|
export declare function loadConfig(options?: LoadConfigOptions): Promise<LoadedConfig>;
|
|
30
|
+
export declare function resolveGlobalTomlConfigPath(env?: NodeJS.ProcessEnv): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type ProjectScopeOptions = {
|
|
2
|
+
projectPath: string;
|
|
3
|
+
globalConfigPath: string;
|
|
4
|
+
};
|
|
5
|
+
type Violation = {
|
|
6
|
+
path: string;
|
|
7
|
+
reason?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function mergeProjectTomlConfig(baseConfig: unknown, projectConfig: unknown, options: ProjectScopeOptions): unknown;
|
|
10
|
+
export declare function collectProjectScopeViolations(config: unknown): Violation[];
|
|
11
|
+
export declare function flattenLeaves(value: unknown, path?: string[]): Array<{
|
|
12
|
+
path: string[];
|
|
13
|
+
value: unknown;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -106,6 +106,12 @@ export declare const kyosoConfigSchema: z.ZodObject<{
|
|
|
106
106
|
}>;
|
|
107
107
|
timeoutMs: z.ZodNumber;
|
|
108
108
|
}, z.core.$strip>;
|
|
109
|
+
verification: z.ZodObject<{
|
|
110
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
111
|
+
maxFindings: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
113
|
+
allowDemotion: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
+
}, z.core.$strip>;
|
|
109
115
|
audit: z.ZodObject<{
|
|
110
116
|
enabled: z.ZodBoolean;
|
|
111
117
|
format: z.ZodLiteral<"jsonl">;
|
|
@@ -114,6 +120,9 @@ export declare const kyosoConfigSchema: z.ZodObject<{
|
|
|
114
120
|
includeFileContents: z.ZodBoolean;
|
|
115
121
|
}, z.core.$strip>;
|
|
116
122
|
}, z.core.$strip>;
|
|
123
|
+
export declare const kyosoConfigKnownLeafPaths: string[];
|
|
124
|
+
export declare const kyosoConfigRecordPrefixes: string[];
|
|
125
|
+
export declare const kyosoConfigSecuritySensitivePrefixes: string[];
|
|
117
126
|
export type KyosoConfig = z.infer<typeof kyosoConfigSchema>;
|
|
118
127
|
export type KyosoConfigInput = PartialDeep<KyosoConfig>;
|
|
119
128
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadTomlConfigFile(configPath: string): Promise<unknown>;
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export declare const DEFAULT_MAX_DIFF_BYTES = 300000;
|
|
|
4
4
|
export declare const RAW_OUTPUT_MAX_CHARS = 16384;
|
|
5
5
|
export declare const TRACE_DIR = ".kyoso/traces";
|
|
6
6
|
export declare const KYOSO_CHILD_AGENT = "KYOSO_CHILD_AGENT";
|
|
7
|
-
export declare const KYOSO_VERSION = "0.
|
|
7
|
+
export declare const KYOSO_VERSION = "0.6.0";
|
package/dist/core/types.d.ts
CHANGED
|
@@ -48,8 +48,14 @@ export type KyosoFinding = {
|
|
|
48
48
|
lineEnd?: number;
|
|
49
49
|
}>;
|
|
50
50
|
sourceAgents: Array<AgentName | "judge" | "kyoso_policy">;
|
|
51
|
+
crossValidation?: "corroborated" | "single_source";
|
|
51
52
|
confidence: "high" | "medium" | "low";
|
|
52
53
|
cisaMapping?: CisaDimension[];
|
|
54
|
+
verification?: {
|
|
55
|
+
status: "confirmed" | "refuted" | "uncertain" | "not_verified";
|
|
56
|
+
verifier?: AgentName;
|
|
57
|
+
note?: string;
|
|
58
|
+
};
|
|
53
59
|
};
|
|
54
60
|
export type CisaSecureByDesignResult = {
|
|
55
61
|
customerSecurityOutcomes: GateStatus;
|
|
@@ -59,7 +65,7 @@ export type CisaSecureByDesignResult = {
|
|
|
59
65
|
notes: string[];
|
|
60
66
|
};
|
|
61
67
|
export type AgentName = "codex" | "claude";
|
|
62
|
-
export type AgentRole = "implementation_reviewer" | "architecture_security_reviewer" | "combined_reviewer";
|
|
68
|
+
export type AgentRole = "implementation_reviewer" | "architecture_security_reviewer" | "combined_reviewer" | "finding_verifier";
|
|
63
69
|
export type ReviewMode = "multi_agent" | "single_agent";
|
|
64
70
|
export type NormalizedAgentOpinion = {
|
|
65
71
|
agent: AgentName;
|
|
@@ -84,6 +90,18 @@ export type NormalizedAgentOpinion = {
|
|
|
84
90
|
openQuestions: string[];
|
|
85
91
|
cisaSecureByDesign?: Partial<CisaSecureByDesignResult>;
|
|
86
92
|
};
|
|
93
|
+
export type CrossModelAnalysis = {
|
|
94
|
+
blindSpots: string[];
|
|
95
|
+
contradictions: Array<{
|
|
96
|
+
topic: string;
|
|
97
|
+
detail: string;
|
|
98
|
+
}>;
|
|
99
|
+
partialCoverage: Array<{
|
|
100
|
+
findingId?: string;
|
|
101
|
+
note: string;
|
|
102
|
+
}>;
|
|
103
|
+
provider: string;
|
|
104
|
+
};
|
|
87
105
|
export type AgentRunInput = {
|
|
88
106
|
traceId: string;
|
|
89
107
|
agent: AgentName;
|
|
@@ -113,6 +131,7 @@ export type KyosoResult = {
|
|
|
113
131
|
degraded: boolean;
|
|
114
132
|
agentsUsed: AgentName[];
|
|
115
133
|
reviewMode: ReviewMode;
|
|
134
|
+
verificationMode?: "cross_agent" | "skipped_single_agent";
|
|
116
135
|
summaryMarkdown: string;
|
|
117
136
|
findings: KyosoFinding[];
|
|
118
137
|
cisaSecureByDesign?: CisaSecureByDesignResult;
|
|
@@ -124,6 +143,7 @@ export type KyosoResult = {
|
|
|
124
143
|
}>;
|
|
125
144
|
judgeComment: string;
|
|
126
145
|
}>;
|
|
146
|
+
crossModelAnalysis?: CrossModelAnalysis;
|
|
127
147
|
testsToAdd: string[];
|
|
128
148
|
residualRisks: string[];
|
|
129
149
|
agentOpinions: Array<{
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AgentName, KyosoFinding } from "./types.js";
|
|
2
|
+
export type VerificationVerdict = {
|
|
3
|
+
findingId: string;
|
|
4
|
+
verdict: "confirmed" | "refuted" | "uncertain";
|
|
5
|
+
reasoning: string;
|
|
6
|
+
evidence: string;
|
|
7
|
+
};
|
|
8
|
+
export type VerificationTarget = {
|
|
9
|
+
finding: KyosoFinding;
|
|
10
|
+
verifier: AgentName;
|
|
11
|
+
};
|
|
12
|
+
export type VerificationSelection = {
|
|
13
|
+
selected: VerificationTarget[];
|
|
14
|
+
overflow: VerificationTarget[];
|
|
15
|
+
};
|
|
16
|
+
export declare function selectVerificationTargets(findings: KyosoFinding[], maxFindings: number): VerificationSelection;
|
|
17
|
+
export declare function groupVerificationTargetsByVerifier(targets: VerificationTarget[]): Array<{
|
|
18
|
+
verifier: AgentName;
|
|
19
|
+
findings: KyosoFinding[];
|
|
20
|
+
}>;
|
|
21
|
+
export declare function markVerificationOverflow(targets: VerificationTarget[]): void;
|
|
22
|
+
export declare function parseVerificationVerdicts(rawText: string | undefined): VerificationVerdict[] | undefined;
|
|
23
|
+
export declare function applyVerificationVerdicts(targets: VerificationTarget[], verifier: AgentName, verdicts: VerificationVerdict[] | undefined): Record<"confirmed" | "refuted" | "uncertain", number>;
|
|
24
|
+
export declare function countVerificationStatuses(findings: KyosoFinding[]): Record<"confirmed" | "refuted" | "uncertain" | "not_verified", number>;
|