@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
@@ -82,7 +82,45 @@ interface KodaXSessionArchiveMarkerEntry extends KodaXSessionEntryBase {
82
82
  /** Brief summary of the archived content */
83
83
  summary: string;
84
84
  }
85
- type KodaXSessionEntry = KodaXSessionMessageEntry | KodaXSessionCompactionEntry | KodaXSessionBranchSummaryEntry | KodaXSessionLabelEntry | KodaXSessionArchiveMarkerEntry;
85
+ type KodaXGoalStatus = 'active' | 'paused' | 'budget_limited' | 'blocked' | 'complete';
86
+ /**
87
+ * Persistent user-set goal state. v0.7.44 FEATURE_192 — backs the
88
+ * `/goal` slash command and the get_goal / create_goal / update_goal
89
+ * tools.
90
+ *
91
+ * Persistence model: each lifecycle event (create / update / pause /
92
+ * resume / clear / budget_limited / blocked / complete) appends a
93
+ * `KodaXSessionGoalEntry` carrying a frozen `KodaXGoalState` snapshot
94
+ * to the session lineage. `readLatestGoalFromBranch` walks the active
95
+ * branch's message-entry IDs and returns the latest goal entry whose
96
+ * parentId belongs to that branch — so forks and rewinds naturally
97
+ * drop goals attached to abandoned message paths.
98
+ */
99
+ interface KodaXGoalState {
100
+ readonly version: 1;
101
+ /** `${createdAt}-${rand}` — stable across updates of the same goal. */
102
+ readonly id: string;
103
+ readonly objective: string;
104
+ readonly status: KodaXGoalStatus;
105
+ /** Optional explicit token budget; null when the user did not set one. */
106
+ readonly tokenBudget: number | null;
107
+ readonly tokensUsed: number;
108
+ readonly timeUsedSeconds: number;
109
+ /** Consecutive turns the model has reported the same blocker. */
110
+ readonly blockerTurnCount: number;
111
+ /** The blocker_kind string the model last reported, or null. */
112
+ readonly lastBlockerKind: string | null;
113
+ readonly createdAt: number;
114
+ readonly updatedAt: number;
115
+ }
116
+ type KodaXGoalEventType = 'created' | 'updated' | 'paused' | 'resumed' | 'cleared' | 'budget_limited' | 'blocked' | 'complete';
117
+ interface KodaXSessionGoalEntry extends KodaXSessionEntryBase {
118
+ type: 'goal';
119
+ /** Snapshot at time of event; `null` only when `event === 'cleared'`. */
120
+ goal: KodaXGoalState | null;
121
+ event: KodaXGoalEventType;
122
+ }
123
+ type KodaXSessionEntry = KodaXSessionMessageEntry | KodaXSessionCompactionEntry | KodaXSessionBranchSummaryEntry | KodaXSessionLabelEntry | KodaXSessionArchiveMarkerEntry | KodaXSessionGoalEntry;
86
124
  interface KodaXSessionArtifactLedgerEntry {
87
125
  id: string;
88
126
  kind: 'file_read' | 'file_modified' | 'file_created' | 'file_deleted' | 'path_scope' | 'search_scope' | 'command_scope' | 'check_result' | 'decision' | 'image_input' | 'tombstone';
@@ -119,7 +157,7 @@ interface KodaXSessionNavigationOptions {
119
157
  summarizeCurrentBranch?: boolean;
120
158
  }
121
159
  interface KodaXSessionTreeNode {
122
- entry: Exclude<KodaXSessionEntry, KodaXSessionLabelEntry>;
160
+ entry: Exclude<KodaXSessionEntry, KodaXSessionLabelEntry | KodaXSessionGoalEntry>;
123
161
  children: KodaXSessionTreeNode[];
124
162
  label?: string;
125
163
  active: boolean;
@@ -251,4 +289,4 @@ interface KodaXSessionStorage {
251
289
  deleteAll?(gitRoot?: string): Promise<void>;
252
290
  }
253
291
 
254
- export type { KodaXCompactMemoryProgress as K, SessionErrorMetadata as S, KodaXCompactMemorySeed as a, KodaXExtensionSessionRecord as b, KodaXExtensionSessionState as c, KodaXExtensionStore as d, KodaXExtensionStoreEntry as e, KodaXJsonValue as f, KodaXSessionArchiveMarkerEntry as g, KodaXSessionArtifactLedgerEntry as h, KodaXSessionBranchSummaryEntry as i, KodaXSessionCompactionEntry as j, KodaXSessionData as k, KodaXSessionEntry as l, KodaXSessionEntryBase as m, KodaXSessionLabelEntry as n, KodaXSessionLineage as o, KodaXSessionMessageEntry as p, KodaXSessionMeta as q, KodaXSessionNavigationOptions as r, KodaXSessionRuntimeInfo as s, KodaXSessionScope as t, KodaXSessionStorage as u, KodaXSessionTreeNode as v, KodaXSessionUiHistoryItem as w, KodaXSessionUiHistoryItemType as x, KodaXSessionWorkspaceKind as y };
292
+ export type { KodaXSessionUiHistoryItem as A, KodaXSessionUiHistoryItemType as B, KodaXSessionWorkspaceKind as C, KodaXCompactMemoryProgress as K, SessionErrorMetadata as S, KodaXCompactMemorySeed as a, KodaXExtensionSessionRecord as b, KodaXExtensionSessionState as c, KodaXExtensionStore as d, KodaXExtensionStoreEntry as e, KodaXGoalEventType as f, KodaXGoalState as g, KodaXGoalStatus as h, KodaXJsonValue as i, KodaXSessionArchiveMarkerEntry as j, KodaXSessionArtifactLedgerEntry as k, KodaXSessionBranchSummaryEntry as l, KodaXSessionCompactionEntry as m, KodaXSessionData as n, KodaXSessionEntry as o, KodaXSessionEntryBase as p, KodaXSessionGoalEntry as q, KodaXSessionLabelEntry as r, KodaXSessionLineage as s, KodaXSessionMessageEntry as t, KodaXSessionMeta as u, KodaXSessionNavigationOptions as v, KodaXSessionRuntimeInfo as w, KodaXSessionScope as x, KodaXSessionStorage as y, KodaXSessionTreeNode as z };
@@ -1,6 +1,6 @@
1
- import { l as BashPrefixExtractor, W as KodaXOptions, x as KodaXContextTokenSnapshot, K as KodaXAgentMode, $ as KodaXRepoIntelligenceMode, A as AgentsFile, i as AutoModeStats, aa as KodaXSkillInvocationContext, T as KodaXMcpServersConfig } from './bash-prefix-extractor.d-DMrGImMl.js';
2
- import { a as SessionStorage$1 } from './storage.d-DPAEX7zS.js';
3
- import { u as KodaXSessionStorage, k as KodaXSessionData, w as KodaXSessionUiHistoryItem, o as KodaXSessionLineage, h as KodaXSessionArtifactLedgerEntry, s as KodaXSessionRuntimeInfo } from './types.d-mM8vqvhT.js';
1
+ import { l as BashPrefixExtractor, a1 as KodaXOptions, L as KodaXContextTokenSnapshot, K as KodaXAgentMode, a6 as KodaXRepoIntelligenceMode, A as AgentsFile, i as AutoModeStats, ah as KodaXSkillInvocationContext, _ as KodaXMcpServersConfig } from './bash-prefix-extractor.d-HrTUwtV7.js';
2
+ import { a as SessionStorage$1 } from './storage.d-BvTdjYQF.js';
3
+ import { y as KodaXSessionStorage, n as KodaXSessionData, A as KodaXSessionUiHistoryItem, s as KodaXSessionLineage, k as KodaXSessionArtifactLedgerEntry, w as KodaXSessionRuntimeInfo } from './types.d-HBbWT-iA.js';
4
4
  import { m as KodaXMessage, D as KodaXReasoningMode, q as KodaXProviderCapabilityProfile, E as KodaXReasoningOverride, h as KodaXCustomProviderConfig } from './types.d-B1uGoVTE.js';
5
5
  import * as readline from 'readline';
6
6
  import { SpawnSyncReturns } from 'child_process';
@@ -233,6 +233,8 @@ interface CurrentConfig {
233
233
  repointelEndpoint?: string;
234
234
  repointelBin?: string;
235
235
  repoIntelligenceTrace?: boolean;
236
+ /** FEATURE_102 Phase 3 — cross-provider child fallback chain. */
237
+ fallbackProviders?: string[];
236
238
  }
237
239
  type SessionLoadStatus = 'loaded' | 'missing' | 'blocked';
238
240
  type SessionBranchSwitchStatus = 'switched' | 'missing' | 'blocked';
@@ -479,6 +481,14 @@ declare function loadConfig(): {
479
481
  * Mirrored to env var `KODAX_STALL_LOG=1`.
480
482
  */
481
483
  stallLog?: boolean;
484
+ /**
485
+ * FEATURE_102 Phase 3 (v0.7.45) — ordered cross-provider fallback chain for
486
+ * child dispatch. When a child's primary provider is exhausted/down, the
487
+ * runtime re-runs it on the next provider here. Empty/absent = OFF. Mirrored
488
+ * to env var `KODAX_FALLBACK_PROVIDERS` (comma-separated) for the coding
489
+ * layer, which has no config access. Set via the `/fallback` command.
490
+ */
491
+ fallbackProviders?: string[];
482
492
  };
483
493
  declare function prepareRuntimeConfig(): ReturnType<typeof loadConfig>;
484
494
  declare function saveConfig(config: {
@@ -502,6 +512,8 @@ declare function saveConfig(config: {
502
512
  verifierLog?: boolean;
503
513
  /** FEATURE_187 Phase C — opt-in stall sidecar log line. */
504
514
  stallLog?: boolean;
515
+ /** FEATURE_102 Phase 3 — cross-provider child fallback chain. */
516
+ fallbackProviders?: string[];
505
517
  }): void;
506
518
  declare function getGitRoot(): Promise<string | null>;
507
519
  declare function rateLimitedCall<T>(fn: () => Promise<T>): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodax-ai/kodax",
3
- "version": "0.7.43",
3
+ "version": "0.7.45",
4
4
  "description": "极致轻量化 Coding Agent - TypeScript 实现,支持 12 个 LLM 提供商,可发布为免 Node 单文件二进制",
5
5
  "type": "module",
6
6
  "private": false,
@@ -53,7 +53,7 @@
53
53
  "scripts": {
54
54
  "build": "npm run build:packages && npm run build:bundle && npm run build:dts",
55
55
  "build:dts": "node scripts/build-dts.mjs",
56
- "build:packages": "tsc -b tsconfig.build.json && npm run copy:builtin -w @kodax-ai/agent",
56
+ "build:packages": "tsc -b tsconfig.build.json && npm run copy:builtin -w @kodax-ai/agent && npm run copy:provider-caps -w @kodax-ai/llm",
57
57
  "build:bundle": "node scripts/build-bundle.mjs",
58
58
  "dev": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_cli.ts",
59
59
  "dev:cli": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_cli.ts",