@kodax-ai/kodax 0.7.77 → 0.7.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3651 -3201
- package/README.md +317 -110
- package/README_CN.md +255 -91
- package/config-templates/config.example.jsonc +124 -32
- package/config-templates/integrations/a2a.example.jsonc +23 -7
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
- package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
- package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
- package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
- package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
- package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
- package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
- package/dist/builtin/skill-creator/scripts/utils.js +5 -1
- package/dist/chunks/agent-V4AC5JZD.js +2 -0
- package/dist/chunks/argument-completer-ZPC2MLES.js +2 -0
- package/dist/chunks/chunk-5BNQXXGY.js +1 -0
- package/dist/chunks/{chunk-EH7AOMJ7.js → chunk-67THZRM6.js} +1 -1
- package/dist/chunks/chunk-6GVQDQTQ.js +292 -0
- package/dist/chunks/chunk-B6UY3VHV.js +348 -0
- package/dist/chunks/{chunk-HORNWBYR.js → chunk-BBOVVDQJ.js} +1 -1
- package/dist/chunks/chunk-CR2IF7VF.js +30 -0
- package/dist/chunks/{chunk-FNW2XUL5.js → chunk-CXHEZY5G.js} +1 -1
- package/dist/chunks/chunk-EDZ4QILG.js +266 -0
- package/dist/chunks/chunk-GEECPO2H.js +218 -0
- package/dist/chunks/chunk-H5LLM7DB.js +89 -0
- package/dist/chunks/chunk-KLWP7POA.js +467 -0
- package/dist/chunks/{chunk-XSA37BVM.js → chunk-M4N2JZTZ.js} +2 -2
- package/dist/chunks/chunk-OWQT3FTE.js +5 -0
- package/dist/chunks/chunk-Q4M7DJOD.js +319 -0
- package/dist/chunks/{chunk-3DD4QEBH.js → chunk-QCZLCLFL.js} +10 -10
- package/dist/chunks/chunk-RQPMGRTR.js +810 -0
- package/dist/chunks/chunk-SG6P4SZS.js +123 -0
- package/dist/chunks/chunk-TSTVAU5E.js +386 -0
- package/dist/chunks/chunk-ZCZZUE5E.js +662 -0
- package/dist/chunks/compaction-config-AEUGVROL.js +2 -0
- package/dist/chunks/{construction-bootstrap-RPRL3L7R.js → construction-bootstrap-K3ZGEN5N.js} +1 -1
- package/dist/chunks/dist-GFJFRPAV.js +2 -0
- package/dist/chunks/{dist-FDSOIR35.js → dist-JMO47GJV.js} +1 -1
- package/dist/chunks/host-23K2Q6RZ.js +2 -0
- package/dist/chunks/run-manager-PGIR6ITA.js +2 -0
- package/dist/chunks/utils-6LEKJPQN.js +2 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.js +6 -6
- package/dist/kodax_bootstrap.js +2 -1
- package/dist/kodax_cli.js +2225 -1468
- package/dist/kodax_resume.js +570 -34
- package/dist/provider-capabilities.json +85 -50
- package/dist/runtime-worker.js +2076 -1343
- package/dist/sandbox-workspace-session.js +829 -0
- package/dist/sdk-a2a.d.ts +24 -18
- package/dist/sdk-a2a.js +8 -8
- package/dist/sdk-agent.d.ts +315 -168
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +42 -205
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +3 -3
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +7 -6
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +77 -36
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +406 -163
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.d.ts +93 -0
- package/dist/sdk-sandbox.js +2 -0
- package/dist/sdk-session.d.ts +8 -9
- 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 +283 -18
- package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-pZdu6qt7.d.ts → bash-prefix-extractor.d-CNSidpmv.d.ts} +149 -10
- package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-CxCm1KZz.d.ts → capsule.d-B3q98pLQ.d.ts} +9 -7
- package/dist/types-chunks/{types.d-RdWRfUEs.d.ts → controller.d-RGV7Pjv9.d.ts} +785 -8
- package/dist/types-chunks/{guardrail.d-B0PwAZVR.d.ts → guardrail.d-1NLSFTyN.d.ts} +310 -70
- package/dist/types-chunks/{history-retrieval.d-B__aEN62.d.ts → history-retrieval.d-BAegI14A.d.ts} +16 -3
- package/dist/types-chunks/{integration-config.d-ojG4swOP.d.ts → integration-config.d-BNowXE8k.d.ts} +23 -8
- package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
- package/dist/types-chunks/{public-api.d--fF88JrC.d.ts → public-api.d-BpJhHoa7.d.ts} +366 -28
- package/dist/types-chunks/{commands.d-BccESAMV.d.ts → repl.d-CZ12Ow3X.d.ts} +89 -78
- package/dist/types-chunks/{side-query.d-5JvXhuOZ.d.ts → resolver.d-C9IW4fmU.d.ts} +7 -67
- package/dist/types-chunks/{run-manager.d-B47hIqnI.d.ts → run-manager.d-CX3AUocA.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-CLWf8Adb.d.ts → sdk-session-B3cfJKqF.d.ts} +3 -3
- package/dist/types-chunks/side-query.d-CP1LiRiH.d.ts +83 -0
- package/dist/types-chunks/{types-LanCEDj8.d.ts → types-Bf3Y3mW-.d.ts} +42 -3
- package/dist/types-chunks/{types.d-CODuyyqy.d.ts → types.d-BZ9oXvTV.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DCQVBqVn.d.ts → types.d-BbtGlKZu.d.ts} +25 -3
- package/dist/types-chunks/{types.d-DCsKM8aT.d.ts → types.d-C0_rn--1.d.ts} +4 -4
- package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
- package/dist/types-chunks/{utils.d-CDduqbFw.d.ts → utils.d-CGpHavsU.d.ts} +32 -8
- package/docs/SDK_EMBEDDER_GUIDE.md +1117 -227
- package/package.json +11 -1
- package/dist/chunks/agent-NGSWFE73.js +0 -2
- package/dist/chunks/argument-completer-WGGZPEEO.js +0 -2
- package/dist/chunks/chunk-27QLRH3D.js +0 -5
- package/dist/chunks/chunk-2MQPVY6P.js +0 -770
- package/dist/chunks/chunk-6WAPVAGQ.js +0 -74
- package/dist/chunks/chunk-AOENDSVN.js +0 -448
- package/dist/chunks/chunk-FSXI4MAV.js +0 -78
- package/dist/chunks/chunk-HV2GMZUZ.js +0 -343
- package/dist/chunks/chunk-IQT4RPCE.js +0 -46
- package/dist/chunks/chunk-JS2BHGJP.js +0 -158
- package/dist/chunks/chunk-OAMKECRG.js +0 -381
- package/dist/chunks/chunk-ON2WG2LG.js +0 -622
- package/dist/chunks/chunk-RUGAAHTF.js +0 -321
- package/dist/chunks/chunk-TGCG7U2W.js +0 -37
- package/dist/chunks/compaction-config-BE7VYWH6.js +0 -2
- package/dist/chunks/dist-ZZBNVTKU.js +0 -2
- package/dist/chunks/host-QAKQVC4A.js +0 -2
- package/dist/chunks/run-manager-N4UFWA2D.js +0 -2
- package/dist/chunks/utils-AUHCI4D5.js +0 -2
- package/dist/types-chunks/center-types.d-BBT122uJ.d.ts +0 -91
- package/dist/types-chunks/guardrail.d-CJx9RRd3.d.ts +0 -156
package/dist/types-chunks/{integration-config.d-ojG4swOP.d.ts → integration-config.d-BNowXE8k.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as McpServersConfig } from './config.d-CJy1WENT.js';
|
|
2
2
|
|
|
3
|
-
type IntegrationDomain =
|
|
4
|
-
type IntegrationConfigSource =
|
|
3
|
+
type IntegrationDomain = "mcp" | "a2a" | "extensions";
|
|
4
|
+
type IntegrationConfigSource = "user" | "legacy-user" | "default";
|
|
5
5
|
interface McpIntegrationDocument {
|
|
6
6
|
readonly version: 1;
|
|
7
7
|
readonly servers: McpServersConfig;
|
|
@@ -19,7 +19,7 @@ interface IntegrationConfigSnapshot<T extends object> {
|
|
|
19
19
|
readonly loadedAt: string;
|
|
20
20
|
}
|
|
21
21
|
interface IntegrationConfigDiagnostic {
|
|
22
|
-
readonly code:
|
|
22
|
+
readonly code: "invalid-config" | "activation-failed" | "watcher-degraded";
|
|
23
23
|
readonly message: string;
|
|
24
24
|
readonly time: string;
|
|
25
25
|
}
|
|
@@ -33,7 +33,7 @@ interface IntegrationConfigStatus {
|
|
|
33
33
|
readonly watching: boolean;
|
|
34
34
|
}
|
|
35
35
|
interface LegacyIntegrationMigrationDomainPlan {
|
|
36
|
-
readonly action:
|
|
36
|
+
readonly action: "create" | "none";
|
|
37
37
|
readonly entries: number;
|
|
38
38
|
readonly destination: string;
|
|
39
39
|
readonly reason?: string;
|
|
@@ -44,9 +44,12 @@ interface LegacyIntegrationMigrationPlan {
|
|
|
44
44
|
readonly warnings: readonly string[];
|
|
45
45
|
}
|
|
46
46
|
interface LegacyIntegrationMigrationResult extends LegacyIntegrationMigrationPlan {
|
|
47
|
-
readonly applied: readonly (
|
|
47
|
+
readonly applied: readonly ("mcp" | "extensions")[];
|
|
48
48
|
readonly cleanedLegacy: boolean;
|
|
49
49
|
}
|
|
50
|
+
declare class IntegrationConfigConflictError extends Error {
|
|
51
|
+
constructor(file: string, expected: string | undefined, actual: string | undefined);
|
|
52
|
+
}
|
|
50
53
|
type IntegrationDocumentValidator<T extends object> = (value: unknown) => T;
|
|
51
54
|
type IntegrationConfigListener<T extends object> = (snapshot: IntegrationConfigSnapshot<T>, previous: IntegrationConfigSnapshot<T> | undefined) => Promise<void> | void;
|
|
52
55
|
type IntegrationReloadResult<T extends object> = {
|
|
@@ -71,7 +74,8 @@ declare function writeIntegrationDocument<T extends object>(input: {
|
|
|
71
74
|
readonly configHome: string;
|
|
72
75
|
readonly document: T;
|
|
73
76
|
readonly validate: IntegrationDocumentValidator<T>;
|
|
74
|
-
|
|
77
|
+
/** `null` means the destination must still be absent when committed. */
|
|
78
|
+
readonly expectedRevision?: string | null;
|
|
75
79
|
}): IntegrationConfigSnapshot<T>;
|
|
76
80
|
declare class IntegrationConfigController<T extends object> {
|
|
77
81
|
#private;
|
|
@@ -80,6 +84,17 @@ declare class IntegrationConfigController<T extends object> {
|
|
|
80
84
|
readonly configHome: string;
|
|
81
85
|
readonly validate: IntegrationDocumentValidator<T>;
|
|
82
86
|
readonly read: () => IntegrationConfigSnapshot<T>;
|
|
87
|
+
/**
|
|
88
|
+
* Optional legacy source consulted only while the split domain file is
|
|
89
|
+
* absent. It participates in both filesystem watching and polling.
|
|
90
|
+
*/
|
|
91
|
+
readonly fallbackPath?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Explicit fail-closed document used only when the first disk read is
|
|
94
|
+
* invalid. The diagnostic remains visible and a later valid file replaces
|
|
95
|
+
* this snapshot through the normal reload path.
|
|
96
|
+
*/
|
|
97
|
+
readonly coldStartDefault?: T;
|
|
83
98
|
});
|
|
84
99
|
initialize(): Promise<IntegrationConfigSnapshot<T>>;
|
|
85
100
|
snapshot(): IntegrationConfigSnapshot<T> | undefined;
|
|
@@ -91,5 +106,5 @@ declare class IntegrationConfigController<T extends object> {
|
|
|
91
106
|
close(): void;
|
|
92
107
|
}
|
|
93
108
|
|
|
94
|
-
export {
|
|
95
|
-
export type { ExtensionsIntegrationDocument as E, LegacyIntegrationMigrationDomainPlan as L, McpIntegrationDocument as M, IntegrationConfigDiagnostic as
|
|
109
|
+
export { IntegrationConfigConflictError as I, IntegrationConfigController as a, parseMcpIntegrationDocument as k, planLegacyIntegrationMigration as l, migrateLegacyIntegrationConfig as m, readMcpIntegration as n, resolveIntegrationConfigPath as o, parseExtensionsIntegrationDocument as p, readExtensionsIntegration as r, writeIntegrationDocument as w };
|
|
110
|
+
export type { ExtensionsIntegrationDocument as E, LegacyIntegrationMigrationDomainPlan as L, McpIntegrationDocument as M, IntegrationConfigDiagnostic as b, IntegrationConfigListener as c, IntegrationConfigSnapshot as d, IntegrationConfigSource as e, IntegrationConfigStatus as f, IntegrationDocumentValidator as g, IntegrationDomain as h, LegacyIntegrationMigrationPlan as i, LegacyIntegrationMigrationResult as j };
|
|
@@ -30,6 +30,10 @@ declare class McpAuthRequiredError extends Error {
|
|
|
30
30
|
constructor(status: number, wwwAuthenticate?: string | undefined);
|
|
31
31
|
}
|
|
32
32
|
type StdioFraming = 'content-length' | 'ndjson';
|
|
33
|
+
declare class McpTransportCleanupIncompleteError extends Error {
|
|
34
|
+
readonly code: "mcp_cleanup_incomplete";
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
33
37
|
interface McpTransportOptions {
|
|
34
38
|
stdioFraming?: StdioFraming;
|
|
35
39
|
httpResolvedTransport?: 'streamable-http' | 'sse';
|
|
@@ -170,5 +174,5 @@ declare function performOAuthLogin(options: PerformOAuthLoginOptions): Promise<O
|
|
|
170
174
|
*/
|
|
171
175
|
declare function loadValidToken(serverId: string): Promise<OAuthToken | undefined>;
|
|
172
176
|
|
|
173
|
-
export { McpAuthRequiredError as M, McpExpiredSessionError as a, createMcpTransport as
|
|
174
|
-
export type { AuthorizationServerMetadata as A, DiscoveredOAuthEndpoints as D, OAuthClientInfo as O, PerformOAuthLoginOptions as P, WwwAuthenticateChallenge as W, McpTransport as b, McpTransportEvents as
|
|
177
|
+
export { McpAuthRequiredError as M, McpExpiredSessionError as a, McpTransportCleanupIncompleteError as c, createMcpTransport as g, discoverAuthorizationServerMetadata as h, discoverOAuthEndpoints as i, discoverProtectedResourceMetadata as j, extractInsufficientScope as k, extractResourceMetadataUrl as l, loadValidToken as m, performOAuthLogin as p, registerOAuthClient as r };
|
|
178
|
+
export type { AuthorizationServerMetadata as A, DiscoveredOAuthEndpoints as D, OAuthClientInfo as O, PerformOAuthLoginOptions as P, WwwAuthenticateChallenge as W, McpTransport as b, McpTransportEvents as d, OAuthLoginConsent as e, ProtectedResourceMetadata as f };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { bH as KodaXSessionData, bM as KodaXSessionLineage, bR as KodaXSessionNavigationOptions, bT as KodaXSessionRuntimeInfo, bV as KodaXSessionStorage, i as AgentActorSnapshot, aQ as CompactionReport, by as KodaXJsonValue } from './types.d-RdWRfUEs.js';
|
|
1
|
+
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-CNSidpmv.js';
|
|
2
|
+
import { G as KodaXReasoningMode, k as KodaXMessage, T as KodaXTaskResultMetadata } from './types.d-CgrXrFrq.js';
|
|
3
|
+
import { cY as LearningSurfaceSnapshot$1, cT as LearningQuery, cS as LearningPage, cv as LearnedCapabilityRecord, cO as LearningEvent, cX as LearningSubscribeOptions, bY as KodaXSessionData, c1 as KodaXSessionLineage, c6 as KodaXSessionNavigationOptions, c8 as KodaXSessionRuntimeInfo, ca as KodaXSessionStorage, bZ as KodaXSessionEntry, bU as KodaXSessionArtifactLedgerEntry, bC as KodaXExtensionSessionRecord, cc as KodaXSessionUiHistoryItem, c9 as KodaXSessionScope, k as AgentActorSnapshot, aX as CompactionReport, bO as KodaXJsonValue } from './controller.d-RGV7Pjv9.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* TextBuffer - Text buffer management class - 文本缓冲区管理类
|
|
@@ -898,12 +897,182 @@ declare class MemorySessionStorage implements SessionStorage {
|
|
|
898
897
|
}
|
|
899
898
|
declare function createMemorySessionStorage(): SessionStorage;
|
|
900
899
|
|
|
900
|
+
type SessionConversationHistoryStatus = 'resolved' | 'partial' | 'ambiguous';
|
|
901
|
+
type SessionConversationHistoryIssueCode = 'active_entry_missing' | 'compaction_boundary_invalid' | 'compaction_predecessor_ambiguous' | 'compaction_predecessor_missing' | 'legacy_overlap_ambiguous' | 'lineage_path_incomplete' | 'lineage_unavailable' | 'logical_identity_conflict';
|
|
902
|
+
interface SessionConversationHistoryIssue {
|
|
903
|
+
readonly code: SessionConversationHistoryIssueCode;
|
|
904
|
+
readonly message: string;
|
|
905
|
+
/** Number of diagnostics of this code represented by this bounded summary. */
|
|
906
|
+
readonly occurrenceCount: number;
|
|
907
|
+
/** Total evidence references before `entryIds` was bounded. */
|
|
908
|
+
readonly entryCount: number;
|
|
909
|
+
readonly entryIds: readonly string[];
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* One SDK-resolved conversation item. `auditEntryIds` names every proven
|
|
913
|
+
* physical copy represented by it; raw bodies remain in the audit API.
|
|
914
|
+
*/
|
|
915
|
+
interface SessionConversationHistoryEntry {
|
|
916
|
+
readonly boundaryId?: string;
|
|
917
|
+
readonly auditEntryIds: readonly string[];
|
|
918
|
+
readonly message: KodaXMessage;
|
|
919
|
+
}
|
|
920
|
+
interface SessionConversationHistoryData {
|
|
921
|
+
readonly sourceRevision: string;
|
|
922
|
+
readonly status: SessionConversationHistoryStatus;
|
|
923
|
+
readonly entries: readonly SessionConversationHistoryEntry[];
|
|
924
|
+
readonly issues: readonly SessionConversationHistoryIssue[];
|
|
925
|
+
}
|
|
926
|
+
declare function emptyConversationEntryChain(): string;
|
|
927
|
+
declare function extendConversationEntryChain(previous: string, entries: readonly SessionConversationHistoryEntry[]): string;
|
|
928
|
+
declare function createConversationEntryChain(entries: readonly SessionConversationHistoryEntry[]): string;
|
|
929
|
+
declare function createSessionConversationHistoryRevision(history: SessionConversationHistoryData, entryChain?: string): string;
|
|
930
|
+
|
|
931
|
+
type SessionSourceFileKind = 'main' | 'islands' | 'legacy_archive';
|
|
932
|
+
interface SessionSourceFileRevisionState {
|
|
933
|
+
readonly kind: SessionSourceFileKind;
|
|
934
|
+
readonly relativePath: string;
|
|
935
|
+
readonly byteLength: number;
|
|
936
|
+
readonly chunkCount: number;
|
|
937
|
+
readonly chain: string;
|
|
938
|
+
/** Canonical base64 for the final incomplete source chunk. */
|
|
939
|
+
readonly tail: string;
|
|
940
|
+
}
|
|
941
|
+
interface SessionSourceRevisionState {
|
|
942
|
+
readonly version: 1;
|
|
943
|
+
readonly files: readonly SessionSourceFileRevisionState[];
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
interface ConversationPageCacheAdmission {
|
|
947
|
+
readonly surface?: string;
|
|
948
|
+
readonly profileId?: string;
|
|
949
|
+
}
|
|
950
|
+
interface ConversationPageCacheInput {
|
|
951
|
+
readonly expectedRevision?: string;
|
|
952
|
+
readonly end?: number;
|
|
953
|
+
readonly limit: number;
|
|
954
|
+
readonly maxPageBytes: number;
|
|
955
|
+
readonly maxInlineEntryBytes: number;
|
|
956
|
+
readonly reservedBytes: number;
|
|
957
|
+
readonly authorize?: (admission: ConversationPageCacheAdmission) => void | Promise<void>;
|
|
958
|
+
readonly signal?: AbortSignal;
|
|
959
|
+
}
|
|
960
|
+
interface ConversationPageCacheEntry {
|
|
961
|
+
readonly index: number;
|
|
962
|
+
readonly boundaryId?: string;
|
|
963
|
+
readonly byteLength: number;
|
|
964
|
+
readonly oversized: boolean;
|
|
965
|
+
readonly entry?: SessionConversationHistoryEntry;
|
|
966
|
+
}
|
|
967
|
+
interface ConversationPageCachePage {
|
|
968
|
+
readonly revision: string;
|
|
969
|
+
readonly sourceRevision: string;
|
|
970
|
+
readonly status: SessionConversationHistoryStatus;
|
|
971
|
+
readonly issues: readonly SessionConversationHistoryIssue[];
|
|
972
|
+
readonly entries: readonly ConversationPageCacheEntry[];
|
|
973
|
+
readonly hasMore: boolean;
|
|
974
|
+
readonly nextEnd?: number;
|
|
975
|
+
}
|
|
976
|
+
interface ConversationPageCacheChunkInput {
|
|
977
|
+
readonly revision: string;
|
|
978
|
+
readonly entryIndex: number;
|
|
979
|
+
readonly offset: number;
|
|
980
|
+
readonly authorize?: (admission: ConversationPageCacheAdmission) => void | Promise<void>;
|
|
981
|
+
readonly signal?: AbortSignal;
|
|
982
|
+
}
|
|
983
|
+
interface ConversationPageCacheChunk {
|
|
984
|
+
readonly revision: string;
|
|
985
|
+
readonly entryIndex: number;
|
|
986
|
+
readonly boundaryId?: string;
|
|
987
|
+
readonly data: Buffer;
|
|
988
|
+
readonly nextOffset?: number;
|
|
989
|
+
}
|
|
990
|
+
declare class ConversationPageCacheCapacityError extends Error {
|
|
991
|
+
constructor();
|
|
992
|
+
}
|
|
993
|
+
|
|
901
994
|
/**
|
|
902
995
|
* KodaX session storage - filesystem implementation.
|
|
903
996
|
*/
|
|
904
997
|
|
|
998
|
+
/**
|
|
999
|
+
* Opaque process-local boundary for a prepared, append-only Session write.
|
|
1000
|
+
* Obtain a fresh value from {@link FileSessionStorage.prepareSessionAppend};
|
|
1001
|
+
* a committed append consumes the boundary. It returns a reusable successor
|
|
1002
|
+
* when that successor can be witnessed safely, or `null` when the caller must
|
|
1003
|
+
* reload before another append.
|
|
1004
|
+
*/
|
|
1005
|
+
interface PreparedSessionAppendBaseline {
|
|
1006
|
+
readonly sessionId: string;
|
|
1007
|
+
readonly revision: string;
|
|
1008
|
+
readonly lineageCount: number;
|
|
1009
|
+
readonly artifactCount: number;
|
|
1010
|
+
readonly extensionCount: number;
|
|
1011
|
+
readonly activeEntryId: string | null;
|
|
1012
|
+
readonly tag?: string;
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* An explicit append-only delta. Historical arrays are intentionally absent:
|
|
1016
|
+
* callers that need to rewrite existing Session data must use
|
|
1017
|
+
* {@link FileSessionStorage.appendSessionDelta}, which performs an exact merge.
|
|
1018
|
+
*/
|
|
1019
|
+
interface PreparedSessionTailDelta {
|
|
1020
|
+
readonly baseline: PreparedSessionAppendBaseline;
|
|
1021
|
+
readonly title: string;
|
|
1022
|
+
readonly activeEntryId: string | null;
|
|
1023
|
+
readonly lineageEntries: readonly KodaXSessionEntry[];
|
|
1024
|
+
readonly artifactEntries?: readonly KodaXSessionArtifactLedgerEntry[];
|
|
1025
|
+
readonly extensionRecords?: readonly KodaXExtensionSessionRecord[];
|
|
1026
|
+
readonly uiHistory?: readonly KodaXSessionUiHistoryItem[];
|
|
1027
|
+
readonly scope?: KodaXSessionScope;
|
|
1028
|
+
}
|
|
1029
|
+
type SessionReadErrorCode = 'data_corrupt' | 'data_changed' | 'version_incompatible' | 'read_timeout' | 'read_cancelled';
|
|
1030
|
+
declare class SessionReadError extends Error {
|
|
1031
|
+
readonly code: SessionReadErrorCode;
|
|
1032
|
+
constructor(code: SessionReadErrorCode, message: string);
|
|
1033
|
+
}
|
|
1034
|
+
interface SessionReadOptions {
|
|
1035
|
+
readonly timeoutMs?: number;
|
|
1036
|
+
readonly signal?: AbortSignal;
|
|
1037
|
+
}
|
|
1038
|
+
/** Immutable read boundary used by conversation-history fork/rewind. */
|
|
1039
|
+
interface SessionHistoryBoundary {
|
|
1040
|
+
readonly sourceRevision: string;
|
|
1041
|
+
}
|
|
1042
|
+
interface SessionReadSnapshot {
|
|
1043
|
+
readonly data: SessionData;
|
|
1044
|
+
readonly lineage: KodaXSessionLineage | null;
|
|
1045
|
+
/** Exact identity of the immutable persisted bundle used for this capture. */
|
|
1046
|
+
readonly sourceRevision: string;
|
|
1047
|
+
/** Incrementally extendable witness for the exact persisted bundle revision. */
|
|
1048
|
+
readonly sourceRevisionState: SessionSourceRevisionState;
|
|
1049
|
+
/** Stat-derived witness for prepared-page validation at this exact capture. */
|
|
1050
|
+
readonly boundaryRevision: string;
|
|
1051
|
+
}
|
|
1052
|
+
type StableFileIdentity = {
|
|
1053
|
+
readonly dev: bigint;
|
|
1054
|
+
readonly ino: bigint;
|
|
1055
|
+
readonly size: bigint;
|
|
1056
|
+
readonly mtimeNs: bigint;
|
|
1057
|
+
readonly ctimeNs: bigint;
|
|
1058
|
+
};
|
|
1059
|
+
type SessionTopologyIdentity = {
|
|
1060
|
+
readonly root: StableFileIdentity;
|
|
1061
|
+
readonly epoch: string | null;
|
|
1062
|
+
readonly writerScope: 'session' | 'global';
|
|
1063
|
+
readonly writerIdentity: StableFileIdentity | null;
|
|
1064
|
+
readonly activeWriterIdentity: StableFileIdentity | null;
|
|
1065
|
+
};
|
|
1066
|
+
type SessionLocationTraversalBoundary = {
|
|
1067
|
+
readonly topologyBefore?: SessionTopologyIdentity;
|
|
1068
|
+
readonly writerTopologyDigestBefore?: string;
|
|
1069
|
+
readonly topologyMutationBefore: boolean;
|
|
1070
|
+
};
|
|
905
1071
|
declare class FileSessionStorage implements KodaXSessionStorage {
|
|
906
1072
|
private readonly sessionsDir;
|
|
1073
|
+
private readonly configHome;
|
|
1074
|
+
private readonly sessionLocations;
|
|
1075
|
+
private readonly verifiedLocationMisses;
|
|
907
1076
|
/**
|
|
908
1077
|
* v0.7.46 — optional explicit project cwd for in-process embedders
|
|
909
1078
|
* (KodaX Space) serving multiple projects from a single runtime.
|
|
@@ -927,25 +1096,56 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
927
1096
|
private readonly emitMismatchWarnings;
|
|
928
1097
|
constructor(opts?: {
|
|
929
1098
|
sessionsDir?: string;
|
|
1099
|
+
configHome?: string;
|
|
930
1100
|
cwd?: string;
|
|
931
1101
|
emitMismatchWarnings?: boolean;
|
|
932
1102
|
});
|
|
933
1103
|
/** Absolute session root used by this storage instance. */
|
|
934
1104
|
getSessionsDir(): string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Return the current one-shot boundary for an explicit tail-only append.
|
|
1107
|
+
* A full save/load initializes this boundary; every successful write rotates
|
|
1108
|
+
* it so stale or concurrent deltas fail with `data_changed`.
|
|
1109
|
+
*/
|
|
1110
|
+
private currentPreparedSessionAppend;
|
|
1111
|
+
/**
|
|
1112
|
+
* Prepare an authenticated one-shot boundary for a bounded tail append.
|
|
1113
|
+
* Returns `null` when no canonical cache witness is available; callers must
|
|
1114
|
+
* then load/rebuild or use the exact full-snapshot append path.
|
|
1115
|
+
*/
|
|
1116
|
+
prepareSessionAppend(id: string): Promise<PreparedSessionAppendBaseline | null>;
|
|
1117
|
+
/** @internal Register main paths found by one list traversal. */
|
|
1118
|
+
indexSessionLocations(filePaths: readonly string[], globallyVerified: boolean, topologyIdentity?: SessionTopologyIdentity): void;
|
|
1119
|
+
/** @internal Start an authoritative all-project locator traversal. */
|
|
1120
|
+
beginSessionLocationTraversal(): SessionLocationTraversalBoundary;
|
|
1121
|
+
/** @internal Commit locator hints only when the whole traversal was stable. */
|
|
1122
|
+
completeSessionLocationTraversal(boundary: SessionLocationTraversalBoundary, filePaths: readonly string[], traversalComplete: boolean): void;
|
|
935
1123
|
private writeQueues;
|
|
936
1124
|
private serializedWrite;
|
|
1125
|
+
private refreshSelfVerifiedLocationTopology;
|
|
1126
|
+
private sessionWriteLockPath;
|
|
1127
|
+
private persistSessionLocationHint;
|
|
1128
|
+
private resolveSessionLocationHint;
|
|
937
1129
|
private appendState;
|
|
938
|
-
private
|
|
1130
|
+
private lineageIdentityFilterHashes;
|
|
939
1131
|
private projectJsonWritten;
|
|
940
1132
|
private migrationPromise?;
|
|
941
1133
|
private ensureMigrated;
|
|
942
|
-
/** Update watermarks
|
|
1134
|
+
/** Update watermarks without retaining or serializing the full Session graph. */
|
|
943
1135
|
private syncAppendState;
|
|
1136
|
+
private syncAppendStateFromFile;
|
|
944
1137
|
private legacyFlatPath;
|
|
945
1138
|
private legacyFlatArchivePath;
|
|
946
1139
|
private projectDir;
|
|
947
1140
|
/** Resolve (and cache) the project directory a write for `id` should land in. */
|
|
948
1141
|
private resolveWriteDir;
|
|
1142
|
+
private isLocationGloballyVerified;
|
|
1143
|
+
private verifiedLocationTopology;
|
|
1144
|
+
private verifiedMissingLocationTopology;
|
|
1145
|
+
private assertLocationTopologyUnchanged;
|
|
1146
|
+
private readSessionTopologyIdentitySync;
|
|
1147
|
+
private advanceSessionLocationTopology;
|
|
1148
|
+
private withSessionLocationTopologyChange;
|
|
949
1149
|
private writeFilePath;
|
|
950
1150
|
/**
|
|
951
1151
|
* id-only locator (ADR-038 §7). Resolution order:
|
|
@@ -958,30 +1158,66 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
958
1158
|
* returns null with a warning rather than guessing.
|
|
959
1159
|
*/
|
|
960
1160
|
private resolveSessionLocation;
|
|
1161
|
+
private resolveAmbiguousSessionLocation;
|
|
961
1162
|
private readSession;
|
|
962
1163
|
private readArchivedEntries;
|
|
1164
|
+
private completeConversationLineage;
|
|
963
1165
|
private appendIslandArchive;
|
|
964
1166
|
/** Write `<dir>/project.json` once per process per directory (best-effort). */
|
|
965
1167
|
private ensureProjectJson;
|
|
1168
|
+
private rebuildConversationCache;
|
|
1169
|
+
private updateConversationCacheAfterAppend;
|
|
966
1170
|
private writeSessionInternal;
|
|
967
1171
|
private mergeAndWriteInternal;
|
|
968
1172
|
appendSessionDelta(id: string, data: SessionData): Promise<void>;
|
|
969
|
-
|
|
970
|
-
|
|
1173
|
+
/**
|
|
1174
|
+
* Append an explicit new tail without accepting any historical prefix.
|
|
1175
|
+
* A fulfilled non-null value means the append committed and its successor
|
|
1176
|
+
* boundary is reusable. A fulfilled `null` also means the append committed,
|
|
1177
|
+
* but the successor could not be witnessed: reload and do not retry the same
|
|
1178
|
+
* tail. Pre-commit validation conflicts reject with `data_changed`.
|
|
1179
|
+
*/
|
|
1180
|
+
appendPreparedSessionTail(id: string, delta: PreparedSessionTailDelta): Promise<PreparedSessionAppendBaseline | null>;
|
|
971
1181
|
save(id: string, data: SessionData): Promise<void>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Fast creation path for IDs produced by KodaX's timestamp + random-bit
|
|
1184
|
+
* generator. The per-ID cross-process lock and exact target check preserve
|
|
1185
|
+
* atomic creation without an all-project negative lookup. Caller-supplied
|
|
1186
|
+
* IDs must continue through the ordinary global conflict check.
|
|
1187
|
+
*/
|
|
1188
|
+
createGenerated(id: string, data: SessionData): Promise<void>;
|
|
1189
|
+
mutateLineage(id: string, mutation: (lineage: KodaXSessionLineage) => KodaXSessionLineage): Promise<boolean>;
|
|
972
1190
|
/** F270/F269 owner mutation: CAS-update only the Actor section of a session snapshot. */
|
|
973
1191
|
saveActorSnapshot(id: string, snapshot: AgentActorSnapshot, expectedRevision: number): Promise<void>;
|
|
1192
|
+
/** Read Session data without recovery writes or append-watermark mutation. */
|
|
1193
|
+
peek(id: string): Promise<SessionData | null>;
|
|
1194
|
+
/** Strict read-only Session load. It never migrates or repairs persisted data. */
|
|
1195
|
+
read(id: string, options?: SessionReadOptions): Promise<SessionData | null>;
|
|
1196
|
+
readConversationPageCache(id: string, input: ConversationPageCacheInput, options?: SessionReadOptions): Promise<ConversationPageCachePage | null>;
|
|
1197
|
+
readConversationPageBoundary(id: string, options?: SessionReadOptions): Promise<{
|
|
1198
|
+
readonly boundaryRevision: string;
|
|
1199
|
+
readonly admission: ConversationPageCacheAdmission;
|
|
1200
|
+
} | null>;
|
|
1201
|
+
prepareConversationPageCache(id: string, history: SessionConversationHistoryData, lineage: KodaXSessionLineage, runtimeInfo: KodaXSessionRuntimeInfo | undefined, boundaryRevision: string, sourceRevisionState: SessionSourceRevisionState, options?: SessionReadOptions): Promise<void>;
|
|
1202
|
+
readConversationPageCacheChunk(id: string, input: ConversationPageCacheChunkInput, options?: SessionReadOptions): Promise<ConversationPageCacheChunk | null>;
|
|
1203
|
+
/** Stable read-only main + sidecar snapshot with no lock or migration writes. */
|
|
1204
|
+
readFullSnapshot(id: string, options?: SessionReadOptions): Promise<SessionReadSnapshot | null>;
|
|
1205
|
+
private readFullSnapshotAtPath;
|
|
974
1206
|
load(id: string): Promise<SessionData | null>;
|
|
1207
|
+
isArchived(id: string): Promise<boolean>;
|
|
975
1208
|
getLineage(id: string): Promise<KodaXSessionLineage | null>;
|
|
976
1209
|
loadFullLineage(id: string): Promise<KodaXSessionLineage | null>;
|
|
977
1210
|
setActiveEntry(id: string, selector: string, options?: {
|
|
978
1211
|
summarizeCurrentBranch?: boolean;
|
|
979
1212
|
}): Promise<SessionData | null>;
|
|
980
|
-
rewind(id: string, selector?: string
|
|
1213
|
+
rewind(id: string, selector?: string, options?: {
|
|
1214
|
+
historyBoundary?: SessionHistoryBoundary;
|
|
1215
|
+
}): Promise<SessionData | null>;
|
|
981
1216
|
setLabel(id: string, selector: string, label?: string): Promise<SessionData | null>;
|
|
982
1217
|
fork(id: string, selector?: string, options?: {
|
|
983
1218
|
sessionId?: string;
|
|
984
1219
|
title?: string;
|
|
1220
|
+
historyBoundary?: SessionHistoryBoundary;
|
|
985
1221
|
}): Promise<{
|
|
986
1222
|
sessionId: string;
|
|
987
1223
|
data: SessionData;
|
|
@@ -1016,26 +1252,46 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
1016
1252
|
* (never orphans the sidecar). No-op + returns false for a missing session.
|
|
1017
1253
|
*/
|
|
1018
1254
|
archive(id: string): Promise<boolean>;
|
|
1255
|
+
archiveOwned(id: string, ownerId: string): Promise<boolean>;
|
|
1256
|
+
private sessionConversationCacheMainPaths;
|
|
1257
|
+
private removeSessionConversationCaches;
|
|
1258
|
+
private archiveWithActorOwner;
|
|
1019
1259
|
/** Restore an archived session back into its project directory. */
|
|
1020
1260
|
unarchive(id: string): Promise<boolean>;
|
|
1261
|
+
unarchiveOwned(id: string, ownerId: string): Promise<boolean>;
|
|
1262
|
+
private unarchiveWithActorOwner;
|
|
1021
1263
|
/**
|
|
1022
|
-
* Move a session +
|
|
1264
|
+
* Move a session + modern and legacy island sidecars between two directories. Propagates a
|
|
1023
1265
|
* non-ENOENT rename error (e.g. Windows file-in-use) so a partial move is
|
|
1024
1266
|
* surfaced as a failure instead of silently splitting main + sidecar.
|
|
1025
1267
|
*/
|
|
1026
1268
|
private movePair;
|
|
1269
|
+
/**
|
|
1270
|
+
* Remove a complete Session file set without exposing a partial failure.
|
|
1271
|
+
* Every canonical path is first renamed to an ignored tombstone. A staging
|
|
1272
|
+
* failure rolls all prior renames back; only after the full set is hidden do
|
|
1273
|
+
* we unlink tombstones. A locked tombstone is recoverable and no longer
|
|
1274
|
+
* represents a live Session, so cleanup failure is diagnostic rather than a
|
|
1275
|
+
* failed logical deletion.
|
|
1276
|
+
*/
|
|
1277
|
+
private removeFileSetAtomically;
|
|
1278
|
+
private assertActorFileOwner;
|
|
1027
1279
|
delete(id: string): Promise<void>;
|
|
1280
|
+
/** Strict deletion path for the Runtime that already owns the Actor tree. */
|
|
1281
|
+
deleteOwned(id: string, ownerId: string): Promise<void>;
|
|
1282
|
+
private deleteWithActorOwner;
|
|
1028
1283
|
deleteAll(gitRoot?: string): Promise<void>;
|
|
1029
1284
|
/**
|
|
1030
|
-
* Auto-retention: delete
|
|
1285
|
+
* Auto-retention: delete a complete Session file set when its main file
|
|
1031
1286
|
* mtime is older than `retentionDays`. Modeled on claudecode's
|
|
1032
1287
|
* `cleanup.ts` (`unlinkIfOld`). Bounds the sessions directory so it never
|
|
1033
1288
|
* accumulates unboundedly — which is what keeps `list()`'s head-read pass
|
|
1034
1289
|
* fast (its cost scales with file COUNT, not size). A non-positive /
|
|
1035
|
-
* non-finite `retentionDays` disables cleanup (no-op).
|
|
1036
|
-
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1290
|
+
* non-finite `retentionDays` disables cleanup (no-op). The sweep continues
|
|
1291
|
+
* after individual failures, then reports them together so cleanup is
|
|
1292
|
+
* observable and retryable. Durable Actor owners and non-terminal turns are
|
|
1293
|
+
* never eligible.
|
|
1294
|
+
* Returns the number of files removed.
|
|
1039
1295
|
*/
|
|
1040
1296
|
cleanupOldSessions(retentionDays: number): Promise<number>;
|
|
1041
1297
|
}
|
|
@@ -1154,10 +1410,54 @@ interface SessionTranscriptEntry {
|
|
|
1154
1410
|
readonly taskResults?: readonly KodaXTaskResultMetadata[];
|
|
1155
1411
|
}
|
|
1156
1412
|
interface FullTranscriptSessionData extends Omit<SessionData, 'messages'> {
|
|
1413
|
+
/** Legacy flattened projection. Rewind markers are excluded. */
|
|
1157
1414
|
readonly messages: KodaXMessage[];
|
|
1415
|
+
/** Messages on the active branch that are eligible for model context. */
|
|
1158
1416
|
readonly activeMessages: KodaXMessage[];
|
|
1417
|
+
/**
|
|
1418
|
+
* Authoritative raw append-order audit entries, including archived islands
|
|
1419
|
+
* and inactive branches. The host owns visibility, folding, and presentation.
|
|
1420
|
+
*/
|
|
1159
1421
|
readonly transcriptEntries: SessionTranscriptEntry[];
|
|
1160
1422
|
}
|
|
1423
|
+
/** One immutable storage boundary shared by Runtime admission and history. */
|
|
1424
|
+
interface SessionReadCapture {
|
|
1425
|
+
readonly data: SessionData;
|
|
1426
|
+
readonly transcript: FullTranscriptSessionData;
|
|
1427
|
+
readonly sourceRevision: string;
|
|
1428
|
+
/** Internal exact-revision witness used to extend prepared page caches. */
|
|
1429
|
+
readonly sourceRevisionState: SessionSourceRevisionState;
|
|
1430
|
+
/** Bounded persisted-file witness corresponding to sourceRevision. */
|
|
1431
|
+
readonly boundaryRevision: string;
|
|
1432
|
+
}
|
|
1433
|
+
type SessionBundleExportStatus = 'ok' | 'partial' | 'unsupported' | 'corrupt' | 'ambiguous' | 'missing';
|
|
1434
|
+
interface SessionBundleExportFile {
|
|
1435
|
+
readonly kind: 'main' | 'islands' | 'legacy_archive';
|
|
1436
|
+
readonly path: string;
|
|
1437
|
+
readonly byteLength: number;
|
|
1438
|
+
readonly sha256: string;
|
|
1439
|
+
readonly modifiedAt: string;
|
|
1440
|
+
/** Best-effort UTF-8 projection for inspection and JSONL diagnostics. */
|
|
1441
|
+
readonly content: string;
|
|
1442
|
+
/** Canonical byte-preserving representation. */
|
|
1443
|
+
readonly contentBase64: string;
|
|
1444
|
+
}
|
|
1445
|
+
interface SessionBundleExportDiagnostic {
|
|
1446
|
+
readonly code: 'partial_tail' | 'malformed_record' | 'unsupported_record' | 'unsupported_version';
|
|
1447
|
+
readonly file: string;
|
|
1448
|
+
readonly line?: number;
|
|
1449
|
+
readonly message: string;
|
|
1450
|
+
}
|
|
1451
|
+
interface SessionBundleExportResult {
|
|
1452
|
+
readonly sessionId: string;
|
|
1453
|
+
readonly status: SessionBundleExportStatus;
|
|
1454
|
+
readonly files: readonly SessionBundleExportFile[];
|
|
1455
|
+
readonly candidates?: readonly string[];
|
|
1456
|
+
readonly diagnostics: readonly SessionBundleExportDiagnostic[];
|
|
1457
|
+
}
|
|
1458
|
+
interface SessionBundleExportOptions extends SessionReadOptions {
|
|
1459
|
+
readonly sessionsDir?: string;
|
|
1460
|
+
}
|
|
1161
1461
|
interface AppendClientNoticeOptions {
|
|
1162
1462
|
readonly source?: string;
|
|
1163
1463
|
readonly content: string;
|
|
@@ -1206,6 +1506,9 @@ interface SessionManager {
|
|
|
1206
1506
|
listSessions: typeof listSessions;
|
|
1207
1507
|
loadSession: typeof loadSession;
|
|
1208
1508
|
loadFullTranscript: typeof loadFullTranscript;
|
|
1509
|
+
readFullTranscript: typeof readFullTranscript;
|
|
1510
|
+
readConversationHistory: typeof readConversationHistory;
|
|
1511
|
+
readSessionCapture(id: string, options?: SessionReadOptions): Promise<SessionReadCapture | null>;
|
|
1209
1512
|
appendClientNotice: typeof appendClientNotice;
|
|
1210
1513
|
forkSession: typeof forkSession;
|
|
1211
1514
|
rewindSession: typeof rewindSession;
|
|
@@ -1242,11 +1545,32 @@ declare function loadSession(id: string): Promise<SessionData | null>;
|
|
|
1242
1545
|
/**
|
|
1243
1546
|
* Load append-order transcript data by ID.
|
|
1244
1547
|
*
|
|
1245
|
-
* `loadSession` remains the active model-context API. This helper
|
|
1246
|
-
* scrollback
|
|
1247
|
-
* append order
|
|
1548
|
+
* `loadSession` remains the active model-context API. This helper returns raw
|
|
1549
|
+
* host-facing scrollback/audit data, including archived islands and inactive
|
|
1550
|
+
* branches, in append order. Hosts decide what to show or fold.
|
|
1248
1551
|
*/
|
|
1249
1552
|
declare function loadFullTranscript(id: string): Promise<FullTranscriptSessionData | null>;
|
|
1553
|
+
/**
|
|
1554
|
+
* Strict, boundary-consistent history read.
|
|
1555
|
+
*
|
|
1556
|
+
* Unlike the legacy null-on-error helper, this never migrates or repairs the
|
|
1557
|
+
* Session and preserves structured read errors for the host.
|
|
1558
|
+
*/
|
|
1559
|
+
declare function readFullTranscript(id: string, options?: SessionReadOptions): Promise<FullTranscriptSessionData | null>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Read the SDK-resolved ordinary conversation view at one immutable boundary.
|
|
1562
|
+
* Raw append-order audit data remains available through `readFullTranscript`.
|
|
1563
|
+
*/
|
|
1564
|
+
declare function readConversationHistory(id: string, options?: SessionReadOptions): Promise<SessionConversationHistoryData | null>;
|
|
1565
|
+
/** Build the conversation projection from an already captured read boundary. */
|
|
1566
|
+
declare function conversationHistoryFromCapture(capture: SessionReadCapture, checkpoint?: () => void): SessionConversationHistoryData;
|
|
1567
|
+
declare function readSessionCapture(id: string, options?: SessionReadOptions): Promise<SessionReadCapture | null>;
|
|
1568
|
+
/**
|
|
1569
|
+
* Export the exact persisted Session bundle without migration, recovery, or
|
|
1570
|
+
* schema rewriting. Unknown and malformed records remain byte-for-byte intact
|
|
1571
|
+
* and are described by diagnostics instead of being discarded.
|
|
1572
|
+
*/
|
|
1573
|
+
declare function exportSessionBundle(id: string, options?: SessionBundleExportOptions): Promise<SessionBundleExportResult>;
|
|
1250
1574
|
/**
|
|
1251
1575
|
* Append a host-owned transcript notice that never enters model context.
|
|
1252
1576
|
*
|
|
@@ -1255,15 +1579,25 @@ declare function loadFullTranscript(id: string): Promise<FullTranscriptSessionDa
|
|
|
1255
1579
|
* `loadSession()` keeps returning only the active model messages.
|
|
1256
1580
|
*/
|
|
1257
1581
|
declare function appendClientNotice(id: string, options: AppendClientNoticeOptions): Promise<SessionTranscriptEntry | null>;
|
|
1582
|
+
interface SessionConversationMutationBoundary {
|
|
1583
|
+
readonly boundaryId: string;
|
|
1584
|
+
readonly sourceRevision: string;
|
|
1585
|
+
}
|
|
1586
|
+
interface ForkSessionOptions {
|
|
1587
|
+
readonly selector?: string;
|
|
1588
|
+
readonly sessionId?: string;
|
|
1589
|
+
readonly title?: string;
|
|
1590
|
+
readonly historyBoundary?: SessionConversationMutationBoundary;
|
|
1591
|
+
}
|
|
1592
|
+
interface RewindSessionOptions {
|
|
1593
|
+
readonly selector?: string;
|
|
1594
|
+
readonly historyBoundary?: SessionConversationMutationBoundary;
|
|
1595
|
+
}
|
|
1258
1596
|
/**
|
|
1259
1597
|
* Fork a session at an optional selector.
|
|
1260
1598
|
* Returns null for a missing session. NEVER throws.
|
|
1261
1599
|
*/
|
|
1262
|
-
declare function forkSession(id: string, opts?: {
|
|
1263
|
-
selector?: string;
|
|
1264
|
-
sessionId?: string;
|
|
1265
|
-
title?: string;
|
|
1266
|
-
}): Promise<{
|
|
1600
|
+
declare function forkSession(id: string, opts?: ForkSessionOptions): Promise<{
|
|
1267
1601
|
sessionId: string;
|
|
1268
1602
|
data: SessionData;
|
|
1269
1603
|
} | null>;
|
|
@@ -1271,9 +1605,7 @@ declare function forkSession(id: string, opts?: {
|
|
|
1271
1605
|
* Rewind a session to a previous user entry.
|
|
1272
1606
|
* Returns null for a missing session. NEVER throws.
|
|
1273
1607
|
*/
|
|
1274
|
-
declare function rewindSession(id: string, opts?:
|
|
1275
|
-
selector?: string;
|
|
1276
|
-
}): Promise<SessionData | null>;
|
|
1608
|
+
declare function rewindSession(id: string, opts?: RewindSessionOptions): Promise<SessionData | null>;
|
|
1277
1609
|
/**
|
|
1278
1610
|
* Set the active lineage entry by selector.
|
|
1279
1611
|
* Returns null for a missing session. NEVER throws.
|
|
@@ -1308,6 +1640,10 @@ type DeleteSessionResult = {
|
|
|
1308
1640
|
startedAt: number;
|
|
1309
1641
|
};
|
|
1310
1642
|
};
|
|
1643
|
+
} | {
|
|
1644
|
+
error: {
|
|
1645
|
+
code: 'delete_failed';
|
|
1646
|
+
};
|
|
1311
1647
|
};
|
|
1312
1648
|
/**
|
|
1313
1649
|
* Delete a session by ID.
|
|
@@ -1347,10 +1683,12 @@ declare function watchSessions(cb: WatchSessionsCallback): {
|
|
|
1347
1683
|
* that directory instead of the module-load-frozen `KODAX_SESSIONS_DIR`.
|
|
1348
1684
|
* `listRunningSessions` still consults the agent-config-home instances
|
|
1349
1685
|
* directory (sibling-process awareness is not scoped per sessions dir).
|
|
1686
|
+
* `configHome` binds rewind/setActive review fencing to the same Runtime owner.
|
|
1350
1687
|
*/
|
|
1351
1688
|
declare function createSessionManager(opts?: {
|
|
1352
1689
|
sessionsDir?: string;
|
|
1690
|
+
configHome?: string;
|
|
1353
1691
|
}): SessionManager;
|
|
1354
1692
|
|
|
1355
|
-
export {
|
|
1356
|
-
export type {
|
|
1693
|
+
export { DEFAULT_UI_STATE as D, FILE_MODIFICATION_TOOLS as F, KeypressHandlerPriority as G, MemorySessionStorage as O, PERMISSION_MODES as Q, watchSessions as a$, appendClientNotice as aA, archiveSession as aB, compactSession as aC, computeConfirmTools as aD, conversationHistoryFromCapture as aE, createConversationEntryChain as aF, createMemorySessionStorage as aG, createSessionConversationHistoryRevision as aH, createSessionManager as aI, deleteSession as aJ, emptyConversationEntryChain as aK, exportSessionBundle as aL, extendConversationEntryChain as aM, forkSession as aN, isPermissionMode as aO, listRunningSessions as aP, listSessions as aQ, loadFullTranscript as aR, loadSession as aS, normalizePermissionMode as aT, permissionModeDisplayName as aU, readConversationHistory as aV, readFullTranscript as aW, readSessionCapture as aX, rewindSession as aY, setActiveEntry as aZ, unarchiveSession as a_, SessionReadError as ac, StreamingState as ak, TOOL_STATUS_ICONS as am, TextBuffer as an, ToolCallStatus as at, ConversationPageCacheCapacityError as g, FileSessionStorage as k };
|
|
1694
|
+
export type { SessionBundleExportFile as $, AppProps as A, KeypressEvent as B, CompactSessionOptions as C, KeypressHandler as E, HistoryEntry as H, InputPromptProps as I, LearningSurfaceSnapshot as J, KeyInfo as K, LearningBinding as L, LegacyMessageListProps as M, ListSessionsOptions as N, Message as P, PastedContent as R, PermissionContext as S, PermissionMode as T, PreparedSessionAppendBaseline as U, PreparedSessionTailDelta as V, PromptEditingMode as W, PromptSubmitPayload as X, RewindSessionOptions as Y, RunningSessionInfo as Z, SessionBundleExportDiagnostic as _, AppState as a, SessionBundleExportOptions as a0, SessionBundleExportResult as a1, SessionBundleExportStatus as a2, SessionConversationHistoryData as a3, SessionConversationHistoryEntry as a4, SessionConversationHistoryIssue as a5, SessionConversationHistoryIssueCode as a6, SessionConversationHistoryStatus as a7, SessionConversationMutationBoundary as a8, SessionData as a9, SessionManager as aa, SessionReadCapture as ab, SessionReadErrorCode as ad, SessionReadOptions as ae, SessionStorage as af, SessionSummary as ag, SessionTranscriptEntry as ah, SessionTranscriptEntryType as ai, StatusBarProps as aj, Suggestion as al, TextBufferOptions as ao, Theme as ap, ThemeColors as aq, ThemeSymbols as ar, ToolCall as as, UIActions as au, UIState as av, UseTextBufferReturn as aw, VisualCursor as ax, VisualLayout as ay, WatchSessionsCallback as az, AppendClientNoticeOptions as b, CompactSessionResult as c, Completer as d, Completion as e, ConfirmResult as f, CreatableHistoryItem as h, CursorPosition as i, DeleteSessionResult as j, ForkSessionOptions as l, FullTranscriptSessionData as m, HistoryItem as n, HistoryItemAssistant as o, HistoryItemBase as p, HistoryItemError as q, HistoryItemEvent as r, HistoryItemHint as s, HistoryItemInfo as t, HistoryItemSidecar as u, HistoryItemSystem as v, HistoryItemThinking as w, HistoryItemToolGroup as x, HistoryItemType as y, HistoryItemUser as z };
|