@kodax-ai/kodax 0.7.83 → 0.7.85
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 +154 -4
- package/README.md +48 -26
- package/README_CN.md +26 -21
- package/dist/chunks/agent-OQ37XUWF.js +2 -0
- package/dist/chunks/argument-completer-IMRSIF2N.js +2 -0
- package/dist/chunks/chunk-2XJQNFVR.js +379 -0
- package/dist/chunks/chunk-3E4OSFP2.js +1279 -0
- package/dist/chunks/chunk-CDWYKVZC.js +482 -0
- package/dist/chunks/chunk-CZCEFGQG.js +412 -0
- package/dist/chunks/chunk-IA246OAN.js +679 -0
- package/dist/chunks/chunk-IWRNGH4M.js +319 -0
- package/dist/chunks/chunk-MJ4G5ZCW.js +2 -0
- package/dist/chunks/{chunk-RAQGGVIF.js → chunk-ODRLFQQH.js} +1 -1
- package/dist/chunks/chunk-RSOAHVUR.js +5 -0
- package/dist/chunks/chunk-RTFVMEF6.js +415 -0
- package/dist/chunks/{chunk-XB2JNLXH.js → chunk-SR4E5FQK.js} +2 -2
- package/dist/chunks/{chunk-HI6RCW5Y.js → chunk-TBBY2DKE.js} +2 -2
- package/dist/chunks/chunk-UH5WNJXF.js +92 -0
- package/dist/chunks/{chunk-6QILIBOU.js → chunk-ZVOXWLT6.js} +214 -201
- package/dist/chunks/compaction-config-3WLLNN57.js +2 -0
- package/dist/chunks/{construction-bootstrap-E4M3CY3N.js → construction-bootstrap-CZ6NWEWQ.js} +1 -1
- package/dist/chunks/dist-NFLLOZWF.js +2 -0
- package/dist/chunks/host-LWUSSCWH.js +2 -0
- package/dist/chunks/run-manager-PBMOVP7A.js +2 -0
- package/dist/chunks/utils-KFLK3EHJ.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 +1975 -1564
- package/dist/kodax_resume.js +269 -90
- package/dist/runtime-worker.js +1824 -1419
- package/dist/sandbox-workspace-session.js +979 -66
- 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 -13
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +64 -23
- package/dist/sdk-runtime.js +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 +251 -64
- package/dist/types-chunks/{bash-prefix-extractor.d-CJM7OY-L.d.ts → bash-prefix-extractor.d-BnZQDirs.d.ts} +130 -13
- package/dist/types-chunks/{capsule.d-B7yoH4dM.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-CYNuR2n9.d.ts → controller.d-Dzxz22X-.d.ts} +28 -1020
- package/dist/types-chunks/{guardrail.d-fM3mn4Op.d.ts → guardrail.d-BCkgaWT1.d.ts} +25 -19
- package/dist/types-chunks/{history-retrieval.d-BDI-ZMvY.d.ts → history-retrieval.d-Debbzn1z.d.ts} +1 -1
- package/dist/types-chunks/{public-api.d-i10kvYFs.d.ts → public-api.d-N6G6Jw8X.d.ts} +3 -2
- package/dist/types-chunks/{repl.d-Cs3eqGVT.d.ts → repl.d-BkTIOkJD.d.ts} +5 -5
- package/dist/types-chunks/review-inbox.d-DuZqFX-z.d.ts +221 -0
- package/dist/types-chunks/{run-manager.d-CodHf6rw.d.ts → run-manager.d-BS4lJfL3.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-CRXu5xNs.d.ts → sdk-session-DLkZTOc-.d.ts} +2 -2
- package/dist/types-chunks/{shell-command-sets.d-DfeSUjjM.d.ts → shell-command-sets.d-BrLw-WN9.d.ts} +3 -2
- package/dist/types-chunks/{types-Bf3Y3mW-.d.ts → types-PHjfwebT.d.ts} +62 -190
- package/dist/types-chunks/{types.d-BbtGlKZu.d.ts → types.d-BSPlmJqf.d.ts} +25 -6
- package/dist/types-chunks/{types.d-DIXZFauU.d.ts → types.d-Bo4fyMLu.d.ts} +1 -1
- package/dist/types-chunks/{types.d-DKs4tfSd.d.ts → types.d-Ch3BD97c.d.ts} +2 -2
- package/dist/types-chunks/types.d-DlLBRqZ9.d.ts +1057 -0
- package/dist/types-chunks/{utils.d-CgITiLyc.d.ts → utils.d-BI-kjuev.d.ts} +7 -4
- package/package.json +4 -2
- package/dist/chunks/agent-S7LMMTG7.js +0 -2
- package/dist/chunks/argument-completer-SQHG2LYE.js +0 -2
- package/dist/chunks/chunk-37RT45HT.js +0 -379
- package/dist/chunks/chunk-3DKQC7A2.js +0 -479
- package/dist/chunks/chunk-45E23YJI.js +0 -885
- package/dist/chunks/chunk-6UENDY33.js +0 -89
- package/dist/chunks/chunk-DSFHIUHZ.js +0 -655
- package/dist/chunks/chunk-DZUMH6GJ.js +0 -2
- package/dist/chunks/chunk-E7C4DRD2.js +0 -5
- package/dist/chunks/chunk-EVXIJPZ6.js +0 -218
- package/dist/chunks/chunk-KHEFUT6O.js +0 -5
- package/dist/chunks/chunk-LF2JBTBG.js +0 -319
- package/dist/chunks/chunk-TC2VHPG5.js +0 -348
- package/dist/chunks/chunk-URCS6CVP.js +0 -292
- package/dist/chunks/compaction-config-SSQ5NXUP.js +0 -2
- package/dist/chunks/dist-MIXP4ULB.js +0 -2
- package/dist/chunks/host-ZCPI7SMC.js +0 -2
- package/dist/chunks/run-manager-4RYG7HSP.js +0 -2
- package/dist/chunks/utils-7DKE2EKT.js +0 -2
- package/docs/SDK_EMBEDDER_GUIDE.md +0 -5735
|
@@ -1,88 +1,9 @@
|
|
|
1
|
-
import { k as KodaXMessage } from './types.d-CgrXrFrq.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* @kodax-ai/agent Types
|
|
5
3
|
*
|
|
6
4
|
* 通用 Agent 类型定义
|
|
7
5
|
*/
|
|
8
6
|
|
|
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
7
|
interface KodaXMemoryOutcomeDigest {
|
|
87
8
|
readonly id: string;
|
|
88
9
|
readonly reviewKey: string;
|
|
@@ -110,10 +31,19 @@ interface KodaXMemoryOutcomeDigest {
|
|
|
110
31
|
* governed reviewer, never proof that Memory was queued or applied.
|
|
111
32
|
*/
|
|
112
33
|
readonly memoryIntent?: KodaXMemoryIntent;
|
|
34
|
+
/** Explicit Memory operations already completed during this episode. */
|
|
35
|
+
readonly handledMemoryOperations?: readonly KodaXHandledMemoryOperation[];
|
|
113
36
|
readonly memoryInfluence?: readonly KodaXMemoryInfluenceRef[];
|
|
114
37
|
readonly visibility: 'prompt_safe' | 'private' | 'sensitive';
|
|
115
38
|
readonly createdAt: string;
|
|
116
39
|
}
|
|
40
|
+
interface KodaXHandledMemoryOperation {
|
|
41
|
+
readonly operation: 'remember' | 'correct' | 'forget';
|
|
42
|
+
readonly disposition?: 'applied' | 'decision' | 'blocked';
|
|
43
|
+
readonly statement?: string;
|
|
44
|
+
readonly claimKey?: string;
|
|
45
|
+
readonly targetRefIds: readonly string[];
|
|
46
|
+
}
|
|
117
47
|
interface KodaXMemoryIntent {
|
|
118
48
|
readonly operation: 'remember' | 'correct';
|
|
119
49
|
readonly evidenceRef: string;
|
|
@@ -133,92 +63,6 @@ interface KodaXMemoryInfluenceRef {
|
|
|
133
63
|
readonly decisionReceiptRef: string;
|
|
134
64
|
readonly grade: 'direct' | 'supporting' | 'exposed' | 'unknown';
|
|
135
65
|
}
|
|
136
|
-
interface KodaXSessionMemoryOutcomeDigestEntry extends KodaXSessionEntryBase {
|
|
137
|
-
readonly type: 'memory_outcome_digest';
|
|
138
|
-
readonly digest: KodaXMemoryOutcomeDigest;
|
|
139
|
-
/** Durable F263 review job identity. Absent on pre-F263 lineage records. */
|
|
140
|
-
readonly jobId?: string;
|
|
141
|
-
}
|
|
142
|
-
interface KodaXSessionMemoryReviewReceiptEntry extends KodaXSessionEntryBase {
|
|
143
|
-
readonly type: 'memory_review_receipt';
|
|
144
|
-
/** Distinguishes repeated review keys across branch epochs. */
|
|
145
|
-
readonly jobId?: string;
|
|
146
|
-
readonly reviewKey: string;
|
|
147
|
-
readonly proposalIds: readonly string[];
|
|
148
|
-
readonly status: 'completed' | 'no_action';
|
|
149
|
-
readonly completedAt: string;
|
|
150
|
-
}
|
|
151
|
-
type KodaXGoalStatus = 'active' | 'paused' | 'budget_limited' | 'blocked' | 'complete';
|
|
152
|
-
/**
|
|
153
|
-
* Persistent user-set goal state. v0.7.44 FEATURE_192 — backs the
|
|
154
|
-
* `/goal` slash command and the get_goal / create_goal / update_goal
|
|
155
|
-
* tools.
|
|
156
|
-
*
|
|
157
|
-
* Persistence model: each lifecycle event (create / update / pause /
|
|
158
|
-
* resume / clear / budget_limited / blocked / complete) appends a
|
|
159
|
-
* `KodaXSessionGoalEntry` carrying a frozen `KodaXGoalState` snapshot
|
|
160
|
-
* to the session lineage. `readLatestGoalFromBranch` walks the active
|
|
161
|
-
* branch's message-entry IDs and returns the latest goal entry whose
|
|
162
|
-
* parentId belongs to that branch — so forks and rewinds naturally
|
|
163
|
-
* drop goals attached to abandoned message paths.
|
|
164
|
-
*/
|
|
165
|
-
interface KodaXGoalState {
|
|
166
|
-
readonly version: 1;
|
|
167
|
-
/** `${createdAt}-${rand}` — stable across updates of the same goal. */
|
|
168
|
-
readonly id: string;
|
|
169
|
-
readonly objective: string;
|
|
170
|
-
readonly status: KodaXGoalStatus;
|
|
171
|
-
/** Optional explicit token budget; null when the user did not set one. */
|
|
172
|
-
readonly tokenBudget: number | null;
|
|
173
|
-
readonly tokensUsed: number;
|
|
174
|
-
readonly timeUsedSeconds: number;
|
|
175
|
-
/** Consecutive turns the model has reported the same blocker. */
|
|
176
|
-
readonly blockerTurnCount: number;
|
|
177
|
-
/** The blocker_kind string the model last reported, or null. */
|
|
178
|
-
readonly lastBlockerKind: string | null;
|
|
179
|
-
readonly createdAt: number;
|
|
180
|
-
readonly updatedAt: number;
|
|
181
|
-
}
|
|
182
|
-
type KodaXGoalEventType = 'created' | 'updated' | 'paused' | 'resumed' | 'cleared' | 'budget_limited' | 'blocked' | 'complete';
|
|
183
|
-
interface KodaXSessionGoalEntry extends KodaXSessionEntryBase {
|
|
184
|
-
type: 'goal';
|
|
185
|
-
/** Snapshot at time of event; `null` only when `event === 'cleared'`. */
|
|
186
|
-
goal: KodaXGoalState | null;
|
|
187
|
-
event: KodaXGoalEventType;
|
|
188
|
-
}
|
|
189
|
-
type KodaXSessionEntry = KodaXSessionMessageEntry | KodaXSessionCompactionEntry | KodaXSessionBranchSummaryEntry | KodaXSessionLabelEntry | KodaXSessionArchiveMarkerEntry | KodaXSessionRewindMarkerEntry | KodaXSessionClientNoticeEntry | KodaXSessionMemoryOutcomeDigestEntry | KodaXSessionMemoryReviewReceiptEntry | KodaXSessionGoalEntry;
|
|
190
|
-
interface KodaXSessionArtifactLedgerEntry {
|
|
191
|
-
id: string;
|
|
192
|
-
kind: 'file_read' | 'file_modified' | 'file_created' | 'file_deleted' | 'path_scope' | 'search_scope' | 'command_scope' | 'check_result' | 'decision' | 'image_input' | 'tombstone';
|
|
193
|
-
sourceTool?: string;
|
|
194
|
-
action?: string;
|
|
195
|
-
target: string;
|
|
196
|
-
displayTarget?: string;
|
|
197
|
-
summary?: string;
|
|
198
|
-
sessionEntryId?: string;
|
|
199
|
-
timestamp: string;
|
|
200
|
-
metadata?: Record<string, KodaXJsonValue>;
|
|
201
|
-
}
|
|
202
|
-
interface KodaXCompactMemoryProgress {
|
|
203
|
-
completed: string[];
|
|
204
|
-
inProgress: string[];
|
|
205
|
-
blockers: string[];
|
|
206
|
-
}
|
|
207
|
-
interface KodaXCompactMemorySeed {
|
|
208
|
-
objective?: string;
|
|
209
|
-
constraints: string[];
|
|
210
|
-
progress: KodaXCompactMemoryProgress;
|
|
211
|
-
keyDecisions: string[];
|
|
212
|
-
nextSteps: string[];
|
|
213
|
-
keyContext: string[];
|
|
214
|
-
importantTargets: string[];
|
|
215
|
-
tombstones: string[];
|
|
216
|
-
}
|
|
217
|
-
interface KodaXSessionLineage {
|
|
218
|
-
version: 2;
|
|
219
|
-
activeEntryId: string | null;
|
|
220
|
-
entries: KodaXSessionEntry[];
|
|
221
|
-
}
|
|
222
66
|
|
|
223
67
|
interface MemoryContextIdentity {
|
|
224
68
|
/** Explicit owner home for durable runtime state; never persisted in review envelopes. */
|
|
@@ -333,6 +177,25 @@ interface MemoryLifecycleOperationResult {
|
|
|
333
177
|
readonly residualSourceRefs: readonly string[];
|
|
334
178
|
readonly warnings: readonly string[];
|
|
335
179
|
}
|
|
180
|
+
interface MemoryRememberInput {
|
|
181
|
+
/** `correct` requires an exact managed Memory ref so the host never guesses a destructive target. */
|
|
182
|
+
readonly operation?: 'remember' | 'correct';
|
|
183
|
+
readonly statement: string;
|
|
184
|
+
readonly targetRefId?: string;
|
|
185
|
+
readonly claimKind?: MemoryClaimKind;
|
|
186
|
+
readonly claimKey?: string;
|
|
187
|
+
/** Stable evidence identity supplied by the user-facing host. */
|
|
188
|
+
readonly evidenceRef?: string;
|
|
189
|
+
/** Optional version guard for a target selected from a previously shown view. */
|
|
190
|
+
readonly expectedTargetFingerprint?: string;
|
|
191
|
+
}
|
|
192
|
+
interface MemoryRememberResult {
|
|
193
|
+
readonly status: 'remembered' | 'updated' | 'already_known' | 'needs_clarification' | 'needs_review' | 'rejected';
|
|
194
|
+
readonly changedRefIds: readonly string[];
|
|
195
|
+
readonly proposalIds: readonly string[];
|
|
196
|
+
readonly reason?: string;
|
|
197
|
+
readonly warnings: readonly string[];
|
|
198
|
+
}
|
|
336
199
|
interface MemoryCuratorInput {
|
|
337
200
|
readonly includePrivate?: boolean;
|
|
338
201
|
readonly includeSensitive?: boolean;
|
|
@@ -440,6 +303,8 @@ interface MemoryReviewDraftAction {
|
|
|
440
303
|
readonly claimKey?: string;
|
|
441
304
|
readonly actionSignature?: string;
|
|
442
305
|
readonly preconditions?: string;
|
|
306
|
+
/** Host-bound version for an explicitly presented correction target. */
|
|
307
|
+
readonly authorizationTargetFingerprint?: string;
|
|
443
308
|
readonly counterexamples?: readonly string[];
|
|
444
309
|
readonly relationship?: 'same_claim' | 'condition_refinement' | 'conflict';
|
|
445
310
|
}
|
|
@@ -467,12 +332,11 @@ interface MemoryReviewPersistenceDecision {
|
|
|
467
332
|
readonly existingRefId?: string;
|
|
468
333
|
readonly proposalId?: string;
|
|
469
334
|
}
|
|
470
|
-
type MemoryReviewRunner = (input: MemoryReviewModelInput) => Promise<MemoryReviewPlan>;
|
|
471
335
|
interface MemoryController {
|
|
472
336
|
listInbox(): Promise<readonly MemoryActionProposal[]>;
|
|
473
337
|
showProposal(id: string): Promise<MemoryActionProposal | undefined>;
|
|
474
|
-
approveProposal(id: string, expectedFingerprints: Readonly<Record<string, string
|
|
475
|
-
rejectProposal(id: string, reason?: string): Promise<MemoryRejectResult>;
|
|
338
|
+
approveProposal(id: string, expectedFingerprints: Readonly<Record<string, string>>, expectedRevision?: string): Promise<MemoryApplyResult>;
|
|
339
|
+
rejectProposal(id: string, reason?: string, expectedRevision?: string): Promise<MemoryRejectResult>;
|
|
476
340
|
listRefs(filter?: MemoryRefFilter): Promise<readonly MemoryItemRef[]>;
|
|
477
341
|
readRef(ref: MemoryItemRef): Promise<MemoryBodySnapshot>;
|
|
478
342
|
runCurator(input?: MemoryCuratorInput): Promise<MemoryGovernanceReport>;
|
|
@@ -490,29 +354,14 @@ interface MemoryController {
|
|
|
490
354
|
listHostAppliedEpisodeProposalIds?(proposalIds: readonly string[]): Promise<readonly string[]>;
|
|
491
355
|
reviewEpisode(digest: KodaXMemoryOutcomeDigest, signal?: AbortSignal): Promise<MemoryEpisodeReviewResult>;
|
|
492
356
|
archiveRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
493
|
-
forgetRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
357
|
+
forgetRef(id: string, expectedBodyFingerprint?: string): Promise<MemoryLifecycleOperationResult>;
|
|
494
358
|
purgeRef(id: string): Promise<MemoryLifecycleOperationResult>;
|
|
495
359
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
readonly proposalId: string;
|
|
502
|
-
} | {
|
|
503
|
-
readonly type: 'proposal.rejected';
|
|
504
|
-
readonly proposalId: string;
|
|
505
|
-
} | {
|
|
506
|
-
readonly type: 'curator.completed';
|
|
507
|
-
readonly reportId: string;
|
|
508
|
-
} | {
|
|
509
|
-
readonly type: 'pack.selected';
|
|
510
|
-
readonly refIds: readonly string[];
|
|
511
|
-
} | {
|
|
512
|
-
readonly type: 'review.completed';
|
|
513
|
-
readonly trigger: MemoryReviewTrigger;
|
|
514
|
-
readonly actionCount: number;
|
|
515
|
-
};
|
|
360
|
+
/** Additive management capability implemented by KodaX's default control plane. */
|
|
361
|
+
interface MemoryManagementController extends MemoryController {
|
|
362
|
+
/** Applies an explicit, prompt-safe user/host instruction without a second approval ceremony. */
|
|
363
|
+
remember(input: MemoryRememberInput): Promise<MemoryRememberResult>;
|
|
364
|
+
}
|
|
516
365
|
|
|
517
366
|
type MemoryEvidenceGrade = 'authoritative' | 'verified' | 'corroborated' | 'observed' | 'inferred';
|
|
518
367
|
interface MemoryEvidenceRef {
|
|
@@ -629,6 +478,7 @@ interface MemoryEpisodeOutcome {
|
|
|
629
478
|
readonly summary: string;
|
|
630
479
|
readonly evidence: readonly MemoryEvidenceRef[];
|
|
631
480
|
readonly memoryIntent?: KodaXMemoryIntent;
|
|
481
|
+
readonly handledMemoryOperations?: readonly KodaXHandledMemoryOperation[];
|
|
632
482
|
}
|
|
633
483
|
type PersistedOutcomeDigest = KodaXMemoryOutcomeDigest;
|
|
634
484
|
interface MemorySession {
|
|
@@ -647,6 +497,25 @@ interface MemorySession {
|
|
|
647
497
|
interface MemoryAgent {
|
|
648
498
|
startSession(input: MemorySessionInput): Promise<MemorySession>;
|
|
649
499
|
}
|
|
500
|
+
/** Additive durable-memory management facade implemented by createMemoryAgent. */
|
|
501
|
+
interface MemoryManagementAgent extends MemoryAgent {
|
|
502
|
+
/** Lists accepted durable Memory with bodies, suitable for user-facing summaries. */
|
|
503
|
+
list(filter?: MemoryListFilter): Promise<readonly AcceptedMemoryView[]>;
|
|
504
|
+
/** Applies an explicit prompt-safe Memory instruction through the governed control plane. */
|
|
505
|
+
remember(input: MemoryRememberInput): Promise<MemoryRememberResult>;
|
|
506
|
+
/** Forgets one exact ref; callers should disambiguate before invoking it. */
|
|
507
|
+
forget(refId: string, expectedStorageFingerprint?: string): Promise<MemoryLifecycleOperationResult>;
|
|
508
|
+
}
|
|
509
|
+
/** User-facing accepted Memory; storageFingerprint versions the governed source file. */
|
|
510
|
+
interface AcceptedMemoryView {
|
|
511
|
+
readonly ref: MemoryItemRef;
|
|
512
|
+
readonly handle: string;
|
|
513
|
+
readonly body: string;
|
|
514
|
+
readonly storageFingerprint: string;
|
|
515
|
+
readonly readAt: string;
|
|
516
|
+
readonly warnings: readonly string[];
|
|
517
|
+
}
|
|
518
|
+
type MemoryListFilter = Pick<MemoryRefFilter, 'query' | 'scopes'>;
|
|
650
519
|
interface CreateMemoryAgentOptions {
|
|
651
520
|
readonly controlPlane: MemoryController;
|
|
652
521
|
readonly initialMemoryPack?: MemoryPack;
|
|
@@ -658,5 +527,8 @@ interface CreateMemoryAgentOptions {
|
|
|
658
527
|
readonly onTrace?: (event: MemoryAgentTraceEvent) => void;
|
|
659
528
|
readonly sourcePolicy?: MemorySourcePolicy;
|
|
660
529
|
}
|
|
530
|
+
interface CreateMemoryManagementAgentOptions extends Omit<CreateMemoryAgentOptions, 'controlPlane'> {
|
|
531
|
+
readonly controlPlane: MemoryManagementController;
|
|
532
|
+
}
|
|
661
533
|
|
|
662
|
-
export type {
|
|
534
|
+
export type { AcceptedMemoryView as A, CreateMemoryAgentOptions as C, KodaXHandledMemoryOperation as K, MemoryAgent as M, PersistedOutcomeDigest as P, CreateMemoryManagementAgentOptions as a, MemoryAgentTraceEvent as b, MemoryDecisionReceipt as c, MemoryEpisodeOutcome as d, MemoryEvidenceGrade as e, MemoryEvidenceRef as f, MemoryInterventionInput as g, MemoryInterventionTrigger as h, MemoryListFilter as i, MemoryManagementAgent as j, MemoryObservation as k, MemoryObservationKind as l, MemoryQueryInput as m, MemoryRecallCandidate as n, MemoryRecallInput as o, MemoryRecallRunner as p, MemoryRecallRunnerInput as q, MemoryReminder as r, MemorySelectionMode as s, MemorySession as t, MemorySessionInput as u, MemorySourcePolicy as v };
|
|
@@ -216,16 +216,35 @@ interface SkillPathsConfig {
|
|
|
216
216
|
learnedPath?: string;
|
|
217
217
|
learnedArea?: LearnedSkillDiscoveryConfig;
|
|
218
218
|
}
|
|
219
|
-
interface
|
|
219
|
+
interface LearnedSkillDiscoveryScope {
|
|
220
|
+
readonly configHomeHash: string;
|
|
221
|
+
readonly tenantHash: string;
|
|
222
|
+
readonly projectHash: string;
|
|
223
|
+
}
|
|
224
|
+
interface LearnedSkillDiscoveryConfigBase {
|
|
220
225
|
readonly rootDir: string;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
readonly tenantHash: string;
|
|
224
|
-
readonly projectHash: string;
|
|
225
|
-
};
|
|
226
|
+
/** Additional identity-specific Learned Areas, in fallback precedence order. */
|
|
227
|
+
readonly additionalRootDirs?: readonly string[];
|
|
226
228
|
readonly testingBindings?: Readonly<Record<string, string>>;
|
|
227
229
|
readonly now?: string;
|
|
228
230
|
}
|
|
231
|
+
interface LearnedSkillDiscoveryConfig extends LearnedSkillDiscoveryConfigBase {
|
|
232
|
+
/**
|
|
233
|
+
* Primary identity scope. Kept required so existing consumers can both
|
|
234
|
+
* construct and read the original public configuration shape unchanged.
|
|
235
|
+
*/
|
|
236
|
+
readonly expectedScope: LearnedSkillDiscoveryScope;
|
|
237
|
+
/**
|
|
238
|
+
* One or more identity scopes paired with rootDir/additionalRootDirs.
|
|
239
|
+
* Multi-scope support resolves the non-deterministic divergence between
|
|
240
|
+
* `remote:*` (git remote available) and `local:*` (git remote unavailable)
|
|
241
|
+
* project identities within the same repository.
|
|
242
|
+
*/
|
|
243
|
+
readonly expectedScopes?: readonly [
|
|
244
|
+
LearnedSkillDiscoveryScope,
|
|
245
|
+
...LearnedSkillDiscoveryScope[]
|
|
246
|
+
];
|
|
247
|
+
}
|
|
229
248
|
/**
|
|
230
249
|
* Get default skill discovery paths
|
|
231
250
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { aa as KodaXWireReasoningEffort, a2 as KodaXToolDefinition, a4 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-CgrXrFrq.js';
|
|
2
2
|
import { K as KodaXBaseProvider } from './base.d-DxG0m09Z.js';
|
|
3
3
|
import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-K664nHOS.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { Y as KodaXJsonValue, Q as KodaXExtensionSessionRecord, S as KodaXExtensionStore } from './types.d-DlLBRqZ9.js';
|
|
5
|
+
import { aT as KodaXToolExecutionContext, bB as ToolSideEffect } from './bash-prefix-extractor.d-BnZQDirs.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* KodaX Constructed-World types (FEATURE_087, v0.7.28).
|