@kodax-ai/kodax 0.7.44 → 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.
- package/CHANGELOG.md +49 -0
- package/README.md +6 -5
- package/README_CN.md +6 -5
- package/dist/chunks/chunk-CZHIUJQS.js +535 -0
- package/dist/chunks/{chunk-RUDYNAK7.js → chunk-FKB7BWQT.js} +1 -1
- package/dist/chunks/chunk-FT2XFFNP.js +2 -0
- package/dist/chunks/{chunk-HHQ7YTGM.js → chunk-IJUB7QXG.js} +57 -57
- package/dist/chunks/{chunk-DI2G3YWL.js → chunk-PGF5EZ7C.js} +12 -12
- package/dist/chunks/{chunk-4YPL2UVZ.js → chunk-X6EHEQWP.js} +253 -252
- package/dist/chunks/{compaction-config-NAPRF7XR.js → compaction-config-WCNGYWT3.js} +1 -1
- package/dist/chunks/{construction-bootstrap-PHTGBRNU.js → construction-bootstrap-OB5SDNBD.js} +1 -1
- package/dist/chunks/dist-C2VOGY5Z.js +2 -0
- package/dist/chunks/{dist-RHIHZAYX.js → dist-Q2PQM7U7.js} +1 -1
- package/dist/chunks/{utils-TV3UYCHQ.js → utils-CHXCBR3Q.js} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +746 -726
- package/dist/provider-capabilities.json +18 -4
- package/dist/sdk-agent.d.ts +47 -2
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +23 -5
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +6 -5
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +1 -1
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-DdoSeghD.d.ts → bash-prefix-extractor.d-HrTUwtV7.d.ts} +181 -138
- package/dist/types-chunks/{resolver.d-B7ZnVuuf.d.ts → resolver.d-OMwxURit.d.ts} +1 -1
- package/dist/types-chunks/{storage.d-DFD9ln5c.d.ts → storage.d-BvTdjYQF.d.ts} +12 -0
- package/dist/types-chunks/{utils.d-C5fzCE9W.d.ts → utils.d-DSEX6Rq1.d.ts} +14 -2
- package/package.json +1 -1
- package/dist/chunks/chunk-35BDEEC5.js +0 -2
- package/dist/chunks/chunk-QHILHQBB.js +0 -519
- package/dist/chunks/dist-CCYBJJZY.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-BfJUXxC0.js';
|
|
1
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-HBbWT-iA.js';
|
|
2
3
|
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
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-DM8zEJgF.js';
|
|
4
|
-
import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-BfJUXxC0.js';
|
|
5
5
|
import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
|
|
6
6
|
import { K as KodaXBaseProvider } from './base.d-FUJahC0i.js';
|
|
7
7
|
import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
|
|
@@ -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:
|
|
@@ -154,7 +154,7 @@ 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
159
|
* Per-provider static metadata. v0.7.43 promoted this from a partial
|
|
160
160
|
* descriptor (`models: string[]`) to the full capability surface so
|
|
@@ -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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { a as SessionStorage$1 } from './storage.d-
|
|
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
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';
|
|
@@ -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,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{ic as A,kc as T}from"./chunk-4YPL2UVZ.js";import{S as w,T as S,U as L,V as x,W as I,X as h,ca as O,da as m,ga as b,qa as R}from"./chunk-DI2G3YWL.js";import{va as k}from"./chunk-HHQ7YTGM.js";import{a as i}from"./chunk-V4WSBIXB.js";import a from"fs";import c from"path";import{exec as j,spawnSync as z}from"child_process";import{promisify as U}from"util";import{fileURLToPath as q}from"url";var E="en";function H(){return(process.env.LC_ALL||process.env.LC_MESSAGES||process.env.LANG||"").toLowerCase().startsWith("zh")?"zh":"en"}i(H,"detectSystemLocale");function M(e){if(!e||e==="auto"){E=H();return}E=e.toLowerCase().replace(/[-_].*/,"")==="zh"?"zh":"en"}i(M,"setLocale");var D={en:{"dialog.confirm":"[Confirm]","dialog.select":"[Select]","dialog.input":"[Input]","confirm.instruction.basic":"Press (y) yes, (n) no","confirm.instruction.always":"Press (y) yes, (a) always yes for this tool, (n) no","confirm.instruction.protected":"Press (y) to confirm, (n) to cancel (protected path)","confirm.result.approved":"Approved","confirm.result.approved_always":"Approved (always)","confirm.result.denied":"Denied","tool.bash.title":"Execute bash command?","tool.shell.title":"Execute shell command?","tool.write.title":"Write to file?","tool.edit.title":"Edit file?","tool.generic.title":"Execute {tool}?","field.reason":"Reason","field.intent":"Intent","field.target":"Target","field.scope":"Scope","field.risk":"Risk","field.summary":"Summary","intent.read":"Read project files","intent.delete":"Delete files","intent.deps":"Modify dependencies or environment","intent.modify":"Modify files","intent.execute":"Execute command","intent.write_file":"Write file","intent.edit_file":"Edit file","intent.use_tool":"Use {tool}","risk.destructive":"Destructive change","risk.deps":"May change dependencies or local tools","risk.modify":"May modify files","risk.unknown":"Command effects depend on its arguments","risk.network":"May access network","scope.outside":"Outside project","scope.protected":"Protected path","waiting.confirm":"Waiting: approval required","waiting.select":"Waiting: choose an option","waiting.input":"Waiting: answer the prompt","placeholder.confirm":"Respond to the approval prompt above...","placeholder.select":"Choose an option above...","placeholder.input":"Answer the prompt above...","placeholder.busy":"Agent is busy...","placeholder.queue":"Queue a follow-up for the next round...","placeholder.idle":"Type a message...","select.choice":"Choice:","select.type_number":"(type a number)","select.more":"{count} more choices...","select.more_above":"\u2191 {count} more above","select.more_below":"\u2193 {count} more below","select.confirm_hint":"Press Enter to confirm, Esc to cancel","select.navigate_hint":"Use \u2191\u2193 to navigate, Enter to confirm, Esc to cancel","select.multiselect_hint":"Use \u2191\u2193 to navigate, Space to toggle, Enter to confirm, Esc to cancel","select.multiselect_empty":"Select at least one option with Space before confirming.","select.back_prev":"\u2190 Back to previous question","input.default":"Default:","input.value":"Value:","input.type_response":"(type your response)","managed.completed":"Task completed","managed.completed.blocked":"Task blocked","managed.completed.continuation":"Task needs continuation",cancelled:"[Cancelled] Operation cancelled by user"},zh:{"dialog.confirm":"[\u786E\u8BA4]","dialog.select":"[\u9009\u62E9]","dialog.input":"[\u8F93\u5165]","confirm.instruction.basic":"\u6309 (y) \u786E\u8BA4, (n) \u62D2\u7EDD","confirm.instruction.always":"\u6309 (y) \u786E\u8BA4, (a) \u59CB\u7EC8\u5141\u8BB8\u6B64\u5DE5\u5177, (n) \u62D2\u7EDD","confirm.instruction.protected":"\u6309 (y) \u786E\u8BA4, (n) \u53D6\u6D88 (\u53D7\u4FDD\u62A4\u8DEF\u5F84)","confirm.result.approved":"\u5DF2\u6279\u51C6","confirm.result.approved_always":"\u5DF2\u6279\u51C6 (\u59CB\u7EC8\u5141\u8BB8)","confirm.result.denied":"\u5DF2\u62D2\u7EDD","tool.bash.title":"\u6267\u884C bash \u547D\u4EE4\uFF1F","tool.shell.title":"\u6267\u884C shell \u547D\u4EE4\uFF1F","tool.write.title":"\u5199\u5165\u6587\u4EF6\uFF1F","tool.edit.title":"\u7F16\u8F91\u6587\u4EF6\uFF1F","tool.generic.title":"\u6267\u884C {tool}\uFF1F","field.reason":"\u539F\u56E0","field.intent":"\u610F\u56FE","field.target":"\u76EE\u6807","field.scope":"\u8303\u56F4","field.risk":"\u98CE\u9669","field.summary":"\u6458\u8981","intent.read":"\u8BFB\u53D6\u9879\u76EE\u6587\u4EF6","intent.delete":"\u5220\u9664\u6587\u4EF6","intent.deps":"\u4FEE\u6539\u4F9D\u8D56\u6216\u73AF\u5883","intent.modify":"\u4FEE\u6539\u6587\u4EF6","intent.execute":"\u6267\u884C\u547D\u4EE4","intent.write_file":"\u5199\u5165\u6587\u4EF6","intent.edit_file":"\u7F16\u8F91\u6587\u4EF6","intent.use_tool":"\u4F7F\u7528 {tool}","risk.destructive":"\u7834\u574F\u6027\u53D8\u66F4","risk.deps":"\u53EF\u80FD\u4FEE\u6539\u4F9D\u8D56\u6216\u672C\u5730\u5DE5\u5177","risk.modify":"\u53EF\u80FD\u4FEE\u6539\u6587\u4EF6","risk.unknown":"\u547D\u4EE4\u6548\u679C\u53D6\u51B3\u4E8E\u53C2\u6570","risk.network":"\u53EF\u80FD\u8BBF\u95EE\u7F51\u7EDC","scope.outside":"\u9879\u76EE\u5916\u90E8","scope.protected":"\u53D7\u4FDD\u62A4\u8DEF\u5F84","waiting.confirm":"\u7B49\u5F85\u4E2D\uFF1A\u9700\u8981\u5BA1\u6279","waiting.select":"\u7B49\u5F85\u4E2D\uFF1A\u8BF7\u9009\u62E9","waiting.input":"\u7B49\u5F85\u4E2D\uFF1A\u8BF7\u56DE\u7B54","placeholder.confirm":"\u8BF7\u56DE\u5E94\u4E0A\u65B9\u7684\u5BA1\u6279\u63D0\u793A...","placeholder.select":"\u8BF7\u5728\u4E0A\u65B9\u9009\u62E9\u4E00\u4E2A\u9009\u9879...","placeholder.input":"\u8BF7\u56DE\u7B54\u4E0A\u65B9\u7684\u63D0\u793A...","placeholder.busy":"\u4EE3\u7406\u6B63\u5728\u5DE5\u4F5C\u4E2D...","placeholder.queue":"\u6392\u961F\u7B49\u5F85\u4E0B\u4E00\u8F6E\u8DDF\u8FDB...","placeholder.idle":"\u8F93\u5165\u6D88\u606F...","select.choice":"\u9009\u9879\uFF1A","select.type_number":"(\u8F93\u5165\u7F16\u53F7)","select.more":"\u8FD8\u6709 {count} \u4E2A\u9009\u9879...","select.more_above":"\u2191 \u4E0A\u65B9\u8FD8\u6709 {count} \u4E2A","select.more_below":"\u2193 \u4E0B\u65B9\u8FD8\u6709 {count} \u4E2A","select.confirm_hint":"\u6309 Enter \u786E\u8BA4\uFF0CEsc \u53D6\u6D88","select.navigate_hint":"\u4F7F\u7528 \u2191\u2193 \u5BFC\u822A\uFF0CEnter \u786E\u8BA4\uFF0CEsc \u53D6\u6D88","select.multiselect_hint":"\u4F7F\u7528 \u2191\u2193 \u5BFC\u822A\uFF0C\u7A7A\u683C \u5207\u6362\u9009\u4E2D\uFF0CEnter \u786E\u8BA4\uFF0CEsc \u53D6\u6D88","select.multiselect_empty":"\u8BF7\u5148\u4F7F\u7528\u7A7A\u683C\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u9009\u9879\u3002","select.back_prev":"\u2190 \u8FD4\u56DE\u4E0A\u4E00\u9898","input.default":"\u9ED8\u8BA4\u503C\uFF1A","input.value":"\u503C\uFF1A","input.type_response":"(\u8F93\u5165\u4F60\u7684\u56DE\u7B54)","managed.completed":"\u4EFB\u52A1\u5B8C\u6210","managed.completed.blocked":"\u4EFB\u52A1\u53D7\u963B","managed.completed.continuation":"\u4EFB\u52A1\u9700\u8981\u7EE7\u7EED",cancelled:"[\u5DF2\u53D6\u6D88] \u64CD\u4F5C\u5DF2\u88AB\u7528\u6237\u53D6\u6D88"}};function me(e,t){let o=D[E][e]??D.en[e]??e;if(t)for(let[r,l]of Object.entries(t))o=o.replace(`{${r}}`,String(l));return o}i(me,"t");var W=U(j),X=k(),Se=c.join(X,"sessions"),p=c.join(X,"config.json"),Le=60,s=null,_=!1,J="dumb";function Q(e){let t=c.basename(e).toLowerCase(),n="__KODAX_SHELL_ENV_START__",o=`printf '%s\\0' '${n}'; env -0`;return t==="fish"?{args:["-i","-c",o],sentinel:n}:{args:t==="bash"||t==="zsh"?["-ic",o]:["-lc",o],sentinel:n}}i(Q,"buildShellEnvCommand");function Y(e,t){let n=`${t}\0`,o=e.lastIndexOf(n);if(o===-1)return{};let r=e.slice(o+n.length),l={};for(let u of r.split("\0")){if(!u)continue;let d=u.indexOf("=");d<=0||(l[u.slice(0,d)]=u.slice(d+1))}return l}i(Y,"parseNullDelimitedShellEnv");function Z(e={}){let t=e.env??process.env;if((e.platform??process.platform)==="win32"||t.KODAX_DISABLE_SHELL_ENV_HYDRATION==="1")return!1;let o=e.shell??t.SHELL;if(!o||!c.isAbsolute(o))return!1;let{args:r,sentinel:l}=Q(o),u=e.run??z,d={...t,TERM:J},f=u(o,r,{encoding:"utf8",env:d,maxBuffer:1024*1024,timeout:5e3,windowsHide:!0,detached:!0,stdio:["ignore","pipe","pipe"]});if(f.status!==0||!f.stdout)return!1;let B=typeof f.stdout=="string"?f.stdout:f.stdout.toString("utf8"),V=Y(B,l),C=!1;for(let[v,F]of Object.entries(V))v!=="TERM"&&t[v]===void 0&&(t[v]=F,C=!0);return C}i(Z,"hydrateProcessEnvFromShell");function ee(){if(!_){_=!0;try{Z()}catch{}}}i(ee,"ensureShellEnvironmentHydrated");function xe(){_=!1}i(xe,"resetShellEnvironmentHydrationForTesting");function te(e){O(e.customProviders??[])}i(te,"registerConfiguredCustomProviders");function $(e){if(!Array.isArray(e))return;let t=e.filter(n=>typeof n=="string").map(n=>n.trim()).filter(n=>n.length>0);return t.length>0?t:[]}i($,"normalizeConfiguredExtensions");function ne(e){if(e.permissionMode!=="default")return e;let t={...e,permissionMode:"accept-edits"};try{a.mkdirSync(c.dirname(p),{recursive:!0}),a.writeFileSync(p,JSON.stringify(t,null,2))}catch{}return t}i(ne,"migrateLegacyPermissionModeInConfig");function oe(){if(s)return s;let e="0.7.44";if(e)return s=e,s;let t=c.join(c.dirname(q(import.meta.url)),"../../package.json");if(a.existsSync(t))try{return s=JSON.parse(a.readFileSync(t,"utf-8")).version??"0.0.0",s??"0.0.0"}catch{}return s="0.0.0",s}i(oe,"getVersion");var Ie=oe();function Oe(e){return S(e)}i(Oe,"getProviderModel");function P(e,t){let n=new Set(e.map(r=>r.toLowerCase())),o=[...e];for(let r of t)n.has(r.toLowerCase())||o.push(r);return o}i(P,"mergeModels");function ie(e,t){t||(t=y().providerModels);let n=t?.[e];if(n&&n.length>0){try{let o=h(e);if(o.length>0)return P(n,o)}catch{}try{let o=m(e);if(o)return P(n,o.getAvailableModels())}catch{}return n}try{let o=h(e);if(o.length>0)return o}catch{}try{let o=m(e);if(o)return o.getAvailableModels()}catch{}return[]}i(ie,"getProviderAvailableModels");function re(e,t){let n=L(e,t);if(n!=="unknown")return n;try{let o=m(e);if(o)return o.getReasoningCapability(t)}catch{}return"unknown"}i(re,"getProviderReasoningCapability");function se(e){let t=x(e);if(t)return t;try{return b().find(o=>o.name===e)?.capabilityProfile??null}catch{return null}}i(se,"getProviderCapabilityProfile");function G(e,t){let n=se(e),o=re(e,t);if(n)return{capabilityProfile:n,reasoningCapability:o};try{let r=R(e);return{capabilityProfile:r.getCapabilityProfile(),reasoningCapability:r.getReasoningCapability(t)}}catch{return null}}i(G,"getProviderCapabilityMetadata");function Re(e,t){let n=G(e,t);return n?A({providerName:e,model:t,capabilityProfile:n.capabilityProfile,reasoningCapability:n.reasoningCapability==="unknown"?void 0:n.reasoningCapability}):null}i(Re,"getProviderCapabilitySnapshot");function ae(e,t,n,o){let r=G(e,t);return r?T({providerName:e,model:t,capabilityProfile:r.capabilityProfile,reasoningCapability:r.reasoningCapability==="unknown"?void 0:r.reasoningCapability,reasoningMode:n,hints:o}):null}i(ae,"getProviderPolicyDecision");function ke(e){let t=e.transport==="cli-bridge"?"CLI bridge":"Native API",n=e.conversationSemantics==="last-user-message"?"forwards only the latest user message":"preserves full conversation history",o=e.mcpSupport==="native"?"MCP available":"MCP unavailable";return`${t}; ${n}; ${o}`}i(ke,"describeProviderCapabilitySummary");function Ae(e){switch(e){case"native-budget":return"B";case"native-effort":return"E";case"native-toggle":return"T";default:return"-"}}i(Ae,"formatReasoningCapabilityShort");function ce(e){switch(e){case"native-budget":return"budget";case"native-effort":return"effort";case"native-toggle":return"toggle";default:return"none"}}i(ce,"describeReasoningCapabilityControl");function Te(e,t){if(e==="off")return"Reasoning disabled";switch(t){case"native-budget":return"Uses native thinking budget control";case"native-effort":return"Uses native reasoning effort control";case"native-toggle":return"Uses provider-native thinking toggle only";case"none":return"Runs without native reasoning parameters";case"prompt-only":return"Uses prompt overlays only; no native reasoning parameter";default:return"Runs without native reasoning parameters"}}i(Te,"describeReasoningExecution");function De(e){let t=[];e||(e=y().providerModels);for(let n of I())t.push({name:n.name,model:n.model,models:ie(n.name,e),configured:n.capabilityProfile.transport==="cli-bridge"?!0:n.configured,reasoningCapability:n.reasoningCapability,capabilityProfile:n.capabilityProfile});try{let n=b().map(o=>({...o,models:(()=>{let r=e?.[o.name];return r&&r.length>0?P(r,o.models):o.models})()}));t.push(...n)}catch{}return t}i(De,"getProviderList");function Me(e){if(w(e))return!0;try{return m(e)?.isConfigured()??!1}catch{return!1}}i(Me,"isProviderConfigured");function y(){try{if(a.existsSync(p)){let e=JSON.parse(a.readFileSync(p,"utf-8")),t=e.reasoningCeiling??e.reasoningMode;return ne({...e,reasoningMode:t,extensions:$(e.extensions)})}}catch{}return{}}i(y,"loadConfig");function le(e){e.streamIdleTimeoutMs&&!process.env.KODAX_STREAM_IDLE_TIMEOUT_MS&&(process.env.KODAX_STREAM_IDLE_TIMEOUT_MS=String(e.streamIdleTimeoutMs))}i(le,"applyResilienceRuntimeEnv");function ue(e){e.repoIntelligenceMode&&!process.env.KODAX_REPO_INTELLIGENCE_MODE&&(process.env.KODAX_REPO_INTELLIGENCE_MODE=e.repoIntelligenceMode),e.repointelEndpoint&&!process.env.KODAX_REPOINTEL_ENDPOINT&&(process.env.KODAX_REPOINTEL_ENDPOINT=e.repointelEndpoint),e.repointelBin&&!process.env.KODAX_REPOINTEL_BIN&&(process.env.KODAX_REPOINTEL_BIN=e.repointelBin),e.repoIntelligenceTrace===!0&&!process.env.KODAX_REPO_INTELLIGENCE_TRACE&&(process.env.KODAX_REPO_INTELLIGENCE_TRACE="1")}i(ue,"applyRepoIntelligenceRuntimeEnv");function pe(e){e.verifierLog===!0&&!process.env.KODAX_VERIFIER_LOG&&(process.env.KODAX_VERIFIER_LOG="1")}i(pe,"applyVerifierRuntimeEnv");function de(e){e.stallLog===!0&&!process.env.KODAX_STALL_LOG&&(process.env.KODAX_STALL_LOG="1")}i(de,"applyStallSidecarRuntimeEnv");function Ne(){ee();let e=y();return le(e),ue(e),pe(e),de(e),te(e),M(e.locale),e}i(Ne,"prepareRuntimeConfig");function Ke(e){let n={...y(),...e},o=$(n.extensions);o!==void 0&&(n.extensions=o);for(let r of Object.keys(e))e[r]===void 0&&delete n[r];a.mkdirSync(c.dirname(p),{recursive:!0}),a.writeFileSync(p,JSON.stringify(n,null,2))}i(Ke,"saveConfig");async function Xe(){try{let{stdout:e}=await W("git rev-parse --show-toplevel");return e.trim()}catch{return null}}i(Xe,"getGitRoot");function fe(e){switch(e){case"builtin":return"Built-in";case"runtime":return"Runtime extension";case"custom":return"Custom config";default:return"Unknown"}}i(fe,"formatProviderSourceKind");function $e(e){let t=e.transport==="cli-bridge"?"CLI bridge":"Native API",n=e.conversationSemantics==="last-user-message"?"latest-user-message only":"full conversation history";return[`Source: ${fe(e.sourceKind)}`,`Transport: ${t}`,`Conversation semantics: ${n}`,`Context fidelity: ${e.contextFidelity}`,`Tool calling: ${e.toolCallingFidelity}`,`Session behavior: ${e.sessionSupport}`,`Long-running support: ${e.longRunningSupport}`,`Evidence-heavy flows: ${e.evidenceSupport}`,`Multimodal support: ${e.multimodalSupport}`,`MCP support: ${e.mcpSupport}`,`Reasoning control: ${ce(e.reasoningCapability)}`]}i($e,"formatProviderCapabilityDetailLines");function Ge(e,t,n){return[{label:"General coding",hints:{}},{label:"Evidence-heavy review",hints:{evidenceHeavy:!0}},{label:"Long-running task",hints:{longRunning:!0}}].map(r=>({label:r.label,decision:ae(e,t,n,r.hints)})).filter(r=>r.decision!==null)}i(Ge,"getProviderCommonPolicyScenarios");var N=.5,K=0,g={locked:!1,queue:[]};async function Be(e){for(;g.locked;)await new Promise(t=>g.queue.push(t));g.locked=!0;try{let t=(Date.now()-K)/1e3;t<N&&await new Promise(o=>setTimeout(o,(N-t)*1e3));let n=await e();return K=Date.now(),n}finally{g.locked=!1;let t=g.queue.shift();t&&t()}}i(Be,"rateLimitedCall");export{me as a,X as b,Se as c,p as d,Le as e,Z as f,xe as g,te as h,oe as i,Ie as j,Oe as k,ie as l,re as m,se as n,Re as o,ae as p,ke as q,Ae as r,ce as s,Te as t,De as u,Me as v,y as w,Ne as x,Ke as y,Xe as z,fe as A,$e as B,Ge as C,Be as D};
|