@kodax-ai/kodax 0.7.44 → 0.7.46

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 (52) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +6 -5
  3. package/README_CN.md +6 -5
  4. package/dist/builtin/skill-creator/scripts/utils.js +12 -27
  5. package/dist/chunks/chunk-2GEKCIIW.js +31 -0
  6. package/dist/chunks/chunk-ARUWXX25.js +2 -0
  7. package/dist/chunks/chunk-JRT447X5.js +565 -0
  8. package/dist/chunks/chunk-K4RBLNSY.js +2 -0
  9. package/dist/chunks/chunk-VBIVZOSD.js +425 -0
  10. package/dist/chunks/{chunk-4YPL2UVZ.js → chunk-XUEINS3X.js} +253 -252
  11. package/dist/chunks/{chunk-RUDYNAK7.js → chunk-Z4UT32NN.js} +1 -1
  12. package/dist/chunks/{compaction-config-NAPRF7XR.js → compaction-config-PFTBIGQT.js} +1 -1
  13. package/dist/chunks/{construction-bootstrap-PHTGBRNU.js → construction-bootstrap-2FKNOZZE.js} +1 -1
  14. package/dist/chunks/devtools-4CRULTR2.js +2 -0
  15. package/dist/chunks/devtools-YINBSZC7.js +2 -0
  16. package/dist/chunks/dist-JLMKDPEL.js +2 -0
  17. package/dist/chunks/dist-QTV5M2JW.js +2 -0
  18. package/dist/chunks/{utils-TV3UYCHQ.js → utils-LY3LB65Z.js} +1 -1
  19. package/dist/index.d.ts +11 -11
  20. package/dist/index.js +2 -2
  21. package/dist/kodax_cli.js +913 -863
  22. package/dist/provider-capabilities.json +46 -18
  23. package/dist/sdk-agent.d.ts +55 -10
  24. package/dist/sdk-agent.js +1 -1
  25. package/dist/sdk-coding.d.ts +31 -13
  26. package/dist/sdk-coding.js +1 -1
  27. package/dist/sdk-llm.d.ts +84 -7
  28. package/dist/sdk-llm.js +1 -1
  29. package/dist/sdk-mcp.js +1 -1
  30. package/dist/sdk-repl.d.ts +19 -9
  31. package/dist/sdk-repl.js +2 -2
  32. package/dist/sdk-session.d.ts +27 -6
  33. package/dist/sdk-session.js +1 -1
  34. package/dist/sdk-skills.js +1 -1
  35. package/dist/types-chunks/{base.d-FUJahC0i.d.ts → base.d-BdJKSPO2.d.ts} +18 -1
  36. package/dist/types-chunks/{bash-prefix-extractor.d-DdoSeghD.d.ts → bash-prefix-extractor.d-BICYx8pt.d.ts} +184 -141
  37. package/dist/types-chunks/{file-tracker.d-DOfaoCbJ.d.ts → file-tracker.d-BNTIvsdb.d.ts} +11 -4
  38. package/dist/types-chunks/{resolver.d-B7ZnVuuf.d.ts → resolver.d-DkgJlEzr.d.ts} +80 -4
  39. package/dist/types-chunks/storage.d-B1Jk6ryM.d.ts +202 -0
  40. package/dist/types-chunks/{types.d-HBbWT-iA.d.ts → types.d-B_MIIApc.d.ts} +1 -1
  41. package/dist/types-chunks/{types.d-B1uGoVTE.d.ts → types.d-Cf-GCzac.d.ts} +82 -1
  42. package/dist/types-chunks/{types.d-DM8zEJgF.d.ts → types.d-D2RNa5Y7.d.ts} +2 -2
  43. package/dist/types-chunks/{utils.d-C5fzCE9W.d.ts → utils.d-pzHPkrb8.d.ts} +31 -5
  44. package/package.json +1 -1
  45. package/dist/chunks/chunk-35BDEEC5.js +0 -2
  46. package/dist/chunks/chunk-DI2G3YWL.js +0 -31
  47. package/dist/chunks/chunk-HHQ7YTGM.js +0 -425
  48. package/dist/chunks/chunk-QHILHQBB.js +0 -519
  49. package/dist/chunks/devtools-EYGFOXEU.js +0 -2
  50. package/dist/chunks/dist-CCYBJJZY.js +0 -2
  51. package/dist/chunks/dist-RHIHZAYX.js +0 -2
  52. package/dist/types-chunks/storage.d-DFD9ln5c.d.ts +0 -115
@@ -1,9 +1,9 @@
1
- import { g as KodaXGoalState, s as KodaXSessionLineage, x as KodaXSessionScope, y as KodaXSessionStorage, i as KodaXJsonValue, k as KodaXSessionArtifactLedgerEntry, S as SessionErrorMetadata } from './types.d-HBbWT-iA.js';
2
- import { W as KodaXTokenUsage, m as KodaXMessage, D as KodaXReasoningMode, k as KodaXHarnessProfile, R as KodaXTaskWorkIntent, H as KodaXReviewScale, N as KodaXTaskComplexity, a as KodaXAmaFanoutClass, P as KodaXTaskRoutingDecision, Q as KodaXTaskType, I as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-B1uGoVTE.js';
3
- import { f as AgentMessage, av as StopHookFn, C as ChildTaskRegistry, p as CompactionUpdate, v as Guardrail, s as DiscoveredInstance, az as TaskAbortRegistry, aa as RunnerToolCall, aE as ToolGuardrail } from './types.d-DM8zEJgF.js';
4
1
  import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-BfJUXxC0.js';
2
+ import { g as KodaXGoalState, s as KodaXSessionLineage, x as KodaXSessionScope, y as KodaXSessionStorage, i as KodaXJsonValue, k as KodaXSessionArtifactLedgerEntry, S as SessionErrorMetadata } from './types.d-B_MIIApc.js';
3
+ import { X as KodaXTokenUsage, n as KodaXMessage, E as KodaXReasoningMode, k as KodaXHarnessProfile, S as KodaXTaskWorkIntent, I as KodaXReviewScale, O as KodaXTaskComplexity, a as KodaXAmaFanoutClass, Q as KodaXTaskRoutingDecision, R as KodaXTaskType, J as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-Cf-GCzac.js';
4
+ import { f as AgentMessage, av as StopHookFn, C as ChildTaskRegistry, p as CompactionUpdate, v as Guardrail, s as DiscoveredInstance, az as TaskAbortRegistry, aa as RunnerToolCall, aE as ToolGuardrail } from './types.d-D2RNa5Y7.js';
5
5
  import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
6
- import { K as KodaXBaseProvider } from './base.d-FUJahC0i.js';
6
+ import { K as KodaXBaseProvider } from './base.d-BdJKSPO2.js';
7
7
  import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
8
8
 
9
9
  /**
@@ -790,6 +790,162 @@ interface ProviderResiliencePolicy extends ProviderResilienceConfig {
790
790
  provider: string;
791
791
  }
792
792
 
793
+ /**
794
+ * FEATURE_200 Phase F (v0.7.45) — MCP domain types extracted from types.ts.
795
+ * Thin KodaX-facing aliases over the @kodax-ai/agent MCP types. Re-exported
796
+ * from ../types.ts so all `../types` importers are unaffected.
797
+ */
798
+
799
+ type KodaXMcpTransport = McpTransportKind;
800
+ type KodaXMcpConnectMode = McpConnectMode;
801
+ type KodaXMcpServerConfig = McpServerConfig;
802
+ /** Flat map of MCP server configs, keyed under `mcpServers` in config.json. */
803
+ type KodaXMcpServersConfig = McpServersConfig;
804
+
805
+ /**
806
+ * FEATURE_200 Phase F (v0.7.45) — Todo domain types extracted from types.ts.
807
+ * Self-contained (no other coding-type deps); re-exported from ../types.ts
808
+ * so all `../types` importers are unaffected.
809
+ */
810
+ /**
811
+ * Status of a planned todo item. Lifecycle: pending → in_progress →
812
+ * (completed | failed | skipped). Failed items are reset to pending
813
+ * when the next iteration begins (Evaluator revise verdict). Skipped
814
+ * is for Planner-side merging of two obligations into one.
815
+ */
816
+ type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'skipped' | 'cancelled';
817
+ /**
818
+ * FEATURE_114 v0.7.36: Per-step deterministic evaluator hint. When a
819
+ * todo item carries an `evaluator`, the runner runs the corresponding
820
+ * deterministic check (build / test / lint) at the moment its status
821
+ * transitions to `completed`. Failure surfaces stderr in the next
822
+ * tool result so the Worker can self-correct. No LLM-as-judge
823
+ * variant — Phase 0.7 industry survey said 4/4 codebases reject
824
+ * per-step LLM verification.
825
+ */
826
+ type TodoEvaluatorHint = 'build' | 'test' | 'lint';
827
+ /**
828
+ * One row in the planner-produced todo list. Subject is the short
829
+ * imperative title (shown in the UI row + throttle reminder); the
830
+ * optional description carries fuller context for downstream consumers
831
+ * that need the full work instruction. Sourced from Scout's existing
832
+ * `executionObligations: string[]` payload (each string becomes the
833
+ * `subject` of one seed item, no `description`). Status is advanced
834
+ * via the `todo_update` tool by Scout (H0 path) / Worker / Generator /
835
+ * Planner.
836
+ *
837
+ * v0.7.42 — `content` field renamed to `subject` to match claudecode V2
838
+ * `TaskSchema` (TaskCreateTool's required `subject` + `description`
839
+ * pair). KodaX makes `description` optional because trivial single-line
840
+ * steps don't need it; weaker models reach the API more easily without
841
+ * the forced second-string burden.
842
+ *
843
+ * `owner` partitions the list when child agents run in parallel under
844
+ * `dispatch_child_task`; "main" is the parent thread.
845
+ */
846
+ interface TodoItem {
847
+ readonly id: string;
848
+ /** Brief imperative title — the row label users see in the plan list. */
849
+ readonly subject: string;
850
+ /**
851
+ * Optional fuller description / context. Read by the executing role
852
+ * when picking up an item (claudecode V2 `TaskGet`-style detail view).
853
+ * Not rendered in the compact plan-list row.
854
+ */
855
+ readonly description?: string;
856
+ readonly status: TodoStatus;
857
+ readonly owner?: string;
858
+ /** Index into the originating `executionObligations: string[]` array (0-based). */
859
+ readonly sourceObligationIndex?: number;
860
+ /** Optional note attached on a status transition (e.g. failure reason). */
861
+ readonly note?: string;
862
+ /**
863
+ * FEATURE_114 v0.7.36: per-step deterministic evaluator hint. When
864
+ * present, the runner runs the corresponding deterministic check on
865
+ * `pending → completed` and surfaces stderr / exit code in the next
866
+ * tool result on failure.
867
+ */
868
+ readonly evaluator?: TodoEvaluatorHint;
869
+ /**
870
+ * FEATURE_149 v0.7.38 (Slice C4) — present-continuous form of `content`,
871
+ * used by the spinner status line while this item is `in_progress`.
872
+ * Mirrors Claude Code's [`Spinner.tsx:169`](c:/Works/claudecode/src/components/Spinner.tsx#L169)
873
+ * `currentTodo?.activeForm` lookup. Examples:
874
+ * content: "Run failing test" → activeForm: "Running failing test"
875
+ * content: "Refactor auth" → activeForm: "Refactoring auth"
876
+ * content: "Verify build" → activeForm: "Verifying build"
877
+ *
878
+ * Optional. When absent, the spinner falls back to a generic verb (no
879
+ * regression vs pre-FEATURE_149 behavior). When the LLM provides
880
+ * activeForm via `todo_update`, the spinner picks it up live without
881
+ * waiting for the round to end — that's the user-visible "working on X
882
+ * now" feel CC achieves.
883
+ */
884
+ readonly activeForm?: string;
885
+ /**
886
+ * FEATURE_170 v0.7.41 — opaque per-task metadata bag carried alongside
887
+ * the item. Surface for downstream consumers (extension hooks, eval
888
+ * harnesses, future swarm features) to attach arbitrary structured
889
+ * context without forcing a schema change. UI does NOT render this.
890
+ * Empty / undefined when the LLM does not supply it.
891
+ */
892
+ readonly metadata?: Record<string, unknown>;
893
+ }
894
+ type TodoList = readonly TodoItem[];
895
+
896
+ /**
897
+ * FEATURE_200 Phase F (v0.7.45) — repo-intelligence domain types extracted
898
+ * from types.ts. Self-contained; re-exported from ../types.ts (and 4 members
899
+ * re-imported there for internal use). `../types` importers unaffected.
900
+ */
901
+ type KodaXRepoIntelligenceMode = 'auto' | 'off' | 'oss' | 'premium-shared' | 'premium-native';
902
+ type KodaXRepoIntelligenceResolvedMode = 'off' | 'oss' | 'premium-shared' | 'premium-native';
903
+ interface KodaXRepoIntelligenceCapability {
904
+ mode: KodaXRepoIntelligenceResolvedMode;
905
+ engine: 'oss' | 'premium';
906
+ bridge: 'none' | 'shared' | 'native';
907
+ level: 'basic' | 'enhanced';
908
+ status: 'ok' | 'limited' | 'unavailable' | 'warming';
909
+ warnings: string[];
910
+ contractVersion?: number;
911
+ }
912
+ interface KodaXRepoIntelligenceTrace {
913
+ mode: KodaXRepoIntelligenceResolvedMode;
914
+ engine: 'oss' | 'premium';
915
+ bridge: 'none' | 'shared' | 'native';
916
+ triggeredAt: string;
917
+ source: 'fallback' | 'premium';
918
+ daemonLatencyMs?: number;
919
+ cliLatencyMs?: number;
920
+ cacheHit?: boolean;
921
+ capsuleBytes?: number;
922
+ capsuleEstimatedTokens?: number;
923
+ }
924
+ /**
925
+ * Repo-intelligence retrieval trace event. Emitted by agent / managed-task
926
+ * pipelines (`emitRepoIntelligenceTrace` / `emitManagedRepoIntelligenceTrace`)
927
+ * at `routing` / `preturn` / `module` / `impact` / `task-snapshot` stages,
928
+ * consumed by REPL `json-events` (stdout JSONL contract), `cli-events`
929
+ * (interactive REPL), and `acp_server`.
930
+ *
931
+ * Note: FEATURE_083 (v0.7.24) initially marked this as superseded by
932
+ * `EvidenceSpan` in `@kodax-ai/agent`. **FEATURE_086 (v0.7.27) re-evaluated
933
+ * and retained it**: `EvidenceSpanData` is a generic
934
+ * `{ source, queryPreview?, resultCount?, cacheHit?, error? }` abstraction
935
+ * that does not carry the repo-intelligence-specific `stage` enum,
936
+ * `capability`, or `trace` bundle. The `stage` enum in particular is a
937
+ * typed contract that UI consumers (json-events schema) depend on;
938
+ * flattening it into a bag of attributes would drop type safety and break
939
+ * downstream script compatibility. This type is therefore a product
940
+ * feature of repo-intelligence, not legacy trace plumbing.
941
+ */
942
+ interface KodaXRepoIntelligenceTraceEvent {
943
+ stage: 'routing' | 'preturn' | 'module' | 'impact' | 'task-snapshot';
944
+ summary: string;
945
+ capability?: KodaXRepoIntelligenceCapability;
946
+ trace?: KodaXRepoIntelligenceTrace;
947
+ }
948
+
793
949
  interface KodaXEvents {
794
950
  onTextDelta?: (text: string) => void;
795
951
  onThinkingDelta?: (text: string) => void;
@@ -1008,6 +1164,22 @@ interface KodaXSessionOptions {
1008
1164
  scope?: KodaXSessionScope;
1009
1165
  storage?: KodaXSessionStorage;
1010
1166
  initialMessages?: KodaXMessage[];
1167
+ /**
1168
+ * Persistence ownership signal (FEATURE_173 dual-writer fix).
1169
+ *
1170
+ * When `true`, a higher-level host (the interactive REPL) owns writing
1171
+ * this session to `storage` — it persists the full lineage / uiHistory /
1172
+ * artifactLedger incrementally via `appendSessionDelta`. The runner MUST
1173
+ * NOT also snapshot the session: `saveSessionSnapshot` early-returns so
1174
+ * the runner's flat full-rewrite `storage.save` can never race / clobber
1175
+ * the host's richer incremental writes (which regressed `activeEntryId`
1176
+ * to the first round on resume).
1177
+ *
1178
+ * `storage` is still consulted for LOAD (resume / `resolveInitialMessages`
1179
+ * tier 2). When absent (print CLI, ACP, SDK headless), the runner remains
1180
+ * the sole writer — unchanged behaviour, fail-safe default.
1181
+ */
1182
+ persistedByHost?: boolean;
1011
1183
  }
1012
1184
  interface KodaXContextTokenSnapshot {
1013
1185
  /** Current best-known token count for the full conversation context. */
@@ -1030,143 +1202,6 @@ interface KodaXProviderPolicyHints {
1030
1202
  workIntent?: KodaXTaskWorkIntent;
1031
1203
  }
1032
1204
 
1033
- type KodaXMcpTransport = McpTransportKind;
1034
- type KodaXMcpConnectMode = McpConnectMode;
1035
- type KodaXMcpServerConfig = McpServerConfig;
1036
- /** Flat map of MCP server configs, keyed under `mcpServers` in config.json. */
1037
- type KodaXMcpServersConfig = McpServersConfig;
1038
- type KodaXRepoIntelligenceMode = 'auto' | 'off' | 'oss' | 'premium-shared' | 'premium-native';
1039
- type KodaXRepoIntelligenceResolvedMode = 'off' | 'oss' | 'premium-shared' | 'premium-native';
1040
- interface KodaXRepoIntelligenceCapability {
1041
- mode: KodaXRepoIntelligenceResolvedMode;
1042
- engine: 'oss' | 'premium';
1043
- bridge: 'none' | 'shared' | 'native';
1044
- level: 'basic' | 'enhanced';
1045
- status: 'ok' | 'limited' | 'unavailable' | 'warming';
1046
- warnings: string[];
1047
- contractVersion?: number;
1048
- }
1049
- interface KodaXRepoIntelligenceTrace {
1050
- mode: KodaXRepoIntelligenceResolvedMode;
1051
- engine: 'oss' | 'premium';
1052
- bridge: 'none' | 'shared' | 'native';
1053
- triggeredAt: string;
1054
- source: 'fallback' | 'premium';
1055
- daemonLatencyMs?: number;
1056
- cliLatencyMs?: number;
1057
- cacheHit?: boolean;
1058
- capsuleBytes?: number;
1059
- capsuleEstimatedTokens?: number;
1060
- }
1061
- /**
1062
- * Repo-intelligence retrieval trace event. Emitted by agent / managed-task
1063
- * pipelines (`emitRepoIntelligenceTrace` / `emitManagedRepoIntelligenceTrace`)
1064
- * at `routing` / `preturn` / `module` / `impact` / `task-snapshot` stages,
1065
- * consumed by REPL `json-events` (stdout JSONL contract), `cli-events`
1066
- * (interactive REPL), and `acp_server`.
1067
- *
1068
- * Note: FEATURE_083 (v0.7.24) initially marked this as superseded by
1069
- * `EvidenceSpan` in `@kodax-ai/agent`. **FEATURE_086 (v0.7.27) re-evaluated
1070
- * and retained it**: `EvidenceSpanData` is a generic
1071
- * `{ source, queryPreview?, resultCount?, cacheHit?, error? }` abstraction
1072
- * that does not carry the repo-intelligence-specific `stage` enum,
1073
- * `capability`, or `trace` bundle. The `stage` enum in particular is a
1074
- * typed contract that UI consumers (json-events schema) depend on;
1075
- * flattening it into a bag of attributes would drop type safety and break
1076
- * downstream script compatibility. This type is therefore a product
1077
- * feature of repo-intelligence, not legacy trace plumbing.
1078
- */
1079
- interface KodaXRepoIntelligenceTraceEvent {
1080
- stage: 'routing' | 'preturn' | 'module' | 'impact' | 'task-snapshot';
1081
- summary: string;
1082
- capability?: KodaXRepoIntelligenceCapability;
1083
- trace?: KodaXRepoIntelligenceTrace;
1084
- }
1085
- /**
1086
- * Status of a planned todo item. Lifecycle: pending → in_progress →
1087
- * (completed | failed | skipped). Failed items are reset to pending
1088
- * when the next iteration begins (Evaluator revise verdict). Skipped
1089
- * is for Planner-side merging of two obligations into one.
1090
- */
1091
- type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'skipped' | 'cancelled';
1092
- /**
1093
- * FEATURE_114 v0.7.36: Per-step deterministic evaluator hint. When a
1094
- * todo item carries an `evaluator`, the runner runs the corresponding
1095
- * deterministic check (build / test / lint) at the moment its status
1096
- * transitions to `completed`. Failure surfaces stderr in the next
1097
- * tool result so the Worker can self-correct. No LLM-as-judge
1098
- * variant — Phase 0.7 industry survey said 4/4 codebases reject
1099
- * per-step LLM verification.
1100
- */
1101
- type TodoEvaluatorHint = 'build' | 'test' | 'lint';
1102
- /**
1103
- * One row in the planner-produced todo list. Subject is the short
1104
- * imperative title (shown in the UI row + throttle reminder); the
1105
- * optional description carries fuller context for downstream consumers
1106
- * that need the full work instruction. Sourced from Scout's existing
1107
- * `executionObligations: string[]` payload (each string becomes the
1108
- * `subject` of one seed item, no `description`). Status is advanced
1109
- * via the `todo_update` tool by Scout (H0 path) / Worker / Generator /
1110
- * Planner.
1111
- *
1112
- * v0.7.42 — `content` field renamed to `subject` to match claudecode V2
1113
- * `TaskSchema` (TaskCreateTool's required `subject` + `description`
1114
- * pair). KodaX makes `description` optional because trivial single-line
1115
- * steps don't need it; weaker models reach the API more easily without
1116
- * the forced second-string burden.
1117
- *
1118
- * `owner` partitions the list when child agents run in parallel under
1119
- * `dispatch_child_task`; "main" is the parent thread.
1120
- */
1121
- interface TodoItem {
1122
- readonly id: string;
1123
- /** Brief imperative title — the row label users see in the plan list. */
1124
- readonly subject: string;
1125
- /**
1126
- * Optional fuller description / context. Read by the executing role
1127
- * when picking up an item (claudecode V2 `TaskGet`-style detail view).
1128
- * Not rendered in the compact plan-list row.
1129
- */
1130
- readonly description?: string;
1131
- readonly status: TodoStatus;
1132
- readonly owner?: string;
1133
- /** Index into the originating `executionObligations: string[]` array (0-based). */
1134
- readonly sourceObligationIndex?: number;
1135
- /** Optional note attached on a status transition (e.g. failure reason). */
1136
- readonly note?: string;
1137
- /**
1138
- * FEATURE_114 v0.7.36: per-step deterministic evaluator hint. When
1139
- * present, the runner runs the corresponding deterministic check on
1140
- * `pending → completed` and surfaces stderr / exit code in the next
1141
- * tool result on failure.
1142
- */
1143
- readonly evaluator?: TodoEvaluatorHint;
1144
- /**
1145
- * FEATURE_149 v0.7.38 (Slice C4) — present-continuous form of `content`,
1146
- * used by the spinner status line while this item is `in_progress`.
1147
- * Mirrors Claude Code's [`Spinner.tsx:169`](c:/Works/claudecode/src/components/Spinner.tsx#L169)
1148
- * `currentTodo?.activeForm` lookup. Examples:
1149
- * content: "Run failing test" → activeForm: "Running failing test"
1150
- * content: "Refactor auth" → activeForm: "Refactoring auth"
1151
- * content: "Verify build" → activeForm: "Verifying build"
1152
- *
1153
- * Optional. When absent, the spinner falls back to a generic verb (no
1154
- * regression vs pre-FEATURE_149 behavior). When the LLM provides
1155
- * activeForm via `todo_update`, the spinner picks it up live without
1156
- * waiting for the round to end — that's the user-visible "working on X
1157
- * now" feel CC achieves.
1158
- */
1159
- readonly activeForm?: string;
1160
- /**
1161
- * FEATURE_170 v0.7.41 — opaque per-task metadata bag carried alongside
1162
- * the item. Surface for downstream consumers (extension hooks, eval
1163
- * harnesses, future swarm features) to attach arbitrary structured
1164
- * context without forcing a schema change. UI does NOT render this.
1165
- * Empty / undefined when the LLM does not supply it.
1166
- */
1167
- readonly metadata?: Record<string, unknown>;
1168
- }
1169
- type TodoList = readonly TodoItem[];
1170
1205
  interface KodaXRepoRoutingSignals {
1171
1206
  workspaceRoot?: string;
1172
1207
  changedFileCount: number;
@@ -1290,6 +1325,14 @@ interface KodaXChildContextBundle {
1290
1325
  * preserves byte-identical v0.7.42 baseline dispatch behavior.
1291
1326
  */
1292
1327
  specialistName?: string;
1328
+ /**
1329
+ * FEATURE_102 Phase 2 (v0.7.45) — explicit per-dispatch provider/model the
1330
+ * dispatching agent chose for this child (e.g. a cross-family second review).
1331
+ * Priority in child-executor: `bundle.provider/model` > specialist's declared
1332
+ * model > parent default. Omitting both inherits the parent (byte-identical).
1333
+ */
1334
+ provider?: string;
1335
+ model?: string;
1293
1336
  }
1294
1337
  /**
1295
1338
  * FEATURE_120 v0.7.39 Phase 4 — model tier hint. Tier semantics:
@@ -1,6 +1,6 @@
1
- import { m as KodaXMessage } from './types.d-B1uGoVTE.js';
2
- import { f as AgentMessage, ag as SessionEntry, ae as Session, ah as SessionExtension, m as CompactionDetails, u as FileOperations } from './types.d-DM8zEJgF.js';
3
- import { s as KodaXSessionLineage, i as KodaXJsonValue, a as KodaXCompactMemorySeed, o as KodaXSessionEntry, z as KodaXSessionTreeNode, r as KodaXSessionLabelEntry, q as KodaXSessionGoalEntry, v as KodaXSessionNavigationOptions, k as KodaXSessionArtifactLedgerEntry } from './types.d-HBbWT-iA.js';
1
+ import { n as KodaXMessage } from './types.d-Cf-GCzac.js';
2
+ import { f as AgentMessage, ag as SessionEntry, ae as Session, ah as SessionExtension, m as CompactionDetails, u as FileOperations } from './types.d-D2RNa5Y7.js';
3
+ import { s as KodaXSessionLineage, i as KodaXJsonValue, a as KodaXCompactMemorySeed, o as KodaXSessionEntry, z as KodaXSessionTreeNode, r as KodaXSessionLabelEntry, q as KodaXSessionGoalEntry, v as KodaXSessionNavigationOptions, k as KodaXSessionArtifactLedgerEntry } from './types.d-B_MIIApc.js';
4
4
 
5
5
  /**
6
6
  * @kodax-ai/agent Constants
@@ -457,7 +457,14 @@ declare class LineageCompaction implements CompactionPolicy {
457
457
 
458
458
  /**
459
459
  * 生成会话 ID
460
- * 格式: YYYYMMDD_HHMMSS
460
+ * 格式: YYYYMMDD_HHMMSS_<suffix> (suffix = ms 低位 + 随机, base36)
461
+ *
462
+ * FEATURE_219 (v0.7.46): the date-prefix is preserved (sortable +
463
+ * human-readable), but a per-call suffix makes the id GLOBALLY unique.
464
+ * Under the pre-FEATURE_219 flat layout the filename collision silently
465
+ * masked two same-second sessions (overwrite risk); under the per-project
466
+ * directory layout the same id could otherwise exist in two project folders
467
+ * and make `loadSession(id)` ambiguous. See ADR-038 §7.
461
468
  */
462
469
  declare function generateSessionId(): Promise<string>;
463
470
  /**
@@ -1,6 +1,6 @@
1
- import { D as KodaXReasoningMode, U as KodaXThinkingBudgetMap, V as KodaXThinkingDepth, r as KodaXProviderConfig, C as KodaXReasoningCapability, F as KodaXReasoningRequest, Q as KodaXTaskType, E as KodaXReasoningOverride, X as KodaXToolDefinition, m as KodaXMessage, z as KodaXProviderStreamOptions, J as KodaXStreamResult, n as KodaXModelDescriptor, q as KodaXProviderCapabilityProfile, h as KodaXCustomProviderConfig } from './types.d-B1uGoVTE.js';
1
+ import { E as KodaXReasoningMode, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, s as KodaXProviderConfig, D as KodaXReasoningCapability, G as KodaXReasoningRequest, R as KodaXTaskType, F as KodaXReasoningOverride, a2 as KodaXVerifyCredentialResult, Y as KodaXToolDefinition, n as KodaXMessage, A as KodaXProviderStreamOptions, L as KodaXStreamResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, a3 as KodaXVerifyStrategy, h as KodaXCustomProviderConfig, m as KodaXListModelsResult } from './types.d-Cf-GCzac.js';
2
2
  import Anthropic from '@anthropic-ai/sdk';
3
- import { K as KodaXBaseProvider } from './base.d-FUJahC0i.js';
3
+ import { K as KodaXBaseProvider } from './base.d-BdJKSPO2.js';
4
4
  import OpenAI from 'openai';
5
5
 
6
6
  /**
@@ -64,6 +64,24 @@ declare abstract class KodaXAnthropicCompatProvider extends KodaXBaseProvider {
64
64
  protected client: Anthropic;
65
65
  protected initClient(): void;
66
66
  protected onStaleConnection(): void;
67
+ /**
68
+ * FEATURE_216 v0.7.45 — Lightweight credential verification.
69
+ * Dispatches by `this.config.verifyStrategy`:
70
+ * - `count-tokens` (default for Anthropic protocol): 0-token
71
+ * `messages.countTokens()` — empirically reliable across 5/5
72
+ * Anthropic-compat providers tested (anthropic / zhipu-coding /
73
+ * kimi-code / minimax-coding / ark-coding).
74
+ * - `models-list`: 0-token `models.list()` — supported by Anthropic
75
+ * SDK 0.80+; not used by any Anthropic built-in but available
76
+ * for custom providers that explicitly opt-in.
77
+ * - `minimal-message`: ~7-token `messages.create({max_tokens:1})`
78
+ * fallback for Anthropic-compat providers whose `count_tokens`
79
+ * endpoint returns 404 (mimo / mimo-coding empirically).
80
+ */
81
+ verifyCredential(opts?: {
82
+ timeoutMs?: number;
83
+ signal?: AbortSignal;
84
+ }): Promise<KodaXVerifyCredentialResult>;
67
85
  /**
68
86
  * FEATURE_116 (v0.7.37) — Wrap a string `system` prompt as a single
69
87
  * cacheable text block. v1 treats the entire system prompt as one cache
@@ -107,6 +125,26 @@ declare abstract class KodaXOpenAICompatProvider extends KodaXBaseProvider {
107
125
  protected client: OpenAI;
108
126
  protected initClient(): void;
109
127
  protected onStaleConnection(): void;
128
+ /**
129
+ * FEATURE_216 v0.7.45 — Lightweight credential verification.
130
+ * Dispatches by `this.config.verifyStrategy`:
131
+ * - `models-list` (default for OpenAI protocol): 0-token
132
+ * `models.list()` — empirically reliable for openai-compat
133
+ * providers where `/v1/models` gates on auth (kimi / qwen /
134
+ * deepseek confirmed). Verified by opencode `setup-recording-env.ts`
135
+ * for OPENAI_API_KEY proper.
136
+ * - `minimal-message`: ~6-token `chat.completions.create({max_tokens:1})`
137
+ * fallback for OpenAI-compat providers whose `/v1/models` is
138
+ * publicly accessible (zhipu — false-positive risk).
139
+ * - `count-tokens`: NOT supported on OpenAI protocol. Custom provider
140
+ * validator rejects this combo at config time; built-in providers
141
+ * never declare it. Orchestrator returns `unsupported` if it slips
142
+ * through, surfacing the misconfiguration.
143
+ */
144
+ verifyCredential(opts?: {
145
+ timeoutMs?: number;
146
+ signal?: AbortSignal;
147
+ }): Promise<KodaXVerifyCredentialResult>;
110
148
  /**
111
149
  * FEATURE_116 (v0.7.37) — Strip any `cache-boundary` markers from
112
150
  * KodaXMessage content arrays before they reach OpenAI wire
@@ -154,7 +192,7 @@ declare abstract class KodaXOpenAICompatProvider extends KodaXBaseProvider {
154
192
  * Provider 注册表 - 统一管理所有 Provider
155
193
  */
156
194
 
157
- type ProviderName = 'anthropic' | 'openai' | 'deepseek' | 'kimi' | 'kimi-code' | 'qwen' | 'zhipu' | 'zhipu-coding' | 'minimax-coding' | 'mimo-coding' | 'ark-coding' | 'gemini-cli' | 'codex-cli';
195
+ type ProviderName = 'anthropic' | 'openai' | 'deepseek' | 'kimi' | 'kimi-code' | 'qwen' | 'zhipu' | 'zhipu-coding' | 'minimax-coding' | 'mimo-coding' | 'mimo' | 'ark-coding' | 'gemini-cli' | 'codex-cli';
158
196
  /**
159
197
  * Per-provider static metadata. v0.7.43 promoted this from a partial
160
198
  * descriptor (`models: string[]`) to the full capability surface so
@@ -193,6 +231,12 @@ type ProviderSnapshot = {
193
231
  readonly thinkingBudgetCap?: number;
194
232
  /** Whether the provider supports `thinking_budget` / native reasoning. */
195
233
  readonly supportsThinking?: boolean;
234
+ /**
235
+ * FEATURE_216 v0.7.45 — Which verify primitive this provider supports
236
+ * for credential checks. Mirrors `provider-capabilities.types.ts`
237
+ * ProviderSnapshot's required field.
238
+ */
239
+ readonly verifyStrategy: KodaXVerifyStrategy;
196
240
  };
197
241
  declare const KODAX_PROVIDER_SNAPSHOTS: Record<ProviderName, ProviderSnapshot>;
198
242
  declare const KODAX_PROVIDERS: Record<string, () => KodaXBaseProvider>;
@@ -405,6 +449,38 @@ declare function resolveModelCapabilities(providerName: string, modelId: string)
405
449
  * checking `process.env[snapshot.apiKeyEnv]` if they care.
406
450
  */
407
451
  declare function listAllModelCapabilities(): KodaXModelCapabilities[];
452
+ /**
453
+ * FEATURE_216 v0.7.45 — Top-level lightweight credential verification
454
+ * for any registered provider (built-in / custom / runtime).
455
+ *
456
+ * Never throws. Short-circuits before hitting the provider ctor for:
457
+ * - unknown provider name → `unsupported`
458
+ * - cli-bridge / `verifyStrategy='unsupported'` → `unsupported`
459
+ * - env var missing → `unconfigured` (avoids the `getApiKey()` throw)
460
+ *
461
+ * Otherwise instantiates via `resolveProvider(name)` and delegates to
462
+ * `provider.verifyCredential(opts)`. Cost: 0 tokens (count-tokens /
463
+ * models-list strategies) or ~6-7 tokens (minimal-message strategy).
464
+ */
465
+ declare function verifyProviderCredential(name: string, opts?: {
466
+ timeoutMs?: number;
467
+ signal?: AbortSignal;
468
+ }): Promise<KodaXVerifyCredentialResult>;
469
+ /**
470
+ * FEATURE_216 v0.7.45 — Returns the static model list KodaX maintains
471
+ * for a provider. Distinct from credential verification: this is for
472
+ * model-picker UIs in SDK consumers. Sourced from
473
+ * `provider-capabilities.json` for built-in providers + the custom
474
+ * registry for user-configured ones. Always `source: 'static'` in
475
+ * v0.7.45 — KodaX-curated list is the authoritative source per
476
+ * FEATURE_198 ("KodaX self-maintained snapshot is the only reliable
477
+ * source" — upstream `/v1/models` is noisy/inconsistent across
478
+ * providers). Future versions may add an opt-in upstream refresh.
479
+ */
480
+ declare function listProviderModels(name: string, _opts?: {
481
+ timeoutMs?: number;
482
+ signal?: AbortSignal;
483
+ }): Promise<KodaXListModelsResult>;
408
484
 
409
- export { registerCustomProviders as $, getModelCapabilities as A, getProvider as B, getProviderConfiguredCapabilityProfile as C, getProviderConfiguredReasoningCapability as D, getProviderList as E, getProviderModel as F, getProviderModelDescriptors as G, getProviderModels as H, getReasoningCapability as I, getRuntimeModelProvider as J, KODAX_DEFAULT_PROVIDER as K, getRuntimeModelProviderNames as L, isCustomProviderName as M, isKnownProvider as N, isProviderConfigured as O, isProviderName as Q, isReasoningEnabled as R, isRuntimeModelProviderName as S, listAllModelCapabilities as T, listBuiltinModelCapabilities as U, listCustomProviderModelCapabilities as V, loadReasoningOverride as W, mapDepthToOpenAIReasoningEffort as X, normalizeReasoningRequest as Y, reasoningCapabilityToOverride as Z, reasoningOverrideToCapability as _, KODAX_DEFAULT_THINKING_BUDGETS as a, registerModelProvider as a0, resolveModelCapabilities as a1, resolveProvider as a2, resolveProviderModelDescriptors as a3, resolveThinkingBudget as a4, saveReasoningOverride as a5, validateCustomProviderConfig as a6, KODAX_PROVIDERS as b, KODAX_PROVIDER_SNAPSHOTS as c, KODAX_REASONING_MODE_SEQUENCE as d, KODAX_REASONING_SAFETY_RESERVE as e, KodaXAnthropicCompatProvider as f, KodaXError as g, KodaXNetworkError as i, KodaXOpenAICompatProvider as j, KodaXProviderError as k, KodaXRateLimitError as l, KodaXToolCallIdError as m, buildReasoningOverrideKey as n, clampThinkingBudget as o, clearReasoningOverride as p, clearRuntimeModelProviders as q, createCustomProvider as r, getAvailableProviderNames as s, getCustomModelCapabilities as t, getCustomProvider as u, getCustomProviderList as v, getCustomProviderModelDescriptors as w, getCustomProviderModels as x, getCustomProviderNames as y, getDefaultThinkingDepthForMode as z };
485
+ export { reasoningOverrideToCapability as $, getModelCapabilities as A, getProvider as B, getProviderConfiguredCapabilityProfile as C, getProviderConfiguredReasoningCapability as D, getProviderList as E, getProviderModel as F, getProviderModelDescriptors as G, getProviderModels as H, getReasoningCapability as I, getRuntimeModelProvider as J, KODAX_DEFAULT_PROVIDER as K, getRuntimeModelProviderNames as L, isCustomProviderName as M, isKnownProvider as N, isProviderConfigured as O, isProviderName as Q, isReasoningEnabled as R, isRuntimeModelProviderName as S, listAllModelCapabilities as T, listBuiltinModelCapabilities as U, listCustomProviderModelCapabilities as V, listProviderModels as W, loadReasoningOverride as X, mapDepthToOpenAIReasoningEffort as Y, normalizeReasoningRequest as Z, reasoningCapabilityToOverride as _, KODAX_DEFAULT_THINKING_BUDGETS as a, registerCustomProviders as a0, registerModelProvider as a1, resolveModelCapabilities as a2, resolveProvider as a3, resolveProviderModelDescriptors as a4, resolveThinkingBudget as a5, saveReasoningOverride as a6, validateCustomProviderConfig as a7, verifyProviderCredential as a8, KODAX_PROVIDERS as b, KODAX_PROVIDER_SNAPSHOTS as c, KODAX_REASONING_MODE_SEQUENCE as d, KODAX_REASONING_SAFETY_RESERVE as e, KodaXAnthropicCompatProvider as f, KodaXError as g, KodaXNetworkError as i, KodaXOpenAICompatProvider as j, KodaXProviderError as k, KodaXRateLimitError as l, KodaXToolCallIdError as m, buildReasoningOverrideKey as n, clampThinkingBudget as o, clearReasoningOverride as p, clearRuntimeModelProviders as q, createCustomProvider as r, getAvailableProviderNames as s, getCustomModelCapabilities as t, getCustomProvider as u, getCustomProviderList as v, getCustomProviderModelDescriptors as w, getCustomProviderModels as x, getCustomProviderNames as y, getDefaultThinkingDepthForMode as z };
410
486
  export type { ProviderName as P, KodaXModelCapabilities as h };