@kodax-ai/kodax 0.7.56 → 0.7.58
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 +2004 -1887
- package/README.md +52 -48
- package/README_CN.md +37 -32
- package/dist/builtin/code-review/SKILL.md +22 -3
- package/dist/chunks/agent-YJNC2755.js +2 -0
- package/dist/chunks/argument-completer-QGBNXTYJ.js +2 -0
- package/dist/chunks/chunk-526OILYL.js +2 -0
- package/dist/chunks/{chunk-ZBK3DZ3S.js → chunk-6AU6EPO6.js} +1 -1
- package/dist/chunks/chunk-73Z7BK5H.js +15 -0
- package/dist/chunks/chunk-7QB55SYG.js +326 -0
- package/dist/chunks/chunk-CQ6EQG7E.js +322 -0
- package/dist/chunks/chunk-CV6JHPEO.js +2 -0
- package/dist/chunks/chunk-D6QVXQNI.js +1 -0
- package/dist/chunks/chunk-HS2K74I4.js +31 -0
- package/dist/chunks/chunk-NKHXRN7G.js +403 -0
- package/dist/chunks/chunk-OBPB5BQ6.js +310 -0
- package/dist/chunks/chunk-P4VF3JEP.js +7 -0
- package/dist/chunks/chunk-PIQWODWN.js +18 -0
- package/dist/chunks/chunk-QHWXPJEG.js +601 -0
- package/dist/chunks/chunk-XXEIFNBE.js +52 -0
- package/dist/chunks/chunk-ZZDC75H4.js +681 -0
- package/dist/chunks/compaction-config-OPMRZSAK.js +2 -0
- package/dist/chunks/{construction-bootstrap-EDDVNP2B.js → construction-bootstrap-CIXFH5SE.js} +4 -4
- package/dist/chunks/dist-JSE7NICF.js +2 -0
- package/dist/chunks/dist-SDNQOW52.js +2 -0
- package/dist/chunks/host-H7FQMMRC.js +2 -0
- package/dist/chunks/{paste-5IDBBQQ3.js → paste-Y4DVUWSM.js} +1 -1
- package/dist/chunks/run-manager-4H5HWMVW.js +2 -0
- package/dist/chunks/utils-FLVVQHM7.js +2 -0
- package/dist/index.d.ts +22 -18
- package/dist/index.js +6 -6
- package/dist/kodax_cli.js +1303 -1108
- package/dist/provider-capabilities.json +986 -197
- package/dist/sdk-agent.d.ts +162 -14
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +285 -255
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +66 -43
- 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 +64 -5
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +114 -107
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-session.d.ts +7 -7
- 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-BA9Doaj_.d.ts} +38 -8
- package/dist/types-chunks/{bash-prefix-extractor.d-DZF1gDDz.d.ts → bash-prefix-extractor.d-D3cddmyV.d.ts} +639 -163
- package/dist/types-chunks/capability-learning.d-DRV80ISB.d.ts +29 -0
- package/dist/types-chunks/{cost-tracker.d-wRtyEW9d.d.ts → cost-tracker.d-CBLk1fiD.d.ts} +24 -2
- package/dist/types-chunks/{guardrail.d-DQQknOfb.d.ts → guardrail.d-iK7FwMdW.d.ts} +32 -10
- 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-DHow2y2G.d.ts} +170 -14
- package/dist/types-chunks/{resolver.d-Djq8KlCE.d.ts → resolver.d-DDOfVYDr.d.ts} +111 -18
- package/dist/types-chunks/{capsule.d-D0kjnqYy.d.ts → run-manager.d-ByDcJc5g.d.ts} +124 -13
- package/dist/types-chunks/{sdk-session-BP6ZNpOp.d.ts → sdk-session-21Tt3N_x.d.ts} +74 -9
- package/dist/types-chunks/{storage.d-CkydxFsV.d.ts → storage.d-BsZrBPYu.d.ts} +2 -2
- package/dist/types-chunks/{types.d-BJmoMf5H.d.ts → types.d-Ci5YPFEh.d.ts} +135 -22
- package/dist/types-chunks/{types.d-BKuHSiR0.d.ts → types.d-D4ZA8LJV.d.ts} +7 -3
- package/dist/types-chunks/{utils.d-bC97IuQZ.d.ts → utils.d-BURxOxFd.d.ts} +94 -19
- package/package.json +12 -7
- package/dist/chunks/agent-MAAKRAF2.js +0 -2
- 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/compaction-config-NAJEEPG5.js +0 -2
- package/dist/chunks/dist-2267YGB5.js +0 -2
- package/dist/chunks/dist-GW32CHO5.js +0 -2
- package/dist/chunks/utils-J7XBBZGB.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as KodaXProviderConfig, j as KodaXMessage, _ as KodaXToolDefinition, G as KodaXReasoningRequest, x as KodaXProviderStreamOptions, M as KodaXStreamResult, a4 as KodaXVerifyCredentialResult, k as KodaXModelDescriptor, o as KodaXProviderCapabilityProfile, A as KodaXReasoningCapability, F as KodaXReasoningProfile, m as KodaXNormalizedReasoningRequest, a6 as KodaXWireReasoningEffort } from './types.d-Ci5YPFEh.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Retry-After header parsing — FEATURE_130 (v0.7.36).
|
|
5
5
|
*
|
|
6
|
-
* Handles the four forms KodaX's
|
|
6
|
+
* Handles the four forms KodaX's built-in provider adapters encounter when a
|
|
7
7
|
* model returns 429 (rate limit) or 503/529 (overloaded):
|
|
8
8
|
*
|
|
9
9
|
* 1. `Retry-After: 120` — integer seconds (HTTP 7231 standard)
|
|
@@ -89,6 +89,27 @@ declare function extractHeadersFromError(error: unknown): HeadersLike;
|
|
|
89
89
|
* Provider 抽象基类 - 所有 Provider 的公共基础
|
|
90
90
|
*/
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Passive-learning guard threaded into `withRateLimit`: when the request fails
|
|
94
|
+
* with a reasoning-effort rejection, fire `onRejected` (so the REPL records it)
|
|
95
|
+
* and surface a typed error. `effort` is the value that was on the wire (used
|
|
96
|
+
* when the provider error doesn't echo a value).
|
|
97
|
+
*/
|
|
98
|
+
interface ReasoningRejectionGuard {
|
|
99
|
+
readonly model: string;
|
|
100
|
+
readonly effort?: string;
|
|
101
|
+
readonly onRejected?: (event: {
|
|
102
|
+
provider: string;
|
|
103
|
+
model: string;
|
|
104
|
+
effort: string;
|
|
105
|
+
}) => void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface ResolvedV2ReasoningIntent {
|
|
109
|
+
readonly disabled: boolean;
|
|
110
|
+
readonly effort?: KodaXWireReasoningEffort;
|
|
111
|
+
readonly requestedEffort?: KodaXWireReasoningEffort;
|
|
112
|
+
}
|
|
92
113
|
/**
|
|
93
114
|
* FEATURE_130 (v0.7.36): structured payload fired through
|
|
94
115
|
* `KodaXEvents.onRetryAfter` whenever a provider's `withRateLimit`
|
|
@@ -121,6 +142,14 @@ declare abstract class KodaXBaseProvider {
|
|
|
121
142
|
* returns `stop_reason: max_tokens`. See `coding/src/agent.ts`.
|
|
122
143
|
*/
|
|
123
144
|
protected maxOutputTokensOverride?: number;
|
|
145
|
+
/**
|
|
146
|
+
* One-shot flag for the passive-learning self-heal: when a request is
|
|
147
|
+
* rejected for its reasoning-effort value, `withRateLimit` flips this true
|
|
148
|
+
* and retries the SAME turn. The reasoning-application path then drops the
|
|
149
|
+
* effort param so the retry uses the provider default and the user's turn
|
|
150
|
+
* still completes — no interruption, no re-typed query. Cleared on success.
|
|
151
|
+
*/
|
|
152
|
+
protected suppressReasoningEffort: boolean;
|
|
124
153
|
/**
|
|
125
154
|
* Public setter for the one-shot override above. Callers outside the
|
|
126
155
|
* provider package (notably the agent loop's escalation branch) use this
|
|
@@ -165,6 +194,7 @@ declare abstract class KodaXBaseProvider {
|
|
|
165
194
|
* layer sets it — matches third-party Anthropic-compat behavior.
|
|
166
195
|
*/
|
|
167
196
|
getEffectiveStrictThinkingSignature(model?: string): boolean;
|
|
197
|
+
protected getEffectiveThinkingBudgetCap(model?: string): number | undefined;
|
|
168
198
|
abstract stream(messages: KodaXMessage[], tools: KodaXToolDefinition[], system: string, reasoning?: boolean | KodaXReasoningRequest, streamOptions?: KodaXProviderStreamOptions, signal?: AbortSignal): Promise<KodaXStreamResult>;
|
|
169
199
|
supportsNonStreamingFallback(): boolean;
|
|
170
200
|
complete(_messages: KodaXMessage[], _tools: KodaXToolDefinition[], _system: string, _reasoning?: boolean | KodaXReasoningRequest, _streamOptions?: KodaXProviderStreamOptions, _signal?: AbortSignal): Promise<KodaXStreamResult>;
|
|
@@ -194,9 +224,7 @@ declare abstract class KodaXBaseProvider {
|
|
|
194
224
|
getCapabilityProfile(): KodaXProviderCapabilityProfile;
|
|
195
225
|
getConfiguredReasoningCapability(modelOverride?: string): KodaXReasoningCapability;
|
|
196
226
|
getReasoningCapability(modelOverride?: string): KodaXReasoningCapability;
|
|
197
|
-
|
|
198
|
-
getReasoningOverrideKey(modelOverride?: string): string;
|
|
199
|
-
protected persistReasoningCapabilityOverride(capability: KodaXReasoningCapability, modelOverride?: string): void;
|
|
227
|
+
getReasoningProfile(modelOverride?: string): KodaXReasoningProfile | undefined;
|
|
200
228
|
protected shouldFallbackForReasoningError(error: unknown, ...terms: string[]): boolean;
|
|
201
229
|
protected shouldFallbackForSpecificReasoningError(error: unknown, ...terms: string[]): boolean;
|
|
202
230
|
protected shouldFallbackForForcedToolChoiceError(error: unknown): boolean;
|
|
@@ -225,7 +253,9 @@ declare abstract class KodaXBaseProvider {
|
|
|
225
253
|
protected getApiKey(): string;
|
|
226
254
|
protected shouldLogStreamDiagnostics(): boolean;
|
|
227
255
|
protected logStreamDiagnostic(...args: unknown[]): void;
|
|
228
|
-
protected normalizeReasoning(reasoning?: boolean | KodaXReasoningRequest):
|
|
256
|
+
protected normalizeReasoning(reasoning?: boolean | KodaXReasoningRequest): KodaXNormalizedReasoningRequest;
|
|
257
|
+
protected validateExplicitReasoningEffort(reasoning: KodaXNormalizedReasoningRequest, modelOverride?: string): void;
|
|
258
|
+
protected resolveReasoningProfileIntent(reasoning: KodaXNormalizedReasoningRequest, capability: KodaXReasoningProfile, modelOverride?: string): ResolvedV2ReasoningIntent;
|
|
229
259
|
/**
|
|
230
260
|
* Called when ECONNRESET/EPIPE is detected, indicating a stale keep-alive
|
|
231
261
|
* socket. Subclasses should override to rebuild their HTTP client with a
|
|
@@ -247,7 +277,7 @@ declare abstract class KodaXBaseProvider {
|
|
|
247
277
|
* Returns milliseconds, or undefined when no usable header is present.
|
|
248
278
|
*
|
|
249
279
|
* FEATURE_130 (v0.7.36): now delegates to the shared `parseRetryAfter`
|
|
250
|
-
* helper so all
|
|
280
|
+
* helper so all built-in provider adapters get 4-form coverage without each
|
|
251
281
|
* adapter rolling its own parser. The 4 forms supported are:
|
|
252
282
|
* - `Retry-After: <integer-seconds>`
|
|
253
283
|
* - `Retry-After: <HTTP-date>`
|
|
@@ -264,7 +294,7 @@ declare abstract class KodaXBaseProvider {
|
|
|
264
294
|
*/
|
|
265
295
|
protected parseContextOverflow(error: unknown): number | undefined;
|
|
266
296
|
protected isContextOverflowError(error: unknown): boolean;
|
|
267
|
-
protected withRateLimit<T>(fn: () => Promise<T>, signal?: AbortSignal, retries?: number, onRateLimit?: (attempt: number, maxRetries: number, delayMs: number) => void, onRetryAfter?: KodaXOnRetryAfterCallback): Promise<T>;
|
|
297
|
+
protected withRateLimit<T>(fn: () => Promise<T>, signal?: AbortSignal, retries?: number, onRateLimit?: (attempt: number, maxRetries: number, delayMs: number) => void, onRetryAfter?: KodaXOnRetryAfterCallback, reasoningGuard?: ReasoningRejectionGuard): Promise<T>;
|
|
268
298
|
}
|
|
269
299
|
|
|
270
300
|
export { KodaXBaseProvider as K, extractHeadersFromError as e, parseRetryAfter as p };
|