@kodax-ai/kodax 0.7.56 → 0.7.57
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 +33 -0
- package/README.md +21 -23
- package/README_CN.md +15 -17
- package/dist/builtin/code-review/SKILL.md +22 -3
- package/dist/chunks/{agent-MAAKRAF2.js → agent-EHWQZA4C.js} +1 -1
- package/dist/chunks/argument-completer-AYDAYGKL.js +2 -0
- package/dist/chunks/chunk-3WWPJGPQ.js +2 -0
- package/dist/chunks/chunk-4SHP3M67.js +2 -0
- package/dist/chunks/chunk-KN6IJMTB.js +636 -0
- package/dist/chunks/{chunk-ZBK3DZ3S.js → chunk-LZKGOR2C.js} +1 -1
- package/dist/chunks/chunk-MJFPFRGK.js +423 -0
- package/dist/chunks/chunk-N2N2W3AQ.js +584 -0
- package/dist/chunks/chunk-PCPFLPS4.js +5 -0
- package/dist/chunks/chunk-TCLSPUTR.js +31 -0
- package/dist/chunks/chunk-VACH6QWN.js +315 -0
- package/dist/chunks/chunk-YSVPF6SN.js +597 -0
- package/dist/chunks/{compaction-config-NAJEEPG5.js → compaction-config-TLDMFMZO.js} +1 -1
- package/dist/chunks/{construction-bootstrap-EDDVNP2B.js → construction-bootstrap-55B7Q5RX.js} +4 -4
- package/dist/chunks/dist-IE4HVWP7.js +2 -0
- package/dist/chunks/dist-IKOK2MJQ.js +2 -0
- package/dist/chunks/paste-WTL2XN7P.js +2 -0
- package/dist/chunks/utils-EJ2VCRTC.js +2 -0
- package/dist/index.d.ts +21 -17
- package/dist/index.js +6 -6
- package/dist/kodax_cli.js +1098 -1073
- package/dist/provider-capabilities.json +986 -197
- package/dist/sdk-agent.d.ts +20 -13
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +140 -110
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +5 -5
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +48 -5
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +106 -97
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +6 -6
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +11 -0
- package/dist/types-chunks/{base.d-CwPfI8WQ.d.ts → base.d-BnjQrSVf.d.ts} +36 -6
- package/dist/types-chunks/{bash-prefix-extractor.d-DZF1gDDz.d.ts → bash-prefix-extractor.d-BgvMbfq6.d.ts} +190 -135
- package/dist/types-chunks/{capsule.d-D0kjnqYy.d.ts → capsule.d-DwJp5r63.d.ts} +14 -11
- package/dist/types-chunks/{types.d-BKuHSiR0.d.ts → guardrail.d-BP3yyr6u.d.ts} +3 -121
- package/dist/types-chunks/{guardrail.d-DQQknOfb.d.ts → guardrail.d-C1DhxnvC.d.ts} +31 -9
- package/dist/types-chunks/{manager.d-DLmDhX3i.d.ts → manager.d-DBD7SOTT.d.ts} +7 -2
- package/dist/types-chunks/{process.d-BdiIUr8T.d.ts → process.d-BZncyzEj.d.ts} +2 -1
- package/dist/types-chunks/{resolver.d-Djq8KlCE.d.ts → resolver.d-ZvKQgl0X.d.ts} +82 -18
- package/dist/types-chunks/{sdk-session-BP6ZNpOp.d.ts → sdk-session-DAScB0rW.d.ts} +6 -4
- package/dist/types-chunks/{storage.d-CkydxFsV.d.ts → storage.d-CPvn9qI0.d.ts} +2 -2
- package/dist/types-chunks/{types.d-BJmoMf5H.d.ts → types.d-6VOXvF88.d.ts} +101 -22
- package/dist/types-chunks/types.d-D8WcfrOD.d.ts +143 -0
- package/dist/types-chunks/{utils.d-bC97IuQZ.d.ts → utils.d-CpgVIjYZ.d.ts} +16 -18
- package/package.json +11 -6
- package/dist/chunks/argument-completer-OWEXGWNL.js +0 -2
- package/dist/chunks/chunk-4OHXHC2S.js +0 -314
- package/dist/chunks/chunk-5YJIAP6C.js +0 -551
- package/dist/chunks/chunk-7EAGBLRV.js +0 -2
- package/dist/chunks/chunk-CDGOEK3T.js +0 -31
- package/dist/chunks/chunk-DHETLULC.js +0 -425
- package/dist/chunks/chunk-JCDO2FR4.js +0 -584
- package/dist/chunks/chunk-NZVJ3DFC.js +0 -656
- package/dist/chunks/chunk-QI3MRJGU.js +0 -5
- package/dist/chunks/chunk-XXQ3RLA2.js +0 -2
- package/dist/chunks/dist-2267YGB5.js +0 -2
- package/dist/chunks/dist-GW32CHO5.js +0 -2
- package/dist/chunks/paste-5IDBBQQ3.js +0 -2
- package/dist/chunks/utils-J7XBBZGB.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* KodaX AI Types
|
|
3
3
|
*
|
|
4
|
-
|
|
4
|
+
* AI 层类型定义 - 所有 Provider 共享的类型接口
|
|
5
5
|
*/
|
|
6
6
|
interface KodaXTextBlock {
|
|
7
7
|
type: 'text';
|
|
@@ -120,6 +120,57 @@ interface KodaXToolDefinition {
|
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
type KodaXReasoningCapability = 'native-effort' | 'native-budget' | 'native-toggle' | 'native-adaptive' | 'none' | 'prompt-only' | 'unknown';
|
|
123
|
+
type KodaXStableEffortIntent = 'auto' | 'none' | 'low' | 'medium' | 'high';
|
|
124
|
+
type KodaXWireReasoningEffort = string;
|
|
125
|
+
type KodaXReasoningPresetName = 'zai-glm-5.2' | 'zai-glm-toggle' | 'deepseek-v4-openai' | 'deepseek-v4-anthropic' | 'deepseek-toggle' | 'kimi-k2.7-code' | 'kimi-hybrid-toggle' | 'minimax-m3' | 'minimax-m2-always' | 'mimo-v2.5-toggle' | 'qwen-hybrid-thinking' | 'openai-chat-reasoning' | 'openai-responses-reasoning' | 'codex-cli-effort' | 'claude-adaptive-xhigh' | 'claude-adaptive-max' | 'anthropic-budget' | 'generic-thinking-toggle' | 'none';
|
|
126
|
+
interface KodaXReasoningEffortRequest {
|
|
127
|
+
readonly value: KodaXWireReasoningEffort;
|
|
128
|
+
readonly isExplicit: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface KodaXReasoningEffortPreset {
|
|
131
|
+
readonly value: KodaXWireReasoningEffort;
|
|
132
|
+
readonly description?: string;
|
|
133
|
+
readonly isDefault?: boolean;
|
|
134
|
+
readonly isUserVisible?: boolean;
|
|
135
|
+
}
|
|
136
|
+
type KodaXReasoningEffortWireStrategy = 'openai-responses-effort' | 'openai-chat-effort' | 'codex-cli-config' | 'anthropic-output-effort' | 'provider-budget' | 'provider-toggle' | 'prompt-only' | 'none';
|
|
137
|
+
type KodaXThinkingWireStrategy = 'anthropic-adaptive' | 'anthropic-budget' | 'provider-budget' | 'provider-toggle' | 'none';
|
|
138
|
+
interface KodaXReasoningProfile {
|
|
139
|
+
readonly reasoningPreset?: KodaXReasoningPresetName;
|
|
140
|
+
readonly effortStrategy: KodaXReasoningEffortWireStrategy;
|
|
141
|
+
readonly thinkingStrategy?: KodaXThinkingWireStrategy;
|
|
142
|
+
readonly defaultEffort?: KodaXWireReasoningEffort;
|
|
143
|
+
readonly supportedEfforts?: readonly KodaXReasoningEffortPreset[];
|
|
144
|
+
readonly effortAliases?: Partial<Record<KodaXWireReasoningEffort, KodaXWireReasoningEffort>>;
|
|
145
|
+
readonly disabledEfforts?: readonly KodaXWireReasoningEffort[];
|
|
146
|
+
readonly localRejectEfforts?: readonly KodaXWireReasoningEffort[];
|
|
147
|
+
readonly allowCustomEffort?: boolean;
|
|
148
|
+
readonly budgetByEffort?: Partial<Record<KodaXWireReasoningEffort, number>>;
|
|
149
|
+
readonly supportsReasoningEffort?: boolean;
|
|
150
|
+
readonly supportsReasoningSummary?: boolean;
|
|
151
|
+
readonly supportsEncryptedReasoningReplay?: boolean;
|
|
152
|
+
readonly supportsAdaptiveThinking?: boolean;
|
|
153
|
+
readonly supportsManualThinkingBudget?: boolean;
|
|
154
|
+
readonly supportsDisabledThinking?: boolean;
|
|
155
|
+
readonly requiresEffortBetaHeader?: boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Friendly reasoning declaration for CUSTOM providers / models — the canonical
|
|
159
|
+
* user-facing form. List the effort rungs the model accepts (order = the Ctrl+T
|
|
160
|
+
* ladder; include `"off"` to allow disabling thinking) plus an optional
|
|
161
|
+
* `default`. The wire strategy (effortStrategy / thinkingStrategy) is derived
|
|
162
|
+
* from the provider `protocol`, so users never touch preset names or strategy
|
|
163
|
+
* enums. Use the string `"none"` for a model with no thinking capability. For
|
|
164
|
+
* full, explicit control fall back to `reasoningProfile`.
|
|
165
|
+
*
|
|
166
|
+
* Example: `"reasoning": { "efforts": ["off", "low", "high", "max"], "default": "high" }`
|
|
167
|
+
*/
|
|
168
|
+
interface KodaXSimpleReasoningConfig {
|
|
169
|
+
readonly efforts: readonly string[];
|
|
170
|
+
readonly default?: string;
|
|
171
|
+
}
|
|
172
|
+
/** User-facing reasoning declaration: friendly form, `"none"`, or (advanced) a raw profile override. */
|
|
173
|
+
type KodaXReasoningConfig = KodaXSimpleReasoningConfig | 'none' | Partial<KodaXReasoningProfile>;
|
|
123
174
|
type KodaXProviderTransport = 'native-api' | 'cli-bridge';
|
|
124
175
|
type KodaXProviderConversationSemantics = 'full-history' | 'last-user-message';
|
|
125
176
|
type KodaXProviderMcpSupport = 'native' | 'none';
|
|
@@ -140,7 +191,6 @@ interface KodaXProviderCapabilityProfile {
|
|
|
140
191
|
multimodalSupport?: KodaXProviderMultimodalSupport;
|
|
141
192
|
evidenceSupport?: KodaXProviderEvidenceSupport;
|
|
142
193
|
}
|
|
143
|
-
type KodaXReasoningOverride = 'budget' | 'effort' | 'toggle' | 'adaptive' | 'none';
|
|
144
194
|
type KodaXReasoningMode = 'off' | 'auto' | 'quick' | 'balanced' | 'deep';
|
|
145
195
|
type KodaXThinkingDepth = 'off' | 'low' | 'medium' | 'high';
|
|
146
196
|
type KodaXTaskType = 'conversation' | 'lookup' | 'review' | 'bugfix' | 'edit' | 'refactor' | 'plan' | 'qa' | 'unknown';
|
|
@@ -155,23 +205,7 @@ type KodaXMutationSurface = 'read-only' | 'docs-only' | 'code' | 'system';
|
|
|
155
205
|
type KodaXAssuranceIntent = 'default' | 'explicit-check';
|
|
156
206
|
type KodaXHarnessProfile = 'H0_DIRECT' | 'H1_EXECUTE_EVAL' | 'H2_PLAN_EXECUTE_EVAL' | 'PLANNED';
|
|
157
207
|
type KodaXReviewScale = 'small' | 'large' | 'massive';
|
|
158
|
-
type
|
|
159
|
-
type KodaXAmaTactic = 'direct' | 'child-fanout' | 'planning-pass' | 'verification-pass' | 'repair-loop';
|
|
160
|
-
type KodaXAmaFanoutClass = 'finding-validation' | 'evidence-scan' | 'module-triage' | 'hypothesis-check';
|
|
161
|
-
interface KodaXAmaFanoutPolicy {
|
|
162
|
-
admissible: boolean;
|
|
163
|
-
class?: KodaXAmaFanoutClass;
|
|
164
|
-
reason: string;
|
|
165
|
-
maxChildren?: number;
|
|
166
|
-
requiresReadOnly?: boolean;
|
|
167
|
-
}
|
|
168
|
-
interface KodaXAmaControllerDecision {
|
|
169
|
-
profile: KodaXAmaProfile;
|
|
170
|
-
tactics: KodaXAmaTactic[];
|
|
171
|
-
fanout: KodaXAmaFanoutPolicy;
|
|
172
|
-
reason: string;
|
|
173
|
-
upgradeTriggers: string[];
|
|
174
|
-
}
|
|
208
|
+
type KodaXChildFanoutClass = 'finding-validation' | 'evidence-scan' | 'module-triage' | 'hypothesis-check';
|
|
175
209
|
interface KodaXTaskRoutingDecision {
|
|
176
210
|
primaryTask: KodaXTaskType;
|
|
177
211
|
secondaryTask?: KodaXTaskType;
|
|
@@ -207,18 +241,40 @@ interface KodaXThinkingBudgetMap {
|
|
|
207
241
|
type KodaXTaskBudgetOverrides = Partial<Record<KodaXTaskType, Partial<KodaXThinkingBudgetMap>>>;
|
|
208
242
|
interface KodaXReasoningRequest {
|
|
209
243
|
enabled?: boolean;
|
|
210
|
-
|
|
211
|
-
|
|
244
|
+
/**
|
|
245
|
+
* Canonical reasoning control. Reasoning single-tracking removed the legacy
|
|
246
|
+
* `mode` (KodaXReasoningMode) + `depth` (KodaXThinkingDepth) request fields —
|
|
247
|
+
* callers pass `effort` (or `enabled` as a boolean shorthand). Providers
|
|
248
|
+
* derive any thinking budget from the effort via `effortToThinkingDepth`.
|
|
249
|
+
*/
|
|
250
|
+
effort?: KodaXWireReasoningEffort;
|
|
212
251
|
taskType?: KodaXTaskType;
|
|
213
252
|
executionMode?: KodaXExecutionMode;
|
|
214
253
|
}
|
|
254
|
+
interface KodaXNormalizedReasoningRequest {
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
effort: KodaXWireReasoningEffort;
|
|
257
|
+
effortSource?: 'explicit' | 'legacy';
|
|
258
|
+
taskType: KodaXTaskType;
|
|
259
|
+
executionMode: KodaXExecutionMode;
|
|
260
|
+
}
|
|
215
261
|
interface KodaXModelDescriptor {
|
|
216
262
|
id: string;
|
|
217
263
|
displayName?: string;
|
|
218
264
|
contextWindow?: number;
|
|
219
265
|
maxOutputTokens?: number;
|
|
220
266
|
thinkingBudgetCap?: number;
|
|
267
|
+
/** @deprecated Auto-migrated on load. Prefer `reasoning: { efforts, default }`. */
|
|
221
268
|
reasoningCapability?: KodaXReasoningCapability;
|
|
269
|
+
/** @deprecated Internal preset name; auto-migrated on load. Prefer `reasoning`. */
|
|
270
|
+
reasoningPreset?: KodaXReasoningPresetName;
|
|
271
|
+
/**
|
|
272
|
+
* Canonical reasoning declaration: friendly `{ efforts, default }`, `"none"`,
|
|
273
|
+
* or (advanced) a raw `Partial<KodaXReasoningProfile>` override. See
|
|
274
|
+
* `KodaXReasoningConfig`.
|
|
275
|
+
*/
|
|
276
|
+
reasoning?: KodaXReasoningConfig;
|
|
277
|
+
reasoningProfile?: KodaXReasoningProfile;
|
|
222
278
|
/**
|
|
223
279
|
* Per-model override for `replayReasoningContent`. Falls through to the
|
|
224
280
|
* provider-level flag when undefined. Lets a single gateway endpoint
|
|
@@ -309,6 +365,14 @@ interface KodaXCustomProviderConfig {
|
|
|
309
365
|
baseUrl: string;
|
|
310
366
|
apiKeyEnv: string;
|
|
311
367
|
model: string;
|
|
368
|
+
/** @deprecated Internal preset name; auto-migrated on load. Prefer `reasoning`. */
|
|
369
|
+
reasoningPreset?: KodaXReasoningPresetName;
|
|
370
|
+
/**
|
|
371
|
+
* Canonical reasoning declaration for this provider: friendly
|
|
372
|
+
* `{ efforts, default }`, `"none"`, or (advanced) a raw profile override.
|
|
373
|
+
* See `KodaXReasoningConfig`.
|
|
374
|
+
*/
|
|
375
|
+
reasoning?: KodaXReasoningConfig;
|
|
312
376
|
/**
|
|
313
377
|
* Additional available models beyond the default. Accepts either a
|
|
314
378
|
* plain model id string (legacy) or a KodaXModelDescriptor object
|
|
@@ -322,8 +386,11 @@ interface KodaXCustomProviderConfig {
|
|
|
322
386
|
* - sdk: keep the upstream SDK default User-Agent
|
|
323
387
|
*/
|
|
324
388
|
userAgentMode?: KodaXProviderUserAgentMode;
|
|
389
|
+
/** @deprecated Auto-migrated on load. Prefer `reasoning: "none"` (off) or `reasoning: { efforts, default }`. */
|
|
325
390
|
supportsThinking?: boolean;
|
|
391
|
+
/** @deprecated Auto-migrated on load. Prefer `reasoning: { efforts, default }`. */
|
|
326
392
|
reasoningCapability?: KodaXReasoningCapability;
|
|
393
|
+
reasoningProfile?: KodaXReasoningProfile;
|
|
327
394
|
capabilityProfile?: KodaXProviderCapabilityProfile;
|
|
328
395
|
contextWindow?: number;
|
|
329
396
|
maxOutputTokens?: number;
|
|
@@ -370,6 +437,7 @@ interface KodaXProviderConfig {
|
|
|
370
437
|
userAgentMode?: KodaXProviderUserAgentMode;
|
|
371
438
|
supportsThinking: boolean;
|
|
372
439
|
reasoningCapability?: KodaXReasoningCapability;
|
|
440
|
+
reasoningProfile?: KodaXReasoningProfile;
|
|
373
441
|
capabilityProfile?: KodaXProviderCapabilityProfile;
|
|
374
442
|
/** 模型的上下文窗口大小 (tokens) */
|
|
375
443
|
contextWindow?: number;
|
|
@@ -471,6 +539,17 @@ interface KodaXProviderStreamOptions {
|
|
|
471
539
|
maxAttempts: number;
|
|
472
540
|
}) => void;
|
|
473
541
|
/** 会话标识,用于多轮对话上下文恢复 */
|
|
542
|
+
/**
|
|
543
|
+
* Passive capability learning — fired when a provider HARD-rejects a
|
|
544
|
+
* reasoning-effort value (400/422 naming the param). The REPL records it in
|
|
545
|
+
* `capability-cache.json` so the rung is removed from the ladder and never
|
|
546
|
+
* offered or sent again (see `classifyReasoningEffortRejection`).
|
|
547
|
+
*/
|
|
548
|
+
onReasoningEffortRejected?: (event: {
|
|
549
|
+
provider: string;
|
|
550
|
+
model: string;
|
|
551
|
+
effort: string;
|
|
552
|
+
}) => void;
|
|
474
553
|
sessionId?: string;
|
|
475
554
|
/** Override the provider's default model for a single request */
|
|
476
555
|
modelOverride?: string;
|
|
@@ -482,4 +561,4 @@ interface KodaXProviderStreamOptions {
|
|
|
482
561
|
signal?: AbortSignal;
|
|
483
562
|
}
|
|
484
563
|
|
|
485
|
-
export type {
|
|
564
|
+
export type { KodaXToolResultBlock as $, KodaXReasoningCapability as A, KodaXReasoningEffortPreset as B, KodaXReasoningEffortRequest as C, KodaXReasoningEffortWireStrategy as D, KodaXReasoningMode as E, KodaXReasoningProfile as F, KodaXReasoningRequest as G, KodaXRedactedThinkingBlock as H, KodaXReviewScale as I, KodaXRiskLevel as J, KodaXAssuranceIntent as K, KodaXStableEffortIntent as L, KodaXStreamResult as M, KodaXTaskActionability as N, KodaXTaskBudgetOverrides as O, KodaXTaskComplexity as P, KodaXTaskFamily as Q, KodaXTaskRoutingDecision as R, KodaXTaskType as S, KodaXTaskWorkIntent as T, KodaXTextBlock as U, KodaXThinkingBlock as V, KodaXThinkingBudgetMap as W, KodaXThinkingDepth as X, KodaXThinkingWireStrategy as Y, KodaXTokenUsage as Z, KodaXToolDefinition as _, KodaXCacheBoundary as a, KodaXToolResultContentItem as a0, KodaXToolResultImageItem as a1, KodaXToolResultTextItem as a2, KodaXToolUseBlock as a3, KodaXVerifyCredentialResult as a4, KodaXVerifyStrategy as a5, KodaXWireReasoningEffort as a6, KodaXChildFanoutClass as b, KodaXContentBlock as c, KodaXCustomProviderConfig as d, KodaXExecutionMode as e, KodaXExecutionPattern as f, KodaXHarnessProfile as g, KodaXImageBlock as h, KodaXListModelsResult as i, KodaXMessage as j, KodaXModelDescriptor as k, KodaXMutationSurface as l, KodaXNormalizedReasoningRequest as m, KodaXProtocolFamily as n, KodaXProviderCapabilityProfile as o, KodaXProviderConfig as p, KodaXProviderContextFidelity as q, KodaXProviderConversationSemantics as r, KodaXProviderEvidenceSupport as s, KodaXProviderLongRunningSupport as t, KodaXProviderMcpSupport as u, KodaXProviderMultimodalSupport as v, KodaXProviderSessionSupport as w, KodaXProviderStreamOptions as x, KodaXProviderToolCallingFidelity as y, KodaXProviderTransport as z };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @kodax-ai/agent/messaging — Message queue types
|
|
3
|
+
*
|
|
4
|
+
* FEATURE_115 (v0.7.36): agentId-scoped 2-tier priority queue infrastructure.
|
|
5
|
+
*
|
|
6
|
+
* Per ADR-021: messaging is a generic agent-platform primitive (not coding-
|
|
7
|
+
* specific). Downstream consumers:
|
|
8
|
+
* - @kodax-ai/coding runner-driven mid-turn drain
|
|
9
|
+
* - @kodax-ai/repl InkREPL ESC soft-pause + text injection (FEATURE_111 absorbed)
|
|
10
|
+
* - subagent task-notification routing (FEATURE_155 idle-yield wakeup)
|
|
11
|
+
*
|
|
12
|
+
* Phase 0.6 study (`c:/tmp/claude-code-actual-usage.md`): Claude Code's
|
|
13
|
+
* `'now'` priority has zero production usage; KodaX simplifies to 2 tiers.
|
|
14
|
+
*/
|
|
15
|
+
type MessagePriority = 'user' | 'background';
|
|
16
|
+
type MessageMode = 'prompt' | 'task-notification' | 'system-reminder';
|
|
17
|
+
type QueuedInputArtifact = {
|
|
18
|
+
readonly kind: 'image';
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly mediaType?: string;
|
|
21
|
+
readonly source?: string;
|
|
22
|
+
readonly description?: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: 'file';
|
|
25
|
+
readonly path: string;
|
|
26
|
+
readonly mediaType?: string;
|
|
27
|
+
readonly mimeType?: string;
|
|
28
|
+
readonly name?: string;
|
|
29
|
+
readonly source?: string;
|
|
30
|
+
readonly description?: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'video';
|
|
33
|
+
readonly path: string;
|
|
34
|
+
readonly mediaType: string;
|
|
35
|
+
readonly name?: string;
|
|
36
|
+
readonly source?: string;
|
|
37
|
+
readonly description?: string;
|
|
38
|
+
};
|
|
39
|
+
interface QueuedMessage {
|
|
40
|
+
/** Stable id for tracing / dedup. Format: `msg-<sequence>`. */
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly priority: MessagePriority;
|
|
43
|
+
/**
|
|
44
|
+
* Routing key:
|
|
45
|
+
* undefined = main thread / coordinator agent
|
|
46
|
+
* 'agent-id-XYZ' = subagent / specific consumer
|
|
47
|
+
*
|
|
48
|
+
* Drain consumers MUST filter by agentId match — undefined matches only
|
|
49
|
+
* undefined-agentId messages, not "any agent".
|
|
50
|
+
*/
|
|
51
|
+
readonly agentId?: string;
|
|
52
|
+
readonly mode: MessageMode;
|
|
53
|
+
readonly content: string;
|
|
54
|
+
readonly inputArtifacts?: readonly QueuedInputArtifact[];
|
|
55
|
+
/** Wall-clock timestamp (`Date.now()`) for tracing only — not used for ordering. */
|
|
56
|
+
readonly enqueuedAt: number;
|
|
57
|
+
}
|
|
58
|
+
interface DequeueFilter {
|
|
59
|
+
/**
|
|
60
|
+
* Only return messages with this agentId.
|
|
61
|
+
* undefined matches messages with no agentId (main-thread messages only).
|
|
62
|
+
*/
|
|
63
|
+
readonly agentId?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Highest priority level included in the drain.
|
|
66
|
+
* 'user' → only user priority drained, background stays queued
|
|
67
|
+
* 'background' → both user + background drained (Sleep-gated case)
|
|
68
|
+
*/
|
|
69
|
+
readonly maxPriority: MessagePriority;
|
|
70
|
+
/**
|
|
71
|
+
* Optional cap on number of messages drained in this call.
|
|
72
|
+
* Defaults to unlimited (drains all matching).
|
|
73
|
+
*/
|
|
74
|
+
readonly limit?: number;
|
|
75
|
+
/**
|
|
76
|
+
* FEATURE_159 (v0.7.40) — optional mode filter. Lets REPL split the
|
|
77
|
+
* single queue into mode-typed views (e.g. `mode:'prompt'` for user
|
|
78
|
+
* input vs `mode:'task-notification'` for child completion banners)
|
|
79
|
+
* without separate queues. When omitted, all modes match.
|
|
80
|
+
*/
|
|
81
|
+
readonly mode?: MessageMode;
|
|
82
|
+
/**
|
|
83
|
+
* FEATURE_159 (v0.7.40) — optional precise-id filter. Single-message
|
|
84
|
+
* targeted removal — drives Esc-pop-this-uuid in REPL. When set, all
|
|
85
|
+
* other filters still apply (agentId / priority / mode mismatches still
|
|
86
|
+
* skip the message), so callers can't accidentally remove a message
|
|
87
|
+
* outside their scope.
|
|
88
|
+
*/
|
|
89
|
+
readonly id?: string;
|
|
90
|
+
/**
|
|
91
|
+
* FEATURE_159 (v0.7.40) — optional escape-hatch predicate, AND-ed with
|
|
92
|
+
* the structured filters. Lets SDK consumers express conditions the
|
|
93
|
+
* typed fields don't cover (e.g. timestamp ranges, content-match) without
|
|
94
|
+
* forcing every new use case to extend `DequeueFilter`. KodaX-internal
|
|
95
|
+
* code should prefer the typed fields for readability; this is the
|
|
96
|
+
* "data-driven main path + predicate escape" pattern.
|
|
97
|
+
*
|
|
98
|
+
* Evaluated AFTER the typed filters succeed — so a `predicate` that
|
|
99
|
+
* inspects `message.content` never runs on messages outside the
|
|
100
|
+
* caller's `agentId` / `mode` / `id` scope.
|
|
101
|
+
*/
|
|
102
|
+
readonly predicate?: (message: QueuedMessage) => boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* FEATURE_159 (v0.7.40) — structured queue event emitted to subscribers.
|
|
106
|
+
*
|
|
107
|
+
* Replaces the prior `() => void` bare-notify signal. Carries the kind +
|
|
108
|
+
* affected messages so SDK observability consumers (logging, tracing,
|
|
109
|
+
* metrics) can react per-event without re-diffing snapshots.
|
|
110
|
+
*
|
|
111
|
+
* Event granularity rules:
|
|
112
|
+
* - `enqueued` fires ONCE per `enqueue()` call (always 1 message).
|
|
113
|
+
* - `dequeued` fires ONCE per `dequeue()` call that removed ≥1 message,
|
|
114
|
+
* carrying ALL drained messages in priority+FIFO order. No-op drains
|
|
115
|
+
* (filter matched nothing) fire no event — quiet by design so the
|
|
116
|
+
* `waitForWakeEvent` 100ms poll doesn't spam idle subscribers.
|
|
117
|
+
* - `cleared` fires ONCE per `clear()` call that removed ≥1 message,
|
|
118
|
+
* carrying the pre-clear messages. Empty-queue clear fires nothing.
|
|
119
|
+
*
|
|
120
|
+
* The `useSyncExternalStore` React hook ignores the event payload (it
|
|
121
|
+
* only needs the change signal); SDK / tracer consumers read the event.
|
|
122
|
+
*/
|
|
123
|
+
type QueueEvent = {
|
|
124
|
+
readonly kind: 'enqueued';
|
|
125
|
+
readonly message: QueuedMessage;
|
|
126
|
+
} | {
|
|
127
|
+
readonly kind: 'dequeued';
|
|
128
|
+
readonly messages: readonly QueuedMessage[];
|
|
129
|
+
} | {
|
|
130
|
+
readonly kind: 'cleared';
|
|
131
|
+
readonly messages: readonly QueuedMessage[];
|
|
132
|
+
};
|
|
133
|
+
/** FEATURE_159 — `MessageQueue.subscribe` listener signature. */
|
|
134
|
+
type QueueEventListener = (event: QueueEvent) => void;
|
|
135
|
+
interface EnqueueInput {
|
|
136
|
+
readonly priority: MessagePriority;
|
|
137
|
+
readonly mode: MessageMode;
|
|
138
|
+
readonly content: string;
|
|
139
|
+
readonly agentId?: string;
|
|
140
|
+
readonly inputArtifacts?: readonly QueuedInputArtifact[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type { DequeueFilter as D, EnqueueInput as E, MessageMode as M, QueueEventListener as Q, MessagePriority as a, QueuedInputArtifact as b, QueuedMessage as c };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as SessionStorage$1, b as PermissionMode } from './storage.d-
|
|
3
|
-
import { ac as KodaXSessionUiHistoryItem, a4 as KodaXSessionLineage, Y as KodaXSessionArtifactLedgerEntry, Q as KodaXExtensionSessionState, P as KodaXExtensionSessionRecord, a8 as KodaXSessionRuntimeInfo, aa as KodaXSessionStorage, $ as KodaXSessionData, bD as WorkflowProcessSource } from './process.d-
|
|
4
|
-
import {
|
|
5
|
-
import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-
|
|
1
|
+
import { R as KodaXOptions, u as KodaXContextTokenSnapshot, m as KodaXAgentMode, W as KodaXRepoIntelligenceMode, a7 as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-BgvMbfq6.js';
|
|
2
|
+
import { c as SessionStorage$1, b as PermissionMode } from './storage.d-CPvn9qI0.js';
|
|
3
|
+
import { ac as KodaXSessionUiHistoryItem, a4 as KodaXSessionLineage, Y as KodaXSessionArtifactLedgerEntry, Q as KodaXExtensionSessionState, P as KodaXExtensionSessionRecord, a8 as KodaXSessionRuntimeInfo, aa as KodaXSessionStorage, $ as KodaXSessionData, bD as WorkflowProcessSource } from './process.d-BZncyzEj.js';
|
|
4
|
+
import { j as KodaXMessage, E as KodaXReasoningMode, o as KodaXProviderCapabilityProfile, d as KodaXCustomProviderConfig } from './types.d-6VOXvF88.js';
|
|
5
|
+
import { A as AgentsFile, f as AutoModeStats, l as KodaXMcpServersConfig } from './guardrail.d-C1DhxnvC.js';
|
|
6
6
|
import * as readline from 'readline';
|
|
7
7
|
import { SpawnSyncReturns } from 'child_process';
|
|
8
8
|
|
|
@@ -155,13 +155,14 @@ interface CommandExecutionMetadata {
|
|
|
155
155
|
interface CurrentConfig {
|
|
156
156
|
provider: string;
|
|
157
157
|
model?: string;
|
|
158
|
+
effort?: string;
|
|
159
|
+
effortOverride?: boolean;
|
|
160
|
+
planModeEffort?: string;
|
|
158
161
|
thinking: boolean;
|
|
159
162
|
reasoningMode: KodaXReasoningMode;
|
|
160
163
|
agentMode: KodaXAgentMode;
|
|
161
164
|
permissionMode: PermissionMode;
|
|
162
165
|
repoIntelligenceMode?: KodaXRepoIntelligenceMode;
|
|
163
|
-
repointelEndpoint?: string;
|
|
164
|
-
repointelBin?: string;
|
|
165
166
|
repoIntelligenceTrace?: boolean;
|
|
166
167
|
/** FEATURE_102 Phase 3 — cross-provider child fallback chain. */
|
|
167
168
|
fallbackProviders?: string[];
|
|
@@ -180,14 +181,13 @@ interface CommandCallbacks {
|
|
|
180
181
|
clearHistory: () => void;
|
|
181
182
|
printHistory: () => void;
|
|
182
183
|
switchProvider?: (provider: string, model?: string) => void;
|
|
184
|
+
setEffort?: (effort?: string) => void;
|
|
183
185
|
setThinking?: (enabled: boolean) => void;
|
|
184
186
|
setReasoningMode?: (mode: KodaXReasoningMode) => void;
|
|
185
187
|
setAgentMode?: (mode: KodaXAgentMode) => void;
|
|
186
188
|
setPermissionMode?: (mode: PermissionMode) => void;
|
|
187
189
|
setRepoIntelligenceRuntime?: (update: {
|
|
188
190
|
mode?: KodaXRepoIntelligenceMode;
|
|
189
|
-
endpoint?: string | null;
|
|
190
|
-
bin?: string | null;
|
|
191
191
|
trace?: boolean;
|
|
192
192
|
}) => void;
|
|
193
193
|
deleteSession?: (id: string) => Promise<void>;
|
|
@@ -339,7 +339,7 @@ declare function executeCommand(parsed: {
|
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
341
|
* KodaX CLI Utilities
|
|
342
|
-
* CLI
|
|
342
|
+
* CLI 灞傚伐鍏峰嚱鏁?
|
|
343
343
|
*/
|
|
344
344
|
|
|
345
345
|
/**
|
|
@@ -411,6 +411,8 @@ declare function isProviderConfigured(name: string): boolean;
|
|
|
411
411
|
declare function loadConfig(): {
|
|
412
412
|
provider?: string;
|
|
413
413
|
model?: string;
|
|
414
|
+
effort?: string;
|
|
415
|
+
planModeEffort?: string;
|
|
414
416
|
thinking?: boolean;
|
|
415
417
|
reasoningMode?: KodaXReasoningMode;
|
|
416
418
|
/**
|
|
@@ -424,14 +426,11 @@ declare function loadConfig(): {
|
|
|
424
426
|
agentMode?: KodaXAgentMode;
|
|
425
427
|
permissionMode?: string;
|
|
426
428
|
locale?: string;
|
|
427
|
-
providerReasoningOverrides?: Record<string, KodaXReasoningOverride>;
|
|
428
429
|
providerModels?: Record<string, string[]>;
|
|
429
430
|
customProviders?: KodaXCustomProviderConfig[];
|
|
430
431
|
extensions?: string[];
|
|
431
432
|
mcpServers?: KodaXMcpServersConfig;
|
|
432
|
-
repoIntelligenceMode?: 'auto' | 'off' | '
|
|
433
|
-
repointelEndpoint?: string;
|
|
434
|
-
repointelBin?: string;
|
|
433
|
+
repoIntelligenceMode?: 'auto' | 'off' | 'light' | 'full';
|
|
435
434
|
repoIntelligenceTrace?: boolean;
|
|
436
435
|
streamIdleTimeoutMs?: number;
|
|
437
436
|
/**
|
|
@@ -464,19 +463,18 @@ declare function prepareRuntimeConfig(): ReturnType<typeof loadConfig>;
|
|
|
464
463
|
declare function saveConfig(config: {
|
|
465
464
|
provider?: string;
|
|
466
465
|
model?: string;
|
|
466
|
+
effort?: string;
|
|
467
|
+
planModeEffort?: string;
|
|
467
468
|
thinking?: boolean;
|
|
468
469
|
reasoningMode?: KodaXReasoningMode;
|
|
469
470
|
agentMode?: KodaXAgentMode;
|
|
470
471
|
permissionMode?: string;
|
|
471
472
|
locale?: string;
|
|
472
|
-
providerReasoningOverrides?: Record<string, KodaXReasoningOverride>;
|
|
473
473
|
providerModels?: Record<string, string[]>;
|
|
474
474
|
customProviders?: KodaXCustomProviderConfig[];
|
|
475
475
|
extensions?: string[];
|
|
476
476
|
mcpServers?: KodaXMcpServersConfig;
|
|
477
|
-
repoIntelligenceMode?: 'auto' | 'off' | '
|
|
478
|
-
repointelEndpoint?: string;
|
|
479
|
-
repointelBin?: string;
|
|
477
|
+
repoIntelligenceMode?: 'auto' | 'off' | 'light' | 'full';
|
|
480
478
|
repoIntelligenceTrace?: boolean;
|
|
481
479
|
/** FEATURE_184 Phase D.3 follow-up — opt-in verifier log line. */
|
|
482
480
|
verifierLog?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodax-ai/kodax",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.57",
|
|
4
4
|
"description": "极致轻量化 Coding Agent - TypeScript 实现,支持 12 个 LLM 提供商,可发布为免 Node 单文件二进制",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -64,9 +64,7 @@
|
|
|
64
64
|
"dev:mem-diag": "node scripts/mem-diag-launch.cjs",
|
|
65
65
|
"dev:mem-snapshot": "node scripts/mem-diag-launch.cjs 2",
|
|
66
66
|
"probe:reasoning": "tsx scripts/probe-reasoning.ts",
|
|
67
|
-
"
|
|
68
|
-
"repointel:demo": "node clients/repointel/scripts/demo.mjs",
|
|
69
|
-
"repointel:doctor": "node clients/repointel/scripts/doctor.mjs",
|
|
67
|
+
"probe:max-tokens": "node scripts/probe-max-tokens.mjs",
|
|
70
68
|
"start": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs dist/kodax_cli.js",
|
|
71
69
|
"build:binary": "node scripts/build-binary.mjs",
|
|
72
70
|
"build:binary:all": "node scripts/build-binary.mjs --all",
|
|
@@ -75,6 +73,7 @@
|
|
|
75
73
|
"test:eval": "vitest run -c vitest.eval.config.ts",
|
|
76
74
|
"bench:perf": "tsx benchmark/perf/repl-render-perf.bench.ts",
|
|
77
75
|
"bench:perf:e2e": "tsx benchmark/perf/repl-render-engine-e2e.bench.ts",
|
|
76
|
+
"bench:repo-intel": "tsx benchmark/perf/repo-intelligence-index.bench.ts",
|
|
78
77
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
79
78
|
"clean:packages": "npm run clean --workspaces"
|
|
80
79
|
},
|
|
@@ -149,10 +148,16 @@
|
|
|
149
148
|
},
|
|
150
149
|
"repository": {
|
|
151
150
|
"type": "git",
|
|
152
|
-
"url": "https://github.com/icetomoyo/KodaX.git"
|
|
151
|
+
"url": "git+https://github.com/icetomoyo/KodaX.git"
|
|
153
152
|
},
|
|
154
153
|
"files": [
|
|
155
|
-
"dist",
|
|
154
|
+
"dist/*.d.ts",
|
|
155
|
+
"dist/*.js",
|
|
156
|
+
"dist/builtin",
|
|
157
|
+
"dist/chunks",
|
|
158
|
+
"dist/provider-capabilities.json",
|
|
159
|
+
"dist/semantic-worker.js",
|
|
160
|
+
"dist/types-chunks",
|
|
156
161
|
"scripts/kodax-bin.cjs",
|
|
157
162
|
"scripts/production-env.cjs",
|
|
158
163
|
"README.md",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{wa as a,xa as b}from"./chunk-5YJIAP6C.js";import"./chunk-7EAGBLRV.js";import"./chunk-ZBK3DZ3S.js";import"./chunk-DHETLULC.js";import"./chunk-NZVJ3DFC.js";import"./chunk-QI3MRJGU.js";import"./chunk-CDGOEK3T.js";import"./chunk-JCDO2FR4.js";import"./chunk-V4WSBIXB.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|