@kodax-ai/kodax 0.7.84 → 0.7.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +218 -5
- package/README.md +1888 -1850
- package/README_CN.md +1146 -1137
- package/dist/chunks/agent-IO6TXNCV.js +2 -0
- package/dist/chunks/argument-completer-JMICSGL6.js +2 -0
- package/dist/chunks/chunk-2RAXDUC7.js +379 -0
- package/dist/chunks/chunk-A5VQGXH2.js +2 -0
- package/dist/chunks/{chunk-OHZFGQEH.js → chunk-AAFFS6RU.js} +2 -2
- package/dist/chunks/chunk-B36G256E.js +679 -0
- package/dist/chunks/chunk-G5FGIRDJ.js +1278 -0
- package/dist/chunks/chunk-GVGLYVG4.js +5 -0
- package/dist/chunks/chunk-MFCPQZ7E.js +519 -0
- package/dist/chunks/chunk-Q6UAGROD.js +415 -0
- package/dist/chunks/chunk-R4EHASEN.js +319 -0
- package/dist/chunks/chunk-U6HNMLNN.js +410 -0
- package/dist/chunks/chunk-UH5WNJXF.js +92 -0
- package/dist/chunks/{chunk-WTYAZOWO.js → chunk-UKCDCVMD.js} +1 -1
- package/dist/chunks/chunk-XA4ENCAH.js +412 -0
- package/dist/chunks/{chunk-ZVPTDYDI.js → chunk-XUKLF26Q.js} +2 -2
- package/dist/chunks/compaction-config-5RMG22CY.js +2 -0
- package/dist/chunks/{construction-bootstrap-EVQ6VWSX.js → construction-bootstrap-4DGAYOWH.js} +1 -1
- package/dist/chunks/dist-DFW7MXT7.js +2 -0
- package/dist/chunks/host-6MMHYTI5.js +2 -0
- package/dist/chunks/run-manager-ISQSWCAM.js +2 -0
- package/dist/chunks/utils-LV7FHKYN.js +2 -0
- package/dist/index.d.ts +17 -15
- package/dist/index.js +2 -2
- package/dist/kodax_bootstrap.js +1 -1
- package/dist/kodax_cli.js +2074 -1615
- package/dist/kodax_resume.js +271 -90
- package/dist/runtime-worker.js +1812 -1359
- package/dist/sandbox-workspace-session.js +1069 -112
- package/dist/sdk-a2a.d.ts +11 -10
- package/dist/sdk-a2a.js +9 -8
- package/dist/sdk-agent.d.ts +39 -299
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +103 -16
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +7 -20
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +14 -15
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +73 -24
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.d.ts +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +7 -6
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.d.ts +2 -2
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +250 -64
- package/dist/types-chunks/{bash-prefix-extractor.d-CkdGL4rM.d.ts → bash-prefix-extractor.d-QqKtuLZm.d.ts} +137 -14
- package/dist/types-chunks/{capsule.d-7wQ_kM1C.d.ts → capsule.d-CN_iMqAS.d.ts} +2 -1
- package/dist/types-chunks/controller.d-A73Kf6tH.d.ts +105 -0
- package/dist/types-chunks/{controller.d-CesRxFL5.d.ts → controller.d-Dzxz22X-.d.ts} +26 -1020
- package/dist/types-chunks/{guardrail.d-KaIeVree.d.ts → guardrail.d-Y_AIh8-I.d.ts} +21 -21
- package/dist/types-chunks/{history-retrieval.d-CbCls7r0.d.ts → history-retrieval.d-Debbzn1z.d.ts} +1 -1
- package/dist/types-chunks/{public-api.d-DpRj8b7d.d.ts → public-api.d-Cg-4GTbK.d.ts} +3 -2
- package/dist/types-chunks/{repl.d-DWeC3PLW.d.ts → repl.d-Bhrbueab.d.ts} +5 -5
- package/dist/types-chunks/review-inbox.d-DuZqFX-z.d.ts +221 -0
- package/dist/types-chunks/{run-manager.d-BXBkLT0A.d.ts → run-manager.d-BS4lJfL3.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-DEtS6u20.d.ts → sdk-session-fQ_KENev.d.ts} +2 -2
- package/dist/types-chunks/{shell-command-sets.d-P2h4_KKL.d.ts → shell-command-sets.d-DRGjd_7Q.d.ts} +3 -2
- package/dist/types-chunks/{types-Bf3Y3mW-.d.ts → types-PHjfwebT.d.ts} +62 -190
- package/dist/types-chunks/{types.d-0m3PS7Ng.d.ts → types.d-BRrJU4pb.d.ts} +2 -2
- package/dist/types-chunks/{types.d-BbtGlKZu.d.ts → types.d-BSPlmJqf.d.ts} +25 -6
- package/dist/types-chunks/{types.d-CUtMr2IG.d.ts → types.d-Bo4fyMLu.d.ts} +1 -1
- package/dist/types-chunks/types.d-DlLBRqZ9.d.ts +1057 -0
- package/dist/types-chunks/{utils.d-C-eSIZ9n.d.ts → utils.d-BIhh_BqE.d.ts} +7 -4
- package/package.json +4 -2
- package/dist/chunks/agent-VMXNVYRK.js +0 -2
- package/dist/chunks/argument-completer-QCS6GUAE.js +0 -2
- package/dist/chunks/chunk-4ZI2CPUQ.js +0 -885
- package/dist/chunks/chunk-6UENDY33.js +0 -89
- package/dist/chunks/chunk-726WJGGY.js +0 -2
- package/dist/chunks/chunk-A7L7XTUH.js +0 -292
- package/dist/chunks/chunk-BBBS644N.js +0 -319
- package/dist/chunks/chunk-E7C4DRD2.js +0 -5
- package/dist/chunks/chunk-ET2BMEQQ.js +0 -655
- package/dist/chunks/chunk-EVXIJPZ6.js +0 -218
- package/dist/chunks/chunk-F44YYR6Z.js +0 -479
- package/dist/chunks/chunk-GRLC3N46.js +0 -385
- package/dist/chunks/chunk-KHEFUT6O.js +0 -5
- package/dist/chunks/chunk-TDJS5SFS.js +0 -348
- package/dist/chunks/chunk-WXHHZZRJ.js +0 -379
- package/dist/chunks/compaction-config-QTMFP7AF.js +0 -2
- package/dist/chunks/dist-XRH6CRLL.js +0 -2
- package/dist/chunks/host-F4TPD6WY.js +0 -2
- package/dist/chunks/run-manager-PYD46OGY.js +0 -2
- package/dist/chunks/utils-TOTTXU2I.js +0 -2
- package/docs/SDK_EMBEDDER_GUIDE.md +0 -5752
|
@@ -0,0 +1,1057 @@
|
|
|
1
|
+
import { k as KodaXMessage } from './types.d-CgrXrFrq.js';
|
|
2
|
+
|
|
3
|
+
type AgentActorState = 'running' | 'idle' | 'closed';
|
|
4
|
+
type AgentTurnState = 'accepted' | 'running' | 'completed' | 'failed' | 'interrupted';
|
|
5
|
+
type AgentExecutionKind = 'native' | 'constructed' | 'workflow' | 'external';
|
|
6
|
+
type AgentForkTurns = 'all' | 'none' | number;
|
|
7
|
+
type AgentDataClassification = 'public' | 'internal' | 'sensitive';
|
|
8
|
+
type AgentProgressKind = 'status' | 'tool' | 'assistant';
|
|
9
|
+
type AgentInterruptScope = 'turn' | 'subtree';
|
|
10
|
+
type AgentMetadataValue = string | number | boolean | null | readonly AgentMetadataValue[] | {
|
|
11
|
+
readonly [key: string]: AgentMetadataValue;
|
|
12
|
+
};
|
|
13
|
+
interface AgentCapabilities {
|
|
14
|
+
readonly tools: readonly string[];
|
|
15
|
+
readonly filesystem: 'none' | 'read' | 'write';
|
|
16
|
+
readonly network: boolean;
|
|
17
|
+
readonly providers: readonly string[];
|
|
18
|
+
readonly canAskUser: boolean;
|
|
19
|
+
/** Backend operation support. Omitted means the complete native contract. */
|
|
20
|
+
readonly control?: {
|
|
21
|
+
readonly followup: boolean;
|
|
22
|
+
readonly interrupt: boolean;
|
|
23
|
+
readonly streaming: boolean;
|
|
24
|
+
readonly artifacts: boolean;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface AgentActor {
|
|
28
|
+
readonly path: string;
|
|
29
|
+
readonly taskName: string;
|
|
30
|
+
readonly parentPath?: string;
|
|
31
|
+
readonly kind: AgentExecutionKind;
|
|
32
|
+
readonly state: AgentActorState;
|
|
33
|
+
readonly capabilities: AgentCapabilities;
|
|
34
|
+
readonly turnIds: readonly string[];
|
|
35
|
+
readonly currentTurnId?: string;
|
|
36
|
+
readonly mailboxCursor: number;
|
|
37
|
+
readonly createdAt: string;
|
|
38
|
+
readonly updatedAt: string;
|
|
39
|
+
readonly revision: number;
|
|
40
|
+
}
|
|
41
|
+
/** Executor-neutral artifact metadata retained beside the legacy string reference. */
|
|
42
|
+
interface AgentArtifactDescriptor {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly uri?: string;
|
|
45
|
+
readonly mimeType?: string;
|
|
46
|
+
readonly size?: number;
|
|
47
|
+
readonly hash?: string;
|
|
48
|
+
readonly provenance?: string;
|
|
49
|
+
readonly producingAgentId?: string;
|
|
50
|
+
readonly remoteTaskId?: string;
|
|
51
|
+
}
|
|
52
|
+
interface AgentTurn {
|
|
53
|
+
readonly turnId: string;
|
|
54
|
+
readonly actorPath: string;
|
|
55
|
+
readonly sequence: number;
|
|
56
|
+
readonly state: AgentTurnState;
|
|
57
|
+
readonly objective: string;
|
|
58
|
+
readonly forkTurns: AgentForkTurns;
|
|
59
|
+
readonly metadata?: Readonly<Record<string, AgentMetadataValue>>;
|
|
60
|
+
readonly createdAt: string;
|
|
61
|
+
readonly startedAt?: string;
|
|
62
|
+
readonly completedAt?: string;
|
|
63
|
+
readonly output?: string;
|
|
64
|
+
readonly artifacts?: readonly string[];
|
|
65
|
+
readonly artifactDetails?: readonly AgentArtifactDescriptor[];
|
|
66
|
+
readonly structured?: AgentMetadataValue;
|
|
67
|
+
readonly error?: string;
|
|
68
|
+
/** Bounded Runtime-owned activity projection; full transcripts remain executor-owned. */
|
|
69
|
+
readonly progress?: readonly AgentProgressItem[];
|
|
70
|
+
readonly revision: number;
|
|
71
|
+
}
|
|
72
|
+
interface AgentProgressUpdate {
|
|
73
|
+
readonly kind: AgentProgressKind;
|
|
74
|
+
readonly summary: string;
|
|
75
|
+
}
|
|
76
|
+
interface AgentProgressItem extends AgentProgressUpdate {
|
|
77
|
+
readonly sequence: number;
|
|
78
|
+
readonly createdAt: string;
|
|
79
|
+
}
|
|
80
|
+
interface AgentMailboxMessage {
|
|
81
|
+
readonly messageId: string;
|
|
82
|
+
readonly sequence: number;
|
|
83
|
+
readonly senderPath: string;
|
|
84
|
+
readonly recipientPath: string;
|
|
85
|
+
readonly turnId?: string;
|
|
86
|
+
readonly kind: 'message' | 'followup' | 'completion';
|
|
87
|
+
readonly classification: AgentDataClassification;
|
|
88
|
+
/** Canonical actors that handled this chain; absent only on pre-hardening schema-v1 snapshots. */
|
|
89
|
+
readonly lineage?: readonly string[];
|
|
90
|
+
readonly forwardedMessageId?: string;
|
|
91
|
+
readonly content: string;
|
|
92
|
+
readonly createdAt: string;
|
|
93
|
+
}
|
|
94
|
+
type AgentEventKind = 'actor_spawned' | 'turn_started' | 'message_delivered' | 'turn_progress' | 'turn_completed' | 'turn_failed' | 'turn_interrupted' | 'actor_closed';
|
|
95
|
+
interface AgentEvent {
|
|
96
|
+
readonly sequence: number;
|
|
97
|
+
readonly kind: AgentEventKind;
|
|
98
|
+
readonly actorPath: string;
|
|
99
|
+
readonly turnId?: string;
|
|
100
|
+
readonly parentPath?: string;
|
|
101
|
+
readonly progress?: AgentProgressItem;
|
|
102
|
+
readonly createdAt: string;
|
|
103
|
+
}
|
|
104
|
+
interface AgentSpawnInput {
|
|
105
|
+
readonly taskName: string;
|
|
106
|
+
readonly objective: string;
|
|
107
|
+
readonly kind?: AgentExecutionKind;
|
|
108
|
+
readonly forkTurns?: AgentForkTurns;
|
|
109
|
+
readonly capabilities?: Partial<AgentCapabilities>;
|
|
110
|
+
readonly metadata?: Readonly<Record<string, AgentMetadataValue>>;
|
|
111
|
+
}
|
|
112
|
+
interface AgentTurnRef {
|
|
113
|
+
readonly actorPath: string;
|
|
114
|
+
readonly turnId: string;
|
|
115
|
+
readonly state: 'accepted' | 'running';
|
|
116
|
+
}
|
|
117
|
+
interface AgentFollowupResult {
|
|
118
|
+
readonly delivery: 'started_turn' | 'current_turn';
|
|
119
|
+
readonly turn: AgentTurnRef;
|
|
120
|
+
}
|
|
121
|
+
interface AgentTreeSnapshot {
|
|
122
|
+
readonly rootPath: '/root';
|
|
123
|
+
readonly actors: readonly AgentListEntry[];
|
|
124
|
+
readonly activeNonRootTurns: number;
|
|
125
|
+
readonly maxConcurrentThreads: number;
|
|
126
|
+
readonly revision: number;
|
|
127
|
+
/** Turn-admission state revision; absent only on older/custom clients. */
|
|
128
|
+
readonly admissionRevision?: number;
|
|
129
|
+
}
|
|
130
|
+
interface AgentTurnSummary {
|
|
131
|
+
readonly turnId: string;
|
|
132
|
+
readonly state: AgentTurnState;
|
|
133
|
+
readonly summary: string;
|
|
134
|
+
readonly summaryTruncated: boolean;
|
|
135
|
+
readonly recentActivity: readonly AgentProgressItem[];
|
|
136
|
+
}
|
|
137
|
+
interface AgentListEntry extends AgentActor {
|
|
138
|
+
readonly latestTurn?: AgentTurnSummary;
|
|
139
|
+
}
|
|
140
|
+
interface AgentDetail {
|
|
141
|
+
readonly actor: AgentActor;
|
|
142
|
+
readonly turns: readonly AgentTurn[];
|
|
143
|
+
readonly mailbox: readonly AgentMailboxMessage[];
|
|
144
|
+
}
|
|
145
|
+
interface AgentOutput {
|
|
146
|
+
readonly actorPath: string;
|
|
147
|
+
readonly turnId: string;
|
|
148
|
+
readonly state: AgentTurnState;
|
|
149
|
+
readonly output?: string;
|
|
150
|
+
readonly outputTruncated?: boolean;
|
|
151
|
+
readonly artifacts: readonly string[];
|
|
152
|
+
readonly artifactDetails?: readonly AgentArtifactDescriptor[];
|
|
153
|
+
readonly progress: readonly AgentProgressItem[];
|
|
154
|
+
readonly structured?: AgentMetadataValue;
|
|
155
|
+
readonly error?: string;
|
|
156
|
+
}
|
|
157
|
+
interface AgentLimitReached {
|
|
158
|
+
readonly code: 'agent_limit_reached';
|
|
159
|
+
readonly maxConcurrentThreads: number;
|
|
160
|
+
readonly activeNonRootTurns: number;
|
|
161
|
+
readonly availableNonRootSlots: 0;
|
|
162
|
+
readonly retryable: true;
|
|
163
|
+
}
|
|
164
|
+
interface AgentBudgetExhausted {
|
|
165
|
+
readonly code: 'agent_budget_exhausted';
|
|
166
|
+
readonly retryable: false;
|
|
167
|
+
readonly reason: string;
|
|
168
|
+
}
|
|
169
|
+
interface AgentBudgetAdmissionInput {
|
|
170
|
+
readonly actorPath: string;
|
|
171
|
+
readonly parentPath: string;
|
|
172
|
+
readonly turnId: string;
|
|
173
|
+
readonly kind: AgentExecutionKind;
|
|
174
|
+
readonly units: 1;
|
|
175
|
+
}
|
|
176
|
+
type AgentBudgetAdmission = {
|
|
177
|
+
readonly admitted: true;
|
|
178
|
+
} | {
|
|
179
|
+
readonly admitted: false;
|
|
180
|
+
readonly fact: AgentBudgetExhausted;
|
|
181
|
+
};
|
|
182
|
+
interface AgentBudgetPort {
|
|
183
|
+
admit(input: AgentBudgetAdmissionInput): Promise<AgentBudgetAdmission>;
|
|
184
|
+
refund?(turnId: string): Promise<void>;
|
|
185
|
+
snapshot?(): unknown;
|
|
186
|
+
}
|
|
187
|
+
interface AgentExecutionInput {
|
|
188
|
+
readonly actor: AgentActor;
|
|
189
|
+
readonly turn: AgentTurn;
|
|
190
|
+
readonly priorTurns: readonly AgentTurn[];
|
|
191
|
+
readonly signal: AbortSignal;
|
|
192
|
+
drainMailbox(): Promise<readonly AgentMailboxMessage[]>;
|
|
193
|
+
reportProgress(update: AgentProgressUpdate): Promise<void>;
|
|
194
|
+
}
|
|
195
|
+
interface AgentExecutionResult {
|
|
196
|
+
readonly output: string;
|
|
197
|
+
readonly artifacts?: readonly string[];
|
|
198
|
+
readonly artifactDetails?: readonly AgentArtifactDescriptor[];
|
|
199
|
+
readonly structured?: AgentMetadataValue;
|
|
200
|
+
/** Runtime-observed completion facts merged into the durable Turn metadata. */
|
|
201
|
+
readonly turnMetadata?: Readonly<Record<string, AgentMetadataValue>>;
|
|
202
|
+
}
|
|
203
|
+
interface AgentMutationOptions {
|
|
204
|
+
/** Optimistic Actor revision checked inside the serialized durable mutation. */
|
|
205
|
+
readonly expectedRevision?: number;
|
|
206
|
+
/** Optimistic tree revision checked inside the serialized durable mutation. */
|
|
207
|
+
readonly expectedTreeRevision?: number;
|
|
208
|
+
/** Optimistic turn-admission revision, excluding progress and mailbox writes. */
|
|
209
|
+
readonly expectedAdmissionRevision?: number;
|
|
210
|
+
}
|
|
211
|
+
interface AgentTurnExecutor {
|
|
212
|
+
execute(input: AgentExecutionInput): Promise<AgentExecutionResult>;
|
|
213
|
+
}
|
|
214
|
+
interface AgentActorSnapshotContents {
|
|
215
|
+
readonly revision: number;
|
|
216
|
+
/** Added after schema v2; legacy snapshots derive it from revision on load. */
|
|
217
|
+
readonly admissionRevision?: number;
|
|
218
|
+
readonly maxConcurrentThreads: number;
|
|
219
|
+
readonly actors: readonly AgentActor[];
|
|
220
|
+
readonly turns: readonly AgentTurn[];
|
|
221
|
+
readonly mailboxes: Readonly<Record<string, readonly AgentMailboxMessage[]>>;
|
|
222
|
+
/** Terminal child turns explicitly observed by their direct parent. */
|
|
223
|
+
readonly acknowledgedCompletionTurnIds?: readonly string[];
|
|
224
|
+
/** Root completion notifications that must survive process-local queue loss. */
|
|
225
|
+
readonly pendingRootCompletionTurnIds?: readonly string[];
|
|
226
|
+
readonly events: readonly AgentEvent[];
|
|
227
|
+
}
|
|
228
|
+
/** Runtime process/controller identity that exclusively owns one durable Actor tree. */
|
|
229
|
+
interface AgentActorOwner {
|
|
230
|
+
readonly ownerId: string;
|
|
231
|
+
readonly runtimeId: string;
|
|
232
|
+
readonly pid: number;
|
|
233
|
+
readonly startedAt: string;
|
|
234
|
+
/** Opaque host identity for proving that this exact Runtime, not only its PID, remains alive. */
|
|
235
|
+
readonly livenessId?: string;
|
|
236
|
+
/** Loopback challenge endpoint paired with livenessId. */
|
|
237
|
+
readonly livenessPort?: number;
|
|
238
|
+
}
|
|
239
|
+
interface AgentActorSnapshotV1 extends AgentActorSnapshotContents {
|
|
240
|
+
readonly schemaVersion: 1;
|
|
241
|
+
}
|
|
242
|
+
interface AgentActorSnapshotV2 extends AgentActorSnapshotContents {
|
|
243
|
+
readonly schemaVersion: 2;
|
|
244
|
+
readonly owner?: AgentActorOwner;
|
|
245
|
+
}
|
|
246
|
+
type AgentActorSnapshot = AgentActorSnapshotV1 | AgentActorSnapshotV2;
|
|
247
|
+
interface AgentActorStore {
|
|
248
|
+
load(): Promise<AgentActorSnapshot | undefined>;
|
|
249
|
+
/** CAS save. Implementations must throw actor_snapshot_conflict on a revision mismatch. */
|
|
250
|
+
save(snapshot: AgentActorSnapshot, expectedRevision: number): Promise<void>;
|
|
251
|
+
}
|
|
252
|
+
/** Runtime-bound actor control surface. The caller path is minted by Runtime. */
|
|
253
|
+
interface AgentActorClient {
|
|
254
|
+
readonly callerPath: string;
|
|
255
|
+
/** Stable in-process identity shared by clients bound to the same Actor tree. */
|
|
256
|
+
readonly admissionScope?: object;
|
|
257
|
+
spawn(input: AgentSpawnInput, options?: AgentMutationOptions): Promise<AgentTurnRef>;
|
|
258
|
+
send(targetPath: string, content: string, classification?: AgentDataClassification, forwardedMessageId?: string): Promise<AgentMailboxMessage>;
|
|
259
|
+
followup(targetPath: string, objective: string, metadata?: Readonly<Record<string, AgentMetadataValue>>, options?: AgentMutationOptions): Promise<AgentFollowupResult>;
|
|
260
|
+
interrupt(targetPath: string, reason?: string, scope?: AgentInterruptScope): Promise<void>;
|
|
261
|
+
acknowledgeCompletions(turnIds: readonly string[]): Promise<number>;
|
|
262
|
+
list(): AgentTreeSnapshot;
|
|
263
|
+
get(targetPath: string): AgentDetail;
|
|
264
|
+
output(targetPath: string, turnId?: string): AgentOutput;
|
|
265
|
+
eventSnapshot(afterSequence?: number): readonly AgentEvent[];
|
|
266
|
+
wait(afterSequence?: number, timeoutMs?: number, signal?: AbortSignal): Promise<AgentEvent | undefined>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @kodax-ai/agent Types
|
|
271
|
+
*
|
|
272
|
+
* 通用 Agent 类型定义
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
type KodaXJsonPrimitive = string | number | boolean | null;
|
|
276
|
+
type KodaXJsonValue = KodaXJsonPrimitive | KodaXJsonValue[] | {
|
|
277
|
+
[key: string]: KodaXJsonValue;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Session error metadata - 会话错误元数据
|
|
281
|
+
* Used for error recovery and session cleanup - 用于错误恢复和会话清理
|
|
282
|
+
*/
|
|
283
|
+
interface SessionErrorMetadata {
|
|
284
|
+
/** Last error message - 最后的错误消息 */
|
|
285
|
+
lastError?: string;
|
|
286
|
+
/** Last error timestamp - 最后错误时间戳 */
|
|
287
|
+
lastErrorTime?: number;
|
|
288
|
+
/** Consecutive error count - 连续错误计数 */
|
|
289
|
+
consecutiveErrors: number;
|
|
290
|
+
}
|
|
291
|
+
interface KodaXExtensionSessionRecord {
|
|
292
|
+
id: string;
|
|
293
|
+
extensionId: string;
|
|
294
|
+
type: string;
|
|
295
|
+
ts: number;
|
|
296
|
+
data?: KodaXJsonValue;
|
|
297
|
+
dedupeKey?: string;
|
|
298
|
+
}
|
|
299
|
+
type KodaXExtensionSessionState = Record<string, Record<string, KodaXJsonValue>>;
|
|
300
|
+
interface KodaXSessionEntryBase {
|
|
301
|
+
id: string;
|
|
302
|
+
parentId: string | null;
|
|
303
|
+
timestamp: string;
|
|
304
|
+
/**
|
|
305
|
+
* Stable logical identity for this transcript item. Cloned/forked entries get
|
|
306
|
+
* a fresh physical `id` but keep their source entry's `logicalId`, allowing
|
|
307
|
+
* SDK hosts to group or fold cloned history without comparing content.
|
|
308
|
+
*/
|
|
309
|
+
logicalId?: string;
|
|
310
|
+
/** Root physical entry id this item was cloned from, when it is a clone. */
|
|
311
|
+
sourceEntryId?: string;
|
|
312
|
+
}
|
|
313
|
+
interface KodaXSessionMessageEntry extends KodaXSessionEntryBase {
|
|
314
|
+
type: 'message';
|
|
315
|
+
message: KodaXMessage;
|
|
316
|
+
}
|
|
317
|
+
interface KodaXSessionCompactionEntry extends KodaXSessionEntryBase {
|
|
318
|
+
type: 'compaction';
|
|
319
|
+
summary: string;
|
|
320
|
+
firstKeptEntryId?: string;
|
|
321
|
+
tokensBefore?: number;
|
|
322
|
+
tokensAfter?: number;
|
|
323
|
+
artifactLedgerId?: string;
|
|
324
|
+
reason?: string;
|
|
325
|
+
details?: KodaXJsonValue;
|
|
326
|
+
memorySeed?: KodaXCompactMemorySeed;
|
|
327
|
+
/**
|
|
328
|
+
* FEATURE_072: post-compact ledger summary + file-content messages that
|
|
329
|
+
* are inlined after the compaction summary at slicer time
|
|
330
|
+
* (`getSessionMessagesFromLineage`). Stored here so they leave the active
|
|
331
|
+
* path automatically when a new compaction entry is appended.
|
|
332
|
+
*
|
|
333
|
+
* NOTE: attachments are emitted by the slicer, NOT by `getContextMessagesForEntry`
|
|
334
|
+
* — preserving the latter's 1-to-1 contract that `entryMatchesContextMessage`
|
|
335
|
+
* and FEATURE_073's future slicing both depend on.
|
|
336
|
+
*/
|
|
337
|
+
postCompactAttachments?: readonly KodaXMessage[];
|
|
338
|
+
}
|
|
339
|
+
interface KodaXSessionBranchSummaryEntry extends KodaXSessionEntryBase {
|
|
340
|
+
type: 'branch_summary';
|
|
341
|
+
summary: string;
|
|
342
|
+
fromId?: string;
|
|
343
|
+
details?: KodaXJsonValue;
|
|
344
|
+
}
|
|
345
|
+
interface KodaXSessionLabelEntry extends KodaXSessionEntryBase {
|
|
346
|
+
type: 'label';
|
|
347
|
+
targetId: string;
|
|
348
|
+
label?: string;
|
|
349
|
+
}
|
|
350
|
+
interface KodaXSessionArchiveMarkerEntry extends KodaXSessionEntryBase {
|
|
351
|
+
type: 'archive_marker';
|
|
352
|
+
/** Links to the corresponding batch in the .archive.jsonl sidecar file */
|
|
353
|
+
archiveBatchId: string;
|
|
354
|
+
/** Number of entries that were archived in this batch */
|
|
355
|
+
archivedEntryCount: number;
|
|
356
|
+
/** Brief summary of the archived content */
|
|
357
|
+
summary: string;
|
|
358
|
+
}
|
|
359
|
+
interface KodaXSessionRewindMarkerEntry extends KodaXSessionEntryBase {
|
|
360
|
+
type: 'rewind_marker';
|
|
361
|
+
targetId: string;
|
|
362
|
+
fromId?: string;
|
|
363
|
+
truncatedCount: number;
|
|
364
|
+
summary: string;
|
|
365
|
+
}
|
|
366
|
+
interface KodaXSessionClientNoticeEntry extends KodaXSessionEntryBase {
|
|
367
|
+
type: 'client_notice';
|
|
368
|
+
source: string;
|
|
369
|
+
content: string;
|
|
370
|
+
turnId?: string;
|
|
371
|
+
payload?: KodaXJsonValue;
|
|
372
|
+
}
|
|
373
|
+
interface KodaXMemoryOutcomeDigest {
|
|
374
|
+
readonly id: string;
|
|
375
|
+
readonly reviewKey: string;
|
|
376
|
+
/** Stable root-episode identity; absent on pre-F263 digests. */
|
|
377
|
+
readonly episodeId?: string;
|
|
378
|
+
readonly sessionId: string;
|
|
379
|
+
readonly branchId: string;
|
|
380
|
+
readonly sequence: number;
|
|
381
|
+
readonly objective: string;
|
|
382
|
+
readonly actionSignature?: string;
|
|
383
|
+
readonly approach: string;
|
|
384
|
+
/**
|
|
385
|
+
* `cancelled` is reserved for a host-bound explicit Memory intent. Ordinary
|
|
386
|
+
* cancelled episodes do not produce an outcome digest.
|
|
387
|
+
*/
|
|
388
|
+
readonly outcome: 'succeeded' | 'failed' | 'cancelled';
|
|
389
|
+
readonly summary: string;
|
|
390
|
+
readonly preconditions?: string;
|
|
391
|
+
readonly lesson?: string;
|
|
392
|
+
readonly evidenceRefs: readonly string[];
|
|
393
|
+
readonly evidence?: readonly KodaXMemoryOutcomeEvidence[];
|
|
394
|
+
/**
|
|
395
|
+
* Explicit durable intent captured from the Action LLM and bound by the
|
|
396
|
+
* host to an exact quote in the current user turn. It is evidence for the
|
|
397
|
+
* governed reviewer, never proof that Memory was queued or applied.
|
|
398
|
+
*/
|
|
399
|
+
readonly memoryIntent?: KodaXMemoryIntent;
|
|
400
|
+
/** Explicit Memory operations already completed during this episode. */
|
|
401
|
+
readonly handledMemoryOperations?: readonly KodaXHandledMemoryOperation[];
|
|
402
|
+
readonly memoryInfluence?: readonly KodaXMemoryInfluenceRef[];
|
|
403
|
+
readonly visibility: 'prompt_safe' | 'private' | 'sensitive';
|
|
404
|
+
readonly createdAt: string;
|
|
405
|
+
}
|
|
406
|
+
interface KodaXHandledMemoryOperation {
|
|
407
|
+
readonly operation: 'remember' | 'correct' | 'forget';
|
|
408
|
+
readonly disposition?: 'applied' | 'decision' | 'blocked';
|
|
409
|
+
readonly statement?: string;
|
|
410
|
+
readonly claimKey?: string;
|
|
411
|
+
readonly targetRefIds: readonly string[];
|
|
412
|
+
}
|
|
413
|
+
interface KodaXMemoryIntent {
|
|
414
|
+
readonly operation: 'remember' | 'correct';
|
|
415
|
+
readonly evidenceRef: string;
|
|
416
|
+
/** Sanitized model-derived claim proposed for governed review. */
|
|
417
|
+
readonly candidateStatement: string;
|
|
418
|
+
/** Sanitized representation of the exact current-user quote verified by the host. */
|
|
419
|
+
readonly userQuote: string;
|
|
420
|
+
}
|
|
421
|
+
interface KodaXMemoryOutcomeEvidence {
|
|
422
|
+
readonly ref: string;
|
|
423
|
+
readonly grade: 'authoritative' | 'verified' | 'corroborated' | 'observed' | 'inferred';
|
|
424
|
+
readonly source: 'user' | 'host' | 'tool' | 'environment' | 'agent';
|
|
425
|
+
readonly verdict?: 'passed' | 'failed' | 'inconclusive';
|
|
426
|
+
readonly observedAt: string;
|
|
427
|
+
}
|
|
428
|
+
interface KodaXMemoryInfluenceRef {
|
|
429
|
+
readonly decisionReceiptRef: string;
|
|
430
|
+
readonly grade: 'direct' | 'supporting' | 'exposed' | 'unknown';
|
|
431
|
+
}
|
|
432
|
+
interface KodaXSessionMemoryOutcomeDigestEntry extends KodaXSessionEntryBase {
|
|
433
|
+
readonly type: 'memory_outcome_digest';
|
|
434
|
+
readonly digest: KodaXMemoryOutcomeDigest;
|
|
435
|
+
/** Durable F263 review job identity. Absent on pre-F263 lineage records. */
|
|
436
|
+
readonly jobId?: string;
|
|
437
|
+
}
|
|
438
|
+
interface KodaXSessionMemoryReviewReceiptEntry extends KodaXSessionEntryBase {
|
|
439
|
+
readonly type: 'memory_review_receipt';
|
|
440
|
+
/** Distinguishes repeated review keys across branch epochs. */
|
|
441
|
+
readonly jobId?: string;
|
|
442
|
+
readonly reviewKey: string;
|
|
443
|
+
readonly proposalIds: readonly string[];
|
|
444
|
+
readonly status: 'completed' | 'no_action';
|
|
445
|
+
readonly completedAt: string;
|
|
446
|
+
}
|
|
447
|
+
type KodaXGoalStatus = 'active' | 'paused' | 'budget_limited' | 'blocked' | 'complete';
|
|
448
|
+
/**
|
|
449
|
+
* Persistent user-set goal state. v0.7.44 FEATURE_192 — backs the
|
|
450
|
+
* `/goal` slash command and the get_goal / create_goal / update_goal
|
|
451
|
+
* tools.
|
|
452
|
+
*
|
|
453
|
+
* Persistence model: each lifecycle event (create / update / pause /
|
|
454
|
+
* resume / clear / budget_limited / blocked / complete) appends a
|
|
455
|
+
* `KodaXSessionGoalEntry` carrying a frozen `KodaXGoalState` snapshot
|
|
456
|
+
* to the session lineage. `readLatestGoalFromBranch` walks the active
|
|
457
|
+
* branch's message-entry IDs and returns the latest goal entry whose
|
|
458
|
+
* parentId belongs to that branch — so forks and rewinds naturally
|
|
459
|
+
* drop goals attached to abandoned message paths.
|
|
460
|
+
*/
|
|
461
|
+
interface KodaXGoalState {
|
|
462
|
+
readonly version: 1;
|
|
463
|
+
/** `${createdAt}-${rand}` — stable across updates of the same goal. */
|
|
464
|
+
readonly id: string;
|
|
465
|
+
readonly objective: string;
|
|
466
|
+
readonly status: KodaXGoalStatus;
|
|
467
|
+
/** Optional explicit token budget; null when the user did not set one. */
|
|
468
|
+
readonly tokenBudget: number | null;
|
|
469
|
+
readonly tokensUsed: number;
|
|
470
|
+
readonly timeUsedSeconds: number;
|
|
471
|
+
/** Consecutive turns the model has reported the same blocker. */
|
|
472
|
+
readonly blockerTurnCount: number;
|
|
473
|
+
/** The blocker_kind string the model last reported, or null. */
|
|
474
|
+
readonly lastBlockerKind: string | null;
|
|
475
|
+
readonly createdAt: number;
|
|
476
|
+
readonly updatedAt: number;
|
|
477
|
+
}
|
|
478
|
+
type KodaXGoalEventType = 'created' | 'updated' | 'paused' | 'resumed' | 'cleared' | 'budget_limited' | 'blocked' | 'complete';
|
|
479
|
+
interface KodaXSessionGoalEntry extends KodaXSessionEntryBase {
|
|
480
|
+
type: 'goal';
|
|
481
|
+
/** Snapshot at time of event; `null` only when `event === 'cleared'`. */
|
|
482
|
+
goal: KodaXGoalState | null;
|
|
483
|
+
event: KodaXGoalEventType;
|
|
484
|
+
}
|
|
485
|
+
type KodaXSessionEntry = KodaXSessionMessageEntry | KodaXSessionCompactionEntry | KodaXSessionBranchSummaryEntry | KodaXSessionLabelEntry | KodaXSessionArchiveMarkerEntry | KodaXSessionRewindMarkerEntry | KodaXSessionClientNoticeEntry | KodaXSessionMemoryOutcomeDigestEntry | KodaXSessionMemoryReviewReceiptEntry | KodaXSessionGoalEntry;
|
|
486
|
+
interface KodaXSessionArtifactLedgerEntry {
|
|
487
|
+
id: string;
|
|
488
|
+
kind: 'file_read' | 'file_modified' | 'file_created' | 'file_deleted' | 'path_scope' | 'search_scope' | 'command_scope' | 'check_result' | 'decision' | 'image_input' | 'tombstone';
|
|
489
|
+
sourceTool?: string;
|
|
490
|
+
action?: string;
|
|
491
|
+
target: string;
|
|
492
|
+
displayTarget?: string;
|
|
493
|
+
summary?: string;
|
|
494
|
+
sessionEntryId?: string;
|
|
495
|
+
timestamp: string;
|
|
496
|
+
metadata?: Record<string, KodaXJsonValue>;
|
|
497
|
+
}
|
|
498
|
+
interface KodaXCompactMemoryProgress {
|
|
499
|
+
completed: string[];
|
|
500
|
+
inProgress: string[];
|
|
501
|
+
blockers: string[];
|
|
502
|
+
}
|
|
503
|
+
interface KodaXCompactMemorySeed {
|
|
504
|
+
objective?: string;
|
|
505
|
+
constraints: string[];
|
|
506
|
+
progress: KodaXCompactMemoryProgress;
|
|
507
|
+
keyDecisions: string[];
|
|
508
|
+
nextSteps: string[];
|
|
509
|
+
keyContext: string[];
|
|
510
|
+
importantTargets: string[];
|
|
511
|
+
tombstones: string[];
|
|
512
|
+
}
|
|
513
|
+
interface KodaXSessionLineage {
|
|
514
|
+
version: 2;
|
|
515
|
+
activeEntryId: string | null;
|
|
516
|
+
entries: KodaXSessionEntry[];
|
|
517
|
+
}
|
|
518
|
+
interface KodaXSessionNavigationOptions {
|
|
519
|
+
summarizeCurrentBranch?: boolean;
|
|
520
|
+
}
|
|
521
|
+
interface KodaXSessionTreeNode {
|
|
522
|
+
entry: Exclude<KodaXSessionEntry, KodaXSessionLabelEntry | KodaXSessionGoalEntry | KodaXSessionClientNoticeEntry | KodaXSessionRewindMarkerEntry | KodaXSessionMemoryOutcomeDigestEntry | KodaXSessionMemoryReviewReceiptEntry>;
|
|
523
|
+
children: KodaXSessionTreeNode[];
|
|
524
|
+
label?: string;
|
|
525
|
+
active: boolean;
|
|
526
|
+
}
|
|
527
|
+
type KodaXSessionScope = 'user' | 'managed-task-worker';
|
|
528
|
+
type KodaXSessionUiTextHistoryItemType = 'user' | 'assistant' | 'system' | 'thinking' | 'error' | 'event' | 'info' | 'hint' | 'sidecar';
|
|
529
|
+
type KodaXSessionUiHistoryItemType = KodaXSessionUiTextHistoryItemType | 'tool_group';
|
|
530
|
+
interface KodaXSessionUiTextHistoryItem {
|
|
531
|
+
type: KodaXSessionUiTextHistoryItemType;
|
|
532
|
+
text: string;
|
|
533
|
+
/** Original UI event time in epoch milliseconds. Absent on older sessions. */
|
|
534
|
+
timestamp?: number;
|
|
535
|
+
icon?: string;
|
|
536
|
+
compactText?: string;
|
|
537
|
+
}
|
|
538
|
+
type KodaXSessionUiToolCallStatus = 'success' | 'error' | 'cancelled' | 'awaiting_approval';
|
|
539
|
+
interface KodaXSessionUiToolCall {
|
|
540
|
+
id: string;
|
|
541
|
+
name: string;
|
|
542
|
+
status: KodaXSessionUiToolCallStatus;
|
|
543
|
+
input?: {
|
|
544
|
+
[key: string]: KodaXJsonValue;
|
|
545
|
+
};
|
|
546
|
+
preview?: string;
|
|
547
|
+
output?: string;
|
|
548
|
+
error?: string;
|
|
549
|
+
startTime?: number;
|
|
550
|
+
endTime?: number;
|
|
551
|
+
}
|
|
552
|
+
interface KodaXSessionUiToolGroupHistoryItem {
|
|
553
|
+
type: 'tool_group';
|
|
554
|
+
/** Original UI event time in epoch milliseconds. Absent on older sessions. */
|
|
555
|
+
timestamp?: number;
|
|
556
|
+
tools: KodaXSessionUiToolCall[];
|
|
557
|
+
}
|
|
558
|
+
type KodaXSessionUiHistoryItem = KodaXSessionUiTextHistoryItem | KodaXSessionUiToolGroupHistoryItem;
|
|
559
|
+
type KodaXSessionWorkspaceKind = 'detected' | 'managed';
|
|
560
|
+
interface KodaXSessionRuntimeInfo {
|
|
561
|
+
canonicalRepoRoot?: string;
|
|
562
|
+
workspaceRoot?: string;
|
|
563
|
+
executionCwd?: string;
|
|
564
|
+
branch?: string;
|
|
565
|
+
workspaceKind?: KodaXSessionWorkspaceKind;
|
|
566
|
+
/** SDK consumer surface/profile label, e.g. `'code'` | `'partner'`. */
|
|
567
|
+
surface?: string;
|
|
568
|
+
/** SDK consumer profile id (stable name or UUID). */
|
|
569
|
+
profileId?: string;
|
|
570
|
+
/** SDK consumer profile version. */
|
|
571
|
+
profileVersion?: string;
|
|
572
|
+
/** LLM provider alias active at session start, e.g. `'anthropic'`. */
|
|
573
|
+
provider?: string;
|
|
574
|
+
/** Model identifier active at session start. */
|
|
575
|
+
model?: string;
|
|
576
|
+
/** Reasoning mode active at session start. */
|
|
577
|
+
reasoningMode?: string;
|
|
578
|
+
/** Permission mode active at session start, e.g. `'auto'` | `'plan'`. */
|
|
579
|
+
permissionMode?: string;
|
|
580
|
+
/** Agent mode active at session start, e.g. `'sa'` | `'ama'`. */
|
|
581
|
+
agentMode?: string;
|
|
582
|
+
}
|
|
583
|
+
interface KodaXSessionData {
|
|
584
|
+
messages: KodaXMessage[];
|
|
585
|
+
title: string;
|
|
586
|
+
gitRoot: string;
|
|
587
|
+
/** Consumer-owned private string persisted with the session. */
|
|
588
|
+
tag?: string;
|
|
589
|
+
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
590
|
+
scope?: KodaXSessionScope;
|
|
591
|
+
uiHistory?: KodaXSessionUiHistoryItem[];
|
|
592
|
+
errorMetadata?: SessionErrorMetadata;
|
|
593
|
+
extensionState?: KodaXExtensionSessionState;
|
|
594
|
+
extensionRecords?: KodaXExtensionSessionRecord[];
|
|
595
|
+
lineage?: KodaXSessionLineage;
|
|
596
|
+
artifactLedger?: KodaXSessionArtifactLedgerEntry[];
|
|
597
|
+
/** Runtime-owned F270 Actor tree snapshot; persisted with the session owner. */
|
|
598
|
+
actorSnapshot?: AgentActorSnapshot;
|
|
599
|
+
}
|
|
600
|
+
interface KodaXSessionMeta {
|
|
601
|
+
_type: 'meta';
|
|
602
|
+
title: string;
|
|
603
|
+
id: string;
|
|
604
|
+
gitRoot: string;
|
|
605
|
+
/** Consumer-owned private string persisted with the session. */
|
|
606
|
+
tag?: string;
|
|
607
|
+
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
608
|
+
createdAt: string;
|
|
609
|
+
scope?: KodaXSessionScope;
|
|
610
|
+
uiHistory?: KodaXSessionUiHistoryItem[];
|
|
611
|
+
extensionState?: KodaXExtensionSessionState;
|
|
612
|
+
extensionRecordCount?: number;
|
|
613
|
+
artifactLedgerCount?: number;
|
|
614
|
+
/** Runtime-owned F270 Actor tree snapshot; absent on pre-v0.7.72 sessions. */
|
|
615
|
+
actorSnapshot?: AgentActorSnapshot;
|
|
616
|
+
lineageVersion?: 2;
|
|
617
|
+
activeEntryId?: string | null;
|
|
618
|
+
lineageEntryCount?: number;
|
|
619
|
+
activeMessageCount?: number;
|
|
620
|
+
/** Error metadata for recovery - 错误元数据用于恢复 */
|
|
621
|
+
errorMetadata?: SessionErrorMetadata;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Extension-scoped persistence entry.
|
|
625
|
+
*
|
|
626
|
+
* Each entry belongs to a namespace (extensionId) and carries
|
|
627
|
+
* a string key, a JSON-safe value, and an opaque version tag
|
|
628
|
+
* used for optimistic concurrency control.
|
|
629
|
+
*/
|
|
630
|
+
interface KodaXExtensionStoreEntry {
|
|
631
|
+
key: string;
|
|
632
|
+
value: KodaXJsonValue;
|
|
633
|
+
version: string;
|
|
634
|
+
updatedAt: number;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Extension persistence store interface (FEATURE_034 manual persistence).
|
|
638
|
+
*
|
|
639
|
+
* Implementations provide a durable key-value store scoped to a single
|
|
640
|
+
* extension identity. The store is independent of session lifecycle —
|
|
641
|
+
* data survives across sessions and restarts.
|
|
642
|
+
*/
|
|
643
|
+
interface KodaXExtensionStore {
|
|
644
|
+
/**
|
|
645
|
+
* Read a single key.
|
|
646
|
+
* Returns `undefined` when the key does not exist.
|
|
647
|
+
*/
|
|
648
|
+
get(key: string): Promise<KodaXExtensionStoreEntry | undefined>;
|
|
649
|
+
/**
|
|
650
|
+
* Write a key-value pair.
|
|
651
|
+
*
|
|
652
|
+
* When `expectedVersion` is provided the write only succeeds when the
|
|
653
|
+
* stored entry's version still matches (optimistic concurrency).
|
|
654
|
+
* Returns the new entry on success, or `false` on version mismatch.
|
|
655
|
+
*/
|
|
656
|
+
put(key: string, value: KodaXJsonValue, options?: {
|
|
657
|
+
expectedVersion?: string;
|
|
658
|
+
}): Promise<KodaXExtensionStoreEntry | false>;
|
|
659
|
+
/**
|
|
660
|
+
* Remove a key.
|
|
661
|
+
* Returns `true` when the key existed and was removed.
|
|
662
|
+
*/
|
|
663
|
+
delete(key: string): Promise<boolean>;
|
|
664
|
+
/**
|
|
665
|
+
* List all keys (optionally filtered by prefix).
|
|
666
|
+
*/
|
|
667
|
+
list(options?: {
|
|
668
|
+
prefix?: string;
|
|
669
|
+
}): Promise<string[]>;
|
|
670
|
+
/**
|
|
671
|
+
* Clear all keys (optionally filtered by prefix).
|
|
672
|
+
* Returns the number of entries removed.
|
|
673
|
+
*/
|
|
674
|
+
clear(options?: {
|
|
675
|
+
prefix?: string;
|
|
676
|
+
}): Promise<number>;
|
|
677
|
+
}
|
|
678
|
+
interface KodaXSessionStorage {
|
|
679
|
+
save(id: string, data: KodaXSessionData): Promise<void>;
|
|
680
|
+
load(id: string): Promise<KodaXSessionData | null>;
|
|
681
|
+
/**
|
|
682
|
+
* Atomically mutates context-silent lineage state against the latest
|
|
683
|
+
* persisted session. Hosts that own session persistence may expose this
|
|
684
|
+
* without allowing the runner to write a stale full snapshot. Returns
|
|
685
|
+
* true when the session existed and the callback was evaluated, including
|
|
686
|
+
* an idempotent no-op; false only when the session was not found.
|
|
687
|
+
*/
|
|
688
|
+
mutateLineage?(id: string, mutation: (lineage: KodaXSessionLineage) => KodaXSessionLineage): Promise<boolean>;
|
|
689
|
+
getLineage?(id: string): Promise<KodaXSessionLineage | null>;
|
|
690
|
+
/** Exact lineage merged from the active session file and island sidecars. */
|
|
691
|
+
loadFullLineage?(id: string): Promise<KodaXSessionLineage | null>;
|
|
692
|
+
setActiveEntry?(id: string, selector: string, options?: KodaXSessionNavigationOptions): Promise<KodaXSessionData | null>;
|
|
693
|
+
setLabel?(id: string, selector: string, label?: string): Promise<KodaXSessionData | null>;
|
|
694
|
+
rewind?(id: string, selector?: string): Promise<KodaXSessionData | null>;
|
|
695
|
+
fork?(id: string, selector?: string, options?: {
|
|
696
|
+
sessionId?: string;
|
|
697
|
+
title?: string;
|
|
698
|
+
}): Promise<{
|
|
699
|
+
sessionId: string;
|
|
700
|
+
data: KodaXSessionData;
|
|
701
|
+
} | null>;
|
|
702
|
+
list?(gitRoot?: string, options?: {
|
|
703
|
+
limit?: number;
|
|
704
|
+
includeArchived?: boolean;
|
|
705
|
+
}): Promise<Array<{
|
|
706
|
+
id: string;
|
|
707
|
+
title: string;
|
|
708
|
+
msgCount: number;
|
|
709
|
+
tag?: string;
|
|
710
|
+
runtimeInfo?: KodaXSessionRuntimeInfo;
|
|
711
|
+
}>>;
|
|
712
|
+
delete?(id: string): Promise<void>;
|
|
713
|
+
deleteAll?(gitRoot?: string): Promise<void>;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
interface MemoryContextIdentity {
|
|
717
|
+
/** Explicit owner home for durable runtime state; never persisted in review envelopes. */
|
|
718
|
+
readonly configHome?: string;
|
|
719
|
+
readonly tenantId: string;
|
|
720
|
+
readonly workspaceId?: string;
|
|
721
|
+
readonly userId?: string;
|
|
722
|
+
readonly agentId: string;
|
|
723
|
+
readonly projectId?: string;
|
|
724
|
+
readonly sessionId: string;
|
|
725
|
+
}
|
|
726
|
+
interface MemoryApplicability {
|
|
727
|
+
readonly tenantId: string;
|
|
728
|
+
readonly workspaceId?: string;
|
|
729
|
+
readonly userId?: string;
|
|
730
|
+
readonly agentId?: string;
|
|
731
|
+
readonly projectId?: string;
|
|
732
|
+
readonly sessionId?: string;
|
|
733
|
+
}
|
|
734
|
+
declare function matchesMemoryApplicability(identity: MemoryContextIdentity, applicability: MemoryApplicability): boolean;
|
|
735
|
+
declare function hashMemoryIdentityComponent(kind: string, canonicalId: string): string;
|
|
736
|
+
declare function memoryApplicabilityFingerprint(applicability: MemoryApplicability): string;
|
|
737
|
+
|
|
738
|
+
type MemoryRefKind = 'working_context' | 'session_trace' | 'artifact_ledger' | 'learning_proposal' | 'memdir' | 'skill' | 'workflow_run' | 'reasoning_report' | 'self_manual' | 'project_doc';
|
|
739
|
+
|
|
740
|
+
type MemoryScope = 'turn' | 'session' | 'project' | 'workspace' | 'agent' | 'user' | 'builtin';
|
|
741
|
+
type MemoryClaimKind = 'fact' | 'policy' | 'preference' | 'procedure' | 'episode';
|
|
742
|
+
type MemoryLifecycle = 'pending' | 'active' | 'provisional' | 'trusted' | 'stale' | 'quarantined' | 'archived' | 'readonly';
|
|
743
|
+
type MemoryAuthority = 'read_only' | 'proposal_only' | 'approved_write';
|
|
744
|
+
type MemoryVisibility = 'prompt_safe' | 'private' | 'sensitive';
|
|
745
|
+
interface MemoryItemRef {
|
|
746
|
+
readonly kind: MemoryRefKind;
|
|
747
|
+
readonly id: string;
|
|
748
|
+
readonly scope: MemoryScope;
|
|
749
|
+
readonly scopeId?: string;
|
|
750
|
+
readonly applicability?: MemoryApplicability;
|
|
751
|
+
readonly claimKind?: MemoryClaimKind;
|
|
752
|
+
readonly claimKey?: string;
|
|
753
|
+
readonly actionSignature?: string;
|
|
754
|
+
readonly title?: string;
|
|
755
|
+
readonly owner: 'user' | 'project' | 'kodax' | 'external';
|
|
756
|
+
readonly lifecycle: MemoryLifecycle;
|
|
757
|
+
readonly authority: MemoryAuthority;
|
|
758
|
+
readonly visibility: MemoryVisibility;
|
|
759
|
+
readonly sourceRefs: readonly string[];
|
|
760
|
+
readonly relatedRefs: readonly string[];
|
|
761
|
+
readonly version?: string;
|
|
762
|
+
readonly bodyFingerprint?: string;
|
|
763
|
+
readonly storageUri?: string;
|
|
764
|
+
readonly createdAt?: string;
|
|
765
|
+
readonly updatedAt?: string;
|
|
766
|
+
readonly lastUsedAt?: string;
|
|
767
|
+
readonly pinned?: boolean;
|
|
768
|
+
readonly applyReceiptRef?: string;
|
|
769
|
+
readonly expectedFingerprint?: string;
|
|
770
|
+
readonly resultingFingerprint?: string;
|
|
771
|
+
}
|
|
772
|
+
interface MemoryRefFilter {
|
|
773
|
+
readonly kinds?: readonly MemoryRefKind[];
|
|
774
|
+
readonly scopes?: readonly MemoryScope[];
|
|
775
|
+
readonly lifecycles?: readonly MemoryLifecycle[];
|
|
776
|
+
readonly includePrivate?: boolean;
|
|
777
|
+
readonly includeSensitive?: boolean;
|
|
778
|
+
readonly query?: string;
|
|
779
|
+
}
|
|
780
|
+
interface MemoryBodySnapshot {
|
|
781
|
+
readonly ref: MemoryItemRef;
|
|
782
|
+
readonly body: string;
|
|
783
|
+
readonly bodyFingerprint: string;
|
|
784
|
+
readonly frontmatter?: Readonly<Record<string, string>>;
|
|
785
|
+
readonly readAt: string;
|
|
786
|
+
readonly warnings: readonly string[];
|
|
787
|
+
}
|
|
788
|
+
type MemoryProposalAction = 'no_op' | 'link_refs' | 'write_memdir' | 'patch_memdir' | 'handoff_to_skill_loop' | 'quarantine' | 'archive' | 'conflict_report';
|
|
789
|
+
interface MemoryApplyPreview {
|
|
790
|
+
readonly summary: string;
|
|
791
|
+
readonly changedRefs: readonly MemoryItemRef[];
|
|
792
|
+
readonly changedPaths: readonly string[];
|
|
793
|
+
readonly beforeFingerprints: Readonly<Record<string, string>>;
|
|
794
|
+
readonly afterFingerprints?: Readonly<Record<string, string>>;
|
|
795
|
+
readonly diff?: string;
|
|
796
|
+
readonly warnings: readonly string[];
|
|
797
|
+
}
|
|
798
|
+
interface MemoryActionProposal {
|
|
799
|
+
readonly id: string;
|
|
800
|
+
readonly action: MemoryProposalAction;
|
|
801
|
+
readonly targetRefs: readonly MemoryItemRef[];
|
|
802
|
+
readonly sourceRefs: readonly MemoryItemRef[];
|
|
803
|
+
readonly expectedFingerprints: Readonly<Record<string, string>>;
|
|
804
|
+
readonly rationale: string;
|
|
805
|
+
readonly risk: 'low' | 'medium' | 'high';
|
|
806
|
+
readonly preview: MemoryApplyPreview;
|
|
807
|
+
readonly requiresApproval: true;
|
|
808
|
+
readonly createdAt: string;
|
|
809
|
+
}
|
|
810
|
+
interface MemoryApproval {
|
|
811
|
+
readonly proposalId: string;
|
|
812
|
+
readonly approvedBy: 'user' | 'host';
|
|
813
|
+
readonly approvedAt: string;
|
|
814
|
+
readonly expectedFingerprints: Readonly<Record<string, string>>;
|
|
815
|
+
readonly policyId?: string;
|
|
816
|
+
readonly policyReason?: string;
|
|
817
|
+
readonly revalidateAuthority?: () => Promise<void>;
|
|
818
|
+
}
|
|
819
|
+
interface MemoryApplyResult {
|
|
820
|
+
readonly proposalId: string;
|
|
821
|
+
readonly applied: boolean;
|
|
822
|
+
readonly changedRefs: readonly MemoryItemRef[];
|
|
823
|
+
readonly changedPaths: readonly string[];
|
|
824
|
+
readonly skippedReason?: string;
|
|
825
|
+
readonly warnings: readonly string[];
|
|
826
|
+
}
|
|
827
|
+
interface MemoryRejectResult {
|
|
828
|
+
readonly proposalId: string;
|
|
829
|
+
readonly rejected: boolean;
|
|
830
|
+
readonly skippedReason?: string;
|
|
831
|
+
readonly review?: MemoryReviewPlan;
|
|
832
|
+
readonly warnings: readonly string[];
|
|
833
|
+
}
|
|
834
|
+
interface MemoryLifecycleOperationResult {
|
|
835
|
+
readonly refId: string;
|
|
836
|
+
readonly operation: 'archive' | 'forget' | 'purge';
|
|
837
|
+
readonly acknowledged: boolean;
|
|
838
|
+
readonly residualSourceRefs: readonly string[];
|
|
839
|
+
readonly warnings: readonly string[];
|
|
840
|
+
}
|
|
841
|
+
interface MemoryRememberInput {
|
|
842
|
+
/** `correct` requires an exact managed Memory ref so the host never guesses a destructive target. */
|
|
843
|
+
readonly operation?: 'remember' | 'correct';
|
|
844
|
+
readonly statement: string;
|
|
845
|
+
readonly targetRefId?: string;
|
|
846
|
+
readonly claimKind?: MemoryClaimKind;
|
|
847
|
+
readonly claimKey?: string;
|
|
848
|
+
/** Stable evidence identity supplied by the user-facing host. */
|
|
849
|
+
readonly evidenceRef?: string;
|
|
850
|
+
/** Optional version guard for a target selected from a previously shown view. */
|
|
851
|
+
readonly expectedTargetFingerprint?: string;
|
|
852
|
+
}
|
|
853
|
+
interface MemoryRememberResult {
|
|
854
|
+
readonly status: 'remembered' | 'updated' | 'already_known' | 'needs_clarification' | 'needs_review' | 'rejected';
|
|
855
|
+
readonly changedRefIds: readonly string[];
|
|
856
|
+
readonly proposalIds: readonly string[];
|
|
857
|
+
readonly reason?: string;
|
|
858
|
+
readonly warnings: readonly string[];
|
|
859
|
+
}
|
|
860
|
+
interface MemorySourceAdapter {
|
|
861
|
+
readonly kind: MemoryRefKind;
|
|
862
|
+
listRefs(filter?: MemoryRefFilter): Promise<readonly MemoryItemRef[]>;
|
|
863
|
+
readRef(ref: MemoryItemRef): Promise<MemoryBodySnapshot>;
|
|
864
|
+
previewProposal(proposal: MemoryActionProposal): Promise<MemoryApplyPreview>;
|
|
865
|
+
applyProposal(proposal: MemoryActionProposal, approval: MemoryApproval): Promise<MemoryApplyResult>;
|
|
866
|
+
}
|
|
867
|
+
interface MemoryCuratorInput {
|
|
868
|
+
readonly includePrivate?: boolean;
|
|
869
|
+
readonly includeSensitive?: boolean;
|
|
870
|
+
}
|
|
871
|
+
interface MemoryAutoCuratorInput extends MemoryCuratorInput {
|
|
872
|
+
readonly enabled?: boolean;
|
|
873
|
+
readonly intervalMs?: number;
|
|
874
|
+
readonly minRefs?: number;
|
|
875
|
+
}
|
|
876
|
+
type MemoryAutoCuratorSkipReason = 'disabled' | 'not_due' | 'insufficient_refs';
|
|
877
|
+
interface MemoryAutoCuratorResult {
|
|
878
|
+
readonly ran: boolean;
|
|
879
|
+
readonly skippedReason?: MemoryAutoCuratorSkipReason;
|
|
880
|
+
readonly report?: MemoryGovernanceReport;
|
|
881
|
+
readonly reportPath?: string;
|
|
882
|
+
readonly nextEligibleAt?: string;
|
|
883
|
+
}
|
|
884
|
+
type MemoryGovernanceFindingKind = 'duplicate' | 'conflict' | 'stale' | 'quarantined' | 'orphaned' | 'no_op';
|
|
885
|
+
interface MemoryGovernanceFinding {
|
|
886
|
+
readonly kind: MemoryGovernanceFindingKind;
|
|
887
|
+
readonly severity: 'info' | 'warning' | 'error';
|
|
888
|
+
readonly refIds: readonly string[];
|
|
889
|
+
readonly summary: string;
|
|
890
|
+
readonly suggestedAction: MemoryProposalAction;
|
|
891
|
+
}
|
|
892
|
+
interface MemoryGovernanceReport {
|
|
893
|
+
readonly reportId: string;
|
|
894
|
+
readonly generatedAt: string;
|
|
895
|
+
readonly findings: readonly MemoryGovernanceFinding[];
|
|
896
|
+
readonly warnings: readonly string[];
|
|
897
|
+
}
|
|
898
|
+
interface MemoryPackInput {
|
|
899
|
+
readonly task: string;
|
|
900
|
+
readonly identity?: MemoryContextIdentity;
|
|
901
|
+
readonly decisionIntent?: string;
|
|
902
|
+
readonly actionSignature?: string;
|
|
903
|
+
readonly maxCandidates?: number;
|
|
904
|
+
readonly maxHints?: number;
|
|
905
|
+
readonly includePrivate?: boolean;
|
|
906
|
+
readonly includeSensitive?: boolean;
|
|
907
|
+
readonly includeSnippets?: boolean;
|
|
908
|
+
readonly ignoreMemory?: boolean;
|
|
909
|
+
readonly purpose?: 'automatic' | 'deliberate_query' | 'intervention';
|
|
910
|
+
}
|
|
911
|
+
interface MemoryPackHint {
|
|
912
|
+
readonly ref: MemoryItemRef;
|
|
913
|
+
readonly hook: string;
|
|
914
|
+
readonly reason: string;
|
|
915
|
+
readonly bodySnippet?: string;
|
|
916
|
+
readonly bodyFingerprint?: string;
|
|
917
|
+
}
|
|
918
|
+
interface MemoryPack {
|
|
919
|
+
readonly generatedAt: string;
|
|
920
|
+
readonly taskFingerprint: string;
|
|
921
|
+
readonly memoryRevision: string;
|
|
922
|
+
readonly candidates: readonly MemoryPackHint[];
|
|
923
|
+
readonly promptHints: readonly MemoryPackHint[];
|
|
924
|
+
/** @deprecated Use promptHints. Retained for F228 source compatibility. */
|
|
925
|
+
readonly hints: readonly MemoryPackHint[];
|
|
926
|
+
readonly omitted: readonly string[];
|
|
927
|
+
readonly traceMetadata: MemoryPackTraceMetadata;
|
|
928
|
+
}
|
|
929
|
+
interface MemoryPackTraceMetadata {
|
|
930
|
+
readonly selectedRefIds: readonly string[];
|
|
931
|
+
readonly omittedRefIds: readonly string[];
|
|
932
|
+
readonly taskFingerprint: string;
|
|
933
|
+
readonly suppressed: boolean;
|
|
934
|
+
}
|
|
935
|
+
type MemoryReviewTrigger = 'user_correction' | 'explicit_remember' | 'explicit_forget' | 'proposal_rejected' | 'conflict_detected' | 'episode_completed';
|
|
936
|
+
interface MemoryReviewCandidateRef {
|
|
937
|
+
readonly ref: MemoryItemRef;
|
|
938
|
+
readonly bodySnippet?: string;
|
|
939
|
+
readonly bodyFingerprint?: string;
|
|
940
|
+
readonly warnings: readonly string[];
|
|
941
|
+
}
|
|
942
|
+
interface MemoryReviewInput {
|
|
943
|
+
readonly trigger: MemoryReviewTrigger;
|
|
944
|
+
readonly userFeedback?: string;
|
|
945
|
+
readonly episodeDigest?: KodaXMemoryOutcomeDigest;
|
|
946
|
+
readonly task?: string;
|
|
947
|
+
readonly sourceRefs?: readonly string[];
|
|
948
|
+
readonly candidateRefIds?: readonly string[];
|
|
949
|
+
readonly includePrivate?: boolean;
|
|
950
|
+
readonly includeSensitive?: boolean;
|
|
951
|
+
readonly maxRefs?: number;
|
|
952
|
+
}
|
|
953
|
+
interface MemoryReviewModelInput {
|
|
954
|
+
readonly trigger: MemoryReviewTrigger;
|
|
955
|
+
readonly userFeedback: string;
|
|
956
|
+
readonly task?: string;
|
|
957
|
+
readonly sourceRefs: readonly string[];
|
|
958
|
+
readonly candidateRefs: readonly MemoryReviewCandidateRef[];
|
|
959
|
+
readonly warnings: readonly string[];
|
|
960
|
+
}
|
|
961
|
+
interface MemoryReviewDraftAction {
|
|
962
|
+
readonly action: MemoryProposalAction;
|
|
963
|
+
readonly targetRefIds: readonly string[];
|
|
964
|
+
readonly summary: string;
|
|
965
|
+
readonly rationale: string;
|
|
966
|
+
readonly confidence: 'low' | 'medium' | 'high';
|
|
967
|
+
readonly risk: 'low' | 'medium' | 'high';
|
|
968
|
+
readonly requiresApproval: true;
|
|
969
|
+
readonly proposedBody?: string;
|
|
970
|
+
readonly claimKind?: MemoryClaimKind;
|
|
971
|
+
readonly claimKey?: string;
|
|
972
|
+
readonly actionSignature?: string;
|
|
973
|
+
readonly preconditions?: string;
|
|
974
|
+
/** Host-bound version for an explicitly presented correction target. */
|
|
975
|
+
readonly authorizationTargetFingerprint?: string;
|
|
976
|
+
readonly counterexamples?: readonly string[];
|
|
977
|
+
readonly relationship?: 'same_claim' | 'condition_refinement' | 'conflict';
|
|
978
|
+
}
|
|
979
|
+
interface MemoryReviewPlan {
|
|
980
|
+
readonly trigger: MemoryReviewTrigger;
|
|
981
|
+
readonly createdAt: string;
|
|
982
|
+
readonly sourceRefs: readonly string[];
|
|
983
|
+
readonly candidateRefs: readonly MemoryReviewCandidateRef[];
|
|
984
|
+
readonly actions: readonly MemoryReviewDraftAction[];
|
|
985
|
+
readonly warnings: readonly string[];
|
|
986
|
+
readonly episodeDigest?: KodaXMemoryOutcomeDigest;
|
|
987
|
+
}
|
|
988
|
+
interface MemoryEpisodeReviewResult {
|
|
989
|
+
readonly plan: MemoryReviewPlan;
|
|
990
|
+
readonly proposalIds: readonly string[];
|
|
991
|
+
readonly appliedProposalIds: readonly string[];
|
|
992
|
+
readonly decisions: readonly MemoryReviewPersistenceDecision[];
|
|
993
|
+
readonly warnings: readonly string[];
|
|
994
|
+
}
|
|
995
|
+
type MemoryReviewPersistenceKind = 'create' | 'evidence_update' | 'condition_refinement' | 'conflict' | 'no_action' | 'reject' | 'quarantine';
|
|
996
|
+
interface MemoryReviewPersistenceDecision {
|
|
997
|
+
readonly actionIndex: number;
|
|
998
|
+
readonly kind: MemoryReviewPersistenceKind;
|
|
999
|
+
readonly reason: string;
|
|
1000
|
+
readonly existingRefId?: string;
|
|
1001
|
+
readonly proposalId?: string;
|
|
1002
|
+
}
|
|
1003
|
+
type MemoryReviewRunner = (input: MemoryReviewModelInput) => Promise<MemoryReviewPlan>;
|
|
1004
|
+
interface MemoryController {
|
|
1005
|
+
listInbox(): Promise<readonly MemoryActionProposal[]>;
|
|
1006
|
+
showProposal(id: string): Promise<MemoryActionProposal | undefined>;
|
|
1007
|
+
approveProposal(id: string, expectedFingerprints: Readonly<Record<string, string>>, expectedRevision?: string): Promise<MemoryApplyResult>;
|
|
1008
|
+
rejectProposal(id: string, reason?: string, expectedRevision?: string): Promise<MemoryRejectResult>;
|
|
1009
|
+
listRefs(filter?: MemoryRefFilter): Promise<readonly MemoryItemRef[]>;
|
|
1010
|
+
readRef(ref: MemoryItemRef): Promise<MemoryBodySnapshot>;
|
|
1011
|
+
runCurator(input?: MemoryCuratorInput): Promise<MemoryGovernanceReport>;
|
|
1012
|
+
maybeRunAutoCurator(input?: MemoryAutoCuratorInput): Promise<MemoryAutoCuratorResult>;
|
|
1013
|
+
buildMemoryPack(input: MemoryPackInput): Promise<MemoryPack>;
|
|
1014
|
+
reviewMemoryFeedback(input: MemoryReviewInput): Promise<MemoryReviewPlan>;
|
|
1015
|
+
prepareEpisodeReview?(digest: KodaXMemoryOutcomeDigest): Promise<MemoryReviewModelInput>;
|
|
1016
|
+
applyReviewedEpisode?(plan: MemoryReviewPlan, digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal, revalidateAuthority?: () => Promise<void>): Promise<MemoryEpisodeReviewResult>;
|
|
1017
|
+
persistReviewPlan(plan: MemoryReviewPlan): Promise<readonly string[]>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Resolves which episode-review proposals were actually auto-applied by the
|
|
1020
|
+
* governed host policy. Used to keep durable receipts complete while user
|
|
1021
|
+
* notices remain truthful.
|
|
1022
|
+
*/
|
|
1023
|
+
listHostAppliedEpisodeProposalIds?(proposalIds: readonly string[]): Promise<readonly string[]>;
|
|
1024
|
+
reviewEpisode(digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal): Promise<MemoryEpisodeReviewResult>;
|
|
1025
|
+
archiveRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
1026
|
+
forgetRef(id: string, expectedBodyFingerprint?: string): Promise<MemoryLifecycleOperationResult>;
|
|
1027
|
+
purgeRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
1028
|
+
}
|
|
1029
|
+
/** Additive management capability implemented by KodaX's default control plane. */
|
|
1030
|
+
interface MemoryManagementController extends MemoryController {
|
|
1031
|
+
/** Applies an explicit, prompt-safe user/host instruction without a second approval ceremony. */
|
|
1032
|
+
remember(input: MemoryRememberInput): Promise<MemoryRememberResult>;
|
|
1033
|
+
}
|
|
1034
|
+
declare function isMemoryManagementController(controller: MemoryController): controller is MemoryManagementController;
|
|
1035
|
+
type MemoryEvent = {
|
|
1036
|
+
readonly type: 'proposal.created';
|
|
1037
|
+
readonly proposalId: string;
|
|
1038
|
+
} | {
|
|
1039
|
+
readonly type: 'proposal.approved';
|
|
1040
|
+
readonly proposalId: string;
|
|
1041
|
+
} | {
|
|
1042
|
+
readonly type: 'proposal.rejected';
|
|
1043
|
+
readonly proposalId: string;
|
|
1044
|
+
} | {
|
|
1045
|
+
readonly type: 'curator.completed';
|
|
1046
|
+
readonly reportId: string;
|
|
1047
|
+
} | {
|
|
1048
|
+
readonly type: 'pack.selected';
|
|
1049
|
+
readonly refIds: readonly string[];
|
|
1050
|
+
} | {
|
|
1051
|
+
readonly type: 'review.completed';
|
|
1052
|
+
readonly trigger: MemoryReviewTrigger;
|
|
1053
|
+
readonly actionCount: number;
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1056
|
+
export { hashMemoryIdentityComponent as bb, isMemoryManagementController as bc, matchesMemoryApplicability as bd, memoryApplicabilityFingerprint as be };
|
|
1057
|
+
export type { KodaXMemoryOutcomeDigest as $, AgentActor as A, AgentMetadataValue as B, AgentMutationOptions as C, AgentOutput as D, AgentProgressItem as E, AgentProgressKind as F, AgentProgressUpdate as G, AgentSpawnInput as H, AgentTreeSnapshot as I, AgentTurn as J, AgentTurnExecutor as K, AgentTurnRef as L, AgentTurnState as M, AgentTurnSummary as N, KodaXCompactMemoryProgress as O, KodaXCompactMemorySeed as P, KodaXExtensionSessionRecord as Q, KodaXExtensionSessionState as R, KodaXExtensionStore as S, KodaXExtensionStoreEntry as T, KodaXGoalEventType as U, KodaXGoalState as V, KodaXGoalStatus as W, KodaXHandledMemoryOperation as X, KodaXJsonValue as Y, KodaXMemoryInfluenceRef as Z, KodaXMemoryIntent as _, AgentActorClient as a, MemoryReviewDraftAction as a$, KodaXMemoryOutcomeEvidence as a0, KodaXSessionArchiveMarkerEntry as a1, KodaXSessionArtifactLedgerEntry as a2, KodaXSessionBranchSummaryEntry as a3, KodaXSessionClientNoticeEntry as a4, KodaXSessionCompactionEntry as a5, KodaXSessionData as a6, KodaXSessionEntry as a7, KodaXSessionEntryBase as a8, KodaXSessionGoalEntry as a9, MemoryAutoCuratorInput as aA, MemoryAutoCuratorResult as aB, MemoryBodySnapshot as aC, MemoryClaimKind as aD, MemoryContextIdentity as aE, MemoryController as aF, MemoryCuratorInput as aG, MemoryEpisodeReviewResult as aH, MemoryEvent as aI, MemoryGovernanceFinding as aJ, MemoryGovernanceFindingKind as aK, MemoryGovernanceReport as aL, MemoryItemRef as aM, MemoryLifecycle as aN, MemoryLifecycleOperationResult as aO, MemoryManagementController as aP, MemoryPack as aQ, MemoryPackHint as aR, MemoryPackInput as aS, MemoryPackTraceMetadata as aT, MemoryProposalAction as aU, MemoryRefFilter as aV, MemoryRefKind as aW, MemoryRejectResult as aX, MemoryRememberInput as aY, MemoryRememberResult as aZ, MemoryReviewCandidateRef as a_, KodaXSessionLabelEntry as aa, KodaXSessionLineage as ab, KodaXSessionMemoryOutcomeDigestEntry as ac, KodaXSessionMemoryReviewReceiptEntry as ad, KodaXSessionMessageEntry as ae, KodaXSessionMeta as af, KodaXSessionNavigationOptions as ag, KodaXSessionRewindMarkerEntry as ah, KodaXSessionRuntimeInfo as ai, KodaXSessionScope as aj, KodaXSessionStorage as ak, KodaXSessionTreeNode as al, KodaXSessionUiHistoryItem as am, KodaXSessionUiHistoryItemType as an, KodaXSessionUiTextHistoryItem as ao, KodaXSessionUiTextHistoryItemType as ap, KodaXSessionUiToolCall as aq, KodaXSessionUiToolCallStatus as ar, KodaXSessionUiToolGroupHistoryItem as as, KodaXSessionWorkspaceKind as at, MemoryActionProposal as au, MemoryApplicability as av, MemoryApplyPreview as aw, MemoryApplyResult as ax, MemoryApproval as ay, MemoryAuthority as az, AgentActorOwner as b, MemoryReviewInput as b0, MemoryReviewModelInput as b1, MemoryReviewPersistenceDecision as b2, MemoryReviewPersistenceKind as b3, MemoryReviewPlan as b4, MemoryReviewRunner as b5, MemoryReviewTrigger as b6, MemoryScope as b7, MemorySourceAdapter as b8, MemoryVisibility as b9, SessionErrorMetadata as ba, AgentActorSnapshot as c, AgentActorSnapshotV1 as d, AgentActorSnapshotV2 as e, AgentActorState as f, AgentActorStore as g, AgentArtifactDescriptor as h, AgentBudgetAdmission as i, AgentBudgetAdmissionInput as j, AgentBudgetExhausted as k, AgentBudgetPort as l, AgentCapabilities as m, AgentDataClassification as n, AgentDetail as o, AgentEvent as p, AgentEventKind as q, AgentExecutionInput as r, AgentExecutionKind as s, AgentExecutionResult as t, AgentFollowupResult as u, AgentForkTurns as v, AgentInterruptScope as w, AgentLimitReached as x, AgentListEntry as y, AgentMailboxMessage as z };
|