@kodax-ai/kodax 0.7.96 → 0.7.97-alpha.2

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 (127) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +85 -62
  3. package/README_CN.md +57 -67
  4. package/config-templates/config.example.jsonc +0 -14
  5. package/dist/chunks/{agent-7N427EVB.js → agent-J7SHFM5N.js} +1 -1
  6. package/dist/chunks/argument-completer-ZJQOWTIS.js +2 -0
  7. package/dist/chunks/{chunk-ABZDFK2X.js → chunk-2GV6MQ4T.js} +14 -14
  8. package/dist/chunks/{chunk-6QI3GOYG.js → chunk-3PS3YEDS.js} +1 -1
  9. package/dist/chunks/chunk-4VJMQDTH.js +417 -0
  10. package/dist/chunks/{chunk-NI7PBPUR.js → chunk-5DSUVP46.js} +1 -1
  11. package/dist/chunks/chunk-5P7RTSZT.js +21 -0
  12. package/dist/chunks/{chunk-XXNR6S4Q.js → chunk-6ZAQKFIM.js} +1 -1
  13. package/dist/chunks/chunk-7V2QBZ73.js +137 -0
  14. package/dist/chunks/{chunk-C7U542KM.js → chunk-F7DHZH6T.js} +1 -1
  15. package/dist/chunks/{chunk-7IMWOR34.js → chunk-HSRYDDPF.js} +1 -1
  16. package/dist/chunks/chunk-K3DQGSQU.js +372 -0
  17. package/dist/chunks/chunk-NO23K2CB.js +2 -0
  18. package/dist/chunks/{chunk-NKT3B3DR.js → chunk-OT5WHAX4.js} +1 -1
  19. package/dist/chunks/{chunk-YEAUDI6U.js → chunk-QGWHJIO4.js} +1 -1
  20. package/dist/chunks/chunk-QOFFAY5C.js +261 -0
  21. package/dist/chunks/{chunk-4PFZ7BEE.js → chunk-QVDTORL3.js} +11 -11
  22. package/dist/chunks/chunk-QZ4B4AWG.js +473 -0
  23. package/dist/chunks/chunk-RXDS6CNA.js +355 -0
  24. package/dist/chunks/{chunk-WV3DJVW4.js → chunk-VDGPJQL7.js} +135 -135
  25. package/dist/chunks/chunk-VEZ4WHPN.js +641 -0
  26. package/dist/chunks/chunk-ZPPAT25E.js +5 -0
  27. package/dist/chunks/chunk-ZQYWDI4O.js +1 -0
  28. package/dist/chunks/chunk-ZS2GUADU.js +498 -0
  29. package/dist/chunks/{chunk-GN2IY5YE.js → chunk-ZTYZYXGV.js} +1 -1
  30. package/dist/chunks/{chunk-EM4XJBTK.js → chunk-ZZQ4GDVU.js} +1 -1
  31. package/dist/chunks/{client-6WZZTTSV.js → client-MXOJ5XUN.js} +1 -1
  32. package/dist/chunks/{compaction-config-ZMEJU4U7.js → compaction-config-5VZSGKBQ.js} +1 -1
  33. package/dist/chunks/{construction-bootstrap-RX4DMHI7.js → construction-bootstrap-U2ZU2WAT.js} +1 -1
  34. package/dist/chunks/dist-CSLNWLOE.js +2 -0
  35. package/dist/chunks/dist-XXMJMJDU.js +2 -0
  36. package/dist/chunks/host-RUXYZFYN.js +2 -0
  37. package/dist/chunks/readline-helpers-JCVULR4C.js +2 -0
  38. package/dist/chunks/run-manager-DRIM5VNE.js +2 -0
  39. package/dist/chunks/utils-MQEBGKIX.js +2 -0
  40. package/dist/index.d.ts +63 -30
  41. package/dist/index.js +10 -6
  42. package/dist/kodax_bootstrap.js +1 -1
  43. package/dist/kodax_cli.js +1745 -1734
  44. package/dist/kodax_resume.js +32 -35
  45. package/dist/native/win32-x64/kodax-windows-sandbox.exe +0 -0
  46. package/dist/native/win32-x64/kodax-windows-text-transaction.node +0 -0
  47. package/dist/native/win32-x64/manifest.json +2 -2
  48. package/dist/sandbox-network-broker.js +77 -77
  49. package/dist/sdk-a2a.d.ts +33 -18
  50. package/dist/sdk-a2a.js +8 -9
  51. package/dist/sdk-agent.d.ts +33 -26
  52. package/dist/sdk-agent.js +1 -1
  53. package/dist/sdk-client.d.ts +40 -0
  54. package/dist/sdk-client.js +2 -0
  55. package/dist/sdk-coding.d.ts +87 -499
  56. package/dist/sdk-coding.js +1 -1
  57. package/dist/sdk-experimental-memory.d.ts +3 -4
  58. package/dist/sdk-experimental-memory.js +1 -1
  59. package/dist/sdk-llm.d.ts +11 -9
  60. package/dist/sdk-llm.js +1 -1
  61. package/dist/sdk-mcp.d.ts +3 -3
  62. package/dist/sdk-mcp.js +1 -1
  63. package/dist/sdk-media.d.ts +3 -1
  64. package/dist/sdk-media.js +1 -1
  65. package/dist/sdk-repl.d.ts +317 -70
  66. package/dist/sdk-repl.js +2 -2
  67. package/dist/sdk-runtime.d.ts +580 -452
  68. package/dist/sdk-runtime.js +1 -1
  69. package/dist/sdk-sandbox.js +1 -1
  70. package/dist/sdk-session.d.ts +13 -9
  71. package/dist/sdk-session.js +1 -1
  72. package/dist/sdk-skills.js +1 -1
  73. package/dist/semantic-worker.js +57 -57
  74. package/dist/types-chunks/{base.d-Bt9lhwSV.d.ts → base.d-ZBOdjDUT.d.ts} +2 -1
  75. package/dist/types-chunks/{bash-prefix-extractor.d-DWFIMg0v.d.ts → bash-prefix-extractor.d-DvswAXKS.d.ts} +136 -66
  76. package/dist/types-chunks/{capability-learning.d-gRtO03f6.d.ts → capability-learning.d-B4pxKwP4.d.ts} +1 -1
  77. package/dist/types-chunks/{capability.d-Ch5Vos33.d.ts → capability.d-DOF3r0fJ.d.ts} +1 -1
  78. package/dist/types-chunks/{capsule.d-Dj1n6s0Y.d.ts → capsule.d-B4atvlxE.d.ts} +7 -19
  79. package/dist/types-chunks/client-contract-A1jdk6xz.d.ts +1993 -0
  80. package/dist/types-chunks/{controller.d-C0IM1Tud.d.ts → controller.d-BkUJ_3sl.d.ts} +1 -1
  81. package/dist/types-chunks/{controller.d-J2t1q8Ly.d.ts → controller.d-yyKajPTi.d.ts} +140 -1380
  82. package/dist/types-chunks/{cost-tracker.d-BWI4lFWn.d.ts → cost-tracker.d-BeaenODW.d.ts} +2 -47
  83. package/dist/types-chunks/{history-retrieval.d-CPN5PMBV.d.ts → history-retrieval.d-JdFfkeF3.d.ts} +2 -2
  84. package/dist/types-chunks/{manager.d-rtmywU9M.d.ts → manager.d-C_20XqCV.d.ts} +8 -1
  85. package/dist/types-chunks/manifest.d-Bw2i-zQi.d.ts +18 -0
  86. package/dist/types-chunks/provider-credential-context.d-BH2OaB1b.d.ts +47 -0
  87. package/dist/types-chunks/provider-request-observation.d-jL8T6wVO.d.ts +34 -0
  88. package/dist/types-chunks/{public-api.d-amBop8Nk.d.ts → public-api.d-Cq8ILMte.d.ts} +52 -13
  89. package/dist/types-chunks/{resolver.d-BrwLoWNr.d.ts → resolver.d-DLY01RHx.d.ts} +4 -2
  90. package/dist/types-chunks/{types.d-CSv0_cZC.d.ts → review-inbox.d-BeaLRNHx.d.ts} +251 -3
  91. package/dist/types-chunks/{shell-command-sets.d-oejwpP_7.d.ts → review-packet.d-D4bbTbq3.d.ts} +46 -3
  92. package/dist/types-chunks/{exec-policy.d-BPESl90L.d.ts → run-manager.d-C7Q71rin.d.ts} +385 -62
  93. package/dist/types-chunks/runtime-client-info-CxnlZlW5.d.ts +175 -0
  94. package/dist/types-chunks/{sdk-session-B6XjHNU1.d.ts → sdk-session-BDFjCpDn.d.ts} +12 -4
  95. package/dist/types-chunks/{side-query.d-DHWG1JZg.d.ts → side-query.d-DTrhVd_r.d.ts} +4 -3
  96. package/dist/types-chunks/trusted-repl-entry-vbUM8R6P.d.ts +445 -0
  97. package/dist/types-chunks/{types.d-CtO8mR1s.d.ts → types.d-BJTN-RZr.d.ts} +5 -5
  98. package/dist/types-chunks/{types.d-BrQMB-hy.d.ts → types.d-BjOq57-z.d.ts} +6 -0
  99. package/dist/types-chunks/types.d-o7t9dds4.d.ts +1484 -0
  100. package/dist/types-chunks/{utils.d-DcznBeQ3.d.ts → utils.d-CWiMhFfu.d.ts} +202 -36
  101. package/docs/CLIENT_CONTRACT.md +441 -0
  102. package/docs/SDK_MIGRATION.md +123 -0
  103. package/docs/SPACE_SDK_SEAMS.md +139 -0
  104. package/package.json +10 -5
  105. package/public_docs/README.md +12 -133
  106. package/public_docs/configuration/config-files.md +8 -14
  107. package/public_docs/sdk/embedder-guide.md +494 -420
  108. package/dist/chunks/argument-completer-FAIHW7HZ.js +0 -2
  109. package/dist/chunks/chunk-66XN5AFU.js +0 -417
  110. package/dist/chunks/chunk-7O2AIFNE.js +0 -373
  111. package/dist/chunks/chunk-DSXUXUZG.js +0 -5
  112. package/dist/chunks/chunk-GYO73UYQ.js +0 -275
  113. package/dist/chunks/chunk-HPCS3LZ5.js +0 -324
  114. package/dist/chunks/chunk-HZYRLIOC.js +0 -137
  115. package/dist/chunks/chunk-SC2ELSUS.js +0 -675
  116. package/dist/chunks/chunk-TEUD5VPJ.js +0 -471
  117. package/dist/chunks/chunk-TYZ2ZAYL.js +0 -487
  118. package/dist/chunks/dist-3UCCMCYR.js +0 -2
  119. package/dist/chunks/dist-F5IWZSAY.js +0 -2
  120. package/dist/chunks/host-W2JJ3V3Q.js +0 -2
  121. package/dist/chunks/run-manager-RBWU3EVE.js +0 -2
  122. package/dist/chunks/utils-DJ4ZFJGL.js +0 -2
  123. package/dist/runtime-worker.js +0 -5381
  124. package/dist/types-chunks/review-inbox.d-CTeUIKda.d.ts +0 -225
  125. package/dist/types-chunks/run-manager.d-hm1XgEou.d.ts +0 -94
  126. package/dist/types-chunks/trusted-repl-entry-D0w5M0UZ.d.ts +0 -323
  127. package/dist/types-chunks/types.d-B1l9pWyX.d.ts +0 -146
@@ -1,4 +1,4 @@
1
- import { k as KodaXMessage } from './types.d-BrQMB-hy.js';
1
+ import { k as KodaXMessage } from './types.d-BjOq57-z.js';
2
2
 
3
3
  type AgentActorState = 'running' | 'idle' | 'closed';
4
4
  type AgentTurnState = 'accepted' | 'running' | 'completed' | 'failed' | 'interrupted';
@@ -574,17 +574,38 @@ type KodaXSessionScope = 'user' | 'managed-task-worker';
574
574
  type KodaXSessionUiTextHistoryItemType = 'user' | 'assistant' | 'system' | 'thinking' | 'error' | 'event' | 'info' | 'hint' | 'sidecar';
575
575
  type KodaXSessionUiHistoryItemType = KodaXSessionUiTextHistoryItemType | 'tool_group';
576
576
  interface KodaXSessionUiTextHistoryItem {
577
+ /** Host checkpoint provenance; never inferred from display IDs or text. */
578
+ sourceRunId?: string;
579
+ sourceTurnId?: string;
580
+ /** Uncommitted generated output; canonical messages take ownership on save. */
581
+ outputId?: string;
582
+ textRevision?: number;
583
+ /** Source input boundary for retained output without a canonical message. */
584
+ afterInputId?: string;
585
+ /** Stable display identity, retained when a live item becomes history. */
586
+ id?: string;
577
587
  type: KodaXSessionUiTextHistoryItemType;
588
+ /** Accepted client input identity; joins this display item to its canonical user message. */
589
+ inputId?: string;
578
590
  text: string;
579
591
  /** Original UI event time in epoch milliseconds. Absent on older sessions. */
580
592
  timestamp?: number;
581
593
  /** Display-only item that is authoritative even without a canonical message anchor. */
582
594
  presentationOnly?: true;
595
+ /** Verifier facts; absent on legacy items whose icon encoded a single value. */
596
+ sidecarVerdict?: 'revise' | 'blocked';
597
+ sidecarDelivery?: 'synthetic-user-message' | 'budget-exhausted' | 'terminal-block';
583
598
  icon?: string;
584
599
  compactText?: string;
585
600
  }
586
601
  type KodaXSessionUiToolCallStatus = 'success' | 'error' | 'cancelled' | 'awaiting_approval';
587
602
  interface KodaXSessionUiToolCall {
603
+ /** Generated assistant invocation owning this call; call IDs can repeat. */
604
+ assistantOutputId?: string;
605
+ /** Execution crossed the tool boundary; a missing result still has an unknown outcome. */
606
+ executionBegan?: true;
607
+ /** A tool result was saved, including an empty result. */
608
+ resultRecorded?: true;
588
609
  id: string;
589
610
  name: string;
590
611
  status: KodaXSessionUiToolCallStatus;
@@ -598,6 +619,10 @@ interface KodaXSessionUiToolCall {
598
619
  endTime?: number;
599
620
  }
600
621
  interface KodaXSessionUiToolGroupHistoryItem {
622
+ sourceRunId?: string;
623
+ sourceTurnId?: string;
624
+ afterInputId?: string;
625
+ id?: string;
601
626
  type: 'tool_group';
602
627
  /** Original UI event time in epoch milliseconds. Absent on older sessions. */
603
628
  timestamp?: number;
@@ -606,6 +631,8 @@ interface KodaXSessionUiToolGroupHistoryItem {
606
631
  type KodaXSessionUiHistoryItem = KodaXSessionUiTextHistoryItem | KodaXSessionUiToolGroupHistoryItem;
607
632
  type KodaXSessionWorkspaceKind = 'detected' | 'managed';
608
633
  interface KodaXSessionRuntimeInfo {
634
+ /** Host-owned task lifetime; delete this Session after its task settles. */
635
+ temporary?: boolean;
609
636
  canonicalRepoRoot?: string;
610
637
  workspaceRoot?: string;
611
638
  executionCwd?: string;
@@ -1107,5 +1134,226 @@ type MemoryEvent = {
1107
1134
  readonly actionCount: number;
1108
1135
  };
1109
1136
 
1110
- export { hashMemoryIdentityComponent as bg, isMemoryManagementController as bh, matchesMemoryApplicability as bi, memoryApplicabilityFingerprint as bj };
1111
- export type { KodaXGoalStatus as $, AgentActor as A, AgentInterruptScope as B, AgentIterationProgress as C, AgentLimitReached as D, AgentListEntry as E, AgentMailboxMessage as F, AgentMetadataValue as G, AgentMutationOptions as H, AgentOutput as I, AgentProgressItem as J, AgentProgressKind as K, AgentProgressUpdate as L, AgentSpawnInput as M, AgentTreeSnapshot as N, AgentTurn as O, AgentTurnExecutor as P, AgentTurnRef as Q, AgentTurnState as R, AgentTurnSummary as S, KodaXCompactMemoryProgress as T, KodaXCompactMemorySeed as U, KodaXExtensionSessionRecord as V, KodaXExtensionSessionState as W, KodaXExtensionStore as X, KodaXExtensionStoreEntry as Y, KodaXGoalEventType as Z, KodaXGoalState as _, AgentActorClient as a, MemoryRefKind as a$, KodaXHandledMemoryOperation as a0, KodaXJsonValue as a1, KodaXMemoryInfluenceRef as a2, KodaXMemoryIntent as a3, KodaXMemoryOutcomeDigest as a4, KodaXMemoryOutcomeEvidence as a5, KodaXSessionArchiveMarkerEntry as a6, KodaXSessionArtifactLedgerEntry as a7, KodaXSessionBranchSummaryEntry as a8, KodaXSessionClientNoticeEntry as a9, MemoryApplicability as aA, MemoryApplyPreview as aB, MemoryApplyResult as aC, MemoryApproval as aD, MemoryAuthority as aE, MemoryAutoCuratorInput as aF, MemoryAutoCuratorResult as aG, MemoryBodySnapshot as aH, MemoryClaimKind as aI, MemoryContextIdentity as aJ, MemoryController as aK, MemoryCuratorInput as aL, MemoryEpisodeReviewResult as aM, MemoryEvent as aN, MemoryGovernanceFinding as aO, MemoryGovernanceFindingKind as aP, MemoryGovernanceReport as aQ, MemoryItemRef as aR, MemoryLifecycle as aS, MemoryLifecycleOperationResult as aT, MemoryManagementController as aU, MemoryPack as aV, MemoryPackHint as aW, MemoryPackInput as aX, MemoryPackTraceMetadata as aY, MemoryProposalAction as aZ, MemoryRefFilter as a_, KodaXSessionCompactionEntry as aa, KodaXSessionData as ab, KodaXSessionEntry as ac, KodaXSessionEntryBase as ad, KodaXSessionGoalEntry as ae, KodaXSessionLabelEntry as af, KodaXSessionLineage as ag, KodaXSessionMemoryOutcomeDigestEntry as ah, KodaXSessionMemoryReviewReceiptEntry as ai, KodaXSessionMessageEntry as aj, KodaXSessionMeta as ak, KodaXSessionNavigationOptions as al, KodaXSessionRewindMarkerEntry as am, KodaXSessionRuntimeInfo as an, KodaXSessionScope as ao, KodaXSessionStorage as ap, KodaXSessionTreeNode as aq, KodaXSessionUiHistoryItem as ar, KodaXSessionUiHistoryItemType as as, KodaXSessionUiTextHistoryItem as at, KodaXSessionUiTextHistoryItemType as au, KodaXSessionUiToolCall as av, KodaXSessionUiToolCallStatus as aw, KodaXSessionUiToolGroupHistoryItem as ax, KodaXSessionWorkspaceKind as ay, MemoryActionProposal as az, AgentActorOwner as b, MemoryRejectResult as b0, MemoryRememberInput as b1, MemoryRememberResult as b2, MemoryReviewCandidateRef as b3, MemoryReviewDraftAction as b4, MemoryReviewInput as b5, MemoryReviewModelInput as b6, MemoryReviewPersistenceDecision as b7, MemoryReviewPersistenceKind as b8, MemoryReviewPlan as b9, MemoryReviewRunner as ba, MemoryReviewTrigger as bb, MemoryScope as bc, MemorySourceAdapter as bd, MemoryVisibility as be, SessionErrorMetadata as bf, AgentActorSaveAttempt as c, AgentActorSaveDiagnostics as d, AgentActorSavePhase as e, AgentActorSaveTiming as f, AgentActorSnapshot as g, AgentActorSnapshotV1 as h, AgentActorSnapshotV2 as i, AgentActorState as j, AgentActorStore as k, AgentArtifactDescriptor as l, AgentBudgetAdmission as m, AgentBudgetAdmissionInput as n, AgentBudgetExhausted as o, AgentBudgetPort as p, AgentCapabilities as q, AgentDataClassification as r, AgentDetail as s, AgentEvent as t, AgentEventKind as u, AgentExecutionInput as v, AgentExecutionKind as w, AgentExecutionResult as x, AgentFollowupResult as y, AgentForkTurns as z };
1137
+ interface PendingEpisodeReviewV1 {
1138
+ readonly version: 1;
1139
+ readonly reviewKey: string;
1140
+ readonly digest: KodaXMemoryOutcomeDigest;
1141
+ readonly ownerSessionRef: string;
1142
+ readonly ownerAgentHash: string;
1143
+ readonly ownerProjectHash?: string;
1144
+ readonly createdAt: string;
1145
+ }
1146
+ interface PendingEpisodeReviewV2 {
1147
+ readonly version: 2;
1148
+ readonly jobId: string;
1149
+ readonly reviewKey: string;
1150
+ readonly digest: KodaXMemoryOutcomeDigest;
1151
+ readonly ownerSessionRef: string;
1152
+ readonly ownerAgentHash: string;
1153
+ readonly ownerProjectHash?: string;
1154
+ readonly branchId: string;
1155
+ readonly branchEpoch: number;
1156
+ readonly authorityCeiling: 'memory_and_project_skill';
1157
+ readonly createdAt: string;
1158
+ }
1159
+ type PendingEpisodeReview = PendingEpisodeReviewV1 | PendingEpisodeReviewV2;
1160
+ interface PendingEpisodeReviewFilter {
1161
+ readonly configHome?: string;
1162
+ readonly tenantId: string;
1163
+ readonly agentId?: string;
1164
+ /** Omit for every project; pass null for ownerless reviews only. */
1165
+ readonly projectId?: string | null;
1166
+ }
1167
+ type EpisodeReviewJobStatus = 'pending' | 'processing' | 'decided' | 'completed' | 'attention';
1168
+ interface EpisodeReviewJobState {
1169
+ readonly schemaVersion: 1;
1170
+ readonly jobId: string;
1171
+ readonly status: EpisodeReviewJobStatus;
1172
+ readonly claimEpoch: number;
1173
+ readonly claimToken?: string;
1174
+ readonly leaseDeadline?: string;
1175
+ readonly providerAttempts: number;
1176
+ readonly applyAttempts: number;
1177
+ readonly applyAttemptsByCarrier: {
1178
+ readonly memory: number;
1179
+ readonly skill: number;
1180
+ };
1181
+ readonly completionAttempts: number;
1182
+ readonly nextAttemptAt?: string;
1183
+ readonly nextApplyAttemptAt?: string;
1184
+ readonly nextCompletionAttemptAt?: string;
1185
+ readonly lastError?: string;
1186
+ readonly updatedAt: string;
1187
+ }
1188
+ interface PendingEpisodeReviewSummary {
1189
+ readonly version: 1 | 2;
1190
+ readonly jobId?: string;
1191
+ readonly reviewKey: string;
1192
+ readonly ownerSessionRef: string;
1193
+ readonly createdAt: string;
1194
+ readonly status: EpisodeReviewJobStatus | 'unknown';
1195
+ readonly providerAttempts?: number;
1196
+ readonly applyAttempts?: number;
1197
+ readonly completionAttempts?: number;
1198
+ readonly nextAttemptAt?: string;
1199
+ readonly nextApplyAttemptAt?: string;
1200
+ readonly nextCompletionAttemptAt?: string;
1201
+ readonly lastError?: string;
1202
+ }
1203
+ interface EpisodeReviewClaim {
1204
+ readonly jobId: string;
1205
+ readonly reviewKey: string;
1206
+ readonly ownerSessionRef: string;
1207
+ readonly branchId: string;
1208
+ readonly branchEpoch: number;
1209
+ readonly epoch: number;
1210
+ readonly token: string;
1211
+ readonly leaseDeadline: string;
1212
+ }
1213
+ interface EpisodeReviewInputSpec {
1214
+ readonly evidence: unknown;
1215
+ readonly promptRevision: string;
1216
+ readonly schemaRevision: string;
1217
+ readonly policyRevision: string;
1218
+ readonly providerRevision: string;
1219
+ }
1220
+ interface EpisodeReviewInputCheckpoint extends EpisodeReviewInputSpec {
1221
+ readonly version: 1;
1222
+ readonly jobId: string;
1223
+ readonly evidenceBytes: string;
1224
+ readonly evidenceHash: string;
1225
+ readonly createdAt: string;
1226
+ }
1227
+ interface EpisodeReviewDecisionInput {
1228
+ readonly inputHash: string;
1229
+ readonly memoryProposalIds: readonly string[];
1230
+ readonly requiredCarriers?: readonly ('memory' | 'skill')[];
1231
+ readonly memoryPlan?: unknown;
1232
+ readonly capabilityDecision?: unknown;
1233
+ }
1234
+ interface EpisodeReviewDecision extends EpisodeReviewDecisionInput {
1235
+ readonly version: 1;
1236
+ readonly jobId: string;
1237
+ readonly decisionId: string;
1238
+ readonly committedAt: string;
1239
+ }
1240
+ interface EpisodeReviewActionInput {
1241
+ readonly actionId: string;
1242
+ readonly decisionId: string;
1243
+ readonly carrier: 'memory' | 'skill';
1244
+ readonly resultRefs: readonly string[];
1245
+ }
1246
+ interface EpisodeReviewActionReceipt extends EpisodeReviewActionInput {
1247
+ readonly version: 1;
1248
+ readonly jobId: string;
1249
+ readonly committedAt: string;
1250
+ }
1251
+ type EpisodeReviewFailureKind = 'provider_timeout' | 'provider_error' | 'malformed_response' | 'shutdown' | 'budget_unavailable' | 'provider_unavailable';
1252
+ declare class EpisodeReviewFailure extends Error {
1253
+ readonly kind: EpisodeReviewFailureKind;
1254
+ constructor(kind: EpisodeReviewFailureKind, message: string);
1255
+ }
1256
+ interface EpisodeReviewJobSnapshot {
1257
+ readonly envelope: PendingEpisodeReviewV2;
1258
+ readonly state: EpisodeReviewJobState;
1259
+ readonly input?: EpisodeReviewInputCheckpoint;
1260
+ readonly decision?: EpisodeReviewDecision;
1261
+ readonly actions: readonly EpisodeReviewActionReceipt[];
1262
+ }
1263
+ interface EpisodeReviewReceipt {
1264
+ readonly version: 1;
1265
+ readonly jobId?: string;
1266
+ readonly reviewKey: string;
1267
+ readonly ownerAgentHash?: string;
1268
+ readonly ownerProjectHash?: string;
1269
+ readonly proposalIds: readonly string[];
1270
+ readonly completedAt: string;
1271
+ }
1272
+ type EpisodeReviewDrainEligibility = 'eligible' | 'discard' | 'defer';
1273
+ interface EpisodeReviewDrainOptions {
1274
+ readonly maxEntries?: number;
1275
+ /** Process this just-persisted job before bounded backlog work. */
1276
+ readonly preferredJobId?: string;
1277
+ /** Skip unrelated backlog when searching across alternate project identities. */
1278
+ readonly onlyPreferred?: boolean;
1279
+ /** Epoch-ms deadline: stop claiming new jobs once passed and release an
1280
+ * in-flight claim instead of committing a decision. */
1281
+ readonly deadlineAtMs?: number;
1282
+ /** Cancel new work and await the active reviewer before releasing its claim.
1283
+ * Owned reviewers must honor their signal and settle; neither cancellation nor
1284
+ * the provider timeout detaches a still-running owned reviewer. */
1285
+ readonly abortSignal?: AbortSignal;
1286
+ readonly revalidate: (entry: PendingEpisodeReview) => Promise<EpisodeReviewDrainEligibility>;
1287
+ readonly review: (entry: PendingEpisodeReview, signal?: AbortSignal) => Promise<readonly string[]>;
1288
+ readonly prepareV2Input?: (entry: PendingEpisodeReviewV2) => Promise<EpisodeReviewInputSpec>;
1289
+ readonly decideV2?: (entry: PendingEpisodeReviewV2, input: EpisodeReviewInputCheckpoint, signal: AbortSignal) => Promise<EpisodeReviewDecisionInput>;
1290
+ readonly listV2Actions?: (entry: PendingEpisodeReviewV2, decision: EpisodeReviewDecision) => readonly ('memory' | 'skill')[];
1291
+ readonly applyV2Action?: (entry: PendingEpisodeReviewV2, decision: EpisodeReviewDecision, carrier: 'memory' | 'skill', claim: EpisodeReviewClaim, commitWithAuthority: (effect: (revalidateAuthority: () => Promise<void>) => Promise<readonly string[]>) => Promise<readonly string[]>) => Promise<readonly string[]>;
1292
+ readonly onV2Completed?: (entry: PendingEpisodeReviewV2, decision: EpisodeReviewDecision, proposalIds: readonly string[]) => Promise<void>;
1293
+ }
1294
+ interface EpisodeReviewDrainResult {
1295
+ readonly reviewed: number;
1296
+ readonly discarded: number;
1297
+ readonly deferred: number;
1298
+ readonly failed: number;
1299
+ readonly failures: readonly {
1300
+ readonly reviewKey: string;
1301
+ readonly error: string;
1302
+ }[];
1303
+ }
1304
+ declare class EpisodeReviewBranchChangedError extends Error {
1305
+ constructor();
1306
+ }
1307
+ declare function captureEpisodeReviewBranchEpoch(identity: MemoryContextIdentity): Promise<number>;
1308
+ declare function persistPendingEpisodeReview(identity: MemoryContextIdentity, digest: KodaXMemoryOutcomeDigest, options?: {
1309
+ readonly expectedBranchEpoch?: number;
1310
+ readonly persistOwner?: (entry: PendingEpisodeReviewV2) => Promise<void>;
1311
+ }): Promise<{
1312
+ readonly path: string;
1313
+ readonly entry: PendingEpisodeReviewV2;
1314
+ }>;
1315
+ declare function claimEpisodeReview(identity: MemoryContextIdentity, reviewKeyOrJobId: string, options?: {
1316
+ readonly now?: Date;
1317
+ readonly leaseMs?: number;
1318
+ }): Promise<EpisodeReviewClaim | undefined>;
1319
+ declare function freezeEpisodeReviewInput(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, spec: EpisodeReviewInputSpec, now?: Date): Promise<EpisodeReviewInputCheckpoint>;
1320
+ declare function commitEpisodeReviewDecision(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, input: EpisodeReviewDecisionInput, now?: Date): Promise<EpisodeReviewDecision>;
1321
+ declare function commitEpisodeReviewAction(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, input: EpisodeReviewActionInput, now?: Date): Promise<EpisodeReviewActionReceipt>;
1322
+ declare function withEpisodeReviewClaimAuthority<T>(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, operation: (revalidateAuthority: () => Promise<void>) => Promise<T>): Promise<T>;
1323
+ declare function failEpisodeReviewAttempt(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, failure: {
1324
+ readonly kind: EpisodeReviewFailureKind;
1325
+ readonly message: string;
1326
+ }, now?: Date): Promise<EpisodeReviewJobState>;
1327
+ declare function failEpisodeReviewApply(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, failure: {
1328
+ readonly carrier: 'memory' | 'skill';
1329
+ readonly message: string;
1330
+ }, now?: Date): Promise<EpisodeReviewJobState>;
1331
+ declare function deferEpisodeReview(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, reason: string, now?: Date): Promise<EpisodeReviewJobState>;
1332
+ declare function completeFencedEpisodeReview(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, proposalIds: readonly string[], now?: Date): Promise<{
1333
+ readonly acknowledged: boolean;
1334
+ readonly receiptPath: string;
1335
+ }>;
1336
+ declare function discardFencedEpisodeReview(identity: MemoryContextIdentity, claim: EpisodeReviewClaim, reason: string, now?: Date): Promise<void>;
1337
+ declare function inspectEpisodeReviewJob(identity: MemoryContextIdentity, reviewKeyOrJobId: string): Promise<EpisodeReviewJobSnapshot | undefined>;
1338
+ declare function listPendingEpisodeReviews(filter: PendingEpisodeReviewFilter): Promise<readonly PendingEpisodeReview[]>;
1339
+ declare function listPendingEpisodeReviewSummaries(filter: PendingEpisodeReviewFilter): Promise<readonly PendingEpisodeReviewSummary[]>;
1340
+ declare function completeEpisodeReview(identity: MemoryContextIdentity, reviewKey: string, proposalIds: readonly string[]): Promise<{
1341
+ readonly acknowledged: boolean;
1342
+ readonly receiptPath: string;
1343
+ }>;
1344
+ /**
1345
+ * Establishes the lock order used by both review completion and Session branch
1346
+ * mutation: the Session root registry first, every sorted tenant branch fence
1347
+ * next, then the caller-owned Session transaction. The supplied fence operation
1348
+ * runs without reacquiring those locks, so a mutation can fence its prospective
1349
+ * lineage and persist that exact lineage atomically with respect to review
1350
+ * effects, new tenant registration and completion delivery.
1351
+ */
1352
+ declare function withPendingEpisodeReviewSessionFence<T>(input: {
1353
+ readonly configHome?: string;
1354
+ readonly sessionId: string;
1355
+ }, operation: (fence: (activeReviewIds: readonly string[]) => Promise<number>) => Promise<T>): Promise<T>;
1356
+ declare function drainPendingEpisodeReviews(identity: MemoryContextIdentity, options: EpisodeReviewDrainOptions): Promise<EpisodeReviewDrainResult>;
1357
+
1358
+ export { EpisodeReviewBranchChangedError as V, EpisodeReviewFailure as a0, captureEpisodeReviewBranchEpoch as bC, claimEpisodeReview as bD, commitEpisodeReviewAction as bE, commitEpisodeReviewDecision as bF, completeEpisodeReview as bG, completeFencedEpisodeReview as bH, deferEpisodeReview as bI, discardFencedEpisodeReview as bJ, drainPendingEpisodeReviews as bK, failEpisodeReviewApply as bL, failEpisodeReviewAttempt as bM, freezeEpisodeReviewInput as bN, hashMemoryIdentityComponent as bO, inspectEpisodeReviewJob as bP, isMemoryManagementController as bQ, listPendingEpisodeReviewSummaries as bR, listPendingEpisodeReviews as bS, matchesMemoryApplicability as bT, memoryApplicabilityFingerprint as bU, persistPendingEpisodeReview as bV, withEpisodeReviewClaimAuthority as bW, withPendingEpisodeReviewSessionFence as bX };
1359
+ export type { EpisodeReviewDrainResult as $, AgentActor as A, AgentInterruptScope as B, AgentIterationProgress as C, AgentLimitReached as D, AgentListEntry as E, AgentMailboxMessage as F, AgentMetadataValue as G, AgentMutationOptions as H, AgentOutput as I, AgentProgressItem as J, AgentProgressKind as K, AgentProgressUpdate as L, AgentSpawnInput as M, AgentTreeSnapshot as N, AgentTurn as O, AgentTurnExecutor as P, AgentTurnRef as Q, AgentTurnState as R, AgentTurnSummary as S, EpisodeReviewActionInput as T, EpisodeReviewActionReceipt as U, EpisodeReviewClaim as W, EpisodeReviewDecision as X, EpisodeReviewDecisionInput as Y, EpisodeReviewDrainEligibility as Z, EpisodeReviewDrainOptions as _, AgentActorClient as a, MemoryController as a$, EpisodeReviewFailureKind as a1, EpisodeReviewInputCheckpoint as a2, EpisodeReviewInputSpec as a3, EpisodeReviewJobSnapshot as a4, EpisodeReviewJobState as a5, EpisodeReviewJobStatus as a6, EpisodeReviewReceipt as a7, KodaXCompactMemoryProgress as a8, KodaXCompactMemorySeed as a9, KodaXSessionMessageEntry as aA, KodaXSessionMeta as aB, KodaXSessionNavigationOptions as aC, KodaXSessionRewindMarkerEntry as aD, KodaXSessionRuntimeInfo as aE, KodaXSessionScope as aF, KodaXSessionStorage as aG, KodaXSessionTreeNode as aH, KodaXSessionUiHistoryItem as aI, KodaXSessionUiHistoryItemType as aJ, KodaXSessionUiTextHistoryItem as aK, KodaXSessionUiTextHistoryItemType as aL, KodaXSessionUiToolCall as aM, KodaXSessionUiToolCallStatus as aN, KodaXSessionUiToolGroupHistoryItem as aO, KodaXSessionWorkspaceKind as aP, MemoryActionProposal as aQ, MemoryApplicability as aR, MemoryApplyPreview as aS, MemoryApplyResult as aT, MemoryApproval as aU, MemoryAuthority as aV, MemoryAutoCuratorInput as aW, MemoryAutoCuratorResult as aX, MemoryBodySnapshot as aY, MemoryClaimKind as aZ, MemoryContextIdentity as a_, KodaXExtensionSessionRecord as aa, KodaXExtensionSessionState as ab, KodaXExtensionStore as ac, KodaXExtensionStoreEntry as ad, KodaXGoalEventType as ae, KodaXGoalState as af, KodaXGoalStatus as ag, KodaXHandledMemoryOperation as ah, KodaXJsonValue as ai, KodaXMemoryInfluenceRef as aj, KodaXMemoryIntent as ak, KodaXMemoryOutcomeDigest as al, KodaXMemoryOutcomeEvidence as am, KodaXSessionArchiveMarkerEntry as an, KodaXSessionArtifactLedgerEntry as ao, KodaXSessionBranchSummaryEntry as ap, KodaXSessionClientNoticeEntry as aq, KodaXSessionCompactionEntry as ar, KodaXSessionData as as, KodaXSessionEntry as at, KodaXSessionEntryBase as au, KodaXSessionGoalEntry as av, KodaXSessionLabelEntry as aw, KodaXSessionLineage as ax, KodaXSessionMemoryOutcomeDigestEntry as ay, KodaXSessionMemoryReviewReceiptEntry as az, AgentActorOwner as b, MemoryCuratorInput as b0, MemoryEpisodeReviewResult as b1, MemoryEvent as b2, MemoryGovernanceFinding as b3, MemoryGovernanceFindingKind as b4, MemoryGovernanceReport as b5, MemoryItemRef as b6, MemoryLifecycle as b7, MemoryLifecycleOperationResult as b8, MemoryManagementController as b9, PendingEpisodeReviewV2 as bA, SessionErrorMetadata as bB, MemoryPack as ba, MemoryPackHint as bb, MemoryPackInput as bc, MemoryPackTraceMetadata as bd, MemoryProposalAction as be, MemoryRefFilter as bf, MemoryRefKind as bg, MemoryRejectResult as bh, MemoryRememberInput as bi, MemoryRememberResult as bj, MemoryReviewCandidateRef as bk, MemoryReviewDraftAction as bl, MemoryReviewInput as bm, MemoryReviewModelInput as bn, MemoryReviewPersistenceDecision as bo, MemoryReviewPersistenceKind as bp, MemoryReviewPlan as bq, MemoryReviewRunner as br, MemoryReviewTrigger as bs, MemoryScope as bt, MemorySourceAdapter as bu, MemoryVisibility as bv, PendingEpisodeReview as bw, PendingEpisodeReviewFilter as bx, PendingEpisodeReviewSummary as by, PendingEpisodeReviewV1 as bz, AgentActorSaveAttempt as c, AgentActorSaveDiagnostics as d, AgentActorSavePhase as e, AgentActorSaveTiming as f, AgentActorSnapshot as g, AgentActorSnapshotV1 as h, AgentActorSnapshotV2 as i, AgentActorState as j, AgentActorStore as k, AgentArtifactDescriptor as l, AgentBudgetAdmission as m, AgentBudgetAdmissionInput as n, AgentBudgetExhausted as o, AgentBudgetPort as p, AgentCapabilities as q, AgentDataClassification as r, AgentDetail as s, AgentEvent as t, AgentEventKind as u, AgentExecutionInput as v, AgentExecutionKind as w, AgentExecutionResult as x, AgentFollowupResult as y, AgentForkTurns as z };
@@ -1,4 +1,4 @@
1
- import { bK as RunScopedToolDefinition, a as BashPrefixExtractor } from './bash-prefix-extractor.d-DWFIMg0v.js';
1
+ import { bL as RunScopedToolDefinition, a as BashPrefixExtractor } from './bash-prefix-extractor.d-DvswAXKS.js';
2
2
 
3
3
  /**
4
4
  * Permission Utilities
@@ -294,5 +294,48 @@ declare const MODIFICATION_TOOLS: Set<string>;
294
294
  declare const BASH_WRITE_COMMANDS: Set<string>;
295
295
  declare const BASH_SAFE_READ_COMMANDS: Set<string>;
296
296
 
297
- export { BASH_SAFE_READ_COMMANDS as B, FILE_MODIFICATION_TOOLS as F, MODIFICATION_TOOLS as M, BASH_WRITE_COMMANDS as a, collectDeterministicBashWriteTargets as b, collectBashWriteTargets as c, getBashOutsideProjectWriteRisk as d, extractPathsFromCommand as e, findGitSubcommandIndex as f, generateSavePattern as g, getDirectShellBypassBlockReason as h, getPlanModeAllowedWritablePaths as i, getPlanModeBlockReason as j, gitSignatureInspectionMayExecute as k, inferPermissionMode as l, isAlwaysConfirmPath as m, isBashReadCommand as n, isBashReadCommandAutoAllowed as o, isBashWriteCommand as p, isCommandOnProtectedPath as q, isHelpCommand as r, isPathInsideProject as s, isPlanModeAllowedPath as t, isShellReadOnlyArgv as u, isToolCallAllowed as v, parseAllowedToolPattern as w, parseGitGrepShortOption as x, tokenizeRawCommandStages as y };
298
- export type { GitGrepShortOption as G, PermissionMode as P, RawCommandWord as R };
297
+ interface ReviewPacketBudget {
298
+ readonly maxBytes: number;
299
+ readonly maxLines: number;
300
+ readonly maxLineChars: number;
301
+ }
302
+ interface ReviewPacketChunk {
303
+ readonly path: string;
304
+ readonly contentHash: string;
305
+ }
306
+ interface ReviewPacketMetadata {
307
+ readonly packetPath: string;
308
+ readonly contentHash: string;
309
+ readonly rangeId: string;
310
+ readonly partitionKey: string;
311
+ readonly label: string;
312
+ readonly baseRef?: string;
313
+ readonly headRef?: string;
314
+ readonly scopePaths: readonly string[];
315
+ readonly riskFlags: readonly 'routing-high'[];
316
+ readonly budget: ReviewPacketBudget;
317
+ readonly evidenceChunks: readonly ReviewPacketChunk[];
318
+ readonly requirementsPresent: boolean;
319
+ readonly testEvidencePresent: boolean;
320
+ }
321
+ interface ReviewPacketInput {
322
+ readonly cwd: string;
323
+ readonly sessionId: string;
324
+ readonly label: string;
325
+ /** Exact captured diff bytes. The builder never rereads Git. */
326
+ readonly diff: string;
327
+ readonly scope?: 'staged' | 'unstaged' | 'all' | 'compare' | 'commit';
328
+ readonly baseRef?: string;
329
+ readonly headRef?: string;
330
+ readonly customPrompt?: string;
331
+ readonly requirements?: readonly string[];
332
+ readonly testEvidence?: readonly string[];
333
+ /** Must come from KodaXTaskRoutingDecision; no local semantic inference occurs. */
334
+ readonly routingRisk?: 'low' | 'medium' | 'high';
335
+ /** Test seam only; production snapshots the existing Read-tool caps. */
336
+ readonly budget?: ReviewPacketBudget;
337
+ }
338
+ declare function writeReviewPackets(input: ReviewPacketInput): Promise<readonly ReviewPacketMetadata[]>;
339
+
340
+ export { parseAllowedToolPattern as A, BASH_SAFE_READ_COMMANDS as B, parseGitGrepShortOption as C, tokenizeRawCommandStages as D, writeReviewPackets as E, FILE_MODIFICATION_TOOLS as F, MODIFICATION_TOOLS as M, BASH_WRITE_COMMANDS as a, collectBashWriteTargets as f, collectDeterministicBashWriteTargets as g, extractPathsFromCommand as h, findGitSubcommandIndex as i, generateSavePattern as j, getBashOutsideProjectWriteRisk as k, getDirectShellBypassBlockReason as l, getPlanModeAllowedWritablePaths as m, getPlanModeBlockReason as n, gitSignatureInspectionMayExecute as o, inferPermissionMode as p, isAlwaysConfirmPath as q, isBashReadCommand as r, isBashReadCommandAutoAllowed as s, isBashWriteCommand as t, isCommandOnProtectedPath as u, isHelpCommand as v, isPathInsideProject as w, isPlanModeAllowedPath as x, isShellReadOnlyArgv as y, isToolCallAllowed as z };
341
+ export type { GitGrepShortOption as G, PermissionMode as P, RawCommandWord as R, ReviewPacketBudget as b, ReviewPacketChunk as c, ReviewPacketInput as d, ReviewPacketMetadata as e };