@kyo-so/cli 0.14.0 → 0.15.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.
@@ -10,9 +10,9 @@ export declare const PLUGIN_RUNTIME_COMPATIBILITY_SCHEMA_VERSION = 2;
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.7.2";
13
+ readonly pluginVersion: "0.7.3";
14
14
  readonly mcpCommand: "npx";
15
- readonly mcpPackagePin: "@kyo-so/cli@0.13.1";
15
+ readonly mcpPackagePin: "@kyo-so/cli@0.14.0";
16
16
  readonly mcpExecutable: "kyoso";
17
17
  };
18
18
  readonly marketplace: {
@@ -131,9 +131,9 @@ export declare const pluginRuntimeContract: {
131
131
  readonly pluginListTopLevelKeys: readonly ["installed", "available"];
132
132
  readonly expectedContract: {
133
133
  readonly distribution: {
134
- readonly pluginVersion: "0.7.2";
134
+ readonly pluginVersion: "0.7.3";
135
135
  readonly mcpCommand: "npx";
136
- readonly mcpPackagePin: "@kyo-so/cli@0.13.1";
136
+ readonly mcpPackagePin: "@kyo-so/cli@0.14.0";
137
137
  readonly mcpExecutable: "kyoso";
138
138
  };
139
139
  readonly marketplace: {
@@ -0,0 +1,5 @@
1
+ import type { ReviewProgressEvent, ReviewProgressSink } from "../core/progress.js";
2
+ export type CliProgressMode = "auto" | "plain" | "jsonl" | "off";
3
+ export declare function resolveCliProgressMode(value: string | undefined, stderrIsTty: boolean): CliProgressMode;
4
+ export declare function createCliProgressSink(mode: CliProgressMode, stderrWrite: (line: string) => void): ReviewProgressSink | undefined;
5
+ export declare function formatPlainProgressMessage(event: ReviewProgressEvent): string;
@@ -6,7 +6,7 @@ type Violation = {
6
6
  path: string;
7
7
  reason?: string;
8
8
  };
9
- export declare const kyosoConfigOverridePaths: readonly ["agents.codex.enabled", "agents.codex.model", "agents.codex.provider", "agents.codex.effort", "agents.codex.role", "agents.codex.timeoutMs", "agents.claude.enabled", "agents.claude.model", "agents.claude.effort", "agents.claude.role", "agents.claude.timeoutMs", "verification.enabled", "verification.maxFindings", "verification.timeoutMs", "judge.mode", "judge.provider", "judge.timeoutMs"];
9
+ export declare const kyosoConfigOverridePaths: readonly ["agents.codex.enabled", "agents.codex.model", "agents.codex.provider", "agents.codex.openRouter.streamIdleTimeoutMs", "agents.codex.openRouter.streamMaxRetries", "agents.codex.openRouter.requestMaxRetries", "agents.codex.effort", "agents.codex.role", "agents.codex.timeoutMs", "agents.claude.enabled", "agents.claude.model", "agents.claude.effort", "agents.claude.role", "agents.claude.timeoutMs", "verification.enabled", "verification.maxFindings", "verification.timeoutMs", "judge.mode", "judge.provider", "judge.timeoutMs"];
10
10
  export declare function isAllowedConfigOverridePath(path: string[]): boolean;
11
11
  export declare function mergeProjectTomlConfig(baseConfig: unknown, projectConfig: unknown, options: ProjectScopeOptions): unknown;
12
12
  export declare function collectProjectScopeViolations(config: unknown): Violation[];
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  export declare const CODEX_OPENROUTER_PROVIDER: "openrouter";
3
3
  export declare const CODEX_DEFAULT_PROVIDER: "default";
4
4
  export declare const CODEX_OPENROUTER_MODEL_REQUIRED_ISSUE: "codex_openrouter_model_required";
5
+ export declare const CODEX_OPENROUTER_POLICY_REQUIRES_PROVIDER_ISSUE: "codex_openrouter_policy_requires_provider";
5
6
  export type CodexProvider = typeof CODEX_OPENROUTER_PROVIDER | typeof CODEX_DEFAULT_PROVIDER;
6
7
  type PartialDeep<T> = {
7
8
  [K in keyof T]?: T[K] extends Record<string, unknown> ? PartialDeep<T[K]> : T[K];
@@ -63,6 +64,11 @@ export declare const kyosoConfigSchema: z.ZodObject<{
63
64
  default: "default";
64
65
  }>>;
65
66
  allowProjectProvider: z.ZodDefault<z.ZodArray<z.ZodString>>;
67
+ openRouter: z.ZodDefault<z.ZodObject<{
68
+ streamIdleTimeoutMs: z.ZodOptional<z.ZodNumber>;
69
+ streamMaxRetries: z.ZodOptional<z.ZodNumber>;
70
+ requestMaxRetries: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strip>>;
66
72
  }, z.core.$strip>;
67
73
  claude: z.ZodObject<{
68
74
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -7,4 +7,4 @@ export declare const JUDGE_MAX_OUTPUT_TOKENS = 4096;
7
7
  export declare const RAW_OUTPUT_MAX_CHARS = 16384;
8
8
  export declare const TRACE_DIR = ".kyoso/traces";
9
9
  export declare const KYOSO_CHILD_AGENT = "KYOSO_CHILD_AGENT";
10
- export declare const KYOSO_VERSION = "0.14.0";
10
+ export declare const KYOSO_VERSION = "0.15.0";
@@ -2,3 +2,8 @@ export declare class KyosoRequestError extends Error {
2
2
  readonly code: string;
3
3
  constructor(message: string, code: string);
4
4
  }
5
+ export declare class KyosoCancellationError extends Error {
6
+ readonly code = "REQUEST_CANCELLED";
7
+ constructor(message?: string);
8
+ }
9
+ export declare function throwIfAborted(signal?: AbortSignal): void;
@@ -0,0 +1,83 @@
1
+ import type { AgentName, AgentRole, KyosoDecision, ModelExecutionIdentity, ReviewCompletion, ReviewTool } from "./types.js";
2
+ export type ReviewPhase = "preflight" | "context" | "snapshot" | "primary" | "aggregation" | "verification" | "judge" | "finalize";
3
+ export type ReviewProgressEvent = {
4
+ type: "review_started";
5
+ traceId: string;
6
+ tool: ReviewTool;
7
+ timestamp: string;
8
+ } | {
9
+ type: "phase_started";
10
+ traceId: string;
11
+ phase: ReviewPhase;
12
+ timestamp: string;
13
+ } | {
14
+ type: "phase_completed";
15
+ traceId: string;
16
+ phase: ReviewPhase;
17
+ durationMs: number;
18
+ timestamp: string;
19
+ } | {
20
+ type: "phase_skipped";
21
+ traceId: string;
22
+ phase: ReviewPhase;
23
+ reason: string;
24
+ timestamp: string;
25
+ } | {
26
+ type: "agent_started";
27
+ traceId: string;
28
+ agent: AgentName;
29
+ role: AgentRole;
30
+ executionIdentity?: ModelExecutionIdentity;
31
+ timestamp: string;
32
+ } | {
33
+ type: "agent_activity";
34
+ traceId: string;
35
+ agent: AgentName;
36
+ activity: "message" | "thought" | "protocol";
37
+ totalOutputBytes: number;
38
+ timestamp: string;
39
+ } | {
40
+ type: "agent_waiting";
41
+ traceId: string;
42
+ agent: AgentName;
43
+ elapsedMs: number;
44
+ sinceLastAcpUpdateMs: number;
45
+ streamIdleTimeoutMs?: number;
46
+ timestamp: string;
47
+ } | {
48
+ type: "agent_retrying";
49
+ traceId: string;
50
+ agent: AgentName;
51
+ observedRetry: number;
52
+ attempt?: number;
53
+ maxRetries?: number;
54
+ reason: string;
55
+ discardedMessageBytes: number;
56
+ timestamp: string;
57
+ } | {
58
+ type: "agent_completed";
59
+ traceId: string;
60
+ agent: AgentName;
61
+ status: "completed" | "failed" | "timeout" | "skipped";
62
+ durationMs: number;
63
+ outputBytes?: number;
64
+ observedStreamRetries?: number;
65
+ timestamp: string;
66
+ } | {
67
+ type: "review_completed";
68
+ traceId: string;
69
+ decision: KyosoDecision;
70
+ completionStatus: ReviewCompletion["status"];
71
+ durationMs: number;
72
+ timestamp: string;
73
+ } | {
74
+ type: "review_failed";
75
+ traceId: string;
76
+ errorCode?: string;
77
+ timestamp: string;
78
+ } | {
79
+ type: "review_cancelled";
80
+ traceId: string;
81
+ timestamp: string;
82
+ };
83
+ export type ReviewProgressSink = (event: ReviewProgressEvent) => void | Promise<void>;
@@ -0,0 +1,12 @@
1
+ import type { ReviewProgressEvent, ReviewProgressSink } from "./progress.js";
2
+ type ProgressDispatcherOptions = {
3
+ sinkTimeoutMs?: number;
4
+ maxQueue?: number;
5
+ onSinkDisabled?: (reason: string) => void;
6
+ };
7
+ export type ProgressDispatcher = {
8
+ emit(event: ReviewProgressEvent): void;
9
+ flush(maxWaitMs?: number): Promise<void>;
10
+ };
11
+ export declare function createProgressDispatcher(sink: ReviewProgressSink | undefined, options?: ProgressDispatcherOptions): ProgressDispatcher;
12
+ export {};
@@ -10,6 +10,10 @@ type Reservation = {
10
10
  thoughtBytes?: number;
11
11
  outputBytes?: number;
12
12
  outputWarningTriggered?: boolean;
13
+ observedStreamRetries?: number;
14
+ discardedRetryMessageBytes?: number;
15
+ firstOutputAt?: string;
16
+ lastAcpUpdateAt?: string;
13
17
  salvaged?: boolean;
14
18
  reportedFindings?: number;
15
19
  findingsTargetExceeded?: boolean;
@@ -65,6 +69,10 @@ export declare class ReviewBudgetTracker {
65
69
  thoughtBytes?: number;
66
70
  outputBytes?: number;
67
71
  outputWarningTriggered?: boolean;
72
+ observedStreamRetries?: number;
73
+ discardedRetryMessageBytes?: number;
74
+ firstOutputAt?: string;
75
+ lastAcpUpdateAt?: string;
68
76
  salvaged?: boolean;
69
77
  reportedFindings?: number;
70
78
  findingsTargetExceeded?: boolean;
@@ -2,6 +2,7 @@ import { type KyosoConfig } from "../config/schema.js";
2
2
  import { type LoadConfigOptions } from "../config/loadConfig.js";
3
3
  import type { AcpAgentManager } from "../acp/AcpAgentManager.js";
4
4
  import { type TraceWriter, type TraceWriterOptions } from "../audit/trace.js";
5
+ import type { ReviewProgressSink } from "./progress.js";
5
6
  import type { KyosoResult, KyosoReviewRequest, NetworkMode, ReviewTool } from "./types.js";
6
7
  export type RunReviewOptions = LoadConfigOptions & {
7
8
  config?: KyosoConfig;
@@ -12,5 +13,8 @@ export type RunReviewOptions = LoadConfigOptions & {
12
13
  mcpNetworkMode?: NetworkMode;
13
14
  entrypoint?: "cli" | "mcp" | "core";
14
15
  traceWriterFactory?: (options: TraceWriterOptions) => TraceWriter;
16
+ onProgress?: ReviewProgressSink;
17
+ signal?: AbortSignal;
18
+ progressHeartbeatMs?: number;
15
19
  };
16
20
  export declare function runReview(tool: ReviewTool, request: KyosoReviewRequest, options?: RunReviewOptions): Promise<KyosoResult>;
@@ -193,6 +193,29 @@ export type CrossModelAnalysis = {
193
193
  }>;
194
194
  provider: string;
195
195
  };
196
+ export type AgentProgressEvent = {
197
+ type: "agent_retrying";
198
+ agent: AgentName;
199
+ observedRetry: number;
200
+ attempt?: number;
201
+ maxRetries?: number;
202
+ reason: string;
203
+ discardedMessageBytes: number;
204
+ timestamp: string;
205
+ } | {
206
+ type: "agent_activity";
207
+ agent: AgentName;
208
+ activity: "message" | "thought" | "protocol";
209
+ totalOutputBytes: number;
210
+ timestamp: string;
211
+ } | {
212
+ type: "agent_waiting";
213
+ agent: AgentName;
214
+ elapsedMs: number;
215
+ sinceLastAcpUpdateMs: number;
216
+ streamIdleTimeoutMs?: number;
217
+ timestamp: string;
218
+ };
196
219
  export type AgentRunInput = {
197
220
  traceId: string;
198
221
  agent: AgentName;
@@ -205,7 +228,11 @@ export type AgentRunInput = {
205
228
  warnOutputBytes?: number;
206
229
  maxOutputBytes?: number;
207
230
  networkMode: NetworkMode;
231
+ signal?: AbortSignal;
232
+ heartbeatMs?: number;
233
+ streamIdleTimeoutMs?: number;
208
234
  onStarted?: (executionIdentity?: ModelExecutionIdentity) => unknown;
235
+ onProgress?: (event: AgentProgressEvent) => unknown;
209
236
  };
210
237
  export type AgentRunResult = {
211
238
  agent: AgentName;
@@ -225,6 +252,10 @@ export type AgentRunResult = {
225
252
  thoughtBytes?: number;
226
253
  outputBytes?: number;
227
254
  outputWarningTriggered?: boolean;
255
+ observedStreamRetries?: number;
256
+ discardedRetryMessageBytes?: number;
257
+ firstOutputAt?: string;
258
+ lastAcpUpdateAt?: string;
228
259
  salvaged?: boolean;
229
260
  reportedFindings?: number;
230
261
  findingsTargetExceeded?: boolean;
@@ -271,6 +302,10 @@ export type ReviewModelCallAudit = {
271
302
  thoughtBytes?: number;
272
303
  outputBytes?: number;
273
304
  outputWarningTriggered?: boolean;
305
+ observedStreamRetries?: number;
306
+ discardedRetryMessageBytes?: number;
307
+ firstOutputAt?: string;
308
+ lastAcpUpdateAt?: string;
274
309
  salvaged?: boolean;
275
310
  reportedFindings?: number;
276
311
  findingsTargetExceeded?: boolean;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export { defineConfig } from "./config/defineConfig.js";
2
2
  export { runReview } from "./core/runReview.js";
3
+ export { KyosoCancellationError } from "./core/errors.js";
4
+ export type { ReviewPhase, ReviewProgressEvent, ReviewProgressSink, } from "./core/progress.js";
3
5
  export type { ChangeRelation, CisaSecureByDesignResult, EvidenceQuality, EvidenceRef, FindingDisposition, GateStatus, KyosoDecision, KyosoFinding, KyosoResult, KyosoReviewRequest, ModelExecutionIdentity, ModelProviderRoute, ModelTokenUsage, NetworkMode, ReviewBudget, ReviewBudgetRequest, ReviewCompletion, ReviewContract, ReviewCoverage, ReviewExecutionBudget, ReviewLens, ReviewModelCallAudit, ReviewTool, } from "./core/types.js";