@kodax-ai/kodax 0.7.78 → 0.7.79

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 (124) hide show
  1. package/CHANGELOG.md +3475 -3197
  2. package/README.md +346 -275
  3. package/README_CN.md +274 -214
  4. package/config-templates/config.example.jsonc +11 -1
  5. package/config-templates/integrations/a2a.example.jsonc +23 -7
  6. package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
  7. package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
  8. package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
  9. package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
  10. package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
  11. package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
  12. package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
  13. package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
  14. package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
  15. package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
  16. package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
  17. package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
  18. package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
  19. package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
  20. package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
  21. package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
  22. package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
  23. package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
  24. package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
  25. package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
  26. package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
  27. package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
  28. package/dist/builtin/skill-creator/scripts/utils.js +5 -1
  29. package/dist/chunks/{agent-ASP4MS3X.js → agent-V4AC5JZD.js} +1 -1
  30. package/dist/chunks/argument-completer-ZPC2MLES.js +2 -0
  31. package/dist/chunks/{chunk-Z3KFRTSB.js → chunk-67THZRM6.js} +1 -1
  32. package/dist/chunks/chunk-6GVQDQTQ.js +292 -0
  33. package/dist/chunks/{chunk-TQDBTTIM.js → chunk-B6UY3VHV.js} +40 -40
  34. package/dist/chunks/{chunk-7OEBJGHK.js → chunk-BBOVVDQJ.js} +1 -1
  35. package/dist/chunks/chunk-CR2IF7VF.js +30 -0
  36. package/dist/chunks/{chunk-UID7BLAB.js → chunk-CXHEZY5G.js} +1 -1
  37. package/dist/chunks/chunk-EDZ4QILG.js +266 -0
  38. package/dist/chunks/chunk-GEECPO2H.js +218 -0
  39. package/dist/chunks/chunk-H5LLM7DB.js +89 -0
  40. package/dist/chunks/chunk-KLWP7POA.js +467 -0
  41. package/dist/chunks/{chunk-2CFHBKRE.js → chunk-M4N2JZTZ.js} +2 -2
  42. package/dist/chunks/{chunk-YAZQTC2L.js → chunk-OWQT3FTE.js} +1 -1
  43. package/dist/chunks/chunk-Q4M7DJOD.js +319 -0
  44. package/dist/chunks/{chunk-6FOJVETH.js → chunk-QCZLCLFL.js} +7 -7
  45. package/dist/chunks/chunk-RQPMGRTR.js +810 -0
  46. package/dist/chunks/chunk-SG6P4SZS.js +123 -0
  47. package/dist/chunks/chunk-TSTVAU5E.js +386 -0
  48. package/dist/chunks/chunk-ZCZZUE5E.js +662 -0
  49. package/dist/chunks/compaction-config-AEUGVROL.js +2 -0
  50. package/dist/chunks/{construction-bootstrap-VQLQGWPY.js → construction-bootstrap-K3ZGEN5N.js} +1 -1
  51. package/dist/chunks/dist-GFJFRPAV.js +2 -0
  52. package/dist/chunks/{dist-BFT5YIGU.js → dist-JMO47GJV.js} +1 -1
  53. package/dist/chunks/host-23K2Q6RZ.js +2 -0
  54. package/dist/chunks/run-manager-PGIR6ITA.js +2 -0
  55. package/dist/chunks/{utils-SID4HW2Q.js → utils-6LEKJPQN.js} +1 -1
  56. package/dist/index.d.ts +20 -20
  57. package/dist/index.js +2 -2
  58. package/dist/kodax_bootstrap.js +2 -1
  59. package/dist/kodax_cli.js +1816 -1458
  60. package/dist/kodax_resume.js +570 -34
  61. package/dist/provider-capabilities.json +85 -50
  62. package/dist/runtime-worker.js +1713 -1361
  63. package/dist/sandbox-workspace-session.js +285 -19
  64. package/dist/sdk-a2a.d.ts +19 -13
  65. package/dist/sdk-a2a.js +8 -8
  66. package/dist/sdk-agent.d.ts +73 -141
  67. package/dist/sdk-agent.js +1 -1
  68. package/dist/sdk-coding.d.ts +29 -60
  69. package/dist/sdk-coding.js +1 -1
  70. package/dist/sdk-experimental-memory.d.ts +3 -3
  71. package/dist/sdk-experimental-memory.js +1 -1
  72. package/dist/sdk-llm.d.ts +7 -7
  73. package/dist/sdk-llm.js +1 -1
  74. package/dist/sdk-mcp.d.ts +1 -1
  75. package/dist/sdk-mcp.js +1 -1
  76. package/dist/sdk-media.d.ts +1 -1
  77. package/dist/sdk-media.js +1 -1
  78. package/dist/sdk-repl.d.ts +25 -26
  79. package/dist/sdk-repl.js +2 -2
  80. package/dist/sdk-runtime.d.ts +227 -31
  81. package/dist/sdk-runtime.js +1 -1
  82. package/dist/sdk-sandbox.js +1 -1
  83. package/dist/sdk-session.d.ts +8 -8
  84. package/dist/sdk-session.js +1 -1
  85. package/dist/sdk-skills.js +1 -1
  86. package/dist/semantic-worker.js +283 -18
  87. package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
  88. package/dist/types-chunks/{bash-prefix-extractor.d-uAe2Oqda.d.ts → bash-prefix-extractor.d-CNSidpmv.d.ts} +28 -7
  89. package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
  90. package/dist/types-chunks/{capsule.d-BlSv9l3V.d.ts → capsule.d-B3q98pLQ.d.ts} +9 -7
  91. package/dist/types-chunks/{types.d-BA-Jwpfs.d.ts → controller.d-RGV7Pjv9.d.ts} +328 -3
  92. package/dist/types-chunks/{guardrail.d-CXDYRgZ3.d.ts → guardrail.d-1NLSFTyN.d.ts} +126 -52
  93. package/dist/types-chunks/{history-retrieval.d-DtCy7x64.d.ts → history-retrieval.d-BAegI14A.d.ts} +16 -3
  94. package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
  95. package/dist/types-chunks/{public-api.d-B3AohsxN.d.ts → public-api.d-BpJhHoa7.d.ts} +334 -25
  96. package/dist/types-chunks/{repl.d-Ie_ZXb_U.d.ts → repl.d-CZ12Ow3X.d.ts} +5 -5
  97. package/dist/types-chunks/{resolver.d-iAQ9ocLB.d.ts → resolver.d-C9IW4fmU.d.ts} +5 -2
  98. package/dist/types-chunks/{run-manager.d-D1twIhF9.d.ts → run-manager.d-CX3AUocA.d.ts} +1 -1
  99. package/dist/types-chunks/{sdk-session-DB9KksIx.d.ts → sdk-session-B3cfJKqF.d.ts} +3 -3
  100. package/dist/types-chunks/{side-query.d-DTuLPcC5.d.ts → side-query.d-CP1LiRiH.d.ts} +8 -2
  101. package/dist/types-chunks/{types-D3g6XUQr.d.ts → types-Bf3Y3mW-.d.ts} +1 -1
  102. package/dist/types-chunks/{types.d-BH0ZkTGf.d.ts → types.d-BZ9oXvTV.d.ts} +2 -2
  103. package/dist/types-chunks/{types.d-DVDTIfB_.d.ts → types.d-C0_rn--1.d.ts} +4 -4
  104. package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
  105. package/dist/types-chunks/{utils.d-CVp6bFl9.d.ts → utils.d-CGpHavsU.d.ts} +14 -6
  106. package/docs/SDK_EMBEDDER_GUIDE.md +1144 -598
  107. package/package.json +4 -1
  108. package/dist/chunks/argument-completer-JYQ7FX3W.js +0 -2
  109. package/dist/chunks/chunk-35PPHOQ2.js +0 -292
  110. package/dist/chunks/chunk-43QNNDHR.js +0 -29
  111. package/dist/chunks/chunk-5GO6FH7L.js +0 -458
  112. package/dist/chunks/chunk-5NDCSFOP.js +0 -78
  113. package/dist/chunks/chunk-6XM4B6K2.js +0 -48
  114. package/dist/chunks/chunk-6YZUE6NC.js +0 -240
  115. package/dist/chunks/chunk-KQLQYHWU.js +0 -386
  116. package/dist/chunks/chunk-NXO6GWSY.js +0 -46
  117. package/dist/chunks/chunk-T2XZTLYE.js +0 -316
  118. package/dist/chunks/chunk-VAT2QYXM.js +0 -765
  119. package/dist/chunks/chunk-YVRYHC4C.js +0 -655
  120. package/dist/chunks/compaction-config-BQSSIWK5.js +0 -2
  121. package/dist/chunks/dist-PCFE24YP.js +0 -2
  122. package/dist/chunks/host-UTFXCYYM.js +0 -2
  123. package/dist/chunks/run-manager-PJU3WIFJ.js +0 -2
  124. package/dist/types-chunks/guardrail.d-BRE_ErEj.d.ts +0 -156
@@ -1,6 +1,6 @@
1
- import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-uAe2Oqda.js';
2
- import { F as KodaXReasoningMode, k as KodaXMessage, S as KodaXTaskResultMetadata } from './types.d-DIpZJKUl.js';
3
- import { cP as LearningSurfaceSnapshot$1, cK as LearningQuery, cJ as LearningPage, cm as LearnedCapabilityRecord, cF as LearningEvent, cO as LearningSubscribeOptions, bP as KodaXSessionData, bU as KodaXSessionLineage, bZ as KodaXSessionNavigationOptions, b$ as KodaXSessionRuntimeInfo, c1 as KodaXSessionStorage, j as AgentActorSnapshot, aU as CompactionReport, bF as KodaXJsonValue } from './types.d-BA-Jwpfs.js';
1
+ import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-CNSidpmv.js';
2
+ import { G as KodaXReasoningMode, k as KodaXMessage, T as KodaXTaskResultMetadata } from './types.d-CgrXrFrq.js';
3
+ import { cY as LearningSurfaceSnapshot$1, cT as LearningQuery, cS as LearningPage, cv as LearnedCapabilityRecord, cO as LearningEvent, cX as LearningSubscribeOptions, bY as KodaXSessionData, c1 as KodaXSessionLineage, c6 as KodaXSessionNavigationOptions, c8 as KodaXSessionRuntimeInfo, ca as KodaXSessionStorage, bZ as KodaXSessionEntry, bU as KodaXSessionArtifactLedgerEntry, bC as KodaXExtensionSessionRecord, cc as KodaXSessionUiHistoryItem, c9 as KodaXSessionScope, k as AgentActorSnapshot, aX as CompactionReport, bO as KodaXJsonValue } from './controller.d-RGV7Pjv9.js';
4
4
 
5
5
  /**
6
6
  * TextBuffer - Text buffer management class - 文本缓冲区管理类
@@ -897,13 +897,182 @@ declare class MemorySessionStorage implements SessionStorage {
897
897
  }
898
898
  declare function createMemorySessionStorage(): SessionStorage;
899
899
 
900
+ type SessionConversationHistoryStatus = 'resolved' | 'partial' | 'ambiguous';
901
+ type SessionConversationHistoryIssueCode = 'active_entry_missing' | 'compaction_boundary_invalid' | 'compaction_predecessor_ambiguous' | 'compaction_predecessor_missing' | 'legacy_overlap_ambiguous' | 'lineage_path_incomplete' | 'lineage_unavailable' | 'logical_identity_conflict';
902
+ interface SessionConversationHistoryIssue {
903
+ readonly code: SessionConversationHistoryIssueCode;
904
+ readonly message: string;
905
+ /** Number of diagnostics of this code represented by this bounded summary. */
906
+ readonly occurrenceCount: number;
907
+ /** Total evidence references before `entryIds` was bounded. */
908
+ readonly entryCount: number;
909
+ readonly entryIds: readonly string[];
910
+ }
911
+ /**
912
+ * One SDK-resolved conversation item. `auditEntryIds` names every proven
913
+ * physical copy represented by it; raw bodies remain in the audit API.
914
+ */
915
+ interface SessionConversationHistoryEntry {
916
+ readonly boundaryId?: string;
917
+ readonly auditEntryIds: readonly string[];
918
+ readonly message: KodaXMessage;
919
+ }
920
+ interface SessionConversationHistoryData {
921
+ readonly sourceRevision: string;
922
+ readonly status: SessionConversationHistoryStatus;
923
+ readonly entries: readonly SessionConversationHistoryEntry[];
924
+ readonly issues: readonly SessionConversationHistoryIssue[];
925
+ }
926
+ declare function emptyConversationEntryChain(): string;
927
+ declare function extendConversationEntryChain(previous: string, entries: readonly SessionConversationHistoryEntry[]): string;
928
+ declare function createConversationEntryChain(entries: readonly SessionConversationHistoryEntry[]): string;
929
+ declare function createSessionConversationHistoryRevision(history: SessionConversationHistoryData, entryChain?: string): string;
930
+
931
+ type SessionSourceFileKind = 'main' | 'islands' | 'legacy_archive';
932
+ interface SessionSourceFileRevisionState {
933
+ readonly kind: SessionSourceFileKind;
934
+ readonly relativePath: string;
935
+ readonly byteLength: number;
936
+ readonly chunkCount: number;
937
+ readonly chain: string;
938
+ /** Canonical base64 for the final incomplete source chunk. */
939
+ readonly tail: string;
940
+ }
941
+ interface SessionSourceRevisionState {
942
+ readonly version: 1;
943
+ readonly files: readonly SessionSourceFileRevisionState[];
944
+ }
945
+
946
+ interface ConversationPageCacheAdmission {
947
+ readonly surface?: string;
948
+ readonly profileId?: string;
949
+ }
950
+ interface ConversationPageCacheInput {
951
+ readonly expectedRevision?: string;
952
+ readonly end?: number;
953
+ readonly limit: number;
954
+ readonly maxPageBytes: number;
955
+ readonly maxInlineEntryBytes: number;
956
+ readonly reservedBytes: number;
957
+ readonly authorize?: (admission: ConversationPageCacheAdmission) => void | Promise<void>;
958
+ readonly signal?: AbortSignal;
959
+ }
960
+ interface ConversationPageCacheEntry {
961
+ readonly index: number;
962
+ readonly boundaryId?: string;
963
+ readonly byteLength: number;
964
+ readonly oversized: boolean;
965
+ readonly entry?: SessionConversationHistoryEntry;
966
+ }
967
+ interface ConversationPageCachePage {
968
+ readonly revision: string;
969
+ readonly sourceRevision: string;
970
+ readonly status: SessionConversationHistoryStatus;
971
+ readonly issues: readonly SessionConversationHistoryIssue[];
972
+ readonly entries: readonly ConversationPageCacheEntry[];
973
+ readonly hasMore: boolean;
974
+ readonly nextEnd?: number;
975
+ }
976
+ interface ConversationPageCacheChunkInput {
977
+ readonly revision: string;
978
+ readonly entryIndex: number;
979
+ readonly offset: number;
980
+ readonly authorize?: (admission: ConversationPageCacheAdmission) => void | Promise<void>;
981
+ readonly signal?: AbortSignal;
982
+ }
983
+ interface ConversationPageCacheChunk {
984
+ readonly revision: string;
985
+ readonly entryIndex: number;
986
+ readonly boundaryId?: string;
987
+ readonly data: Buffer;
988
+ readonly nextOffset?: number;
989
+ }
990
+ declare class ConversationPageCacheCapacityError extends Error {
991
+ constructor();
992
+ }
993
+
900
994
  /**
901
995
  * KodaX session storage - filesystem implementation.
902
996
  */
903
997
 
998
+ /**
999
+ * Opaque process-local boundary for a prepared, append-only Session write.
1000
+ * Obtain a fresh value from {@link FileSessionStorage.prepareSessionAppend};
1001
+ * a committed append consumes the boundary. It returns a reusable successor
1002
+ * when that successor can be witnessed safely, or `null` when the caller must
1003
+ * reload before another append.
1004
+ */
1005
+ interface PreparedSessionAppendBaseline {
1006
+ readonly sessionId: string;
1007
+ readonly revision: string;
1008
+ readonly lineageCount: number;
1009
+ readonly artifactCount: number;
1010
+ readonly extensionCount: number;
1011
+ readonly activeEntryId: string | null;
1012
+ readonly tag?: string;
1013
+ }
1014
+ /**
1015
+ * An explicit append-only delta. Historical arrays are intentionally absent:
1016
+ * callers that need to rewrite existing Session data must use
1017
+ * {@link FileSessionStorage.appendSessionDelta}, which performs an exact merge.
1018
+ */
1019
+ interface PreparedSessionTailDelta {
1020
+ readonly baseline: PreparedSessionAppendBaseline;
1021
+ readonly title: string;
1022
+ readonly activeEntryId: string | null;
1023
+ readonly lineageEntries: readonly KodaXSessionEntry[];
1024
+ readonly artifactEntries?: readonly KodaXSessionArtifactLedgerEntry[];
1025
+ readonly extensionRecords?: readonly KodaXExtensionSessionRecord[];
1026
+ readonly uiHistory?: readonly KodaXSessionUiHistoryItem[];
1027
+ readonly scope?: KodaXSessionScope;
1028
+ }
1029
+ type SessionReadErrorCode = 'data_corrupt' | 'data_changed' | 'version_incompatible' | 'read_timeout' | 'read_cancelled';
1030
+ declare class SessionReadError extends Error {
1031
+ readonly code: SessionReadErrorCode;
1032
+ constructor(code: SessionReadErrorCode, message: string);
1033
+ }
1034
+ interface SessionReadOptions {
1035
+ readonly timeoutMs?: number;
1036
+ readonly signal?: AbortSignal;
1037
+ }
1038
+ /** Immutable read boundary used by conversation-history fork/rewind. */
1039
+ interface SessionHistoryBoundary {
1040
+ readonly sourceRevision: string;
1041
+ }
1042
+ interface SessionReadSnapshot {
1043
+ readonly data: SessionData;
1044
+ readonly lineage: KodaXSessionLineage | null;
1045
+ /** Exact identity of the immutable persisted bundle used for this capture. */
1046
+ readonly sourceRevision: string;
1047
+ /** Incrementally extendable witness for the exact persisted bundle revision. */
1048
+ readonly sourceRevisionState: SessionSourceRevisionState;
1049
+ /** Stat-derived witness for prepared-page validation at this exact capture. */
1050
+ readonly boundaryRevision: string;
1051
+ }
1052
+ type StableFileIdentity = {
1053
+ readonly dev: bigint;
1054
+ readonly ino: bigint;
1055
+ readonly size: bigint;
1056
+ readonly mtimeNs: bigint;
1057
+ readonly ctimeNs: bigint;
1058
+ };
1059
+ type SessionTopologyIdentity = {
1060
+ readonly root: StableFileIdentity;
1061
+ readonly epoch: string | null;
1062
+ readonly writerScope: 'session' | 'global';
1063
+ readonly writerIdentity: StableFileIdentity | null;
1064
+ readonly activeWriterIdentity: StableFileIdentity | null;
1065
+ };
1066
+ type SessionLocationTraversalBoundary = {
1067
+ readonly topologyBefore?: SessionTopologyIdentity;
1068
+ readonly writerTopologyDigestBefore?: string;
1069
+ readonly topologyMutationBefore: boolean;
1070
+ };
904
1071
  declare class FileSessionStorage implements KodaXSessionStorage {
905
1072
  private readonly sessionsDir;
906
1073
  private readonly configHome;
1074
+ private readonly sessionLocations;
1075
+ private readonly verifiedLocationMisses;
907
1076
  /**
908
1077
  * v0.7.46 — optional explicit project cwd for in-process embedders
909
1078
  * (KodaX Space) serving multiple projects from a single runtime.
@@ -933,21 +1102,50 @@ declare class FileSessionStorage implements KodaXSessionStorage {
933
1102
  });
934
1103
  /** Absolute session root used by this storage instance. */
935
1104
  getSessionsDir(): string;
1105
+ /**
1106
+ * Return the current one-shot boundary for an explicit tail-only append.
1107
+ * A full save/load initializes this boundary; every successful write rotates
1108
+ * it so stale or concurrent deltas fail with `data_changed`.
1109
+ */
1110
+ private currentPreparedSessionAppend;
1111
+ /**
1112
+ * Prepare an authenticated one-shot boundary for a bounded tail append.
1113
+ * Returns `null` when no canonical cache witness is available; callers must
1114
+ * then load/rebuild or use the exact full-snapshot append path.
1115
+ */
1116
+ prepareSessionAppend(id: string): Promise<PreparedSessionAppendBaseline | null>;
1117
+ /** @internal Register main paths found by one list traversal. */
1118
+ indexSessionLocations(filePaths: readonly string[], globallyVerified: boolean, topologyIdentity?: SessionTopologyIdentity): void;
1119
+ /** @internal Start an authoritative all-project locator traversal. */
1120
+ beginSessionLocationTraversal(): SessionLocationTraversalBoundary;
1121
+ /** @internal Commit locator hints only when the whole traversal was stable. */
1122
+ completeSessionLocationTraversal(boundary: SessionLocationTraversalBoundary, filePaths: readonly string[], traversalComplete: boolean): void;
936
1123
  private writeQueues;
937
1124
  private serializedWrite;
1125
+ private refreshSelfVerifiedLocationTopology;
938
1126
  private sessionWriteLockPath;
1127
+ private persistSessionLocationHint;
1128
+ private resolveSessionLocationHint;
939
1129
  private appendState;
940
- private sessionDirCache;
1130
+ private lineageIdentityFilterHashes;
941
1131
  private projectJsonWritten;
942
1132
  private migrationPromise?;
943
1133
  private ensureMigrated;
944
- /** Update watermarks. Only overwrites fields the caller actually provided. */
1134
+ /** Update watermarks without retaining or serializing the full Session graph. */
945
1135
  private syncAppendState;
1136
+ private syncAppendStateFromFile;
946
1137
  private legacyFlatPath;
947
1138
  private legacyFlatArchivePath;
948
1139
  private projectDir;
949
1140
  /** Resolve (and cache) the project directory a write for `id` should land in. */
950
1141
  private resolveWriteDir;
1142
+ private isLocationGloballyVerified;
1143
+ private verifiedLocationTopology;
1144
+ private verifiedMissingLocationTopology;
1145
+ private assertLocationTopologyUnchanged;
1146
+ private readSessionTopologyIdentitySync;
1147
+ private advanceSessionLocationTopology;
1148
+ private withSessionLocationTopologyChange;
951
1149
  private writeFilePath;
952
1150
  /**
953
1151
  * id-only locator (ADR-038 §7). Resolution order:
@@ -960,22 +1158,51 @@ declare class FileSessionStorage implements KodaXSessionStorage {
960
1158
  * returns null with a warning rather than guessing.
961
1159
  */
962
1160
  private resolveSessionLocation;
1161
+ private resolveAmbiguousSessionLocation;
963
1162
  private readSession;
964
1163
  private readArchivedEntries;
1164
+ private completeConversationLineage;
965
1165
  private appendIslandArchive;
966
1166
  /** Write `<dir>/project.json` once per process per directory (best-effort). */
967
1167
  private ensureProjectJson;
1168
+ private rebuildConversationCache;
1169
+ private updateConversationCacheAfterAppend;
968
1170
  private writeSessionInternal;
969
1171
  private mergeAndWriteInternal;
970
1172
  appendSessionDelta(id: string, data: SessionData): Promise<void>;
971
- private shouldRunMaintenance;
972
- private runMaintenance;
1173
+ /**
1174
+ * Append an explicit new tail without accepting any historical prefix.
1175
+ * A fulfilled non-null value means the append committed and its successor
1176
+ * boundary is reusable. A fulfilled `null` also means the append committed,
1177
+ * but the successor could not be witnessed: reload and do not retry the same
1178
+ * tail. Pre-commit validation conflicts reject with `data_changed`.
1179
+ */
1180
+ appendPreparedSessionTail(id: string, delta: PreparedSessionTailDelta): Promise<PreparedSessionAppendBaseline | null>;
973
1181
  save(id: string, data: SessionData): Promise<void>;
1182
+ /**
1183
+ * Fast creation path for IDs produced by KodaX's timestamp + random-bit
1184
+ * generator. The per-ID cross-process lock and exact target check preserve
1185
+ * atomic creation without an all-project negative lookup. Caller-supplied
1186
+ * IDs must continue through the ordinary global conflict check.
1187
+ */
1188
+ createGenerated(id: string, data: SessionData): Promise<void>;
974
1189
  mutateLineage(id: string, mutation: (lineage: KodaXSessionLineage) => KodaXSessionLineage): Promise<boolean>;
975
1190
  /** F270/F269 owner mutation: CAS-update only the Actor section of a session snapshot. */
976
1191
  saveActorSnapshot(id: string, snapshot: AgentActorSnapshot, expectedRevision: number): Promise<void>;
977
1192
  /** Read Session data without recovery writes or append-watermark mutation. */
978
1193
  peek(id: string): Promise<SessionData | null>;
1194
+ /** Strict read-only Session load. It never migrates or repairs persisted data. */
1195
+ read(id: string, options?: SessionReadOptions): Promise<SessionData | null>;
1196
+ readConversationPageCache(id: string, input: ConversationPageCacheInput, options?: SessionReadOptions): Promise<ConversationPageCachePage | null>;
1197
+ readConversationPageBoundary(id: string, options?: SessionReadOptions): Promise<{
1198
+ readonly boundaryRevision: string;
1199
+ readonly admission: ConversationPageCacheAdmission;
1200
+ } | null>;
1201
+ prepareConversationPageCache(id: string, history: SessionConversationHistoryData, lineage: KodaXSessionLineage, runtimeInfo: KodaXSessionRuntimeInfo | undefined, boundaryRevision: string, sourceRevisionState: SessionSourceRevisionState, options?: SessionReadOptions): Promise<void>;
1202
+ readConversationPageCacheChunk(id: string, input: ConversationPageCacheChunkInput, options?: SessionReadOptions): Promise<ConversationPageCacheChunk | null>;
1203
+ /** Stable read-only main + sidecar snapshot with no lock or migration writes. */
1204
+ readFullSnapshot(id: string, options?: SessionReadOptions): Promise<SessionReadSnapshot | null>;
1205
+ private readFullSnapshotAtPath;
979
1206
  load(id: string): Promise<SessionData | null>;
980
1207
  isArchived(id: string): Promise<boolean>;
981
1208
  getLineage(id: string): Promise<KodaXSessionLineage | null>;
@@ -983,11 +1210,14 @@ declare class FileSessionStorage implements KodaXSessionStorage {
983
1210
  setActiveEntry(id: string, selector: string, options?: {
984
1211
  summarizeCurrentBranch?: boolean;
985
1212
  }): Promise<SessionData | null>;
986
- rewind(id: string, selector?: string): Promise<SessionData | null>;
1213
+ rewind(id: string, selector?: string, options?: {
1214
+ historyBoundary?: SessionHistoryBoundary;
1215
+ }): Promise<SessionData | null>;
987
1216
  setLabel(id: string, selector: string, label?: string): Promise<SessionData | null>;
988
1217
  fork(id: string, selector?: string, options?: {
989
1218
  sessionId?: string;
990
1219
  title?: string;
1220
+ historyBoundary?: SessionHistoryBoundary;
991
1221
  }): Promise<{
992
1222
  sessionId: string;
993
1223
  data: SessionData;
@@ -1023,13 +1253,15 @@ declare class FileSessionStorage implements KodaXSessionStorage {
1023
1253
  */
1024
1254
  archive(id: string): Promise<boolean>;
1025
1255
  archiveOwned(id: string, ownerId: string): Promise<boolean>;
1256
+ private sessionConversationCacheMainPaths;
1257
+ private removeSessionConversationCaches;
1026
1258
  private archiveWithActorOwner;
1027
1259
  /** Restore an archived session back into its project directory. */
1028
1260
  unarchive(id: string): Promise<boolean>;
1029
1261
  unarchiveOwned(id: string, ownerId: string): Promise<boolean>;
1030
1262
  private unarchiveWithActorOwner;
1031
1263
  /**
1032
- * Move a session + its island sidecar between two directories. Propagates a
1264
+ * Move a session + modern and legacy island sidecars between two directories. Propagates a
1033
1265
  * non-ENOENT rename error (e.g. Windows file-in-use) so a partial move is
1034
1266
  * surfaced as a failure instead of silently splitting main + sidecar.
1035
1267
  */
@@ -1055,9 +1287,10 @@ declare class FileSessionStorage implements KodaXSessionStorage {
1055
1287
  * `cleanup.ts` (`unlinkIfOld`). Bounds the sessions directory so it never
1056
1288
  * accumulates unboundedly — which is what keeps `list()`'s head-read pass
1057
1289
  * fast (its cost scales with file COUNT, not size). A non-positive /
1058
- * non-finite `retentionDays` disables cleanup (no-op). Best-effort: per-file
1059
- * errors are isolated so a single locked/racing file never aborts the
1060
- * sweep. Durable Actor owners and non-terminal turns are never eligible.
1290
+ * non-finite `retentionDays` disables cleanup (no-op). The sweep continues
1291
+ * after individual failures, then reports them together so cleanup is
1292
+ * observable and retryable. Durable Actor owners and non-terminal turns are
1293
+ * never eligible.
1061
1294
  * Returns the number of files removed.
1062
1295
  */
1063
1296
  cleanupOldSessions(retentionDays: number): Promise<number>;
@@ -1177,10 +1410,54 @@ interface SessionTranscriptEntry {
1177
1410
  readonly taskResults?: readonly KodaXTaskResultMetadata[];
1178
1411
  }
1179
1412
  interface FullTranscriptSessionData extends Omit<SessionData, 'messages'> {
1413
+ /** Legacy flattened projection. Rewind markers are excluded. */
1180
1414
  readonly messages: KodaXMessage[];
1415
+ /** Messages on the active branch that are eligible for model context. */
1181
1416
  readonly activeMessages: KodaXMessage[];
1417
+ /**
1418
+ * Authoritative raw append-order audit entries, including archived islands
1419
+ * and inactive branches. The host owns visibility, folding, and presentation.
1420
+ */
1182
1421
  readonly transcriptEntries: SessionTranscriptEntry[];
1183
1422
  }
1423
+ /** One immutable storage boundary shared by Runtime admission and history. */
1424
+ interface SessionReadCapture {
1425
+ readonly data: SessionData;
1426
+ readonly transcript: FullTranscriptSessionData;
1427
+ readonly sourceRevision: string;
1428
+ /** Internal exact-revision witness used to extend prepared page caches. */
1429
+ readonly sourceRevisionState: SessionSourceRevisionState;
1430
+ /** Bounded persisted-file witness corresponding to sourceRevision. */
1431
+ readonly boundaryRevision: string;
1432
+ }
1433
+ type SessionBundleExportStatus = 'ok' | 'partial' | 'unsupported' | 'corrupt' | 'ambiguous' | 'missing';
1434
+ interface SessionBundleExportFile {
1435
+ readonly kind: 'main' | 'islands' | 'legacy_archive';
1436
+ readonly path: string;
1437
+ readonly byteLength: number;
1438
+ readonly sha256: string;
1439
+ readonly modifiedAt: string;
1440
+ /** Best-effort UTF-8 projection for inspection and JSONL diagnostics. */
1441
+ readonly content: string;
1442
+ /** Canonical byte-preserving representation. */
1443
+ readonly contentBase64: string;
1444
+ }
1445
+ interface SessionBundleExportDiagnostic {
1446
+ readonly code: 'partial_tail' | 'malformed_record' | 'unsupported_record' | 'unsupported_version';
1447
+ readonly file: string;
1448
+ readonly line?: number;
1449
+ readonly message: string;
1450
+ }
1451
+ interface SessionBundleExportResult {
1452
+ readonly sessionId: string;
1453
+ readonly status: SessionBundleExportStatus;
1454
+ readonly files: readonly SessionBundleExportFile[];
1455
+ readonly candidates?: readonly string[];
1456
+ readonly diagnostics: readonly SessionBundleExportDiagnostic[];
1457
+ }
1458
+ interface SessionBundleExportOptions extends SessionReadOptions {
1459
+ readonly sessionsDir?: string;
1460
+ }
1184
1461
  interface AppendClientNoticeOptions {
1185
1462
  readonly source?: string;
1186
1463
  readonly content: string;
@@ -1229,6 +1506,9 @@ interface SessionManager {
1229
1506
  listSessions: typeof listSessions;
1230
1507
  loadSession: typeof loadSession;
1231
1508
  loadFullTranscript: typeof loadFullTranscript;
1509
+ readFullTranscript: typeof readFullTranscript;
1510
+ readConversationHistory: typeof readConversationHistory;
1511
+ readSessionCapture(id: string, options?: SessionReadOptions): Promise<SessionReadCapture | null>;
1232
1512
  appendClientNotice: typeof appendClientNotice;
1233
1513
  forkSession: typeof forkSession;
1234
1514
  rewindSession: typeof rewindSession;
@@ -1265,11 +1545,32 @@ declare function loadSession(id: string): Promise<SessionData | null>;
1265
1545
  /**
1266
1546
  * Load append-order transcript data by ID.
1267
1547
  *
1268
- * `loadSession` remains the active model-context API. This helper is for UI
1269
- * scrollback: it returns every persisted transcript-bearing lineage entry in
1270
- * append order and keeps the active branch in `activeMessages`.
1548
+ * `loadSession` remains the active model-context API. This helper returns raw
1549
+ * host-facing scrollback/audit data, including archived islands and inactive
1550
+ * branches, in append order. Hosts decide what to show or fold.
1271
1551
  */
1272
1552
  declare function loadFullTranscript(id: string): Promise<FullTranscriptSessionData | null>;
1553
+ /**
1554
+ * Strict, boundary-consistent history read.
1555
+ *
1556
+ * Unlike the legacy null-on-error helper, this never migrates or repairs the
1557
+ * Session and preserves structured read errors for the host.
1558
+ */
1559
+ declare function readFullTranscript(id: string, options?: SessionReadOptions): Promise<FullTranscriptSessionData | null>;
1560
+ /**
1561
+ * Read the SDK-resolved ordinary conversation view at one immutable boundary.
1562
+ * Raw append-order audit data remains available through `readFullTranscript`.
1563
+ */
1564
+ declare function readConversationHistory(id: string, options?: SessionReadOptions): Promise<SessionConversationHistoryData | null>;
1565
+ /** Build the conversation projection from an already captured read boundary. */
1566
+ declare function conversationHistoryFromCapture(capture: SessionReadCapture, checkpoint?: () => void): SessionConversationHistoryData;
1567
+ declare function readSessionCapture(id: string, options?: SessionReadOptions): Promise<SessionReadCapture | null>;
1568
+ /**
1569
+ * Export the exact persisted Session bundle without migration, recovery, or
1570
+ * schema rewriting. Unknown and malformed records remain byte-for-byte intact
1571
+ * and are described by diagnostics instead of being discarded.
1572
+ */
1573
+ declare function exportSessionBundle(id: string, options?: SessionBundleExportOptions): Promise<SessionBundleExportResult>;
1273
1574
  /**
1274
1575
  * Append a host-owned transcript notice that never enters model context.
1275
1576
  *
@@ -1278,15 +1579,25 @@ declare function loadFullTranscript(id: string): Promise<FullTranscriptSessionDa
1278
1579
  * `loadSession()` keeps returning only the active model messages.
1279
1580
  */
1280
1581
  declare function appendClientNotice(id: string, options: AppendClientNoticeOptions): Promise<SessionTranscriptEntry | null>;
1582
+ interface SessionConversationMutationBoundary {
1583
+ readonly boundaryId: string;
1584
+ readonly sourceRevision: string;
1585
+ }
1586
+ interface ForkSessionOptions {
1587
+ readonly selector?: string;
1588
+ readonly sessionId?: string;
1589
+ readonly title?: string;
1590
+ readonly historyBoundary?: SessionConversationMutationBoundary;
1591
+ }
1592
+ interface RewindSessionOptions {
1593
+ readonly selector?: string;
1594
+ readonly historyBoundary?: SessionConversationMutationBoundary;
1595
+ }
1281
1596
  /**
1282
1597
  * Fork a session at an optional selector.
1283
1598
  * Returns null for a missing session. NEVER throws.
1284
1599
  */
1285
- declare function forkSession(id: string, opts?: {
1286
- selector?: string;
1287
- sessionId?: string;
1288
- title?: string;
1289
- }): Promise<{
1600
+ declare function forkSession(id: string, opts?: ForkSessionOptions): Promise<{
1290
1601
  sessionId: string;
1291
1602
  data: SessionData;
1292
1603
  } | null>;
@@ -1294,9 +1605,7 @@ declare function forkSession(id: string, opts?: {
1294
1605
  * Rewind a session to a previous user entry.
1295
1606
  * Returns null for a missing session. NEVER throws.
1296
1607
  */
1297
- declare function rewindSession(id: string, opts?: {
1298
- selector?: string;
1299
- }): Promise<SessionData | null>;
1608
+ declare function rewindSession(id: string, opts?: RewindSessionOptions): Promise<SessionData | null>;
1300
1609
  /**
1301
1610
  * Set the active lineage entry by selector.
1302
1611
  * Returns null for a missing session. NEVER throws.
@@ -1381,5 +1690,5 @@ declare function createSessionManager(opts?: {
1381
1690
  configHome?: string;
1382
1691
  }): SessionManager;
1383
1692
 
1384
- export { KeypressHandlerPriority as B, DEFAULT_UI_STATE as D, FILE_MODIFICATION_TOOLS as F, MemorySessionStorage as M, PERMISSION_MODES as P, StreamingState as a0, TOOL_STATUS_ICONS as a2, TextBuffer as a3, ToolCallStatus as a9, appendClientNotice as ag, archiveSession as ah, compactSession as ai, computeConfirmTools as aj, createMemorySessionStorage as ak, createSessionManager as al, deleteSession as am, forkSession as an, isPermissionMode as ao, listRunningSessions as ap, listSessions as aq, loadFullTranscript as ar, loadSession as as, normalizePermissionMode as at, permissionModeDisplayName as au, rewindSession as av, setActiveEntry as aw, unarchiveSession as ax, watchSessions as ay, FileSessionStorage as j };
1385
- export type { StatusBarProps as $, AppProps as A, CompactSessionOptions as C, LearningSurfaceSnapshot as E, LegacyMessageListProps as G, HistoryEntry as H, InputPromptProps as I, ListSessionsOptions as J, KeyInfo as K, LearningBinding as L, Message as N, PastedContent as O, PermissionContext as Q, PermissionMode as R, PromptEditingMode as S, PromptSubmitPayload as T, RunningSessionInfo as U, SessionData as V, SessionManager as W, SessionStorage as X, SessionSummary as Y, SessionTranscriptEntry as Z, SessionTranscriptEntryType as _, AppState as a, Suggestion as a1, TextBufferOptions as a4, Theme as a5, ThemeColors as a6, ThemeSymbols as a7, ToolCall as a8, UIActions as aa, UIState as ab, UseTextBufferReturn as ac, VisualCursor as ad, VisualLayout as ae, WatchSessionsCallback as af, AppendClientNoticeOptions as b, CompactSessionResult as c, Completer as d, Completion as e, ConfirmResult as f, CreatableHistoryItem as g, CursorPosition as h, DeleteSessionResult as i, FullTranscriptSessionData as k, HistoryItem as l, HistoryItemAssistant as m, HistoryItemBase as n, HistoryItemError as o, HistoryItemEvent as p, HistoryItemHint as q, HistoryItemInfo as r, HistoryItemSidecar as s, HistoryItemSystem as t, HistoryItemThinking as u, HistoryItemToolGroup as v, HistoryItemType as w, HistoryItemUser as x, KeypressEvent as y, KeypressHandler as z };
1693
+ export { DEFAULT_UI_STATE as D, FILE_MODIFICATION_TOOLS as F, KeypressHandlerPriority as G, MemorySessionStorage as O, PERMISSION_MODES as Q, watchSessions as a$, appendClientNotice as aA, archiveSession as aB, compactSession as aC, computeConfirmTools as aD, conversationHistoryFromCapture as aE, createConversationEntryChain as aF, createMemorySessionStorage as aG, createSessionConversationHistoryRevision as aH, createSessionManager as aI, deleteSession as aJ, emptyConversationEntryChain as aK, exportSessionBundle as aL, extendConversationEntryChain as aM, forkSession as aN, isPermissionMode as aO, listRunningSessions as aP, listSessions as aQ, loadFullTranscript as aR, loadSession as aS, normalizePermissionMode as aT, permissionModeDisplayName as aU, readConversationHistory as aV, readFullTranscript as aW, readSessionCapture as aX, rewindSession as aY, setActiveEntry as aZ, unarchiveSession as a_, SessionReadError as ac, StreamingState as ak, TOOL_STATUS_ICONS as am, TextBuffer as an, ToolCallStatus as at, ConversationPageCacheCapacityError as g, FileSessionStorage as k };
1694
+ export type { SessionBundleExportFile as $, AppProps as A, KeypressEvent as B, CompactSessionOptions as C, KeypressHandler as E, HistoryEntry as H, InputPromptProps as I, LearningSurfaceSnapshot as J, KeyInfo as K, LearningBinding as L, LegacyMessageListProps as M, ListSessionsOptions as N, Message as P, PastedContent as R, PermissionContext as S, PermissionMode as T, PreparedSessionAppendBaseline as U, PreparedSessionTailDelta as V, PromptEditingMode as W, PromptSubmitPayload as X, RewindSessionOptions as Y, RunningSessionInfo as Z, SessionBundleExportDiagnostic as _, AppState as a, SessionBundleExportOptions as a0, SessionBundleExportResult as a1, SessionBundleExportStatus as a2, SessionConversationHistoryData as a3, SessionConversationHistoryEntry as a4, SessionConversationHistoryIssue as a5, SessionConversationHistoryIssueCode as a6, SessionConversationHistoryStatus as a7, SessionConversationMutationBoundary as a8, SessionData as a9, SessionManager as aa, SessionReadCapture as ab, SessionReadErrorCode as ad, SessionReadOptions as ae, SessionStorage as af, SessionSummary as ag, SessionTranscriptEntry as ah, SessionTranscriptEntryType as ai, StatusBarProps as aj, Suggestion as al, TextBufferOptions as ao, Theme as ap, ThemeColors as aq, ThemeSymbols as ar, ToolCall as as, UIActions as au, UIState as av, UseTextBufferReturn as aw, VisualCursor as ax, VisualLayout as ay, WatchSessionsCallback as az, AppendClientNoticeOptions as b, CompactSessionResult as c, Completer as d, Completion as e, ConfirmResult as f, CreatableHistoryItem as h, CursorPosition as i, DeleteSessionResult as j, ForkSessionOptions as l, FullTranscriptSessionData as m, HistoryItem as n, HistoryItemAssistant as o, HistoryItemBase as p, HistoryItemError as q, HistoryItemEvent as r, HistoryItemHint as s, HistoryItemInfo as t, HistoryItemSidecar as u, HistoryItemSystem as v, HistoryItemThinking as w, HistoryItemToolGroup as x, HistoryItemType as y, HistoryItemUser as z };
@@ -1,8 +1,8 @@
1
- import { n as ResolvedAutoModeSettings, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest, p as RuntimeSurfaceStatus } from './utils.d-CVp6bFl9.js';
2
- import { X as SessionStorage$1, R as PermissionMode, L as LearningBinding } from './public-api.d-B3AohsxN.js';
3
- import { a1 as KodaXOptions, ad as KodaXResult } from './bash-prefix-extractor.d-uAe2Oqda.js';
4
- import { c1 as KodaXSessionStorage, bP as KodaXSessionData } from './types.d-BA-Jwpfs.js';
5
- import { s as AutoModeStats } from './guardrail.d-CXDYRgZ3.js';
1
+ import { n as ResolvedAutoModeSettings, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest, p as RuntimeSurfaceStatus } from './utils.d-CGpHavsU.js';
2
+ import { af as SessionStorage$1, T as PermissionMode, L as LearningBinding } from './public-api.d-BpJhHoa7.js';
3
+ import { a1 as KodaXOptions, ad as KodaXResult } from './bash-prefix-extractor.d-CNSidpmv.js';
4
+ import { ca as KodaXSessionStorage, bY as KodaXSessionData } from './controller.d-RGV7Pjv9.js';
5
+ import { s as AutoModeStats } from './guardrail.d-1NLSFTyN.js';
6
6
 
7
7
  interface ReplRuntimePermissionGrantSuggestion {
8
8
  readonly id: string;
@@ -1,6 +1,6 @@
1
- import { F as KodaXReasoningMode, M as KodaXStableEffortIntent, a9 as KodaXWireReasoningEffort, G as KodaXReasoningProfile, Z as KodaXThinkingBudgetMap, _ as KodaXThinkingDepth, q as KodaXProviderConfig, B as KodaXReasoningCapability, H as KodaXReasoningRequest, n as KodaXNormalizedReasoningRequest, V as KodaXTaskType, a7 as KodaXVerifyCredentialResult, a1 as KodaXToolDefinition, k as KodaXMessage, y as KodaXProviderStreamOptions, N as KodaXStreamResult, l as KodaXModelDescriptor, p as KodaXProviderCapabilityProfile, a8 as KodaXVerifyStrategy, d as KodaXCustomProviderConfig, j as KodaXListModelsResult } from './types.d-DIpZJKUl.js';
1
+ import { G as KodaXReasoningMode, N as KodaXStableEffortIntent, aa as KodaXWireReasoningEffort, H as KodaXReasoningProfile, _ as KodaXThinkingBudgetMap, $ as KodaXThinkingDepth, r as KodaXProviderConfig, C as KodaXReasoningCapability, I as KodaXReasoningRequest, n as KodaXNormalizedReasoningRequest, W as KodaXTaskType, a8 as KodaXVerifyCredentialResult, a2 as KodaXToolDefinition, k as KodaXMessage, z as KodaXProviderStreamOptions, O as KodaXStreamResult, l as KodaXModelDescriptor, q as KodaXProviderCapabilityProfile, o as KodaXOpenAICompatMaxOutputTokensField, a9 as KodaXVerifyStrategy, d as KodaXCustomProviderConfig, j as KodaXListModelsResult } from './types.d-CgrXrFrq.js';
2
2
  import Anthropic from '@anthropic-ai/sdk';
3
- import { K as KodaXBaseProvider } from './base.d-4e74xDdy.js';
3
+ import { K as KodaXBaseProvider } from './base.d-DxG0m09Z.js';
4
4
  import OpenAI from 'openai';
5
5
 
6
6
  /**
@@ -282,6 +282,7 @@ declare abstract class KodaXOpenAICompatProvider extends KodaXBaseProvider {
282
282
  protected get client(): OpenAI;
283
283
  protected set client(client: OpenAI);
284
284
  protected buildClient(): OpenAI;
285
+ private getEffectiveMaxOutputTokensField;
285
286
  protected onStaleConnection(): void;
286
287
  /**
287
288
  * FEATURE_216 v0.7.45 — Lightweight credential verification.
@@ -389,6 +390,8 @@ type ProviderSnapshot = {
389
390
  readonly contextWindow?: number;
390
391
  /** Per-turn output token cap KodaX requests. Provider-level default. */
391
392
  readonly maxOutputTokens?: number;
393
+ /** OpenAI Chat Completions field used for the output-token cap. */
394
+ readonly maxOutputTokensField?: KodaXOpenAICompatMaxOutputTokensField;
392
395
  /** Upper bound on `thinking_budget` for native-budget reasoning providers. */
393
396
  readonly thinkingBudgetCap?: number;
394
397
  /** Whether the provider supports `thinking_budget` / native reasoning. */
@@ -1,4 +1,4 @@
1
- import { f4 as WorkflowProcessTrackerOptions, eC as WorkflowEvent, e_ as WorkflowProcessSnapshot, eU as WorkflowProcessEvent } from './types.d-BA-Jwpfs.js';
1
+ import { fg as WorkflowProcessTrackerOptions, eO as WorkflowEvent, fa as WorkflowProcessSnapshot, f4 as WorkflowProcessEvent } from './controller.d-RGV7Pjv9.js';
2
2
 
3
3
  /**
4
4
  * FEATURE_246 Part A0 (ADR-046) — neutral workflow run lifecycle manager.
@@ -1,6 +1,6 @@
1
- import { g as CreatableHistoryItem, a8 as ToolCall } from './public-api.d-B3AohsxN.js';
2
- import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-DIpZJKUl.js';
3
- import { c3 as KodaXSessionUiHistoryItem, c7 as KodaXSessionUiToolCall } from './types.d-BA-Jwpfs.js';
1
+ import { h as CreatableHistoryItem, as as ToolCall } from './public-api.d-BpJhHoa7.js';
2
+ import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-CgrXrFrq.js';
3
+ import { cc as KodaXSessionUiHistoryItem, cg as KodaXSessionUiToolCall } from './controller.d-RGV7Pjv9.js';
4
4
 
5
5
  interface RestoreHistoryItemsFromSessionInput {
6
6
  messages: readonly KodaXMessage[];
@@ -1,5 +1,5 @@
1
- import { k as KodaXMessage, H as KodaXReasoningRequest, a0 as KodaXTokenUsage } from './types.d-DIpZJKUl.js';
2
- import { K as KodaXBaseProvider } from './base.d-4e74xDdy.js';
1
+ import { k as KodaXMessage, I as KodaXReasoningRequest, a1 as KodaXTokenUsage } from './types.d-CgrXrFrq.js';
2
+ import { K as KodaXBaseProvider } from './base.d-DxG0m09Z.js';
3
3
  import { a as CostTracker } from './cost-tracker.d-BeaenODW.js';
4
4
 
5
5
  /**
@@ -58,6 +58,12 @@ interface SideQueryDiagnostics {
58
58
  readonly promptBytes: number;
59
59
  readonly retryCount: number;
60
60
  readonly retryWaitMs: number;
61
+ /** Provider completion mapped to the stable side-query stop taxonomy. */
62
+ readonly stopReason?: SideQueryStopReason;
63
+ /** UTF-8 size of returned text only; response content is never persisted. */
64
+ readonly responseBytes?: number;
65
+ /** Number of provider text blocks concatenated into the returned text. */
66
+ readonly textBlockCount?: number;
61
67
  /** Time until the first lifecycle/data event exposed by the provider adapter. */
62
68
  readonly firstUpstreamEventMs?: number;
63
69
  /** Time until the first non-empty thinking delta. */
@@ -1,4 +1,4 @@
1
- import { k as KodaXMessage } from './types.d-DIpZJKUl.js';
1
+ import { k as KodaXMessage } from './types.d-CgrXrFrq.js';
2
2
 
3
3
  /**
4
4
  * @kodax-ai/agent Types
@@ -1,5 +1,5 @@
1
- import { bD as KodaXInputArtifact } from './types.d-BA-Jwpfs.js';
2
- import { S as KodaXTaskResultMetadata } from './types.d-DIpZJKUl.js';
1
+ import { bM as KodaXInputArtifact } from './controller.d-RGV7Pjv9.js';
2
+ import { T as KodaXTaskResultMetadata } from './types.d-CgrXrFrq.js';
3
3
 
4
4
  /**
5
5
  * @kodax-ai/agent/messaging — Message queue types
@@ -1,8 +1,8 @@
1
- import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-DIpZJKUl.js';
2
- import { K as KodaXBaseProvider } from './base.d-4e74xDdy.js';
1
+ import { aa as KodaXWireReasoningEffort, a2 as KodaXToolDefinition, a4 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-CgrXrFrq.js';
2
+ import { K as KodaXBaseProvider } from './base.d-DxG0m09Z.js';
3
3
  import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-K664nHOS.js';
4
- import { bF as KodaXJsonValue, bt as KodaXExtensionSessionRecord, bv as KodaXExtensionStore } from './types.d-BA-Jwpfs.js';
5
- import { aP as KodaXToolExecutionContext, bx as ToolSideEffect } from './bash-prefix-extractor.d-uAe2Oqda.js';
4
+ import { bO as KodaXJsonValue, bC as KodaXExtensionSessionRecord, bE as KodaXExtensionStore } from './controller.d-RGV7Pjv9.js';
5
+ import { aQ as KodaXToolExecutionContext, by as ToolSideEffect } from './bash-prefix-extractor.d-CNSidpmv.js';
6
6
 
7
7
  /**
8
8
  * KodaX Constructed-World types (FEATURE_087, v0.7.28).