@kodax-ai/kodax 0.7.43 → 0.7.45

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +6 -5
  3. package/README_CN.md +6 -5
  4. package/dist/chunks/chunk-CZHIUJQS.js +535 -0
  5. package/dist/chunks/{chunk-IYSK7LUK.js → chunk-FKB7BWQT.js} +1 -1
  6. package/dist/chunks/chunk-FT2XFFNP.js +2 -0
  7. package/dist/chunks/chunk-IJUB7QXG.js +425 -0
  8. package/dist/chunks/chunk-PGF5EZ7C.js +31 -0
  9. package/dist/chunks/chunk-X6EHEQWP.js +849 -0
  10. package/dist/chunks/{compaction-config-3E57ABCT.js → compaction-config-WCNGYWT3.js} +1 -1
  11. package/dist/chunks/{construction-bootstrap-JR63KI5N.js → construction-bootstrap-OB5SDNBD.js} +1 -1
  12. package/dist/chunks/dist-C2VOGY5Z.js +2 -0
  13. package/dist/chunks/{dist-XANXEVTU.js → dist-Q2PQM7U7.js} +1 -1
  14. package/dist/chunks/{utils-HQ2QCKJA.js → utils-CHXCBR3Q.js} +1 -1
  15. package/dist/index.d.ts +8 -8
  16. package/dist/index.js +2 -2
  17. package/dist/kodax_cli.js +764 -709
  18. package/dist/provider-capabilities.json +181 -0
  19. package/dist/sdk-agent.d.ts +108 -8
  20. package/dist/sdk-agent.js +1 -1
  21. package/dist/sdk-coding.d.ts +385 -13
  22. package/dist/sdk-coding.js +1 -1
  23. package/dist/sdk-llm.d.ts +1 -1
  24. package/dist/sdk-llm.js +1 -1
  25. package/dist/sdk-mcp.js +1 -1
  26. package/dist/sdk-repl.d.ts +7 -6
  27. package/dist/sdk-repl.js +1 -1
  28. package/dist/sdk-session.d.ts +2 -2
  29. package/dist/sdk-session.js +1 -1
  30. package/dist/sdk-skills.js +1 -1
  31. package/dist/types-chunks/{bash-prefix-extractor.d-DMrGImMl.d.ts → bash-prefix-extractor.d-HrTUwtV7.d.ts} +597 -142
  32. package/dist/types-chunks/file-tracker.d-DOfaoCbJ.d.ts +633 -0
  33. package/dist/types-chunks/{resolver.d-CA68_NeH.d.ts → resolver.d-OMwxURit.d.ts} +17 -14
  34. package/dist/types-chunks/{storage.d-DPAEX7zS.d.ts → storage.d-BvTdjYQF.d.ts} +13 -1
  35. package/dist/types-chunks/{file-tracker.d-zaLZeNBK.d.ts → types.d-DM8zEJgF.d.ts} +1029 -535
  36. package/dist/types-chunks/{types.d-mM8vqvhT.d.ts → types.d-HBbWT-iA.d.ts} +41 -3
  37. package/dist/types-chunks/{utils.d-DkLZD_wa.d.ts → utils.d-DSEX6Rq1.d.ts} +15 -3
  38. package/package.json +2 -2
  39. package/dist/chunks/chunk-7G5PSL6C.js +0 -830
  40. package/dist/chunks/chunk-K75O2CAE.js +0 -31
  41. package/dist/chunks/chunk-UG4262JI.js +0 -502
  42. package/dist/chunks/chunk-VHKAJDQD.js +0 -425
  43. package/dist/chunks/chunk-YMRZBS4G.js +0 -2
  44. package/dist/chunks/dist-KWHUKXEL.js +0 -2
  45. package/dist/types-chunks/types.d-CKJtjo-6.d.ts +0 -1127
@@ -154,21 +154,24 @@ declare abstract class KodaXOpenAICompatProvider extends KodaXBaseProvider {
154
154
  * Provider 注册表 - 统一管理所有 Provider
155
155
  */
156
156
 
157
- type ProviderName = 'anthropic' | 'openai' | 'deepseek' | 'kimi' | 'kimi-code' | 'qwen' | 'zhipu' | 'zhipu-coding' | 'minimax-coding' | 'mimo-coding' | 'ark-coding' | 'gemini-cli' | 'codex-cli';
157
+ type ProviderName = 'anthropic' | 'openai' | 'deepseek' | 'kimi' | 'kimi-code' | 'qwen' | 'zhipu' | 'zhipu-coding' | 'minimax-coding' | 'mimo-coding' | 'mimo' | 'ark-coding' | 'gemini-cli' | 'codex-cli';
158
158
  /**
159
- * Per-provider static metadata. v0.7.43 promoted from a partial
159
+ * Per-provider static metadata. v0.7.43 promoted this from a partial
160
160
  * descriptor (`models: string[]`) to the full capability surface so
161
161
  * SDK consumers can read context windows / max output tokens /
162
162
  * thinking-budget caps / per-model descriptors without instantiating
163
163
  * a Provider class (which previously required a valid API key just
164
- * to read static metadata — architectural mismatch).
164
+ * to read static metadata).
165
165
  *
166
- * This map is now the single source of truth for capability data;
166
+ * v0.7.44 FEATURE_198 moved the data into a separate JSON file
167
+ * (`provider-capabilities.json`) so it can be patched without a
168
+ * KodaX release. The structural type below mirrors the JSON-resolved
169
+ * shape and remains the single source of truth for capability data;
167
170
  * Provider classes derive their runtime `config` from it via
168
171
  * `buildProviderConfig`.
169
172
  */
170
173
  type ProviderSnapshot = {
171
- model: string;
174
+ readonly model: string;
172
175
  /**
173
176
  * Alternative model descriptors beyond the default `model`. Carries
174
177
  * per-model capability overrides (`contextWindow` / `maxOutputTokens` /
@@ -177,19 +180,19 @@ type ProviderSnapshot = {
177
180
  * gaps a descriptor leaves unset. The default model has no descriptor
178
181
  * entry — it inherits provider-level defaults directly.
179
182
  */
180
- models?: readonly KodaXModelDescriptor[];
181
- apiKeyEnv: string;
182
- reasoningCapability: KodaXReasoningCapability;
183
- modelReasoningCapabilities?: Partial<Record<string, KodaXReasoningCapability>>;
184
- capabilityProfile: KodaXProviderCapabilityProfile;
183
+ readonly models?: readonly KodaXModelDescriptor[];
184
+ readonly apiKeyEnv: string;
185
+ readonly reasoningCapability: KodaXReasoningCapability;
186
+ readonly modelReasoningCapabilities?: Readonly<Record<string, KodaXReasoningCapability>>;
187
+ readonly capabilityProfile: KodaXProviderCapabilityProfile;
185
188
  /** Maximum input context window (tokens). Provider-level default. */
186
- contextWindow?: number;
189
+ readonly contextWindow?: number;
187
190
  /** Per-turn output token cap KodaX requests. Provider-level default. */
188
- maxOutputTokens?: number;
191
+ readonly maxOutputTokens?: number;
189
192
  /** Upper bound on `thinking_budget` for native-budget reasoning providers. */
190
- thinkingBudgetCap?: number;
193
+ readonly thinkingBudgetCap?: number;
191
194
  /** Whether the provider supports `thinking_budget` / native reasoning. */
192
- supportsThinking?: boolean;
195
+ readonly supportsThinking?: boolean;
193
196
  };
194
197
  declare const KODAX_PROVIDER_SNAPSHOTS: Record<ProviderName, ProviderSnapshot>;
195
198
  declare const KODAX_PROVIDERS: Record<string, () => KodaXBaseProvider>;
@@ -1,4 +1,4 @@
1
- import { k as KodaXSessionData, o as KodaXSessionLineage, r as KodaXSessionNavigationOptions, s as KodaXSessionRuntimeInfo, u as KodaXSessionStorage } from './types.d-mM8vqvhT.js';
1
+ import { n as KodaXSessionData, s as KodaXSessionLineage, v as KodaXSessionNavigationOptions, w as KodaXSessionRuntimeInfo, y as KodaXSessionStorage } from './types.d-HBbWT-iA.js';
2
2
 
3
3
  /**
4
4
  * Session Storage - Session storage abstraction layer
@@ -109,6 +109,18 @@ declare class FileSessionStorage implements KodaXSessionStorage {
109
109
  }>>;
110
110
  delete(id: string): Promise<void>;
111
111
  deleteAll(gitRoot?: string): Promise<void>;
112
+ /**
113
+ * Auto-retention: delete session files (`.jsonl` + `.archive.jsonl`) whose
114
+ * mtime is older than `retentionDays`. Modeled on claudecode's
115
+ * `cleanup.ts` (`unlinkIfOld`). Bounds the sessions directory so it never
116
+ * accumulates unboundedly — which is what keeps `list()`'s head-read pass
117
+ * fast (its cost scales with file COUNT, not size). A non-positive /
118
+ * non-finite `retentionDays` disables cleanup (no-op). Best-effort: per-file
119
+ * errors are swallowed so a single locked/racing file never aborts the
120
+ * sweep. Returns the number of files removed. mtime-based, so the session
121
+ * currently being written/resumed (fresh mtime) is never eligible.
122
+ */
123
+ cleanupOldSessions(retentionDays: number): Promise<number>;
112
124
  }
113
125
 
114
126
  export { FileSessionStorage as F, MemorySessionStorage as M, createMemorySessionStorage as c };