@kodax-ai/kodax 0.7.67 → 0.7.69

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 (102) hide show
  1. package/CHANGELOG.md +209 -3
  2. package/README.md +61 -9
  3. package/README_CN.md +58 -9
  4. package/config-templates/config.example.jsonc +26 -0
  5. package/config-templates/integrations/a2a.example.jsonc +54 -0
  6. package/config-templates/integrations/extensions.example.jsonc +7 -0
  7. package/config-templates/integrations/mcp.example.jsonc +16 -0
  8. package/dist/chunks/agent-DQRXT6M7.js +2 -0
  9. package/dist/chunks/argument-completer-RSK6CCGP.js +2 -0
  10. package/dist/chunks/chunk-4WIODYOH.js +329 -0
  11. package/dist/chunks/chunk-AWMTNUDS.js +37 -0
  12. package/dist/chunks/chunk-F7C7J6IM.js +7 -0
  13. package/dist/chunks/chunk-I4TPQEJN.js +5 -0
  14. package/dist/chunks/chunk-M7TCFYTO.js +107 -0
  15. package/dist/chunks/chunk-NGHQIGVW.js +46 -0
  16. package/dist/chunks/chunk-NGJURAY5.js +306 -0
  17. package/dist/chunks/{chunk-KBBGDRER.js → chunk-PA76WUBL.js} +2 -2
  18. package/dist/chunks/chunk-PQ3XUSY2.js +357 -0
  19. package/dist/chunks/chunk-UJEMSPM5.js +78 -0
  20. package/dist/chunks/{chunk-DEICMTHO.js → chunk-URC6ZI6P.js} +1 -1
  21. package/dist/chunks/{chunk-EN3O2C43.js → chunk-VAZ25MDX.js} +122 -122
  22. package/dist/chunks/chunk-VYKFM3TB.js +751 -0
  23. package/dist/chunks/chunk-WW2O2DEP.js +2 -0
  24. package/dist/chunks/chunk-Y4WOTWUC.js +2 -0
  25. package/dist/chunks/chunk-Z4PPLJF2.js +60 -0
  26. package/dist/chunks/chunk-ZG4DMYBS.js +422 -0
  27. package/dist/chunks/compaction-config-ABLL6UH3.js +2 -0
  28. package/dist/chunks/{construction-bootstrap-GLEHQ2KB.js → construction-bootstrap-GH6RW6ST.js} +1 -1
  29. package/dist/chunks/dist-DRBKYVHF.js +2 -0
  30. package/dist/chunks/dist-RWL2RBO4.js +2 -0
  31. package/dist/chunks/host-7SAB4WEC.js +2 -0
  32. package/dist/chunks/run-manager-XMDKTONJ.js +2 -0
  33. package/dist/chunks/utils-QYE5Y73D.js +2 -0
  34. package/dist/index.d.ts +19 -19
  35. package/dist/index.js +6 -6
  36. package/dist/kodax_cli.js +1497 -1209
  37. package/dist/runtime-worker.js +1371 -1107
  38. package/dist/sdk-a2a.d.ts +397 -0
  39. package/dist/sdk-a2a.js +9 -0
  40. package/dist/sdk-agent.d.ts +172 -33
  41. package/dist/sdk-agent.js +1 -1
  42. package/dist/sdk-coding.d.ts +126 -51
  43. package/dist/sdk-coding.js +1 -1
  44. package/dist/sdk-experimental-memory.d.ts +618 -0
  45. package/dist/sdk-experimental-memory.js +2 -0
  46. package/dist/sdk-llm.d.ts +16 -9
  47. package/dist/sdk-llm.js +1 -1
  48. package/dist/sdk-mcp.d.ts +1 -1
  49. package/dist/sdk-mcp.js +1 -1
  50. package/dist/sdk-media.d.ts +1 -1
  51. package/dist/sdk-media.js +1 -1
  52. package/dist/sdk-repl.d.ts +35 -101
  53. package/dist/sdk-repl.js +2 -2
  54. package/dist/sdk-runtime.d.ts +744 -21
  55. package/dist/sdk-runtime.js +1 -1
  56. package/dist/sdk-session.d.ts +7 -7
  57. package/dist/sdk-session.js +1 -1
  58. package/dist/sdk-skills.js +1 -1
  59. package/dist/semantic-worker.js +100 -12
  60. package/dist/types-chunks/{base.d-DalIRhbb.d.ts → base.d-CYjtB68X.d.ts} +1 -1
  61. package/dist/types-chunks/{bash-prefix-extractor.d-D57Gt6n8.d.ts → bash-prefix-extractor.d-BkIA8Wto.d.ts} +89 -18
  62. package/dist/types-chunks/{capability-learning.d-BQB0M70w.d.ts → capability-learning.d-WtsyRv3O.d.ts} +1 -1
  63. package/dist/types-chunks/{capsule.d-BZmqu_HL.d.ts → capsule.d-xJvfh4YR.d.ts} +5 -5
  64. package/dist/types-chunks/{commands.d-Cg26ud-Y.d.ts → commands.d-DkPfcQWG.d.ts} +4 -4
  65. package/dist/types-chunks/{cost-tracker.d-CBLk1fiD.d.ts → cost-tracker.d-BeaenODW.d.ts} +4 -1
  66. package/dist/types-chunks/{guardrail.d-Ds7JHxR1.d.ts → guardrail.d-6ZDbNbHO.d.ts} +1 -1
  67. package/dist/types-chunks/{guardrail.d-vSaBe64I.d.ts → guardrail.d-R7AiGfrI.d.ts} +4 -4
  68. package/dist/types-chunks/integration-config.d-ojG4swOP.d.ts +95 -0
  69. package/dist/types-chunks/{manager.d-Zum9cGHU.d.ts → manager.d-CoEuPRAo.d.ts} +4 -1
  70. package/dist/types-chunks/{public-api.d-CPBMPDiU.d.ts → public-api.d-7G4--RZE.d.ts} +6 -7
  71. package/dist/types-chunks/{resolver.d-CGkfRULj.d.ts → resolver.d-CIVoGc97.d.ts} +2 -2
  72. package/dist/types-chunks/{run-manager.d-lnwnfyNC.d.ts → run-manager.d-BaXtkryp.d.ts} +1 -1
  73. package/dist/types-chunks/{sdk-session-ByoMLoUS.d.ts → sdk-session-BQccrODn.d.ts} +6 -4
  74. package/dist/types-chunks/{types.d-DG9B4SMm.d.ts → types.d-BtC4yLYO.d.ts} +170 -13
  75. package/dist/types-chunks/{types.d-DYv3a1ka.d.ts → types.d-C9YHEAmA.d.ts} +38 -7
  76. package/dist/types-chunks/{types.d-DU9lLkmE.d.ts → types.d-CJR7t6iW.d.ts} +2 -2
  77. package/dist/types-chunks/{types.d-Bp4Lm1jv.d.ts → types.d-TTvpAGWf.d.ts} +11 -1
  78. package/dist/types-chunks/{utils.d-DMI-9GTR.d.ts → utils.d-BbB5jzi1.d.ts} +15 -7
  79. package/docs/SDK_EMBEDDER_GUIDE.md +732 -14
  80. package/package.json +14 -2
  81. package/dist/chunks/agent-E4V5SLX6.js +0 -2
  82. package/dist/chunks/argument-completer-N6RT5KYT.js +0 -2
  83. package/dist/chunks/chunk-AKMXJSGM.js +0 -56
  84. package/dist/chunks/chunk-CW32NQFO.js +0 -2
  85. package/dist/chunks/chunk-D6QVXQNI.js +0 -1
  86. package/dist/chunks/chunk-NVDK375I.js +0 -729
  87. package/dist/chunks/chunk-O7N22GJ3.js +0 -31
  88. package/dist/chunks/chunk-PZTG2C33.js +0 -7
  89. package/dist/chunks/chunk-QI6SQ2UQ.js +0 -306
  90. package/dist/chunks/chunk-QJJKMNZF.js +0 -2
  91. package/dist/chunks/chunk-RS2GAABJ.js +0 -328
  92. package/dist/chunks/chunk-W2XMNYLK.js +0 -15
  93. package/dist/chunks/chunk-WCSSXBHR.js +0 -419
  94. package/dist/chunks/chunk-YH5BTUQO.js +0 -343
  95. package/dist/chunks/chunk-YRBNXFHY.js +0 -2
  96. package/dist/chunks/compaction-config-56NO42ZI.js +0 -2
  97. package/dist/chunks/dist-4PXB7U22.js +0 -2
  98. package/dist/chunks/dist-4UIRSSFS.js +0 -2
  99. package/dist/chunks/host-DMREFNSO.js +0 -2
  100. package/dist/chunks/paste-C33GZQV5.js +0 -2
  101. package/dist/chunks/run-manager-P5XMSGZ7.js +0 -2
  102. package/dist/chunks/utils-JENPFKAE.js +0 -2
@@ -0,0 +1,618 @@
1
+ import { k as KodaXMessage } from './types-chunks/types.d-TTvpAGWf.js';
2
+
3
+ /**
4
+ * @kodax-ai/agent Types
5
+ *
6
+ * 通用 Agent 类型定义
7
+ */
8
+
9
+ type KodaXJsonPrimitive = string | number | boolean | null;
10
+ type KodaXJsonValue = KodaXJsonPrimitive | KodaXJsonValue[] | {
11
+ [key: string]: KodaXJsonValue;
12
+ };
13
+ interface KodaXSessionEntryBase {
14
+ id: string;
15
+ parentId: string | null;
16
+ timestamp: string;
17
+ /**
18
+ * Stable logical identity for this transcript item. Cloned/forked entries get
19
+ * a fresh physical `id` but keep their source entry's `logicalId`, allowing
20
+ * SDK hosts to group or fold cloned history without comparing content.
21
+ */
22
+ logicalId?: string;
23
+ /** Root physical entry id this item was cloned from, when it is a clone. */
24
+ sourceEntryId?: string;
25
+ }
26
+ interface KodaXSessionMessageEntry extends KodaXSessionEntryBase {
27
+ type: 'message';
28
+ message: KodaXMessage;
29
+ }
30
+ interface KodaXSessionCompactionEntry extends KodaXSessionEntryBase {
31
+ type: 'compaction';
32
+ summary: string;
33
+ firstKeptEntryId?: string;
34
+ tokensBefore?: number;
35
+ tokensAfter?: number;
36
+ artifactLedgerId?: string;
37
+ reason?: string;
38
+ details?: KodaXJsonValue;
39
+ memorySeed?: KodaXCompactMemorySeed;
40
+ /**
41
+ * FEATURE_072: post-compact ledger summary + file-content messages that
42
+ * are inlined after the compaction summary at slicer time
43
+ * (`getSessionMessagesFromLineage`). Stored here so they leave the active
44
+ * path automatically when a new compaction entry is appended.
45
+ *
46
+ * NOTE: attachments are emitted by the slicer, NOT by `getContextMessagesForEntry`
47
+ * — preserving the latter's 1-to-1 contract that `entryMatchesContextMessage`
48
+ * and FEATURE_073's future slicing both depend on.
49
+ */
50
+ postCompactAttachments?: readonly KodaXMessage[];
51
+ }
52
+ interface KodaXSessionBranchSummaryEntry extends KodaXSessionEntryBase {
53
+ type: 'branch_summary';
54
+ summary: string;
55
+ fromId?: string;
56
+ details?: KodaXJsonValue;
57
+ }
58
+ interface KodaXSessionLabelEntry extends KodaXSessionEntryBase {
59
+ type: 'label';
60
+ targetId: string;
61
+ label?: string;
62
+ }
63
+ interface KodaXSessionArchiveMarkerEntry extends KodaXSessionEntryBase {
64
+ type: 'archive_marker';
65
+ /** Links to the corresponding batch in the .archive.jsonl sidecar file */
66
+ archiveBatchId: string;
67
+ /** Number of entries that were archived in this batch */
68
+ archivedEntryCount: number;
69
+ /** Brief summary of the archived content */
70
+ summary: string;
71
+ }
72
+ interface KodaXSessionRewindMarkerEntry extends KodaXSessionEntryBase {
73
+ type: 'rewind_marker';
74
+ targetId: string;
75
+ fromId?: string;
76
+ truncatedCount: number;
77
+ summary: string;
78
+ }
79
+ interface KodaXSessionClientNoticeEntry extends KodaXSessionEntryBase {
80
+ type: 'client_notice';
81
+ source: string;
82
+ content: string;
83
+ turnId?: string;
84
+ payload?: KodaXJsonValue;
85
+ }
86
+ interface KodaXMemoryOutcomeDigest {
87
+ readonly id: string;
88
+ readonly reviewKey: string;
89
+ readonly sessionId: string;
90
+ readonly branchId: string;
91
+ readonly sequence: number;
92
+ readonly objective: string;
93
+ readonly actionSignature?: string;
94
+ readonly approach: string;
95
+ readonly outcome: 'succeeded' | 'failed';
96
+ readonly summary: string;
97
+ readonly preconditions?: string;
98
+ readonly lesson?: string;
99
+ readonly evidenceRefs: readonly string[];
100
+ readonly evidence?: readonly KodaXMemoryOutcomeEvidence[];
101
+ readonly memoryInfluence?: readonly KodaXMemoryInfluenceRef[];
102
+ readonly visibility: 'prompt_safe' | 'private' | 'sensitive';
103
+ readonly createdAt: string;
104
+ }
105
+ interface KodaXMemoryOutcomeEvidence {
106
+ readonly ref: string;
107
+ readonly grade: 'authoritative' | 'verified' | 'corroborated' | 'observed' | 'inferred';
108
+ readonly source: 'user' | 'host' | 'tool' | 'environment' | 'agent';
109
+ readonly observedAt: string;
110
+ }
111
+ interface KodaXMemoryInfluenceRef {
112
+ readonly decisionReceiptRef: string;
113
+ readonly grade: 'direct' | 'supporting' | 'exposed' | 'unknown';
114
+ }
115
+ interface KodaXSessionMemoryOutcomeDigestEntry extends KodaXSessionEntryBase {
116
+ readonly type: 'memory_outcome_digest';
117
+ readonly digest: KodaXMemoryOutcomeDigest;
118
+ }
119
+ interface KodaXSessionMemoryReviewReceiptEntry extends KodaXSessionEntryBase {
120
+ readonly type: 'memory_review_receipt';
121
+ readonly reviewKey: string;
122
+ readonly proposalIds: readonly string[];
123
+ readonly status: 'completed' | 'no_action';
124
+ readonly completedAt: string;
125
+ }
126
+ type KodaXGoalStatus = 'active' | 'paused' | 'budget_limited' | 'blocked' | 'complete';
127
+ /**
128
+ * Persistent user-set goal state. v0.7.44 FEATURE_192 — backs the
129
+ * `/goal` slash command and the get_goal / create_goal / update_goal
130
+ * tools.
131
+ *
132
+ * Persistence model: each lifecycle event (create / update / pause /
133
+ * resume / clear / budget_limited / blocked / complete) appends a
134
+ * `KodaXSessionGoalEntry` carrying a frozen `KodaXGoalState` snapshot
135
+ * to the session lineage. `readLatestGoalFromBranch` walks the active
136
+ * branch's message-entry IDs and returns the latest goal entry whose
137
+ * parentId belongs to that branch — so forks and rewinds naturally
138
+ * drop goals attached to abandoned message paths.
139
+ */
140
+ interface KodaXGoalState {
141
+ readonly version: 1;
142
+ /** `${createdAt}-${rand}` — stable across updates of the same goal. */
143
+ readonly id: string;
144
+ readonly objective: string;
145
+ readonly status: KodaXGoalStatus;
146
+ /** Optional explicit token budget; null when the user did not set one. */
147
+ readonly tokenBudget: number | null;
148
+ readonly tokensUsed: number;
149
+ readonly timeUsedSeconds: number;
150
+ /** Consecutive turns the model has reported the same blocker. */
151
+ readonly blockerTurnCount: number;
152
+ /** The blocker_kind string the model last reported, or null. */
153
+ readonly lastBlockerKind: string | null;
154
+ readonly createdAt: number;
155
+ readonly updatedAt: number;
156
+ }
157
+ type KodaXGoalEventType = 'created' | 'updated' | 'paused' | 'resumed' | 'cleared' | 'budget_limited' | 'blocked' | 'complete';
158
+ interface KodaXSessionGoalEntry extends KodaXSessionEntryBase {
159
+ type: 'goal';
160
+ /** Snapshot at time of event; `null` only when `event === 'cleared'`. */
161
+ goal: KodaXGoalState | null;
162
+ event: KodaXGoalEventType;
163
+ }
164
+ type KodaXSessionEntry = KodaXSessionMessageEntry | KodaXSessionCompactionEntry | KodaXSessionBranchSummaryEntry | KodaXSessionLabelEntry | KodaXSessionArchiveMarkerEntry | KodaXSessionRewindMarkerEntry | KodaXSessionClientNoticeEntry | KodaXSessionMemoryOutcomeDigestEntry | KodaXSessionMemoryReviewReceiptEntry | KodaXSessionGoalEntry;
165
+ interface KodaXSessionArtifactLedgerEntry {
166
+ id: string;
167
+ kind: 'file_read' | 'file_modified' | 'file_created' | 'file_deleted' | 'path_scope' | 'search_scope' | 'command_scope' | 'check_result' | 'decision' | 'image_input' | 'tombstone';
168
+ sourceTool?: string;
169
+ action?: string;
170
+ target: string;
171
+ displayTarget?: string;
172
+ summary?: string;
173
+ sessionEntryId?: string;
174
+ timestamp: string;
175
+ metadata?: Record<string, KodaXJsonValue>;
176
+ }
177
+ interface KodaXCompactMemoryProgress {
178
+ completed: string[];
179
+ inProgress: string[];
180
+ blockers: string[];
181
+ }
182
+ interface KodaXCompactMemorySeed {
183
+ objective?: string;
184
+ constraints: string[];
185
+ progress: KodaXCompactMemoryProgress;
186
+ keyDecisions: string[];
187
+ nextSteps: string[];
188
+ keyContext: string[];
189
+ importantTargets: string[];
190
+ tombstones: string[];
191
+ }
192
+ interface KodaXSessionLineage {
193
+ version: 2;
194
+ activeEntryId: string | null;
195
+ entries: KodaXSessionEntry[];
196
+ }
197
+
198
+ interface MemoryContextIdentity {
199
+ readonly tenantId: string;
200
+ readonly workspaceId?: string;
201
+ readonly userId?: string;
202
+ readonly agentId: string;
203
+ readonly projectId?: string;
204
+ readonly sessionId: string;
205
+ }
206
+ interface MemoryApplicability {
207
+ readonly tenantId: string;
208
+ readonly workspaceId?: string;
209
+ readonly userId?: string;
210
+ readonly agentId?: string;
211
+ readonly projectId?: string;
212
+ readonly sessionId?: string;
213
+ }
214
+
215
+ type MemoryRefKind = 'working_context' | 'session_trace' | 'artifact_ledger' | 'learning_proposal' | 'memdir' | 'skill' | 'workflow_run' | 'reasoning_report' | 'self_manual' | 'project_doc';
216
+
217
+ type MemoryScope = 'turn' | 'session' | 'project' | 'workspace' | 'agent' | 'user' | 'builtin';
218
+ type MemoryClaimKind = 'fact' | 'policy' | 'preference' | 'procedure' | 'episode';
219
+ type MemoryLifecycle = 'pending' | 'active' | 'provisional' | 'trusted' | 'stale' | 'quarantined' | 'archived' | 'readonly';
220
+ type MemoryAuthority = 'read_only' | 'proposal_only' | 'approved_write';
221
+ type MemoryVisibility = 'prompt_safe' | 'private' | 'sensitive';
222
+ interface MemoryItemRef {
223
+ readonly kind: MemoryRefKind;
224
+ readonly id: string;
225
+ readonly scope: MemoryScope;
226
+ readonly scopeId?: string;
227
+ readonly applicability?: MemoryApplicability;
228
+ readonly claimKind?: MemoryClaimKind;
229
+ readonly claimKey?: string;
230
+ readonly actionSignature?: string;
231
+ readonly title?: string;
232
+ readonly owner: 'user' | 'project' | 'kodax' | 'external';
233
+ readonly lifecycle: MemoryLifecycle;
234
+ readonly authority: MemoryAuthority;
235
+ readonly visibility: MemoryVisibility;
236
+ readonly sourceRefs: readonly string[];
237
+ readonly relatedRefs: readonly string[];
238
+ readonly version?: string;
239
+ readonly bodyFingerprint?: string;
240
+ readonly storageUri?: string;
241
+ readonly createdAt?: string;
242
+ readonly updatedAt?: string;
243
+ readonly lastUsedAt?: string;
244
+ readonly pinned?: boolean;
245
+ readonly applyReceiptRef?: string;
246
+ readonly expectedFingerprint?: string;
247
+ readonly resultingFingerprint?: string;
248
+ }
249
+ interface MemoryRefFilter {
250
+ readonly kinds?: readonly MemoryRefKind[];
251
+ readonly scopes?: readonly MemoryScope[];
252
+ readonly lifecycles?: readonly MemoryLifecycle[];
253
+ readonly includePrivate?: boolean;
254
+ readonly includeSensitive?: boolean;
255
+ readonly query?: string;
256
+ }
257
+ interface MemoryBodySnapshot {
258
+ readonly ref: MemoryItemRef;
259
+ readonly body: string;
260
+ readonly bodyFingerprint: string;
261
+ readonly frontmatter?: Readonly<Record<string, string>>;
262
+ readonly readAt: string;
263
+ readonly warnings: readonly string[];
264
+ }
265
+ type MemoryProposalAction = 'no_op' | 'link_refs' | 'write_memdir' | 'patch_memdir' | 'handoff_to_skill_loop' | 'quarantine' | 'archive' | 'conflict_report';
266
+ interface MemoryApplyPreview {
267
+ readonly summary: string;
268
+ readonly changedRefs: readonly MemoryItemRef[];
269
+ readonly changedPaths: readonly string[];
270
+ readonly beforeFingerprints: Readonly<Record<string, string>>;
271
+ readonly afterFingerprints?: Readonly<Record<string, string>>;
272
+ readonly diff?: string;
273
+ readonly warnings: readonly string[];
274
+ }
275
+ interface MemoryActionProposal {
276
+ readonly id: string;
277
+ readonly action: MemoryProposalAction;
278
+ readonly targetRefs: readonly MemoryItemRef[];
279
+ readonly sourceRefs: readonly MemoryItemRef[];
280
+ readonly expectedFingerprints: Readonly<Record<string, string>>;
281
+ readonly rationale: string;
282
+ readonly risk: 'low' | 'medium' | 'high';
283
+ readonly preview: MemoryApplyPreview;
284
+ readonly requiresApproval: true;
285
+ readonly createdAt: string;
286
+ }
287
+ interface MemoryApplyResult {
288
+ readonly proposalId: string;
289
+ readonly applied: boolean;
290
+ readonly changedRefs: readonly MemoryItemRef[];
291
+ readonly changedPaths: readonly string[];
292
+ readonly skippedReason?: string;
293
+ readonly warnings: readonly string[];
294
+ }
295
+ interface MemoryRejectResult {
296
+ readonly proposalId: string;
297
+ readonly rejected: boolean;
298
+ readonly skippedReason?: string;
299
+ readonly review?: MemoryReviewPlan;
300
+ readonly warnings: readonly string[];
301
+ }
302
+ interface MemoryLifecycleOperationResult {
303
+ readonly refId: string;
304
+ readonly operation: 'archive' | 'forget' | 'purge';
305
+ readonly acknowledged: boolean;
306
+ readonly residualSourceRefs: readonly string[];
307
+ readonly warnings: readonly string[];
308
+ }
309
+ interface MemoryCuratorInput {
310
+ readonly includePrivate?: boolean;
311
+ readonly includeSensitive?: boolean;
312
+ }
313
+ interface MemoryAutoCuratorInput extends MemoryCuratorInput {
314
+ readonly enabled?: boolean;
315
+ readonly intervalMs?: number;
316
+ readonly minRefs?: number;
317
+ }
318
+ type MemoryAutoCuratorSkipReason = 'disabled' | 'not_due' | 'insufficient_refs';
319
+ interface MemoryAutoCuratorResult {
320
+ readonly ran: boolean;
321
+ readonly skippedReason?: MemoryAutoCuratorSkipReason;
322
+ readonly report?: MemoryGovernanceReport;
323
+ readonly reportPath?: string;
324
+ readonly nextEligibleAt?: string;
325
+ }
326
+ type MemoryGovernanceFindingKind = 'duplicate' | 'conflict' | 'stale' | 'quarantined' | 'orphaned' | 'no_op';
327
+ interface MemoryGovernanceFinding {
328
+ readonly kind: MemoryGovernanceFindingKind;
329
+ readonly severity: 'info' | 'warning' | 'error';
330
+ readonly refIds: readonly string[];
331
+ readonly summary: string;
332
+ readonly suggestedAction: MemoryProposalAction;
333
+ }
334
+ interface MemoryGovernanceReport {
335
+ readonly reportId: string;
336
+ readonly generatedAt: string;
337
+ readonly findings: readonly MemoryGovernanceFinding[];
338
+ readonly warnings: readonly string[];
339
+ }
340
+ interface MemoryPackInput {
341
+ readonly task: string;
342
+ readonly identity?: MemoryContextIdentity;
343
+ readonly decisionIntent?: string;
344
+ readonly actionSignature?: string;
345
+ readonly maxCandidates?: number;
346
+ readonly maxHints?: number;
347
+ readonly includePrivate?: boolean;
348
+ readonly includeSensitive?: boolean;
349
+ readonly includeSnippets?: boolean;
350
+ readonly ignoreMemory?: boolean;
351
+ readonly purpose?: 'automatic' | 'deliberate_query';
352
+ }
353
+ interface MemoryPackHint {
354
+ readonly ref: MemoryItemRef;
355
+ readonly hook: string;
356
+ readonly reason: string;
357
+ readonly bodySnippet?: string;
358
+ readonly bodyFingerprint?: string;
359
+ }
360
+ interface MemoryPack {
361
+ readonly generatedAt: string;
362
+ readonly taskFingerprint: string;
363
+ readonly memoryRevision: string;
364
+ readonly candidates: readonly MemoryPackHint[];
365
+ readonly promptHints: readonly MemoryPackHint[];
366
+ /** @deprecated Use promptHints. Retained for F228 source compatibility. */
367
+ readonly hints: readonly MemoryPackHint[];
368
+ readonly omitted: readonly string[];
369
+ readonly traceMetadata: MemoryPackTraceMetadata;
370
+ }
371
+ interface MemoryPackTraceMetadata {
372
+ readonly selectedRefIds: readonly string[];
373
+ readonly omittedRefIds: readonly string[];
374
+ readonly taskFingerprint: string;
375
+ readonly suppressed: boolean;
376
+ }
377
+ type MemoryReviewTrigger = 'user_correction' | 'explicit_remember' | 'explicit_forget' | 'proposal_rejected' | 'conflict_detected' | 'episode_completed';
378
+ interface MemoryReviewCandidateRef {
379
+ readonly ref: MemoryItemRef;
380
+ readonly bodySnippet?: string;
381
+ readonly bodyFingerprint?: string;
382
+ readonly warnings: readonly string[];
383
+ }
384
+ interface MemoryReviewInput {
385
+ readonly trigger: MemoryReviewTrigger;
386
+ readonly userFeedback?: string;
387
+ readonly episodeDigest?: KodaXMemoryOutcomeDigest;
388
+ readonly task?: string;
389
+ readonly sourceRefs?: readonly string[];
390
+ readonly candidateRefIds?: readonly string[];
391
+ readonly includePrivate?: boolean;
392
+ readonly includeSensitive?: boolean;
393
+ readonly maxRefs?: number;
394
+ }
395
+ interface MemoryReviewModelInput {
396
+ readonly trigger: MemoryReviewTrigger;
397
+ readonly userFeedback: string;
398
+ readonly task?: string;
399
+ readonly sourceRefs: readonly string[];
400
+ readonly candidateRefs: readonly MemoryReviewCandidateRef[];
401
+ readonly warnings: readonly string[];
402
+ }
403
+ interface MemoryReviewDraftAction {
404
+ readonly action: MemoryProposalAction;
405
+ readonly targetRefIds: readonly string[];
406
+ readonly summary: string;
407
+ readonly rationale: string;
408
+ readonly confidence: 'low' | 'medium' | 'high';
409
+ readonly risk: 'low' | 'medium' | 'high';
410
+ readonly requiresApproval: true;
411
+ readonly proposedBody?: string;
412
+ readonly claimKind?: MemoryClaimKind;
413
+ readonly claimKey?: string;
414
+ readonly actionSignature?: string;
415
+ readonly preconditions?: string;
416
+ readonly counterexamples?: readonly string[];
417
+ readonly relationship?: 'same_claim' | 'condition_refinement' | 'conflict';
418
+ }
419
+ interface MemoryReviewPlan {
420
+ readonly trigger: MemoryReviewTrigger;
421
+ readonly createdAt: string;
422
+ readonly sourceRefs: readonly string[];
423
+ readonly candidateRefs: readonly MemoryReviewCandidateRef[];
424
+ readonly actions: readonly MemoryReviewDraftAction[];
425
+ readonly warnings: readonly string[];
426
+ readonly episodeDigest?: KodaXMemoryOutcomeDigest;
427
+ }
428
+ interface MemoryEpisodeReviewResult {
429
+ readonly plan: MemoryReviewPlan;
430
+ readonly proposalIds: readonly string[];
431
+ readonly appliedProposalIds: readonly string[];
432
+ readonly decisions: readonly MemoryReviewPersistenceDecision[];
433
+ readonly warnings: readonly string[];
434
+ }
435
+ type MemoryReviewPersistenceKind = 'create' | 'evidence_update' | 'condition_refinement' | 'conflict' | 'no_action' | 'reject' | 'quarantine';
436
+ interface MemoryReviewPersistenceDecision {
437
+ readonly actionIndex: number;
438
+ readonly kind: MemoryReviewPersistenceKind;
439
+ readonly reason: string;
440
+ readonly existingRefId?: string;
441
+ readonly proposalId?: string;
442
+ }
443
+ type MemoryReviewRunner = (input: MemoryReviewModelInput) => Promise<MemoryReviewPlan>;
444
+ interface MemoryController {
445
+ listInbox(): Promise<readonly MemoryActionProposal[]>;
446
+ showProposal(id: string): Promise<MemoryActionProposal | undefined>;
447
+ approveProposal(id: string, expectedFingerprints: Readonly<Record<string, string>>): Promise<MemoryApplyResult>;
448
+ rejectProposal(id: string, reason?: string): Promise<MemoryRejectResult>;
449
+ listRefs(filter?: MemoryRefFilter): Promise<readonly MemoryItemRef[]>;
450
+ readRef(ref: MemoryItemRef): Promise<MemoryBodySnapshot>;
451
+ runCurator(input?: MemoryCuratorInput): Promise<MemoryGovernanceReport>;
452
+ maybeRunAutoCurator(input?: MemoryAutoCuratorInput): Promise<MemoryAutoCuratorResult>;
453
+ buildMemoryPack(input: MemoryPackInput): Promise<MemoryPack>;
454
+ reviewMemoryFeedback(input: MemoryReviewInput): Promise<MemoryReviewPlan>;
455
+ persistReviewPlan(plan: MemoryReviewPlan): Promise<readonly string[]>;
456
+ reviewEpisode(digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal): Promise<MemoryEpisodeReviewResult>;
457
+ archiveRef(id: string): Promise<MemoryLifecycleOperationResult>;
458
+ forgetRef(id: string): Promise<MemoryLifecycleOperationResult>;
459
+ purgeRef(id: string): Promise<MemoryLifecycleOperationResult>;
460
+ }
461
+ type MemoryEvent = {
462
+ readonly type: 'proposal.created';
463
+ readonly proposalId: string;
464
+ } | {
465
+ readonly type: 'proposal.approved';
466
+ readonly proposalId: string;
467
+ } | {
468
+ readonly type: 'proposal.rejected';
469
+ readonly proposalId: string;
470
+ } | {
471
+ readonly type: 'curator.completed';
472
+ readonly reportId: string;
473
+ } | {
474
+ readonly type: 'pack.selected';
475
+ readonly refIds: readonly string[];
476
+ } | {
477
+ readonly type: 'review.completed';
478
+ readonly trigger: MemoryReviewTrigger;
479
+ readonly actionCount: number;
480
+ };
481
+
482
+ /** Source-controlled F260 policy identity. Not a runtime configuration knob. */
483
+ declare const MEMORY_POLICY_VERSION = "f260-v0.7.68.2";
484
+
485
+ interface CreateMemoryControlPlaneOptions {
486
+ readonly cwd: string;
487
+ readonly identity?: MemoryContextIdentity;
488
+ readonly learningStorePath?: string;
489
+ readonly memoryRoot?: string;
490
+ readonly projectDocs?: readonly string[];
491
+ readonly extraRefs?: readonly MemoryItemRef[];
492
+ readonly sessionId?: string;
493
+ readonly sessionLineage?: KodaXSessionLineage;
494
+ readonly artifactLedger?: readonly KodaXSessionArtifactLedgerEntry[];
495
+ readonly now?: () => string;
496
+ readonly onEvent?: (event: MemoryEvent) => void;
497
+ readonly discoverSkills?: boolean;
498
+ readonly memoryReviewer?: MemoryReviewRunner;
499
+ }
500
+ declare function createMemoryControlPlane(options: CreateMemoryControlPlaneOptions): MemoryController;
501
+
502
+ type MemoryEvidenceGrade = 'authoritative' | 'verified' | 'corroborated' | 'observed' | 'inferred';
503
+ interface MemoryEvidenceRef {
504
+ readonly ref: string;
505
+ readonly requestedGrade: MemoryEvidenceGrade;
506
+ readonly source: 'user' | 'host' | 'tool' | 'environment' | 'agent';
507
+ readonly observedAt: string;
508
+ }
509
+ type MemorySourcePolicy = (evidence: MemoryEvidenceRef) => MemoryEvidenceGrade;
510
+ type MemoryObservationKind = 'constraint' | 'fact' | 'outcome' | 'correction';
511
+ interface MemoryObservation {
512
+ readonly id: string;
513
+ readonly sequence: number;
514
+ readonly kind: MemoryObservationKind;
515
+ readonly summary: string;
516
+ readonly evidence: readonly MemoryEvidenceRef[];
517
+ readonly visibility: MemoryVisibility;
518
+ readonly claimKey?: string;
519
+ readonly actionSignature?: string;
520
+ readonly occurredAt: string;
521
+ readonly metadata?: Readonly<Record<string, string | number | boolean>>;
522
+ }
523
+ interface MemoryRecallInput {
524
+ readonly decisionRevision: string;
525
+ readonly objective: string;
526
+ readonly decisionContext: string;
527
+ readonly decisionIntent: string;
528
+ readonly actionSignature?: string;
529
+ readonly throughSequence: number;
530
+ }
531
+ interface MemoryQueryInput {
532
+ readonly decisionRevision: string;
533
+ readonly need: string;
534
+ readonly actionSignature?: string;
535
+ readonly throughSequence: number;
536
+ }
537
+ interface MemoryReminder {
538
+ readonly content: string;
539
+ readonly evidenceRefs: readonly string[];
540
+ }
541
+ interface MemoryRecallCandidate {
542
+ readonly refId: string;
543
+ readonly claim: string;
544
+ readonly claimKind?: string;
545
+ }
546
+ interface MemoryRecallRunnerInput {
547
+ readonly objective: string;
548
+ readonly decisionContext: string;
549
+ readonly decisionIntent: string;
550
+ readonly candidates: readonly MemoryRecallCandidate[];
551
+ readonly signal: AbortSignal;
552
+ }
553
+ type MemoryRecallRunner = (input: MemoryRecallRunnerInput) => Promise<{
554
+ readonly selectedRefIds: readonly string[];
555
+ }>;
556
+ type MemorySelectionMode = 'task_hint' | 'exact' | 'semantic_prefetch' | 'deliberate_query';
557
+ interface MemoryDecisionReceipt {
558
+ readonly id: string;
559
+ readonly decisionEpoch: string;
560
+ readonly decisionRevision: string;
561
+ readonly policyVersion: string;
562
+ readonly candidateSetFingerprint: string;
563
+ readonly candidateRefs: readonly string[];
564
+ readonly selectedRefs: readonly string[];
565
+ readonly injectedRefs: readonly string[];
566
+ readonly selectionModes: readonly MemorySelectionMode[];
567
+ readonly actionSignature?: string;
568
+ readonly throughSequence: number;
569
+ }
570
+ type MemoryAgentTraceEvent = {
571
+ readonly type: 'recall.prefetch.completed' | 'recall.prefetch.failed' | 'recall.prefetch.discarded' | 'query.failed' | 'review.timed_out';
572
+ readonly key: string;
573
+ readonly detail?: string;
574
+ } | {
575
+ readonly type: 'memory.decision';
576
+ readonly receipt: MemoryDecisionReceipt;
577
+ };
578
+ interface MemorySessionInput {
579
+ readonly identity: MemoryContextIdentity;
580
+ readonly objective: string;
581
+ }
582
+ interface MemoryEpisodeOutcome {
583
+ readonly status: 'succeeded' | 'failed' | 'cancelled';
584
+ readonly summary: string;
585
+ readonly evidence: readonly MemoryEvidenceRef[];
586
+ }
587
+ type PersistedOutcomeDigest = KodaXMemoryOutcomeDigest;
588
+ interface MemorySession {
589
+ observe(observation: MemoryObservation): void;
590
+ recall(input: MemoryRecallInput): MemoryReminder | undefined;
591
+ query(input: MemoryQueryInput): Promise<MemoryReminder | undefined>;
592
+ rewind(input: {
593
+ readonly throughSequence: number;
594
+ }): void;
595
+ complete(outcome: MemoryEpisodeOutcome): Promise<void>;
596
+ close(options?: {
597
+ readonly drain?: boolean;
598
+ }): Promise<void>;
599
+ }
600
+ interface MemoryAgent {
601
+ startSession(input: MemorySessionInput): Promise<MemorySession>;
602
+ }
603
+ interface CreateMemoryAgentOptions {
604
+ readonly controlPlane: MemoryController;
605
+ readonly initialMemoryPack?: MemoryPack;
606
+ readonly now?: () => string;
607
+ readonly persistOutcomeDigest?: (digest: PersistedOutcomeDigest) => Promise<void>;
608
+ readonly reviewEpisode?: (digest: PersistedOutcomeDigest, signal: AbortSignal) => Promise<void>;
609
+ readonly reviewTimeoutMs?: number;
610
+ readonly recallRunner?: MemoryRecallRunner;
611
+ readonly onTrace?: (event: MemoryAgentTraceEvent) => void;
612
+ readonly sourcePolicy?: MemorySourcePolicy;
613
+ }
614
+
615
+ declare function createMemoryAgent(options: CreateMemoryAgentOptions): MemoryAgent;
616
+
617
+ export { MEMORY_POLICY_VERSION, createMemoryAgent, createMemoryControlPlane };
618
+ export type { CreateMemoryAgentOptions, MemoryAgent, MemoryAgentTraceEvent, MemoryApplicability, MemoryContextIdentity, MemoryController, MemoryDecisionReceipt, MemoryEpisodeOutcome, MemoryEvidenceGrade, MemoryEvidenceRef, MemoryObservation, MemoryObservationKind, MemoryPack, MemoryQueryInput, MemoryRecallCandidate, MemoryRecallInput, MemoryRecallRunner, MemoryRecallRunnerInput, MemoryReminder, MemorySelectionMode, MemorySession, MemorySessionInput, MemorySourcePolicy, PersistedOutcomeDigest };
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{a as r}from"./chunks/chunk-I4TPQEJN.js";import{ea as o,k as e}from"./chunks/chunk-AWMTNUDS.js";import"./chunks/chunk-NGHQIGVW.js";import"./chunks/chunk-ONUPGMER.js";export{e as MEMORY_POLICY_VERSION,r as createMemoryAgent,o as createMemoryControlPlane};
package/dist/sdk-llm.d.ts CHANGED
@@ -1,15 +1,22 @@
1
- import { o as KodaXProviderCapabilityProfile, a7 as KodaXVerifyStrategy, a6 as KodaXVerifyCredentialResult, j as KodaXMessage, G as KodaXReasoningRequest, $ as KodaXTokenUsage, c as KodaXContentBlock, a as KodaXCacheBoundary } from './types-chunks/types.d-Bp4Lm1jv.js';
2
- export { K as KodaXAssuranceIntent, b as KodaXChildFanoutClass, d as KodaXCustomProviderConfig, e as KodaXExecutionMode, f as KodaXExecutionPattern, g as KodaXHarnessProfile, h as KodaXImageBlock, i as KodaXListModelsResult, k as KodaXModelDescriptor, l as KodaXMutationSurface, m as KodaXNormalizedReasoningRequest, n as KodaXProtocolFamily, p as KodaXProviderConfig, q as KodaXProviderContextFidelity, r as KodaXProviderConversationSemantics, s as KodaXProviderEvidenceSupport, t as KodaXProviderLongRunningSupport, u as KodaXProviderMcpSupport, v as KodaXProviderMultimodalSupport, w as KodaXProviderSessionSupport, x as KodaXProviderStreamOptions, y as KodaXProviderToolCallingFidelity, z as KodaXProviderTransport, A as KodaXReasoningCapability, B as KodaXReasoningEffortPreset, C as KodaXReasoningEffortRequest, D as KodaXReasoningEffortWireStrategy, E as KodaXReasoningMode, F as KodaXReasoningProfile, H as KodaXRedactedThinkingBlock, I as KodaXReviewScale, J as KodaXRiskLevel, L as KodaXStableEffortIntent, M as KodaXStreamResult, N as KodaXTaskActionability, O as KodaXTaskBudgetOverrides, P as KodaXTaskComplexity, Q as KodaXTaskFamily, R as KodaXTaskResultMetadata, S as KodaXTaskResultSource, T as KodaXTaskRoutingDecision, U as KodaXTaskType, V as KodaXTaskWorkIntent, W as KodaXTextBlock, X as KodaXThinkingBlock, Y as KodaXThinkingBudgetMap, Z as KodaXThinkingDepth, _ as KodaXThinkingWireStrategy, a0 as KodaXToolDefinition, a1 as KodaXToolResultBlock, a2 as KodaXToolResultContentItem, a3 as KodaXToolResultImageItem, a4 as KodaXToolResultTextItem, a5 as KodaXToolUseBlock, a8 as KodaXWireReasoningEffort } from './types-chunks/types.d-Bp4Lm1jv.js';
3
- export { K as KODAX_DEFAULT_PROVIDER, a as KODAX_DEFAULT_THINKING_BUDGETS, b as KODAX_PROVIDERS, c as KODAX_PROVIDER_SNAPSHOTS, d as KODAX_REASONING_MODE_SEQUENCE, e as KODAX_REASONING_SAFETY_RESERVE, f as KODAX_STABLE_EFFORT_INTENTS, g as KodaXAnthropicCompatProvider, h as KodaXError, i as KodaXModelCapabilities, j as KodaXNetworkError, k as KodaXOpenAICompatProvider, l as KodaXProviderError, m as KodaXRateLimitError, n as KodaXToolCallIdError, P as ProviderName, R as ResolveWireEffortInput, o as ResolvedWireEffort, p as clampThinkingBudget, q as clearRuntimeModelProviders, r as createCustomProvider, s as effortToLegacyReasoningMode, t as getAvailableProviderNames, u as getCustomModelCapabilities, v as getCustomProvider, w as getCustomProviderList, x as getCustomProviderModelDescriptors, y as getCustomProviderModels, z as getCustomProviderNames, A as getDefaultThinkingDepthForMode, B as getModelCapabilities, C as getProvider, D as getProviderConfiguredCapabilityProfile, E as getProviderConfiguredReasoningCapability, F as getProviderList, G as getProviderModel, H as getProviderModelDescriptors, I as getProviderModels, J as getReasoningCapability, L as getRuntimeModelProvider, M as getRuntimeModelProviderNames, N as isCustomProviderName, O as isKnownProvider, Q as isProviderConfigured, S as isProviderName, T as isReasoningEnabled, U as isRuntimeModelProviderName, V as listAllModelCapabilities, W as listBuiltinModelCapabilities, X as listCustomProviderModelCapabilities, Y as listProviderModels, Z as mapDepthToOpenAIReasoningEffort, _ as mapLegacyReasoningModeToEffortIntent, $ as normalizeReasoningEffortValue, a0 as normalizeReasoningRequest, a1 as parseReasoningEffortEnv, a2 as registerCustomProviders, a3 as registerModelProvider, a4 as resolveModelCapabilities, a5 as resolveProvider, a6 as resolveProviderModelDescriptors, a7 as resolveReasoningEffort, a8 as resolveReasoningEffortForModelSwitch, a9 as resolveThinkingBudget, aa as resolveWireEffort, ab as validateCustomProviderConfig, ac as verifyProviderCredential } from './types-chunks/resolver.d-CGkfRULj.js';
4
- import { a as CostTracker } from './types-chunks/cost-tracker.d-CBLk1fiD.js';
5
- export { C as CostRate, D as DEFAULT_COST_RATES, K as KodaXLlmTimeoutConfig, b as KodaXResolvedLlmTimeoutConfig, P as ProviderCostSummary, R as RetryRecord, S as SessionCostSummary, T as TokenUsageRecord, c as calculateCost, d as createCostTracker, f as formatCost, e as formatCostReport, g as getCostRate, h as getSummary, p as parseTimeoutSecEnvMs, r as recordRetry, i as recordUsage, j as resolveLlmTimeoutConfig, t as timeoutSecToMs } from './types-chunks/cost-tracker.d-CBLk1fiD.js';
6
- export { C as CapabilityCache, a as CapabilityCacheEntry, b as CapabilityCacheSource, c as addRejectedEffort, d as capabilityCacheKey, g as getRejectedEfforts, n as narrowReasoningProfile, r as removeCacheEntry, s as sanitizeCapabilityCache } from './types-chunks/capability-learning.d-BQB0M70w.js';
7
- import { K as KodaXBaseProvider } from './types-chunks/base.d-DalIRhbb.js';
8
- export { a as KodaXOnRetryAfterCallback, b as KodaXRetryAfterEvent, P as ParseRetryAfterOptions, R as RetryAfterResult, c as RetryAfterSource, e as extractHeadersFromError, p as parseRetryAfter } from './types-chunks/base.d-DalIRhbb.js';
1
+ import { p as KodaXProviderCapabilityProfile, a8 as KodaXVerifyStrategy, a7 as KodaXVerifyCredentialResult, k as KodaXMessage, H as KodaXReasoningRequest, a0 as KodaXTokenUsage, c as KodaXContentBlock, a as KodaXCacheBoundary } from './types-chunks/types.d-TTvpAGWf.js';
2
+ export { K as KodaXAssuranceIntent, b as KodaXChildFanoutClass, d as KodaXCustomProviderConfig, e as KodaXEphemeralSuffix, f as KodaXExecutionMode, g as KodaXExecutionPattern, h as KodaXHarnessProfile, i as KodaXImageBlock, j as KodaXListModelsResult, l as KodaXModelDescriptor, m as KodaXMutationSurface, n as KodaXNormalizedReasoningRequest, o as KodaXProtocolFamily, q as KodaXProviderConfig, r as KodaXProviderContextFidelity, s as KodaXProviderConversationSemantics, t as KodaXProviderEvidenceSupport, u as KodaXProviderLongRunningSupport, v as KodaXProviderMcpSupport, w as KodaXProviderMultimodalSupport, x as KodaXProviderSessionSupport, y as KodaXProviderStreamOptions, z as KodaXProviderToolCallingFidelity, A as KodaXProviderTransport, B as KodaXReasoningCapability, C as KodaXReasoningEffortPreset, D as KodaXReasoningEffortRequest, E as KodaXReasoningEffortWireStrategy, F as KodaXReasoningMode, G as KodaXReasoningProfile, I as KodaXRedactedThinkingBlock, J as KodaXReviewScale, L as KodaXRiskLevel, M as KodaXStableEffortIntent, N as KodaXStreamResult, O as KodaXTaskActionability, P as KodaXTaskBudgetOverrides, Q as KodaXTaskComplexity, R as KodaXTaskFamily, S as KodaXTaskResultMetadata, T as KodaXTaskResultSource, U as KodaXTaskRoutingDecision, V as KodaXTaskType, W as KodaXTaskWorkIntent, X as KodaXTextBlock, Y as KodaXThinkingBlock, Z as KodaXThinkingBudgetMap, _ as KodaXThinkingDepth, $ as KodaXThinkingWireStrategy, a1 as KodaXToolDefinition, a2 as KodaXToolResultBlock, a3 as KodaXToolResultContentItem, a4 as KodaXToolResultImageItem, a5 as KodaXToolResultTextItem, a6 as KodaXToolUseBlock, a9 as KodaXWireReasoningEffort } from './types-chunks/types.d-TTvpAGWf.js';
3
+ export { K as KODAX_DEFAULT_PROVIDER, a as KODAX_DEFAULT_THINKING_BUDGETS, b as KODAX_PROVIDERS, c as KODAX_PROVIDER_SNAPSHOTS, d as KODAX_REASONING_MODE_SEQUENCE, e as KODAX_REASONING_SAFETY_RESERVE, f as KODAX_STABLE_EFFORT_INTENTS, g as KodaXAnthropicCompatProvider, h as KodaXError, i as KodaXModelCapabilities, j as KodaXNetworkError, k as KodaXOpenAICompatProvider, l as KodaXProviderError, m as KodaXRateLimitError, n as KodaXToolCallIdError, P as ProviderName, R as ResolveWireEffortInput, o as ResolvedWireEffort, p as clampThinkingBudget, q as clearRuntimeModelProviders, r as createCustomProvider, s as effortToLegacyReasoningMode, t as getAvailableProviderNames, u as getCustomModelCapabilities, v as getCustomProvider, w as getCustomProviderList, x as getCustomProviderModelDescriptors, y as getCustomProviderModels, z as getCustomProviderNames, A as getDefaultThinkingDepthForMode, B as getModelCapabilities, C as getProvider, D as getProviderConfiguredCapabilityProfile, E as getProviderConfiguredReasoningCapability, F as getProviderList, G as getProviderModel, H as getProviderModelDescriptors, I as getProviderModels, J as getReasoningCapability, L as getRuntimeModelProvider, M as getRuntimeModelProviderNames, N as isCustomProviderName, O as isKnownProvider, Q as isProviderConfigured, S as isProviderName, T as isReasoningEnabled, U as isRuntimeModelProviderName, V as listAllModelCapabilities, W as listBuiltinModelCapabilities, X as listCustomProviderModelCapabilities, Y as listProviderModels, Z as mapDepthToOpenAIReasoningEffort, _ as mapLegacyReasoningModeToEffortIntent, $ as normalizeReasoningEffortValue, a0 as normalizeReasoningRequest, a1 as parseReasoningEffortEnv, a2 as registerCustomProviders, a3 as registerModelProvider, a4 as resolveModelCapabilities, a5 as resolveProvider, a6 as resolveProviderModelDescriptors, a7 as resolveReasoningEffort, a8 as resolveReasoningEffortForModelSwitch, a9 as resolveThinkingBudget, aa as resolveWireEffort, ab as validateCustomProviderConfig, ac as verifyProviderCredential } from './types-chunks/resolver.d-CIVoGc97.js';
4
+ import { a as CostTracker } from './types-chunks/cost-tracker.d-BeaenODW.js';
5
+ export { C as CostRate, D as DEFAULT_COST_RATES, K as KodaXLlmTimeoutConfig, b as KodaXResolvedLlmTimeoutConfig, P as ProviderCostSummary, R as RetryRecord, S as SessionCostSummary, T as TokenUsageRecord, c as calculateCost, d as createCostTracker, f as formatCost, e as formatCostReport, g as getCostRate, h as getSummary, p as parseTimeoutSecEnvMs, r as recordRetry, i as recordUsage, j as resolveLlmTimeoutConfig, t as timeoutSecToMs } from './types-chunks/cost-tracker.d-BeaenODW.js';
6
+ export { C as CapabilityCache, a as CapabilityCacheEntry, b as CapabilityCacheSource, c as addRejectedEffort, d as capabilityCacheKey, g as getRejectedEfforts, n as narrowReasoningProfile, r as removeCacheEntry, s as sanitizeCapabilityCache } from './types-chunks/capability-learning.d-WtsyRv3O.js';
7
+ import { K as KodaXBaseProvider } from './types-chunks/base.d-CYjtB68X.js';
8
+ export { a as KodaXOnRetryAfterCallback, b as KodaXRetryAfterEvent, P as ParseRetryAfterOptions, R as RetryAfterResult, c as RetryAfterSource, e as extractHeadersFromError, p as parseRetryAfter } from './types-chunks/base.d-CYjtB68X.js';
9
9
  export { C as CapabilityKind, a as CapabilityProvider, b as CapabilityResult } from './types-chunks/capability.d-3C62G8Eq.js';
10
10
  import '@anthropic-ai/sdk';
11
11
  import 'openai';
12
12
 
13
+ /** Run a provider operation with an in-memory, run-scoped credential override. */
14
+ declare function runWithProviderCredential<T>(provider: string, credential: string, operation: () => T): T;
15
+ /** Internal provider lookup. The credential is never copied to config or diagnostics. */
16
+ declare function getScopedProviderCredential(provider: string): string | undefined;
17
+ /** Remove the active run credential from DTOs before diagnostics or persistence. */
18
+ declare function redactScopedProviderCredential<T>(value: T): T;
19
+
13
20
  /**
14
21
  * KodaX AI Constants
15
22
  *
@@ -316,5 +323,5 @@ declare function stripCacheBoundaries<T extends {
316
323
  type: string;
317
324
  }>(blocks: readonly (T | KodaXCacheBoundary)[]): T[];
318
325
 
319
- export { CostTracker, KODAX_API_MIN_INTERVAL, KODAX_CAPPED_MAX_OUTPUT_TOKENS, KODAX_ESCALATED_MAX_OUTPUT_TOKENS, KODAX_MAX_TOKENS, KodaXBaseProvider, KodaXCacheBoundary, KodaXContentBlock, KodaXMessage, KodaXProviderCapabilityProfile, KodaXReasoningRequest, KodaXTokenUsage, KodaXVerifyCredentialResult, KodaXVerifyStrategy, WORKFLOW_MAX_CONCURRENCY_ABSOLUTE, WORKFLOW_MAX_CONCURRENCY_DEFAULT, classifyStopReason, classifyVerifyError, getCodexCliDefaultModel, getCodexCliKnownModels, getGeminiCliDefaultModel, getGeminiCliKnownModels, getRunScopedConfig, insertCacheBoundary, isCacheBoundary, isCleanStop, lowerCacheBoundaries, normalizeCapabilityProfile, parseToolInputWithSalvage, resolveWorkflowMaxConcurrency, runVerifyCredential, runWithScopedConfig, sideQuery, stripCacheBoundaries };
326
+ export { CostTracker, KODAX_API_MIN_INTERVAL, KODAX_CAPPED_MAX_OUTPUT_TOKENS, KODAX_ESCALATED_MAX_OUTPUT_TOKENS, KODAX_MAX_TOKENS, KodaXBaseProvider, KodaXCacheBoundary, KodaXContentBlock, KodaXMessage, KodaXProviderCapabilityProfile, KodaXReasoningRequest, KodaXTokenUsage, KodaXVerifyCredentialResult, KodaXVerifyStrategy, WORKFLOW_MAX_CONCURRENCY_ABSOLUTE, WORKFLOW_MAX_CONCURRENCY_DEFAULT, classifyStopReason, classifyVerifyError, getCodexCliDefaultModel, getCodexCliKnownModels, getGeminiCliDefaultModel, getGeminiCliKnownModels, getRunScopedConfig, getScopedProviderCredential, insertCacheBoundary, isCacheBoundary, isCleanStop, lowerCacheBoundaries, normalizeCapabilityProfile, parseToolInputWithSalvage, redactScopedProviderCredential, resolveWorkflowMaxConcurrency, runVerifyCredential, runWithProviderCredential, runWithScopedConfig, sideQuery, stripCacheBoundaries };
320
327
  export type { KodaXAnthropicCacheableBlock, KodaXCacheLowerMode, KodaXRunScopedConfig, KodaXStopClass, RunVerifyCredentialOpts, SideQueryRequest, SideQueryResult, SideQueryStopReason, VerifyPrimitiveRunner };