@kyo-so/cli 0.10.0 → 0.12.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/.agents/skills/kyoso-review/SKILL.md +22 -4
- package/CHANGELOG.md +54 -0
- package/README.ja.md +69 -15
- package/README.md +69 -15
- package/README.zh-CN.md +69 -15
- package/dist/acp/FakeAgentManager.d.ts +1 -1
- package/dist/acp/prompts.d.ts +8 -3
- package/dist/aggregate/aggregateFindings.d.ts +1 -0
- package/dist/bin/kyoso.js +2286 -208
- package/dist/cli/knownSkillDigests.d.ts +8 -1
- package/dist/cli/pluginRuntimeContract.d.ts +10 -8
- package/dist/config/schema.d.ts +30 -4
- package/dist/core/constants.d.ts +3 -1
- package/dist/core/findingAdmission.d.ts +10 -0
- package/dist/core/requestFingerprint.d.ts +12 -0
- package/dist/core/reviewBudget.d.ts +68 -0
- package/dist/core/reviewPolicy.d.ts +16 -0
- package/dist/core/runReview.d.ts +1 -0
- package/dist/core/tokenUsage.d.ts +2 -0
- package/dist/core/types.d.ts +115 -0
- package/dist/core/verification.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2186 -165
- package/dist/judge/anthropic.d.ts +2 -2
- package/dist/judge/openai.d.ts +2 -2
- package/dist/judge/provider.d.ts +7 -1
- package/dist/mcp/schemas.d.ts +30 -0
- package/dist/security/cisaGate.d.ts +11 -1
- package/package.json +1 -1
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
export declare const CURRENT_SKILL_DIGEST = "sha256:
|
|
1
|
+
export declare const CURRENT_SKILL_DIGEST = "sha256:8654e68ea61f2acea29027056802bf627ad737f084c9a86ab052946943538409";
|
|
2
2
|
export declare const KNOWN_SKILL_DIGESTS_BY_VERSION: {
|
|
3
|
+
readonly "0.11.0": readonly [{
|
|
4
|
+
readonly digest: "sha256:110dd872a3d1c8a71474a0eadb226f51a6addd86f9d4f3ed17b73678b3179a4e";
|
|
5
|
+
readonly kind: "historical";
|
|
6
|
+
}, {
|
|
7
|
+
readonly digest: "sha256:570f83f716734f34db00147f1b98bc8cd4e9c0016d3946b352ecef4a5d6b8734";
|
|
8
|
+
readonly kind: "historical";
|
|
9
|
+
}];
|
|
3
10
|
readonly "0.8.0": readonly [{
|
|
4
11
|
readonly digest: "sha256:b16ea3f8141a01399b96dee650365d99df2b8c5fc99184d9cb22d5d72c106fd8";
|
|
5
12
|
readonly kind: "historical";
|
|
@@ -10,9 +10,9 @@ export declare const PLUGIN_RUNTIME_COMPATIBILITY_SCHEMA_VERSION = 1;
|
|
|
10
10
|
export declare const MINIMUM_SUPPORTED_CODEX_VERSION = "0.144.0-alpha.4";
|
|
11
11
|
export declare const PLUGIN_RUNTIME_EXPECTED_CONTRACT: {
|
|
12
12
|
readonly distribution: {
|
|
13
|
-
readonly pluginVersion: "0.
|
|
13
|
+
readonly pluginVersion: "0.5.0";
|
|
14
14
|
readonly mcpCommand: "npx";
|
|
15
|
-
readonly mcpPackagePin: "@kyo-so/cli@0.
|
|
15
|
+
readonly mcpPackagePin: "@kyo-so/cli@0.11.0";
|
|
16
16
|
};
|
|
17
17
|
readonly marketplace: {
|
|
18
18
|
readonly name: "kyoso";
|
|
@@ -47,7 +47,7 @@ export declare const PLUGIN_RUNTIME_EXPECTED_CONTRACT: {
|
|
|
47
47
|
readonly enabled: true;
|
|
48
48
|
readonly command: "$NODE";
|
|
49
49
|
readonly args: readonly ["$PROBE_SERVER", "$OBSERVATION"];
|
|
50
|
-
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
50
|
+
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
51
51
|
readonly cwd: null;
|
|
52
52
|
readonly startupTimeoutSec: 20;
|
|
53
53
|
readonly toolTimeoutSec: 360;
|
|
@@ -56,7 +56,7 @@ export declare const PLUGIN_RUNTIME_EXPECTED_CONTRACT: {
|
|
|
56
56
|
readonly enabled: false;
|
|
57
57
|
readonly command: "$NODE";
|
|
58
58
|
readonly args: readonly ["$PROBE_SERVER", "$OBSERVATION"];
|
|
59
|
-
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
59
|
+
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
60
60
|
readonly cwd: null;
|
|
61
61
|
readonly startupTimeoutSec: 20;
|
|
62
62
|
readonly toolTimeoutSec: 360;
|
|
@@ -100,6 +100,7 @@ export declare const PLUGIN_RUNTIME_EXPECTED_CONTRACT: {
|
|
|
100
100
|
readonly OPENAI_API_KEY: true;
|
|
101
101
|
readonly CODEX_API_KEY: true;
|
|
102
102
|
readonly CODEX_ACCESS_TOKEN: true;
|
|
103
|
+
readonly OPENROUTER_API_KEY: true;
|
|
103
104
|
readonly ANTHROPIC_API_KEY: true;
|
|
104
105
|
readonly CLAUDE_CODE_OAUTH_TOKEN: true;
|
|
105
106
|
};
|
|
@@ -129,9 +130,9 @@ export declare const pluginRuntimeContract: {
|
|
|
129
130
|
readonly pluginListTopLevelKeys: readonly ["installed", "available"];
|
|
130
131
|
readonly expectedContract: {
|
|
131
132
|
readonly distribution: {
|
|
132
|
-
readonly pluginVersion: "0.
|
|
133
|
+
readonly pluginVersion: "0.5.0";
|
|
133
134
|
readonly mcpCommand: "npx";
|
|
134
|
-
readonly mcpPackagePin: "@kyo-so/cli@0.
|
|
135
|
+
readonly mcpPackagePin: "@kyo-so/cli@0.11.0";
|
|
135
136
|
};
|
|
136
137
|
readonly marketplace: {
|
|
137
138
|
readonly name: "kyoso";
|
|
@@ -166,7 +167,7 @@ export declare const pluginRuntimeContract: {
|
|
|
166
167
|
readonly enabled: true;
|
|
167
168
|
readonly command: "$NODE";
|
|
168
169
|
readonly args: readonly ["$PROBE_SERVER", "$OBSERVATION"];
|
|
169
|
-
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
170
|
+
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
170
171
|
readonly cwd: null;
|
|
171
172
|
readonly startupTimeoutSec: 20;
|
|
172
173
|
readonly toolTimeoutSec: 360;
|
|
@@ -175,7 +176,7 @@ export declare const pluginRuntimeContract: {
|
|
|
175
176
|
readonly enabled: false;
|
|
176
177
|
readonly command: "$NODE";
|
|
177
178
|
readonly args: readonly ["$PROBE_SERVER", "$OBSERVATION"];
|
|
178
|
-
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
179
|
+
readonly envVars: readonly ["OPENAI_API_KEY", "CODEX_API_KEY", "CODEX_HOME", "CODEX_ACCESS_TOKEN", "OPENROUTER_API_KEY", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
179
180
|
readonly cwd: null;
|
|
180
181
|
readonly startupTimeoutSec: 20;
|
|
181
182
|
readonly toolTimeoutSec: 360;
|
|
@@ -219,6 +220,7 @@ export declare const pluginRuntimeContract: {
|
|
|
219
220
|
readonly OPENAI_API_KEY: true;
|
|
220
221
|
readonly CODEX_API_KEY: true;
|
|
221
222
|
readonly CODEX_ACCESS_TOKEN: true;
|
|
223
|
+
readonly OPENROUTER_API_KEY: true;
|
|
222
224
|
readonly ANTHROPIC_API_KEY: true;
|
|
223
225
|
readonly CLAUDE_CODE_OAUTH_TOKEN: true;
|
|
224
226
|
};
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -11,12 +11,31 @@ export declare const kyosoConfigSchema: z.ZodObject<{
|
|
|
11
11
|
mcp: z.ZodBoolean;
|
|
12
12
|
cli: z.ZodBoolean;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
|
-
firstClassClient: z.
|
|
14
|
+
firstClassClient: z.ZodLiteral<"codex">;
|
|
15
15
|
tools: z.ZodObject<{
|
|
16
16
|
planReview: z.ZodBoolean;
|
|
17
17
|
securityReview: z.ZodBoolean;
|
|
18
18
|
diffReview: z.ZodBoolean;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
|
+
reviewPolicy: z.ZodObject<{
|
|
21
|
+
additionalLenses: z.ZodArray<z.ZodEnum<{
|
|
22
|
+
correctness: "correctness";
|
|
23
|
+
regression: "regression";
|
|
24
|
+
security_boundaries: "security_boundaries";
|
|
25
|
+
secrets_and_injection: "secrets_and_injection";
|
|
26
|
+
data_integrity: "data_integrity";
|
|
27
|
+
public_contract: "public_contract";
|
|
28
|
+
supply_chain: "supply_chain";
|
|
29
|
+
privacy: "privacy";
|
|
30
|
+
resource_amplification: "resource_amplification";
|
|
31
|
+
architecture: "architecture";
|
|
32
|
+
performance: "performance";
|
|
33
|
+
tests: "tests";
|
|
34
|
+
documentation: "documentation";
|
|
35
|
+
maintainability: "maintainability";
|
|
36
|
+
}>>;
|
|
37
|
+
multiAgentRequired: z.ZodBoolean;
|
|
38
|
+
}, z.core.$strip>;
|
|
20
39
|
agents: z.ZodObject<{
|
|
21
40
|
codex: z.ZodObject<{
|
|
22
41
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -71,7 +90,7 @@ export declare const kyosoConfigSchema: z.ZodObject<{
|
|
|
71
90
|
workspace: z.ZodObject<{
|
|
72
91
|
mode: z.ZodLiteral<"temp_snapshot">;
|
|
73
92
|
root: z.ZodString;
|
|
74
|
-
readOnly: z.
|
|
93
|
+
readOnly: z.ZodLiteral<true>;
|
|
75
94
|
maxContextBytes: z.ZodNumber;
|
|
76
95
|
maxDiffBytes: z.ZodNumber;
|
|
77
96
|
deny: z.ZodArray<z.ZodString>;
|
|
@@ -89,7 +108,7 @@ export declare const kyosoConfigSchema: z.ZodObject<{
|
|
|
89
108
|
allowUnrestricted: z.ZodBoolean;
|
|
90
109
|
warnOnUnrestricted: z.ZodBoolean;
|
|
91
110
|
mediatedWeb: z.ZodObject<{
|
|
92
|
-
enabled: z.
|
|
111
|
+
enabled: z.ZodLiteral<false>;
|
|
93
112
|
}, z.core.$strip>;
|
|
94
113
|
}, z.core.$strip>;
|
|
95
114
|
securityReview: z.ZodObject<{
|
|
@@ -123,12 +142,19 @@ export declare const kyosoConfigSchema: z.ZodObject<{
|
|
|
123
142
|
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
124
143
|
allowDemotion: z.ZodDefault<z.ZodBoolean>;
|
|
125
144
|
}, z.core.$strip>;
|
|
145
|
+
reviewBudget: z.ZodObject<{
|
|
146
|
+
maxModelCalls: z.ZodNumber;
|
|
147
|
+
maxTotalWallTimeMs: z.ZodNumber;
|
|
148
|
+
maxAgentOutputBytes: z.ZodNumber;
|
|
149
|
+
maxFindingsPerAgent: z.ZodNumber;
|
|
150
|
+
skipOptionalPhasesWhenTokenUsageUnknown: z.ZodBoolean;
|
|
151
|
+
}, z.core.$strip>;
|
|
126
152
|
audit: z.ZodObject<{
|
|
127
153
|
enabled: z.ZodBoolean;
|
|
128
154
|
format: z.ZodLiteral<"jsonl">;
|
|
129
155
|
directory: z.ZodString;
|
|
130
156
|
includeRawAgentOutput: z.ZodBoolean;
|
|
131
|
-
includeFileContents: z.
|
|
157
|
+
includeFileContents: z.ZodLiteral<false>;
|
|
132
158
|
}, z.core.$strip>;
|
|
133
159
|
}, z.core.$strip>;
|
|
134
160
|
export declare const kyosoConfigKnownLeafPaths: string[];
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare const DEFAULT_AGENT_TIMEOUT_MS = 120000;
|
|
2
2
|
export declare const DEFAULT_MAX_CONTEXT_BYTES = 500000;
|
|
3
3
|
export declare const DEFAULT_MAX_DIFF_BYTES = 300000;
|
|
4
|
+
export declare const MAX_AGENT_OUTPUT_BYTES = 1048576;
|
|
5
|
+
export declare const JUDGE_MAX_OUTPUT_TOKENS = 4096;
|
|
4
6
|
export declare const RAW_OUTPUT_MAX_CHARS = 16384;
|
|
5
7
|
export declare const TRACE_DIR = ".kyoso/traces";
|
|
6
8
|
export declare const KYOSO_CHILD_AGENT = "KYOSO_CHILD_AGENT";
|
|
7
|
-
export declare const KYOSO_VERSION = "0.
|
|
9
|
+
export declare const KYOSO_VERSION = "0.12.0";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EvidenceRef, KyosoFinding, KyosoReviewRequest, ReviewMode, ReviewTool } from "./types.js";
|
|
2
|
+
export declare function admitFindings(input: {
|
|
3
|
+
tool: ReviewTool;
|
|
4
|
+
request: KyosoReviewRequest;
|
|
5
|
+
findings: KyosoFinding[];
|
|
6
|
+
reviewMode: ReviewMode;
|
|
7
|
+
}): KyosoFinding[];
|
|
8
|
+
export declare function selectRegressionTests(tests: string[]): string[];
|
|
9
|
+
export declare function buildAdmissionOpenQuestions(findings: KyosoFinding[]): string[];
|
|
10
|
+
export declare function findingFingerprint(finding: Pick<KyosoFinding, "category" | "title">, evidenceRefs: EvidenceRef[]): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KyosoConfig } from "../config/schema.js";
|
|
2
|
+
import type { AgentRole, KyosoReviewRequest, ReviewBudget, ReviewTool } from "./types.js";
|
|
3
|
+
export declare const REVIEW_CONTRACT_VERSION = "2026-07-16-v3";
|
|
4
|
+
export declare function createRequestFingerprint(input: {
|
|
5
|
+
tool: ReviewTool;
|
|
6
|
+
request: KyosoReviewRequest;
|
|
7
|
+
config: KyosoConfig;
|
|
8
|
+
roles: Partial<Record<"codex" | "claude", AgentRole>>;
|
|
9
|
+
budget: ReviewBudget;
|
|
10
|
+
entrypoint?: "cli" | "mcp" | "core";
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function canonicalJson(value: unknown): string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { AgentName, ModelCallKind, ModelTokenUsage, ReviewBudget, ReviewBudgetRequest, ReviewCompletion, ReviewCompletionReason, ReviewExecutionBudget, ReviewModelCallAudit } from "./types.js";
|
|
2
|
+
type ReservationStatus = "reserved" | "started" | "completed" | "skipped";
|
|
3
|
+
type Reservation = {
|
|
4
|
+
id: number;
|
|
5
|
+
kind: ModelCallKind;
|
|
6
|
+
agent?: AgentName;
|
|
7
|
+
status: ReservationStatus;
|
|
8
|
+
reason?: string;
|
|
9
|
+
outputBytes?: number;
|
|
10
|
+
usage?: ModelTokenUsage;
|
|
11
|
+
stopReason?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ModelCallReservation = Pick<Reservation, "id" | "kind" | "agent">;
|
|
14
|
+
export type BudgetReservationFailure = {
|
|
15
|
+
reason: "model_call_budget" | "deadline";
|
|
16
|
+
};
|
|
17
|
+
export declare function resolveReviewBudget(ceiling: ReviewBudget, requested: ReviewBudgetRequest | undefined): ReviewBudget;
|
|
18
|
+
export declare class ReviewBudgetTracker {
|
|
19
|
+
readonly budget: ReviewBudget;
|
|
20
|
+
readonly startedAtEpochMs: number;
|
|
21
|
+
readonly deadlineAtEpochMs: number;
|
|
22
|
+
private readonly reservations;
|
|
23
|
+
private readonly skippedCalls;
|
|
24
|
+
private readonly incompleteReasons;
|
|
25
|
+
private nextReservationId;
|
|
26
|
+
constructor(budget: ReviewBudget, startedAtEpochMs?: number);
|
|
27
|
+
remainingWallTimeMs(now?: number): number;
|
|
28
|
+
hasDeadlineExpired(now?: number): boolean;
|
|
29
|
+
reserveMany(inputs: Array<{
|
|
30
|
+
kind: ModelCallKind;
|
|
31
|
+
agent?: AgentName;
|
|
32
|
+
}>): {
|
|
33
|
+
reservations: ModelCallReservation[];
|
|
34
|
+
} | {
|
|
35
|
+
failure: BudgetReservationFailure;
|
|
36
|
+
};
|
|
37
|
+
reserve(input: {
|
|
38
|
+
kind: ModelCallKind;
|
|
39
|
+
agent?: AgentName;
|
|
40
|
+
}): {
|
|
41
|
+
reservation: ModelCallReservation;
|
|
42
|
+
} | {
|
|
43
|
+
failure: BudgetReservationFailure;
|
|
44
|
+
};
|
|
45
|
+
markStarted(reservation: ModelCallReservation): void;
|
|
46
|
+
hasStarted(reservation: ModelCallReservation): boolean;
|
|
47
|
+
complete(reservation: ModelCallReservation, values?: {
|
|
48
|
+
outputBytes?: number;
|
|
49
|
+
usage?: ModelTokenUsage;
|
|
50
|
+
stopReason?: string;
|
|
51
|
+
}): void;
|
|
52
|
+
skip(reservation: ModelCallReservation, reason: string): void;
|
|
53
|
+
recordSkipped(input: {
|
|
54
|
+
kind: ModelCallKind;
|
|
55
|
+
agent?: AgentName;
|
|
56
|
+
reason: string;
|
|
57
|
+
}): void;
|
|
58
|
+
markIncomplete(reason: ReviewCompletionReason): void;
|
|
59
|
+
isTokenUsageUnknown(): boolean;
|
|
60
|
+
snapshot(now?: number): {
|
|
61
|
+
completion: ReviewCompletion;
|
|
62
|
+
executionBudget: ReviewExecutionBudget;
|
|
63
|
+
modelCalls: ReviewModelCallAudit[];
|
|
64
|
+
};
|
|
65
|
+
private usedCapacity;
|
|
66
|
+
private modelCalls;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentRole, AgentRunResult, KyosoReviewRequest, ReviewCoverage, ReviewLens } from "./types.js";
|
|
2
|
+
export declare const REVIEW_LENSES: readonly ["correctness", "regression", "security_boundaries", "secrets_and_injection", "data_integrity", "public_contract", "supply_chain", "privacy", "resource_amplification", "architecture", "performance", "tests", "documentation", "maintainability"];
|
|
3
|
+
export declare const BUILT_IN_SAFETY_FLOOR: readonly ["correctness", "regression", "security_boundaries", "secrets_and_injection", "data_integrity", "public_contract"];
|
|
4
|
+
export declare const REQUIRED_REVIEW_PERSPECTIVES: AgentRole[];
|
|
5
|
+
export declare function isReviewLens(value: unknown): value is ReviewLens;
|
|
6
|
+
export declare function resolveRequiredLenses(request: KyosoReviewRequest, additionalLenses?: ReviewLens[]): ReviewLens[];
|
|
7
|
+
export declare function buildReviewCoverage(input: {
|
|
8
|
+
request: KyosoReviewRequest;
|
|
9
|
+
additionalLenses?: ReviewLens[];
|
|
10
|
+
agentResults: AgentRunResult[];
|
|
11
|
+
}): ReviewCoverage;
|
|
12
|
+
export declare function isCoverageIncomplete(coverage: ReviewCoverage, options: {
|
|
13
|
+
multiAgentRequired: boolean;
|
|
14
|
+
}): boolean;
|
|
15
|
+
export declare function unavailableReviewCoverage(request: KyosoReviewRequest, reason: string, additionalLenses?: ReviewLens[]): ReviewCoverage;
|
|
16
|
+
export declare function renderTrustedReviewContract(request: KyosoReviewRequest, requiredLenses?: ReviewLens[]): string;
|
package/dist/core/runReview.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type RunReviewOptions = LoadConfigOptions & {
|
|
|
10
10
|
agentManager?: AcpAgentManager;
|
|
11
11
|
env?: NodeJS.ProcessEnv;
|
|
12
12
|
mcpNetworkMode?: NetworkMode;
|
|
13
|
+
entrypoint?: "cli" | "mcp" | "core";
|
|
13
14
|
traceWriterFactory?: (options: TraceWriterOptions) => TraceWriter;
|
|
14
15
|
};
|
|
15
16
|
export declare function runReview(tool: ReviewTool, request: KyosoReviewRequest, options?: RunReviewOptions): Promise<KyosoResult>;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -4,10 +4,53 @@ export type GateStatus = "pass" | "warn" | "fail" | "not_applicable";
|
|
|
4
4
|
export type NetworkMode = "model_only" | "unrestricted";
|
|
5
5
|
export type JudgeProvider = "auto" | "openai" | "anthropic" | "none";
|
|
6
6
|
export type Severity = "critical" | "high" | "medium" | "low" | "info";
|
|
7
|
+
export type ReviewLens = "correctness" | "regression" | "security_boundaries" | "secrets_and_injection" | "data_integrity" | "public_contract" | "supply_chain" | "privacy" | "resource_amplification" | "architecture" | "performance" | "tests" | "documentation" | "maintainability";
|
|
8
|
+
export type ReviewContract = {
|
|
9
|
+
focus?: ReviewLens[];
|
|
10
|
+
nonGoals?: string[];
|
|
11
|
+
acceptedRisks?: Array<{
|
|
12
|
+
findingFingerprint: string;
|
|
13
|
+
rationale: string;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export type FindingDisposition = "gate" | "actionable" | "advisory" | "disputed";
|
|
17
|
+
export type ChangeRelation = "introduced" | "worsened" | "pre_existing" | "unknown";
|
|
18
|
+
export type EvidenceQuality = "concrete" | "partial" | "insufficient";
|
|
19
|
+
export type EvidenceRef = {
|
|
20
|
+
kind: "file" | "diff_hunk" | "plan_clause";
|
|
21
|
+
path?: string;
|
|
22
|
+
lineStart?: number;
|
|
23
|
+
lineEnd?: number;
|
|
24
|
+
label?: string;
|
|
25
|
+
};
|
|
26
|
+
export type ReviewBudget = {
|
|
27
|
+
maxModelCalls: number;
|
|
28
|
+
maxTotalWallTimeMs: number;
|
|
29
|
+
maxAgentOutputBytes: number;
|
|
30
|
+
maxFindingsPerAgent: number;
|
|
31
|
+
skipOptionalPhasesWhenTokenUsageUnknown: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type ReviewBudgetRequest = Partial<ReviewBudget>;
|
|
34
|
+
export type ReviewCompletionReason = "model_call_budget" | "deadline" | "agent_output_limit" | "token_usage_unknown" | "coverage_incomplete" | "disputed_finding";
|
|
35
|
+
export type ReviewCompletion = {
|
|
36
|
+
status: "complete" | "incomplete";
|
|
37
|
+
reasons: ReviewCompletionReason[];
|
|
38
|
+
retryable: false;
|
|
39
|
+
};
|
|
40
|
+
export type ModelCallKind = "primary" | "verifier" | "judge";
|
|
41
|
+
export type ModelTokenUsage = {
|
|
42
|
+
totalTokens?: number;
|
|
43
|
+
inputTokens?: number;
|
|
44
|
+
outputTokens?: number;
|
|
45
|
+
thoughtTokens?: number;
|
|
46
|
+
cachedReadTokens?: number;
|
|
47
|
+
cachedWriteTokens?: number;
|
|
48
|
+
};
|
|
7
49
|
export type FindingCategory = "architecture" | "authn" | "authz" | "csrf" | "xss" | "ssrf" | "injection" | "secret" | "supply_chain" | "privacy" | "data_loss" | "test" | "maintainability" | "cisa_secure_by_design" | "other";
|
|
8
50
|
export type CisaDimension = "customer_security_outcomes" | "secure_by_default" | "transparency_and_accountability" | "governance";
|
|
9
51
|
export type KyosoReviewRequest = {
|
|
10
52
|
goal: string;
|
|
53
|
+
reviewContract?: ReviewContract;
|
|
11
54
|
repoSummary?: string;
|
|
12
55
|
currentPlan?: string;
|
|
13
56
|
selectedFiles?: Array<{
|
|
@@ -30,6 +73,7 @@ export type KyosoReviewRequest = {
|
|
|
30
73
|
options?: {
|
|
31
74
|
network?: NetworkMode;
|
|
32
75
|
maxAgentTimeoutMs?: number;
|
|
76
|
+
reviewBudget?: ReviewBudgetRequest;
|
|
33
77
|
includeAgentRawOutputs?: boolean;
|
|
34
78
|
judgeProvider?: JudgeProvider;
|
|
35
79
|
allowSecretRedaction?: boolean;
|
|
@@ -42,6 +86,12 @@ export type KyosoFinding = {
|
|
|
42
86
|
title: string;
|
|
43
87
|
evidence: string;
|
|
44
88
|
recommendation: string;
|
|
89
|
+
disposition: FindingDisposition;
|
|
90
|
+
changeRelation: ChangeRelation;
|
|
91
|
+
evidenceQuality: EvidenceQuality;
|
|
92
|
+
evidenceRefs: EvidenceRef[];
|
|
93
|
+
policyReasons: string[];
|
|
94
|
+
fingerprint: string;
|
|
45
95
|
files?: Array<{
|
|
46
96
|
path: string;
|
|
47
97
|
lineStart?: number;
|
|
@@ -58,6 +108,8 @@ export type KyosoFinding = {
|
|
|
58
108
|
};
|
|
59
109
|
};
|
|
60
110
|
export type CisaSecureByDesignResult = {
|
|
111
|
+
gateEnabled: boolean;
|
|
112
|
+
enabledDimensions: CisaDimension[];
|
|
61
113
|
customerSecurityOutcomes: GateStatus;
|
|
62
114
|
secureByDefault: GateStatus;
|
|
63
115
|
transparencyAndAccountability: GateStatus;
|
|
@@ -67,6 +119,17 @@ export type CisaSecureByDesignResult = {
|
|
|
67
119
|
export type AgentName = "codex" | "claude";
|
|
68
120
|
export type AgentRole = "implementation_reviewer" | "architecture_security_reviewer" | "combined_reviewer" | "finding_verifier";
|
|
69
121
|
export type ReviewMode = "multi_agent" | "single_agent";
|
|
122
|
+
export type ReviewCoverage = {
|
|
123
|
+
requiredLenses: ReviewLens[];
|
|
124
|
+
attemptedLenses: ReviewLens[];
|
|
125
|
+
missingLenses: Array<{
|
|
126
|
+
lens: ReviewLens;
|
|
127
|
+
reason: string;
|
|
128
|
+
}>;
|
|
129
|
+
requiredPerspectives: AgentRole[];
|
|
130
|
+
completedPerspectives: AgentRole[];
|
|
131
|
+
independentReview: boolean;
|
|
132
|
+
};
|
|
70
133
|
export type NormalizedAgentOpinion = {
|
|
71
134
|
agent: AgentName;
|
|
72
135
|
role: string;
|
|
@@ -77,6 +140,10 @@ export type NormalizedAgentOpinion = {
|
|
|
77
140
|
title: string;
|
|
78
141
|
evidence: string;
|
|
79
142
|
recommendation: string;
|
|
143
|
+
disposition?: FindingDisposition;
|
|
144
|
+
changeRelation?: ChangeRelation;
|
|
145
|
+
evidenceQuality?: EvidenceQuality;
|
|
146
|
+
evidenceRefs?: EvidenceRef[];
|
|
80
147
|
files?: Array<{
|
|
81
148
|
path: string;
|
|
82
149
|
lineStart?: number;
|
|
@@ -110,6 +177,8 @@ export type AgentRunInput = {
|
|
|
110
177
|
prompt: string;
|
|
111
178
|
workspaceDir: string;
|
|
112
179
|
timeoutMs: number;
|
|
180
|
+
deadlineAtEpochMs?: number;
|
|
181
|
+
maxOutputBytes?: number;
|
|
113
182
|
networkMode: NetworkMode;
|
|
114
183
|
onStarted?: (() => void) | (() => Promise<void>);
|
|
115
184
|
};
|
|
@@ -125,14 +194,58 @@ export type AgentRunResult = {
|
|
|
125
194
|
detail?: string;
|
|
126
195
|
};
|
|
127
196
|
warnings?: string[];
|
|
197
|
+
usage?: ModelTokenUsage;
|
|
198
|
+
outputBytes?: number;
|
|
199
|
+
stopReason?: string;
|
|
128
200
|
startedAt: string;
|
|
129
201
|
completedAt?: string;
|
|
130
202
|
};
|
|
203
|
+
export type ReviewExecutionBudget = {
|
|
204
|
+
maxModelCalls: number;
|
|
205
|
+
modelCalls: {
|
|
206
|
+
planned: number;
|
|
207
|
+
consumed: number;
|
|
208
|
+
skipped: number;
|
|
209
|
+
byKind: Record<ModelCallKind, {
|
|
210
|
+
planned: number;
|
|
211
|
+
consumed: number;
|
|
212
|
+
skipped: number;
|
|
213
|
+
}>;
|
|
214
|
+
};
|
|
215
|
+
wallTime: {
|
|
216
|
+
limitMs: number;
|
|
217
|
+
consumedMs: number;
|
|
218
|
+
remainingMs: number;
|
|
219
|
+
};
|
|
220
|
+
maxAgentOutputBytes: number;
|
|
221
|
+
maxFindingsPerAgent: number;
|
|
222
|
+
skipOptionalPhasesWhenTokenUsageUnknown: boolean;
|
|
223
|
+
agentOutputBytes: Partial<Record<AgentName, number>>;
|
|
224
|
+
tokenUsage: {
|
|
225
|
+
status: "reported" | "partial" | "unknown";
|
|
226
|
+
reportedCalls: number;
|
|
227
|
+
unknownCalls: number;
|
|
228
|
+
totals: ModelTokenUsage;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
export type ReviewModelCallAudit = {
|
|
232
|
+
kind: ModelCallKind;
|
|
233
|
+
agent?: AgentName;
|
|
234
|
+
status: "completed" | "skipped";
|
|
235
|
+
reason?: string;
|
|
236
|
+
outputBytes?: number;
|
|
237
|
+
usage?: ModelTokenUsage;
|
|
238
|
+
stopReason?: string;
|
|
239
|
+
};
|
|
131
240
|
export type KyosoResult = {
|
|
132
241
|
decision: KyosoDecision;
|
|
242
|
+
completion: ReviewCompletion;
|
|
243
|
+
executionBudget: ReviewExecutionBudget;
|
|
244
|
+
requestFingerprint: string;
|
|
133
245
|
degraded: boolean;
|
|
134
246
|
agentsUsed: AgentName[];
|
|
135
247
|
reviewMode: ReviewMode;
|
|
248
|
+
coverage: ReviewCoverage;
|
|
136
249
|
verificationMode?: "cross_agent" | "skipped_single_agent";
|
|
137
250
|
summaryMarkdown: string;
|
|
138
251
|
findings: KyosoFinding[];
|
|
@@ -148,6 +261,7 @@ export type KyosoResult = {
|
|
|
148
261
|
crossModelAnalysis?: CrossModelAnalysis;
|
|
149
262
|
testsToAdd: string[];
|
|
150
263
|
residualRisks: string[];
|
|
264
|
+
openQuestions: string[];
|
|
151
265
|
agentOpinions: Array<{
|
|
152
266
|
agent: AgentName;
|
|
153
267
|
role: string;
|
|
@@ -166,6 +280,7 @@ export type KyosoResult = {
|
|
|
166
280
|
workspaceMode: "temp_snapshot";
|
|
167
281
|
configHash?: string;
|
|
168
282
|
warnings?: string[];
|
|
283
|
+
modelCalls: ReviewModelCallAudit[];
|
|
169
284
|
};
|
|
170
285
|
};
|
|
171
286
|
export type SecretScanResult = {
|
|
@@ -18,7 +18,7 @@ export declare function groupVerificationTargetsByVerifier(targets: Verification
|
|
|
18
18
|
verifier: AgentName;
|
|
19
19
|
findings: KyosoFinding[];
|
|
20
20
|
}>;
|
|
21
|
-
export declare function markVerificationOverflow(targets: VerificationTarget[]): void;
|
|
21
|
+
export declare function markVerificationOverflow(targets: VerificationTarget[], reason?: string): void;
|
|
22
22
|
export declare function parseVerificationVerdicts(rawText: string | undefined): VerificationVerdict[] | undefined;
|
|
23
23
|
export declare function applyVerificationVerdicts(targets: VerificationTarget[], verifier: AgentName, verdicts: VerificationVerdict[] | undefined): Record<"confirmed" | "refuted" | "uncertain", number>;
|
|
24
24
|
export declare function countVerificationStatuses(findings: KyosoFinding[]): Record<"confirmed" | "refuted" | "uncertain" | "not_verified", number>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { defineConfig } from "./config/defineConfig.js";
|
|
2
2
|
export { runReview } from "./core/runReview.js";
|
|
3
|
-
export type { CisaSecureByDesignResult, GateStatus, KyosoDecision, KyosoFinding, KyosoResult, KyosoReviewRequest, NetworkMode, ReviewTool, } from "./core/types.js";
|
|
3
|
+
export type { ChangeRelation, CisaSecureByDesignResult, EvidenceQuality, EvidenceRef, FindingDisposition, GateStatus, KyosoDecision, KyosoFinding, KyosoResult, KyosoReviewRequest, ModelTokenUsage, NetworkMode, ReviewBudget, ReviewBudgetRequest, ReviewCompletion, ReviewContract, ReviewCoverage, ReviewExecutionBudget, ReviewLens, ReviewModelCallAudit, ReviewTool, } from "./core/types.js";
|