@kodax-ai/kodax 0.7.73 → 0.7.75
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 +174 -0
- package/README.md +40 -6
- package/README_CN.md +34 -5
- package/config-templates/config.example.jsonc +7 -0
- package/dist/chunks/{agent-T6PGT6AU.js → agent-LVZJB2GQ.js} +1 -1
- package/dist/chunks/argument-completer-GHWEWPVQ.js +2 -0
- package/dist/chunks/chunk-4PVSDE5L.js +2 -0
- package/dist/chunks/chunk-5WSOB34U.js +329 -0
- package/dist/chunks/chunk-6YUDR7WN.js +5 -0
- package/dist/chunks/chunk-6ZMKX3XF.js +74 -0
- package/dist/chunks/chunk-737LI7OS.js +369 -0
- package/dist/chunks/{chunk-64M5HOCA.js → chunk-BN3W2DQY.js} +1 -1
- package/dist/chunks/chunk-DEHOFNQA.js +427 -0
- package/dist/chunks/{chunk-MBAPT2R5.js → chunk-G5VW55T4.js} +1 -1
- package/dist/chunks/{chunk-6RI2RBTF.js → chunk-N6M2LYEP.js} +1 -1
- package/dist/chunks/{chunk-GAFFYJU3.js → chunk-OGL227XV.js} +11 -11
- package/dist/chunks/{chunk-6JTWXGVU.js → chunk-OJQQRLZJ.js} +225 -225
- package/dist/chunks/{chunk-XXQLPTAN.js → chunk-Q65EAOX6.js} +7 -7
- package/dist/chunks/chunk-QRBWNYFV.js +321 -0
- package/dist/chunks/chunk-QSMXI4MH.js +770 -0
- package/dist/chunks/{chunk-MLEAQTCD.js → chunk-SB75RNNR.js} +11 -4
- package/dist/chunks/{chunk-M7FXNPWV.js → chunk-UJRRZINL.js} +6 -6
- package/dist/chunks/{compaction-config-IHJBP4GO.js → compaction-config-L2YZK7Q3.js} +1 -1
- package/dist/chunks/{construction-bootstrap-EGRUHKLP.js → construction-bootstrap-3TQWTHSQ.js} +1 -1
- package/dist/chunks/{dist-EVEJAII2.js → dist-D3EPVAOZ.js} +1 -1
- package/dist/chunks/dist-ZJFTZJ55.js +2 -0
- package/dist/chunks/host-KHDXYFVG.js +2 -0
- package/dist/chunks/{run-manager-AY7RQOWM.js → run-manager-CD24OO4V.js} +1 -1
- package/dist/chunks/{utils-2GAE4XIM.js → utils-HMVP6XPH.js} +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.js +5 -5
- package/dist/kodax_cli.js +1300 -1258
- package/dist/runtime-worker.js +1209 -1167
- package/dist/sdk-a2a.d.ts +9 -8
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +107 -59
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +32 -16
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +27 -20
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +153 -15
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +4 -4
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +16 -14
- package/dist/types-chunks/{bash-prefix-extractor.d-bApf5nGw.d.ts → bash-prefix-extractor.d-r1beOESM.d.ts} +48 -12
- package/dist/types-chunks/{capsule.d-CGWltwno.d.ts → capsule.d-zeqV4IQX.d.ts} +10 -2
- package/dist/types-chunks/{commands.d-CEHGwRok.d.ts → commands.d-DUxnK2TU.d.ts} +10 -7
- package/dist/types-chunks/{guardrail.d-CC4vAQl7.d.ts → guardrail.d-CWYD1bdL.d.ts} +1 -1
- package/dist/types-chunks/{guardrail.d-CXIPlWP3.d.ts → guardrail.d-qjuKJZ31.d.ts} +72 -11
- package/dist/types-chunks/history-retrieval.d-BKTJIrVd.d.ts +57 -0
- package/dist/types-chunks/{public-api.d-FBmX0kxo.d.ts → public-api.d-CX4B11qY.d.ts} +17 -4
- package/dist/types-chunks/{run-manager.d-DUNnJcpE.d.ts → run-manager.d-B9fEIjZk.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-XqacVOs8.d.ts → sdk-session-B0fhAOPa.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DKr6TCXL.d.ts → types.d-Bm_y6YuM.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DgciGHoG.d.ts → types.d-DEctY20M.d.ts} +9 -2
- package/dist/types-chunks/{types.d-BnPhGmar.d.ts → types.d-sRLugmjy.d.ts} +61 -14
- package/dist/types-chunks/{utils.d-BPYX7-KN.d.ts → utils.d-D0wPxz8y.d.ts} +5 -5
- package/docs/SDK_EMBEDDER_GUIDE.md +1995 -1689
- package/package.json +8 -1
- package/dist/chunks/argument-completer-QGMWA2C3.js +0 -2
- package/dist/chunks/chunk-AGDDM5AW.js +0 -329
- package/dist/chunks/chunk-BUPJGG3C.js +0 -5
- package/dist/chunks/chunk-EAD4SF3Z.js +0 -413
- package/dist/chunks/chunk-HVCNAZ52.js +0 -365
- package/dist/chunks/chunk-OG6DRNKV.js +0 -755
- package/dist/chunks/chunk-PFH53O4M.js +0 -2
- package/dist/chunks/chunk-V4F6IYNK.js +0 -73
- package/dist/chunks/chunk-WQ6PWGK5.js +0 -320
- package/dist/chunks/dist-5N3I2RTW.js +0 -2
- package/dist/chunks/host-MECITNE3.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bs as KodaXGoalState, a8 as AgentMessage, dv as StopHookFn, bM as KodaXSessionLineage, k as AgentActorStore, aC as AgentTurnExecutor, t as AgentBudgetPort, h as AgentActorClient, N as AgentExecutionResult, V as AgentExecutorPlaneBinding, by as KodaXJsonValue, bm as KodaXExtensionSessionRecord, f as Agent, dS as WorkflowIsolation, bn as KodaXExtensionSessionState, bD as KodaXSessionArtifactLedgerEntry, df as SessionErrorMetadata, bU as KodaXSessionScope, bV as KodaXSessionStorage, cj as MemoryContextIdentity, cv as MemoryPack, aK as AskUserQuestionOptions, aG as AskUserAnswer, aI as AskUserMultiOptions, dP as WorkflowEventCorrelation, aT as CompactionUpdate, e4 as WorkflowProcessEvent, dO as WorkflowEvent, cJ as MemoryReviewPlan, bA as KodaXMemoryOutcomeDigest, bb as Guardrail, aY as DiscoveredInstance, bw as KodaXInputArtifact, cK as MemoryReviewRunner } from './types.d-sRLugmjy.js';
|
|
2
2
|
import { a0 as KodaXTokenUsage, k as KodaXMessage, a1 as KodaXToolDefinition, a9 as KodaXWireReasoningEffort, U as KodaXTaskRoutingDecision, V as KodaXTaskType, W as KodaXTaskWorkIntent, Q as KodaXTaskComplexity, L as KodaXRiskLevel, h as KodaXHarnessProfile, f as KodaXExecutionMode, b as KodaXChildFanoutClass, F as KodaXReasoningMode, J as KodaXReviewScale } from './types.d-CSmF0t0n.js';
|
|
3
3
|
import { d as SkillDynamicContextExecutor, I as ISkillRegistry } from './types.d-DCQVBqVn.js';
|
|
4
4
|
import { Diagnostic, Position, Location, Hover, DocumentSymbol, SymbolInformation, WorkspaceSymbol, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-protocol';
|
|
@@ -665,6 +665,7 @@ interface GoalLifecycleContext {
|
|
|
665
665
|
interface BeforeNextTurnFnCtx {
|
|
666
666
|
readonly transcript: readonly AgentMessage[];
|
|
667
667
|
readonly iteration: number;
|
|
668
|
+
readonly lastTurnToolNames?: readonly string[];
|
|
668
669
|
}
|
|
669
670
|
type BeforeNextTurnFn = (ctx: BeforeNextTurnFnCtx) => Promise<readonly AgentMessage[]>;
|
|
670
671
|
/**
|
|
@@ -869,7 +870,7 @@ declare function createExternalActorTurnExecutor(binding: AgentExecutorPlaneBind
|
|
|
869
870
|
* configure / install / troubleshoot KodaX?" questions. Pure data + a
|
|
870
871
|
* deterministic resolver — no RAG, no vector store, no network fetch.
|
|
871
872
|
*/
|
|
872
|
-
type KodaXManualTopicId = 'overview' | 'license' | 'install' | 'quickstart' | 'providers' | 'custom-providers' | 'config' | 'permissions' | 'commands' | 'tools' | 'agents' | 'skills' | 'extensions' | 'mcp' | 'a2a' | 'repo-intelligence' | 'sessions' | 'memory' | 'doctor' | 'sdk' | 'troubleshooting';
|
|
873
|
+
type KodaXManualTopicId = 'overview' | 'license' | 'install' | 'quickstart' | 'providers' | 'custom-providers' | 'config' | 'permissions' | 'commands' | 'tools' | 'agents' | 'skills' | 'extensions' | 'mcp' | 'a2a' | 'repo-intelligence' | 'sessions' | 'compaction' | 'memory' | 'doctor' | 'sdk' | 'troubleshooting';
|
|
873
874
|
/** A pointer to the code/doc the topic is derived from (for traceability). */
|
|
874
875
|
interface KodaXManualSource {
|
|
875
876
|
readonly label: string;
|
|
@@ -1194,6 +1195,8 @@ declare function planToolExposure(input: RuntimeToolExposurePlanInput): RuntimeT
|
|
|
1194
1195
|
interface CompactionAntiThrashState {
|
|
1195
1196
|
readonly lowSavingsStreak: number;
|
|
1196
1197
|
readonly cooldownTurnsRemaining: number;
|
|
1198
|
+
readonly coveredTokensAfter?: number;
|
|
1199
|
+
readonly rearmAtTokens?: number;
|
|
1197
1200
|
}
|
|
1198
1201
|
interface CompactionSavingsSample {
|
|
1199
1202
|
readonly tokensBefore: number;
|
|
@@ -1210,7 +1213,7 @@ interface CompactionSavingsDecision {
|
|
|
1210
1213
|
readonly lowSavings: boolean;
|
|
1211
1214
|
readonly enteredCooldown: boolean;
|
|
1212
1215
|
}
|
|
1213
|
-
type CompactionSkipReason = 'low_savings_cooldown';
|
|
1216
|
+
type CompactionSkipReason = 'low_savings_cooldown' | 'covered_context_unchanged';
|
|
1214
1217
|
interface RuntimeCompactionSkippedEvent {
|
|
1215
1218
|
readonly reason: CompactionSkipReason;
|
|
1216
1219
|
readonly currentTokens: number;
|
|
@@ -1220,7 +1223,7 @@ interface RuntimeCompactionSkippedEvent {
|
|
|
1220
1223
|
readonly lowSavingsStreak: number;
|
|
1221
1224
|
}
|
|
1222
1225
|
declare function createCompactionAntiThrashState(): CompactionAntiThrashState;
|
|
1223
|
-
declare function shouldSkipLlmCompaction(state: CompactionAntiThrashState | undefined): boolean;
|
|
1226
|
+
declare function shouldSkipLlmCompaction(state: CompactionAntiThrashState | undefined, currentTokens?: number): boolean;
|
|
1224
1227
|
declare function consumeCompactionCooldown(state: CompactionAntiThrashState | undefined): CompactionAntiThrashState;
|
|
1225
1228
|
declare function recordCompactionSavings(state: CompactionAntiThrashState | undefined, sample: CompactionSavingsSample, config?: CompactionAntiThrashConfig): CompactionSavingsDecision;
|
|
1226
1229
|
|
|
@@ -1598,7 +1601,14 @@ interface KodaXWorkflowEventMeta {
|
|
|
1598
1601
|
readonly workflowCorrelation?: WorkflowEventCorrelation;
|
|
1599
1602
|
}
|
|
1600
1603
|
type KodaXTurnDeliveryKind = 'initial' | 'queued' | 'interrupt' | 'resume';
|
|
1601
|
-
interface
|
|
1604
|
+
interface KodaXContextIdentity {
|
|
1605
|
+
readonly contextId: string;
|
|
1606
|
+
readonly contextKind: 'root' | 'child';
|
|
1607
|
+
readonly parentContextId?: string;
|
|
1608
|
+
readonly agentId?: string;
|
|
1609
|
+
readonly contextRevision: number;
|
|
1610
|
+
}
|
|
1611
|
+
interface KodaXLiveEventMeta extends Partial<KodaXContextIdentity> {
|
|
1602
1612
|
readonly sessionId: string;
|
|
1603
1613
|
readonly seq: number;
|
|
1604
1614
|
readonly turnId: string;
|
|
@@ -1630,6 +1640,8 @@ interface KodaXActivityEventMeta extends KodaXWorkflowEventMeta, Partial<KodaXLi
|
|
|
1630
1640
|
* session. Absent on paths that do not yet thread the resolved session id.
|
|
1631
1641
|
*/
|
|
1632
1642
|
readonly sessionId?: string;
|
|
1643
|
+
/** Exact queue identities consumed by a mid-turn user-message boundary. */
|
|
1644
|
+
readonly queuedMessageIds?: readonly string[];
|
|
1633
1645
|
/**
|
|
1634
1646
|
* FEATURE_247 (R8) — SDK-consumer agent profile that produced this event.
|
|
1635
1647
|
* Absent ⇒ default Coding Agent (or an event emitted before a profile is known).
|
|
@@ -1650,6 +1662,21 @@ interface KodaXWorkflowAgentDigestEvent {
|
|
|
1650
1662
|
interface KodaXToolEventMeta extends KodaXActivityEventMeta {
|
|
1651
1663
|
readonly toolId?: string;
|
|
1652
1664
|
}
|
|
1665
|
+
interface KodaXContextCompactionFinishedEvent extends Partial<KodaXLiveEventMeta> {
|
|
1666
|
+
readonly source: 'manual' | 'automatic_threshold' | 'physical_capacity';
|
|
1667
|
+
readonly tokensBefore: number;
|
|
1668
|
+
readonly tokensAfter: number;
|
|
1669
|
+
readonly committed: boolean;
|
|
1670
|
+
readonly elapsedMs: number;
|
|
1671
|
+
readonly strategy?: 'full_prefix' | 'map_reduce';
|
|
1672
|
+
readonly effectiveTriggerTokens?: number;
|
|
1673
|
+
readonly protectedBudgetTokens?: number;
|
|
1674
|
+
readonly fixedInputTokens?: number;
|
|
1675
|
+
readonly eligibleTokens?: number;
|
|
1676
|
+
readonly rawTailTokens?: number;
|
|
1677
|
+
readonly summaryTokens?: number;
|
|
1678
|
+
readonly queryLedgerTokens?: number;
|
|
1679
|
+
}
|
|
1653
1680
|
interface KodaXSidecarMessageEvent {
|
|
1654
1681
|
readonly source: 'sidecar-verifier';
|
|
1655
1682
|
readonly verdict: 'revise' | 'blocked';
|
|
@@ -1742,7 +1769,9 @@ interface KodaXEvents {
|
|
|
1742
1769
|
tokensAfter: number;
|
|
1743
1770
|
} & Partial<KodaXLiveEventMeta>) => void;
|
|
1744
1771
|
/** Emitted with the rewritten message history when automatic compaction changes the context. */
|
|
1745
|
-
onCompactedMessages?: (messages: KodaXMessage[], update?: CompactionUpdate, meta?: KodaXActivityEventMeta) => void
|
|
1772
|
+
onCompactedMessages?: (messages: KodaXMessage[], update?: CompactionUpdate, meta?: KodaXActivityEventMeta) => void | Promise<void>;
|
|
1773
|
+
/** Canonical, post-commit compaction fact. Legacy callbacks are projections. */
|
|
1774
|
+
onContextCompactionFinished?: (event: KodaXContextCompactionFinishedEvent) => void;
|
|
1746
1775
|
/** Emitted to silently dismiss the compaction UI if compaction aborted or completed without changes */
|
|
1747
1776
|
onCompactEnd?: (meta?: KodaXActivityEventMeta) => void;
|
|
1748
1777
|
/** Whether the caller has queued follow-up input waiting for the next round */
|
|
@@ -2781,16 +2810,18 @@ interface KodaXSelfManualConfig {
|
|
|
2781
2810
|
* over both the adaptive default and `~/.kodax/config.json`. Lets an
|
|
2782
2811
|
* embedder that calls `runManagedTask` in-process pin the context window /
|
|
2783
2812
|
* trigger for a model the built-in capability table doesn't cover (or that
|
|
2784
|
-
* it resolves through a custom provider), or
|
|
2785
|
-
* run — without writing to the user's home-dir config file. Omitted fields
|
|
2813
|
+
* it resolves through a custom provider), or tune the always-on compaction
|
|
2814
|
+
* policy for a run — without writing to the user's home-dir config file. Omitted fields
|
|
2786
2815
|
* fall through to the normal resolution cascade.
|
|
2787
2816
|
*/
|
|
2788
2817
|
interface KodaXCompactionOverride {
|
|
2789
2818
|
/** Override the resolved provider context window, in tokens. */
|
|
2790
2819
|
contextWindow?: number;
|
|
2791
|
-
/** Override the auto-compaction trigger percentage (
|
|
2820
|
+
/** Override the auto-compaction trigger percentage (normalized to 15-90). */
|
|
2792
2821
|
triggerPercent?: number;
|
|
2793
|
-
/**
|
|
2822
|
+
/** Optional absolute token threshold. Missing/zero is inactive. */
|
|
2823
|
+
triggerTokens?: number;
|
|
2824
|
+
/** @deprecated Automatic large compaction is always enabled. */
|
|
2794
2825
|
enabled?: boolean;
|
|
2795
2826
|
}
|
|
2796
2827
|
/**
|
|
@@ -3176,6 +3207,8 @@ interface KodaXToolExecutionContext {
|
|
|
3176
3207
|
readonly content: string;
|
|
3177
3208
|
readonly evidenceRefs: readonly string[];
|
|
3178
3209
|
} | undefined>;
|
|
3210
|
+
/** Exact persisted history loader for the current root or isolated worker Session. */
|
|
3211
|
+
loadSessionHistory?: () => Promise<KodaXSessionLineage | null>;
|
|
3179
3212
|
/** Git root directory - Git 鏍圭洰褰?*/
|
|
3180
3213
|
gitRoot?: string;
|
|
3181
3214
|
/**
|
|
@@ -3222,6 +3255,8 @@ interface KodaXToolExecutionContext {
|
|
|
3222
3255
|
assertReadablePath?: (candidate: string) => void;
|
|
3223
3256
|
/** Host tool visibility ceiling inherited by child agents. */
|
|
3224
3257
|
toolVisibilityPolicy?: KodaXToolVisibilityPolicy;
|
|
3258
|
+
/** Static caller exclusions applied before constructing a model-visible tool schema. */
|
|
3259
|
+
excludeTools?: readonly string[];
|
|
3225
3260
|
/** Maximum physical input capacity of the active model request. */
|
|
3226
3261
|
maximumInputTokens?: number;
|
|
3227
3262
|
/** Remaining capacity for the complete tool-result batch in this request. */
|
|
@@ -3294,6 +3329,7 @@ interface KodaXToolExecutionContext {
|
|
|
3294
3329
|
readonly effort?: KodaXWireReasoningEffort;
|
|
3295
3330
|
readonly repoIntelligenceMode?: KodaXRepoIntelligenceMode;
|
|
3296
3331
|
readonly repoIntelligenceTrace?: boolean;
|
|
3332
|
+
readonly compaction?: Readonly<KodaXCompactionOverride>;
|
|
3297
3333
|
};
|
|
3298
3334
|
/** Parent SDK/REPL callback surface used to preserve nested Agent telemetry. */
|
|
3299
3335
|
parentEvents?: KodaXEvents;
|
|
@@ -3653,5 +3689,5 @@ interface CreateBashPrefixExtractorOptions {
|
|
|
3653
3689
|
*/
|
|
3654
3690
|
declare function createBashPrefixExtractor(opts: CreateBashPrefixExtractorOptions): BashPrefixExtractor;
|
|
3655
3691
|
|
|
3656
|
-
export { ALWAYS_RESIDENT_TOOL_NAMES as A, BASH_POLICY_SPEC as B, LSP_SERVERS as
|
|
3657
|
-
export type {
|
|
3692
|
+
export { ALWAYS_RESIDENT_TOOL_NAMES as A, BASH_POLICY_SPEC as B, LSP_SERVERS as aS, LspService as aU, createBashPrefixExtractor as bA, createCompactionAntiThrashState as bB, createExternalActorTurnExecutor as bC, createLocalCodingActorControl as bD, createRuntimeContextBudgetSnapshot as bE, decideWorkflowInvocation as bF, drainPendingSwaps as bG, estimateToolSchemaTokens as bH, extractCommandPrefix as bI, getDefaultLspService as bJ, hasExplicitNaturalLanguageWorkflowIntent as bK, hasPendingSwap as bL, makeDisabledGoalToolsContext as bM, normalizeKodaXAgentMode as bN, planToolExposure as bO, providerResilienceConfigFromTimeouts as bP, recordCompactionSavings as bQ, resolveConstructedAgent as bR, shouldSkipLlmCompaction as bS, shutdownDefaultLspService as bT, withGoalBeforeNextTurn as bU, withGoalStopHook as bV, workflowStartOutcomeConsumesTurn as bW, buildGoalRuntimeBinding as by, consumeCompactionCooldown as bz, CodingActorSession as d };
|
|
3693
|
+
export type { KodaXManualTopicInput as $, CapabilityRuntimeContract as C, DiagnosticsRequest as D, ExtensionRuntimeContract as E, FailureStage as F, GoalBlockedResult as G, KodaXChildContextBundle as H, KodaXChildExecutionResult as I, KodaXCompactionOverride as J, KodaXActivityEventMeta as K, KodaXContextCompactionFinishedEvent as L, KodaXContextIdentity as M, KodaXContextOptions as N, KodaXContextTokenSnapshot as O, KodaXEffectiveTaskConfig as P, KodaXEvents as Q, KodaXLiveEventMeta as R, KodaXManagedBudgetSnapshot as S, KodaXManagedProtocolPayload as T, KodaXManagedTask as U, KodaXManagedTaskRuntimeState as V, KodaXManagedTaskStatusEvent as W, KodaXManualIndexTopic as X, KodaXManualSource as Y, KodaXManualTopic as Z, KodaXManualTopicId as _, BashPrefixExtractor as a, RecoveryDecision as a$, KodaXMemoryStrategy as a0, KodaXOptions as a1, KodaXOrchestrationVerdict as a2, KodaXParentReductionContract as a3, KodaXProviderPolicyHints as a4, KodaXRepoIntelligenceCapability as a5, KodaXRepoIntelligenceMode as a6, KodaXRepoIntelligenceResolvedMode as a7, KodaXRepoIntelligenceTrace as a8, KodaXRepoIntelligenceTraceEvent as a9, KodaXTaskToolPolicy as aA, KodaXTaskVerificationContract as aB, KodaXTaskVerificationCriterion as aC, KodaXTaskWorkItem as aD, KodaXTimeoutConfig as aE, KodaXToolEventMeta as aF, KodaXToolExecutionContext as aG, KodaXToolVisibilityMeta as aH, KodaXToolVisibilityPolicy as aI, KodaXTurnCompletedEvent as aJ, KodaXTurnDeliveryKind as aK, KodaXTurnFailedEvent as aL, KodaXTurnStartedEvent as aM, KodaXVerificationScorecard as aN, KodaXVerificationScorecardCriterion as aO, KodaXWorkflowAgentDigestEvent as aP, KodaXWorkflowEventMeta as aQ, KodaXWorkflowTimeoutConfig as aR, LspServerInfo as aT, LspServiceConfig as aV, ProviderExecutionState as aW, ProviderRecoveryEvent as aX, ProviderResilienceConfig as aY, ProviderResiliencePolicy as aZ, RecoveryAction as a_, KodaXRepoRoutingSignals as aa, KodaXResult as ab, KodaXRoleRoundSummary as ac, KodaXRuntimeVerificationContract as ad, KodaXSelfManualConfig as ae, KodaXSessionControl as af, KodaXSessionMutators as ag, KodaXSessionOptions as ah, KodaXSidecarMessageEvent as ai, KodaXSkillDynamicContextPolicy as aj, KodaXSkillInvocationContext as ak, KodaXSkillMap as al, KodaXSkillProjectionConfidence as am, KodaXSkillScriptInputFile as an, KodaXSkillScriptOutputFile as ao, KodaXSkillScriptRunInput as ap, KodaXSkillScriptRunner as aq, KodaXTaskCapabilityHint as ar, KodaXTaskContract as as, KodaXTaskEvidenceArtifact as at, KodaXTaskEvidenceBundle as au, KodaXTaskEvidenceEntry as av, KodaXTaskRole as aw, KodaXTaskRoleAssignment as ax, KodaXTaskStatus as ay, KodaXTaskSurface as az, BashPrefixResult as b, RecoveryLadderStep as b0, RecoveryResult as b1, ResilienceClassification as b2, ResilienceErrorClass as b3, ResolveKodaXManualInput as b4, ResolveKodaXManualOptions as b5, ResolveKodaXManualResult as b6, RuntimeCompactionSkippedEvent as b7, RuntimeContextBudgetBreakdown as b8, RuntimeContextBudgetRecommendation as b9, RuntimeContextBudgetSnapshot as ba, RuntimeContextBudgetSnapshotInput as bb, RuntimeContextOptimizationProfile as bc, RuntimeContextPressure as bd, RuntimeDefaultsSnapshot as be, RuntimeToolExposureDecision as bf, RuntimeToolExposureMode as bg, RuntimeToolExposurePlan as bh, RuntimeToolExposurePlanInput as bi, RuntimeToolExposureReason as bj, TodoItem as bk, TodoList as bl, TodoStatus as bm, ToolSideEffect as bn, WorkflowHostPolicy as bo, WorkflowInvocationAction as bp, WorkflowInvocationPolicyDecision as bq, WorkflowInvocationPolicyInput as br, WorkflowInvocationSource as bs, WorkflowStartOutcome as bt, WorkflowToolHost as bu, WorkflowToolHostInlineInput as bv, WorkflowToolHostResult as bw, WorkflowToolHostStartResult as bx, BoundExtensionRuntimeController as c, CodingActorSessionOptions as e, CompactionAntiThrashConfig as f, CompactionAntiThrashState as g, CompactionSavingsDecision as h, CompactionSavingsSample as i, CompactionSkipReason as j, CreateBashPrefixExtractorOptions as k, ExtractCommandPrefixOptions as l, GoalCompleteResult as m, GoalCreateInput as n, GoalLifecycleContext as o, GoalRuntimeBinding as p, GoalRuntimeBindingDeps as q, GoalToolsContext as r, KodaXActorHost as s, KodaXAgentMode as t, KodaXAgentProfile as u, KodaXAgentScope as v, KodaXBudgetDisclosureZone as w, KodaXBudgetExtensionRequest as x, KodaXCanonicalAgentMode as y, KodaXChildAgentResult as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as KodaXMessage } from './types.d-CSmF0t0n.js';
|
|
2
|
-
import { a8 as AgentMessage,
|
|
2
|
+
import { a8 as AgentMessage, de as SessionEntry, dc as Session, dg as SessionExtension, bM as KodaXSessionLineage, by as KodaXJsonValue, aP as CompactionDetails, bl as KodaXCompactMemorySeed, bI as KodaXSessionEntry, bW as KodaXSessionTreeNode, bL as KodaXSessionLabelEntry, bK as KodaXSessionGoalEntry, bF as KodaXSessionClientNoticeEntry, bS as KodaXSessionRewindMarkerEntry, bN as KodaXSessionMemoryOutcomeDigestEntry, bO as KodaXSessionMemoryReviewReceiptEntry, bR as KodaXSessionNavigationOptions, bD as KodaXSessionArtifactLedgerEntry, b9 as FileOperations, dV as WorkflowMeta, dW as WorkflowModelHint, dX as WorkflowModule } from './types.d-sRLugmjy.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @kodax-ai/agent Constants
|
|
@@ -583,6 +583,14 @@ declare function applySessionCompaction(lineage: KodaXSessionLineage | undefined
|
|
|
583
583
|
* defines the helper; no production caller yet.
|
|
584
584
|
*/
|
|
585
585
|
declare function applyLineageTruncation(lineage: KodaXSessionLineage | undefined, trimmedMessages: KodaXMessage[]): KodaXSessionLineage;
|
|
586
|
+
/**
|
|
587
|
+
* Replace message content of entries in old islands (not the active island)
|
|
588
|
+
* with a lightweight placeholder. This releases large tool_result payloads
|
|
589
|
+
* from memory while preserving the entry skeleton for tree structure.
|
|
590
|
+
*
|
|
591
|
+
* Hosts call this only after the exact lineage has been durably committed.
|
|
592
|
+
*/
|
|
593
|
+
declare function evictOldIslandMessageContent(lineage: KodaXSessionLineage): KodaXSessionLineage;
|
|
586
594
|
declare function findPreviousUserEntryId(lineage: KodaXSessionLineage): string | null;
|
|
587
595
|
declare function rewindSessionLineage(lineage: KodaXSessionLineage, targetEntryId: string): KodaXSessionLineage | null;
|
|
588
596
|
declare function forkSessionLineage(lineage: KodaXSessionLineage, selector?: string): KodaXSessionLineage | null;
|
|
@@ -760,5 +768,5 @@ declare function buildWorkflowCapsuleIntent(manifest: {
|
|
|
760
768
|
readonly originalRequest?: string;
|
|
761
769
|
}): WorkflowCapsuleIntent;
|
|
762
770
|
|
|
763
|
-
export { createSessionLineage as $, DefaultSummaryCompaction as D, KODAX_API_MIN_INTERVAL as K, LINEAGE_ENTRY_TYPES as L, actorQueueId as N, appendSessionLineageLabel as O, PROMISE_PATTERN as P, applyLineageTruncation as Q, applySessionCompaction as R, archiveOldIslands as S, assertRestrictedWorkflowQuality as T, buildSessionTree as U, buildWorkflowCapsuleIntent as V, WORKFLOW_CAPSULE_API_VERSION as W, cleanupIncompleteToolCalls as X, countActiveLineageMessages as Y, countTokens as Z, _resetActiveRootQueueRoutesForTests as _, createWorkflowCapsule as a0, createWorkflowModuleFromCapsule as a1, estimateTokens as a2,
|
|
771
|
+
export { createSessionLineage as $, DefaultSummaryCompaction as D, KODAX_API_MIN_INTERVAL as K, LINEAGE_ENTRY_TYPES as L, actorQueueId as N, appendSessionLineageLabel as O, PROMISE_PATTERN as P, applyLineageTruncation as Q, applySessionCompaction as R, archiveOldIslands as S, assertRestrictedWorkflowQuality as T, buildSessionTree as U, buildWorkflowCapsuleIntent as V, WORKFLOW_CAPSULE_API_VERSION as W, cleanupIncompleteToolCalls as X, countActiveLineageMessages as Y, countTokens as Z, _resetActiveRootQueueRoutesForTests as _, createWorkflowCapsule as a0, createWorkflowModuleFromCapsule as a1, estimateTokens as a2, evictOldIslandMessageContent as a3, extractArtifactLedger as a4, extractFileOps as a5, extractTitleFromMessages as a6, findPreviousUserEntryId as a7, forkSessionLineage as a8, generateSessionId as a9, getAgentConfigHome as aa, getAgentConfigPath as ab, getAppDataDir as ac, getSessionLineagePath as ad, getSessionMessagesFromLineage as ae, isPathInsideDirectory as af, lintRestrictedWorkflowSource as ag, mergeArtifactLedger as ah, mergeFileOps as ai, registerActiveRootQueueRoute as aj, resolveActiveRootQueueRoute as ak, resolveExecutionPath as al, resolveSessionLineageTarget as am, rewindSessionLineage as an, setAgentConfigHome as ao, setSessionLineageActiveEntry as ap, validateAndFixToolHistory as aq, validateWorkflowCapsule as ar, validateWorkflowScriptManifest as as, KODAX_DEFAULT_TIMEOUT as f, KODAX_HARD_TIMEOUT as g, KODAX_MAX_INCOMPLETE_RETRIES as h, KODAX_MAX_MAXTOKENS_RETRIES as i, KODAX_MAX_RETRIES as j, KODAX_MAX_TOKENS as k, KODAX_RETRY_BASE_DELAY as l, KODAX_STAGGER_DELAY as m, LineageCompaction as o, LineageExtension as r, WORKFLOW_CAPSULE_FORMAT as v, WORKFLOW_CAPSULE_VERSION as w, WORKFLOW_PATTERN_IDS as x };
|
|
764
772
|
export type { WorkflowCapsuleInputs as A, WorkflowCapsuleIntent as B, CompactionContext as C, WorkflowCapsuleProvenance as E, WorkflowCapsuleRequirements as F, WorkflowPatternId as G, WorkflowQualityLintFinding as H, WorkflowQualityLintOptions as I, WorkflowQualityLintSeverity as J, WorkflowScriptManifest as M, CompactionEntry as a, CompactionEntryPayload as b, CompactionPolicy as c, CreateWorkflowCapsuleInput as d, DefaultSummaryCompactionOptions as e, LineageArtifactLedgerPayload as n, LineageCompactionDelegates as p, LineageEntryType as q, LineageLabelPayload as s, LineageTreeNode as t, PolicyCompactionResult as u, WorkflowCapsule as y, WorkflowCapsuleEnvironmentRequirement as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { X as SessionStorage$1, R as PermissionMode, L as LearningBinding } from './public-api.d-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ResolvedAutoModeSettings, p as RuntimeSurfaceStatus, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest } from './utils.d-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { X as SessionStorage$1, R as PermissionMode, L as LearningBinding } from './public-api.d-CX4B11qY.js';
|
|
2
|
+
import { a1 as KodaXOptions, ab as KodaXResult } from './bash-prefix-extractor.d-r1beOESM.js';
|
|
3
|
+
import { n as ResolvedAutoModeSettings, p as RuntimeSurfaceStatus, b as CommandDefinition, e as CommandSource, c as CommandInfo, C as Command$1, I as InteractiveContext, a as CommandCallbacks, g as CurrentConfig, d as CommandInvocationRequest, f as CommandWorkflowInvocationRequest } from './utils.d-D0wPxz8y.js';
|
|
4
|
+
import { bV as KodaXSessionStorage, bH as KodaXSessionData } from './types.d-sRLugmjy.js';
|
|
5
|
+
import { r as AutoModeStats } from './guardrail.d-qjuKJZ31.js';
|
|
6
6
|
|
|
7
7
|
interface ReplRuntimePermissionGrantSuggestion {
|
|
8
8
|
readonly id: string;
|
|
@@ -87,7 +87,10 @@ interface InkREPLOptions extends KodaXOptions {
|
|
|
87
87
|
declare function runInkInteractiveMode(options: InkREPLOptions): Promise<void>;
|
|
88
88
|
|
|
89
89
|
interface SessionStorage extends KodaXSessionStorage {
|
|
90
|
-
list(gitRoot?: string
|
|
90
|
+
list(gitRoot?: string, options?: {
|
|
91
|
+
limit?: number;
|
|
92
|
+
includeArchived?: boolean;
|
|
93
|
+
}): Promise<Array<{
|
|
91
94
|
id: string;
|
|
92
95
|
title: string;
|
|
93
96
|
msgCount: number;
|
|
@@ -115,7 +118,7 @@ interface RepLOptions extends KodaXOptions {
|
|
|
115
118
|
learning?: LearningBinding;
|
|
116
119
|
}
|
|
117
120
|
declare function runInteractiveMode(options: RepLOptions): Promise<void>;
|
|
118
|
-
declare function processSpecialSyntax(input: string): Promise<string>;
|
|
121
|
+
declare function processSpecialSyntax(input: string, executionCwd?: string): Promise<string>;
|
|
119
122
|
|
|
120
123
|
/**
|
|
121
124
|
* Command Registry - Dynamic command registration system
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bb as Guardrail, d6 as RunnerToolCall, f as Agent, a8 as AgentMessage, d9 as RunnerToolResult, dk as Span } from './types.d-sRLugmjy.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Guardrail Runtime — FEATURE_085 (v0.7.26).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { b as McpServersConfig, M as McpConnectMode, a as McpServerConfig, c as McpTransportKind } from './config.d-CJy1WENT.js';
|
|
2
2
|
import { K as KodaXBaseProvider } from './base.d-ChvpaKjZ.js';
|
|
3
3
|
import { a as CostTracker } from './cost-tracker.d-BeaenODW.js';
|
|
4
|
-
import {
|
|
5
|
-
import { d as ToolGuardrail } from './guardrail.d-
|
|
4
|
+
import { d6 as RunnerToolCall } from './types.d-sRLugmjy.js';
|
|
5
|
+
import { d as ToolGuardrail } from './guardrail.d-CWYD1bdL.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* FEATURE_200 Phase F (v0.7.45) — MCP domain types extracted from types.ts.
|
|
@@ -367,7 +367,7 @@ declare function checkAbsoluteDeny(call: RunnerToolCall, projectRoot: string, ex
|
|
|
367
367
|
*
|
|
368
368
|
* 1. Tier-0 deterministic deny → block
|
|
369
369
|
* 2. Tool projection is '' (Tier 1) → allow (zero token cost)
|
|
370
|
-
* 3. Engine
|
|
370
|
+
* 3. Engine is rules → deterministic Tier 2, otherwise user confirms
|
|
371
371
|
* 4. denial/circuit threshold → engine downgrade, then escalate
|
|
372
372
|
* 5. classify(...) sideQuery
|
|
373
373
|
* allow → allow (record allow → reset consecutive)
|
|
@@ -386,10 +386,10 @@ declare function checkAbsoluteDeny(call: RunnerToolCall, projectRoot: string, ex
|
|
|
386
386
|
* shared (per design doc "防绕阈值"). Without it each guardrail is
|
|
387
387
|
* independent.
|
|
388
388
|
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
389
|
+
* Provider capability checks and the explicit `supportsAutoModeClassifier`
|
|
390
|
+
* flag are deferred to follow-up phases. Tier 2 is supplied by the Runtime
|
|
391
|
+
* host because canonical filesystem and shell parsing live in @kodax/repl;
|
|
392
|
+
* the guardrail remains the single decision point.
|
|
393
393
|
*/
|
|
394
394
|
|
|
395
395
|
type AutoModeEngine = 'llm' | 'rules';
|
|
@@ -426,10 +426,59 @@ type AutoModeAskUser = (call: RunnerToolCall, reason: string,
|
|
|
426
426
|
* confirm dialog (replacing the input-marker path from FEATURE_066).
|
|
427
427
|
*/
|
|
428
428
|
signals?: readonly ToolCallSignal[]) => Promise<AutoModeAskUserVerdict>;
|
|
429
|
+
interface AutoModeRulesContext {
|
|
430
|
+
readonly projectRoot: string;
|
|
431
|
+
readonly executionCwd: string;
|
|
432
|
+
readonly signals: readonly ToolCallSignal[];
|
|
433
|
+
}
|
|
434
|
+
type AutoModePermissionBoundary = 'workspace' | 'system-temp' | 'outside-workspace' | 'protected' | 'unresolved';
|
|
435
|
+
interface AutoModePermissionTarget {
|
|
436
|
+
readonly path: string;
|
|
437
|
+
readonly boundary: AutoModePermissionBoundary;
|
|
438
|
+
}
|
|
439
|
+
type AutoModePermissionOperation = {
|
|
440
|
+
readonly kind: 'read' | 'write' | 'create' | 'delete';
|
|
441
|
+
readonly target: AutoModePermissionTarget;
|
|
442
|
+
readonly options?: Readonly<Record<string, boolean | number | string>>;
|
|
443
|
+
} | {
|
|
444
|
+
readonly kind: 'copy' | 'move' | 'rename';
|
|
445
|
+
readonly source: AutoModePermissionTarget;
|
|
446
|
+
readonly destination: AutoModePermissionTarget;
|
|
447
|
+
readonly options?: Readonly<Record<string, boolean | number | string>>;
|
|
448
|
+
} | {
|
|
449
|
+
readonly kind: 'execute' | 'unknown';
|
|
450
|
+
readonly summary: string;
|
|
451
|
+
readonly options?: Readonly<Record<string, boolean | number | string>>;
|
|
452
|
+
};
|
|
453
|
+
/** Compact deterministic facts supplied to the permission reviewer. */
|
|
454
|
+
interface AutoModePermissionReview {
|
|
455
|
+
readonly schemaVersion: 1;
|
|
456
|
+
readonly analysis: {
|
|
457
|
+
readonly status: 'complete' | 'incomplete';
|
|
458
|
+
readonly shell: 'powershell' | 'shell' | 'tool';
|
|
459
|
+
readonly binding: 'exact' | 'partial';
|
|
460
|
+
readonly reason?: string;
|
|
461
|
+
};
|
|
462
|
+
readonly operations: readonly AutoModePermissionOperation[];
|
|
463
|
+
readonly risks: readonly string[];
|
|
464
|
+
}
|
|
465
|
+
type AutoModeCallAnalyzer = (call: RunnerToolCall, context: AutoModeRulesContext) => AutoModePermissionReview | Promise<AutoModePermissionReview>;
|
|
466
|
+
type AutoModeRulesDecision = {
|
|
467
|
+
readonly action: 'allow';
|
|
468
|
+
} | {
|
|
469
|
+
readonly action: 'block';
|
|
470
|
+
readonly reason: string;
|
|
471
|
+
} | {
|
|
472
|
+
readonly action: 'escalate';
|
|
473
|
+
readonly reason: string;
|
|
474
|
+
};
|
|
475
|
+
/** Deterministic Tier-2 evaluator used only while the rules engine is active. */
|
|
476
|
+
type AutoModeRulesEvaluator = (call: RunnerToolCall, context: AutoModeRulesContext) => AutoModeRulesDecision | Promise<AutoModeRulesDecision>;
|
|
429
477
|
interface AutoModeGuardrailConfig {
|
|
430
478
|
readonly rules: AutoRules;
|
|
431
479
|
readonly claudeMd?: string;
|
|
432
480
|
/**
|
|
481
|
+
* Legacy classifier path only. Runtime compact review excludes AGENTS.md.
|
|
433
482
|
* FEATURE_092 follow-up (auto-mode classifier AGENTS.md staleness fix):
|
|
434
483
|
* live getter for the project AGENTS.md content. Takes precedence over the
|
|
435
484
|
* static `claudeMd` string and is evaluated INSIDE the classify path on
|
|
@@ -449,6 +498,18 @@ interface AutoModeGuardrailConfig {
|
|
|
449
498
|
* paths. See `AutoModeAskUser` for semantics.
|
|
450
499
|
*/
|
|
451
500
|
readonly askUser?: AutoModeAskUser;
|
|
501
|
+
/**
|
|
502
|
+
* Runtime-owned deterministic Tier-2 evaluator. It is injected rather than
|
|
503
|
+
* implemented in @kodax/coding because canonical path and shell-AST helpers
|
|
504
|
+
* live in @kodax/repl. Omitting it preserves fail-closed SDK compatibility:
|
|
505
|
+
* every non-Tier-1 rules call escalates.
|
|
506
|
+
*/
|
|
507
|
+
readonly evaluateRulesCall?: AutoModeRulesEvaluator;
|
|
508
|
+
/**
|
|
509
|
+
* Runtime-owned compact facts used by deterministic read admission and the
|
|
510
|
+
* LLM permission reviewer. Direct read tools fail closed when this is absent.
|
|
511
|
+
*/
|
|
512
|
+
readonly analyzeCall?: AutoModeCallAnalyzer;
|
|
452
513
|
/**
|
|
453
514
|
* Look up a tool's `toClassifierInput` projection by tool name.
|
|
454
515
|
* Returns `undefined` when the tool isn't in the registry. Unknown tools
|
|
@@ -504,8 +565,8 @@ interface AutoModeGuardrailConfig {
|
|
|
504
565
|
/**
|
|
505
566
|
* FEATURE_092 phase 2b.7b slice C: starting engine. Defaults to `'llm'`.
|
|
506
567
|
* Set to `'rules'` to skip the classifier entirely from session start
|
|
507
|
-
* (the
|
|
508
|
-
*
|
|
568
|
+
* (the deterministic Tier-2 evaluator runs for non-Tier-1 calls). Resolved
|
|
569
|
+
* by the REPL from `~/.kodax/config.json`
|
|
509
570
|
* `autoMode.engine` and the `KODAX_AUTO_MODE_ENGINE` env var.
|
|
510
571
|
*/
|
|
511
572
|
readonly initialEngine?: AutoModeEngine;
|
|
@@ -609,5 +670,5 @@ interface AutoModeToolGuardrail extends ToolGuardrail {
|
|
|
609
670
|
}
|
|
610
671
|
declare function createAutoModeToolGuardrail(config: AutoModeGuardrailConfig): AutoModeToolGuardrail;
|
|
611
672
|
|
|
612
|
-
export {
|
|
613
|
-
export type { AbsoluteDenyCheck as A, DenialTracker as D, KodaXMcpConnectMode as K, LoadAgentsOptions as L, RulesLoadError as R, SignalCollector as S, TierZeroPatternId as T, AbsoluteDenyMatch as a, AbsoluteDenyMiss as b, AbsoluteDenyResult as c, AgentsFile as d, AutoModeAskUser as e, AutoModeAskUserVerdict as f,
|
|
673
|
+
export { recordBlock as $, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E, checkAbsoluteDeny as I, collectAllSignals as J, computeRulesFingerprint as M, createAutoModeToolGuardrail as N, createCircuitBreaker as O, createDenialTracker as P, formatAgentsForPrompt as Q, getKodaxGlobalDir as U, loadAgentsFiles as V, WINDOW_MS as W, loadAutoRules as X, parseAutoRules as Y, readTrustState as Z, recordAllow as _, recordError as a0, shouldFallback$1 as a1, shouldFallback as a2, trustProjectRules as a3, CUMULATIVE_THRESHOLD as u };
|
|
674
|
+
export type { AbsoluteDenyCheck as A, RulesLoadResult as B, DenialTracker as D, SkippedRulesSource as F, ToolCallSignal as G, TrustState as H, KodaXMcpConnectMode as K, LoadAgentsOptions as L, RulesLoadError as R, SignalCollector as S, TierZeroPatternId as T, AbsoluteDenyMatch as a, AbsoluteDenyMiss as b, AbsoluteDenyResult as c, AgentsFile as d, AutoModeAskUser as e, AutoModeAskUserVerdict as f, AutoModeCallAnalyzer as g, AutoModeEngine as h, AutoModeGuardrailConfig as i, AutoModePermissionBoundary as j, AutoModePermissionOperation as k, AutoModePermissionReview as l, AutoModePermissionTarget as m, AutoModeRulesContext as n, AutoModeRulesDecision as o, AutoModeRulesEvaluator as p, AutoModeSharedState as q, AutoModeStats as r, AutoModeToolGuardrail as s, AutoRules as t, CircuitBreaker as v, KodaXMcpServerConfig as w, KodaXMcpServersConfig as x, KodaXMcpTransport as y, LoadedRulesSource as z };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { k as KodaXMessage } from './types.d-CSmF0t0n.js';
|
|
2
|
+
import { bM as KodaXSessionLineage } from './types.d-sRLugmjy.js';
|
|
3
|
+
|
|
4
|
+
type KodaXSessionHistoryScope = 'compacted' | 'all';
|
|
5
|
+
type KodaXSessionHistorySource = 'user' | 'assistant' | 'system' | 'tool' | 'child_task';
|
|
6
|
+
interface KodaXSessionHistorySearchOptions {
|
|
7
|
+
query: string;
|
|
8
|
+
limit?: number;
|
|
9
|
+
role?: KodaXMessage['role'];
|
|
10
|
+
scope?: KodaXSessionHistoryScope;
|
|
11
|
+
}
|
|
12
|
+
interface KodaXSessionHistoryHit {
|
|
13
|
+
entryId: string;
|
|
14
|
+
logicalId?: string;
|
|
15
|
+
sourceEntryId?: string;
|
|
16
|
+
timestamp: string;
|
|
17
|
+
role: KodaXMessage['role'];
|
|
18
|
+
source: KodaXSessionHistorySource;
|
|
19
|
+
active: boolean;
|
|
20
|
+
score: number;
|
|
21
|
+
snippet: string;
|
|
22
|
+
citation: string;
|
|
23
|
+
}
|
|
24
|
+
interface KodaXSessionHistorySearchResult {
|
|
25
|
+
revision: string;
|
|
26
|
+
hits: KodaXSessionHistoryHit[];
|
|
27
|
+
}
|
|
28
|
+
interface KodaXSessionHistoryReadOptions {
|
|
29
|
+
entryId: string;
|
|
30
|
+
revision?: string;
|
|
31
|
+
offset?: number;
|
|
32
|
+
maxChars?: number;
|
|
33
|
+
}
|
|
34
|
+
type KodaXSessionHistoryReadResult = {
|
|
35
|
+
status: 'not_found';
|
|
36
|
+
revision: string;
|
|
37
|
+
entryId: string;
|
|
38
|
+
} | {
|
|
39
|
+
status: 'stale';
|
|
40
|
+
revision: string;
|
|
41
|
+
entryId: string;
|
|
42
|
+
} | {
|
|
43
|
+
status: 'ok';
|
|
44
|
+
revision: string;
|
|
45
|
+
entryId: string;
|
|
46
|
+
content: string;
|
|
47
|
+
offset: number;
|
|
48
|
+
nextOffset: number | null;
|
|
49
|
+
totalChars: number;
|
|
50
|
+
redactedBlockCount: number;
|
|
51
|
+
citation: string;
|
|
52
|
+
};
|
|
53
|
+
declare function searchSessionHistory(lineage: KodaXSessionLineage, options: KodaXSessionHistorySearchOptions): KodaXSessionHistorySearchResult;
|
|
54
|
+
declare function readSessionHistoryEntry(lineage: KodaXSessionLineage, options: KodaXSessionHistoryReadOptions): KodaXSessionHistoryReadResult;
|
|
55
|
+
|
|
56
|
+
export { readSessionHistoryEntry as r, searchSessionHistory as s };
|
|
57
|
+
export type { KodaXSessionHistoryHit as K, KodaXSessionHistoryReadOptions as a, KodaXSessionHistoryReadResult as b, KodaXSessionHistoryScope as c, KodaXSessionHistorySearchOptions as d, KodaXSessionHistorySearchResult as e, KodaXSessionHistorySource as f };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-
|
|
1
|
+
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-r1beOESM.js';
|
|
2
2
|
import { F as KodaXReasoningMode, k as KodaXMessage, S as KodaXTaskResultMetadata } from './types.d-CSmF0t0n.js';
|
|
3
3
|
import { p as LearningSurfaceSnapshot$1, n as LearningQuery, m as LearningPage, b as LearnedCapabilityRecord, j as LearningEvent, o as LearningSubscribeOptions } from './center-types.d-BBT122uJ.js';
|
|
4
|
-
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-sRLugmjy.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* TextBuffer - Text buffer management class - 文本缓冲区管理类
|
|
@@ -543,6 +543,8 @@ interface StatusBarProps {
|
|
|
543
543
|
contextWindow: number;
|
|
544
544
|
/** Compaction trigger percentage (0-100) */
|
|
545
545
|
triggerPercent: number;
|
|
546
|
+
/** Optional absolute threshold; zero/undefined is inactive. */
|
|
547
|
+
triggerTokens?: number;
|
|
546
548
|
/** Provider output capacity reserved from the physical context window. */
|
|
547
549
|
reservedResponseTokens?: number;
|
|
548
550
|
};
|
|
@@ -572,8 +574,8 @@ interface StatusBarProps {
|
|
|
572
574
|
/**
|
|
573
575
|
* FEATURE_092 phase 2b.8: classifier engine indicator. Only renders when
|
|
574
576
|
* permissionMode is in the auto family. `'llm'` shows green `auto[LLM]`
|
|
575
|
-
* (healthy), `'rules'` shows yellow `auto[RULES]` (
|
|
576
|
-
*
|
|
577
|
+
* (healthy), `'rules'` shows yellow `auto[RULES]` (deterministic
|
|
578
|
+
* workspace/temp rules; unresolved calls escalate to user confirmation).
|
|
577
579
|
*/
|
|
578
580
|
autoModeEngine?: 'llm' | 'rules';
|
|
579
581
|
}
|
|
@@ -845,6 +847,7 @@ interface SessionStorage {
|
|
|
845
847
|
save(id: string, data: SessionData): Promise<void>;
|
|
846
848
|
load(id: string): Promise<SessionData | null>;
|
|
847
849
|
getLineage?(id: string): Promise<KodaXSessionLineage | null>;
|
|
850
|
+
loadFullLineage?(id: string): Promise<KodaXSessionLineage | null>;
|
|
848
851
|
setActiveEntry?(id: string, selector: string, options?: KodaXSessionNavigationOptions): Promise<SessionData | null>;
|
|
849
852
|
setLabel?(id: string, selector: string, label?: string): Promise<SessionData | null>;
|
|
850
853
|
rewind?(id: string, selector?: string): Promise<SessionData | null>;
|
|
@@ -873,6 +876,7 @@ declare class MemorySessionStorage implements SessionStorage {
|
|
|
873
876
|
save(id: string, data: SessionData): Promise<void>;
|
|
874
877
|
load(id: string): Promise<SessionData | null>;
|
|
875
878
|
getLineage(id: string): Promise<KodaXSessionLineage | null>;
|
|
879
|
+
loadFullLineage(id: string): Promise<KodaXSessionLineage | null>;
|
|
876
880
|
setActiveEntry(id: string, selector: string, options?: KodaXSessionNavigationOptions): Promise<SessionData | null>;
|
|
877
881
|
setLabel(id: string, selector: string, label?: string): Promise<SessionData | null>;
|
|
878
882
|
fork(id: string, selector?: string, options?: {
|
|
@@ -955,6 +959,8 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
955
959
|
*/
|
|
956
960
|
private resolveSessionLocation;
|
|
957
961
|
private readSession;
|
|
962
|
+
private readArchivedEntries;
|
|
963
|
+
private appendIslandArchive;
|
|
958
964
|
/** Write `<dir>/project.json` once per process per directory (best-effort). */
|
|
959
965
|
private ensureProjectJson;
|
|
960
966
|
private writeSessionInternal;
|
|
@@ -967,6 +973,7 @@ declare class FileSessionStorage implements KodaXSessionStorage {
|
|
|
967
973
|
saveActorSnapshot(id: string, snapshot: AgentActorSnapshot, expectedRevision: number): Promise<void>;
|
|
968
974
|
load(id: string): Promise<SessionData | null>;
|
|
969
975
|
getLineage(id: string): Promise<KodaXSessionLineage | null>;
|
|
976
|
+
loadFullLineage(id: string): Promise<KodaXSessionLineage | null>;
|
|
970
977
|
setActiveEntry(id: string, selector: string, options?: {
|
|
971
978
|
summarizeCurrentBranch?: boolean;
|
|
972
979
|
}): Promise<SessionData | null>;
|
|
@@ -1056,6 +1063,10 @@ interface CompactSessionOptions {
|
|
|
1056
1063
|
readonly customInstructions?: string;
|
|
1057
1064
|
/** Provider context-window override (tokens). Otherwise resolved from the provider/model. */
|
|
1058
1065
|
readonly contextWindow?: number;
|
|
1066
|
+
/** Percentage threshold used to derive the protected tail (normalized to 15-90). */
|
|
1067
|
+
readonly triggerPercent?: number;
|
|
1068
|
+
/** Optional absolute threshold used to derive the protected tail; zero is inactive. */
|
|
1069
|
+
readonly triggerTokens?: number;
|
|
1059
1070
|
/** Sessions directory (mirrors createSessionManager's override). */
|
|
1060
1071
|
readonly sessionsDir?: string;
|
|
1061
1072
|
/** Injected storage instance (takes precedence over sessionsDir). */
|
|
@@ -1068,6 +1079,8 @@ interface CompactSessionResult {
|
|
|
1068
1079
|
readonly tokensAfter: number;
|
|
1069
1080
|
/** The rewritten (or unchanged) message list. */
|
|
1070
1081
|
readonly messages: KodaXMessage[];
|
|
1082
|
+
/** Canonical component accounting for a committed compaction. */
|
|
1083
|
+
readonly report?: CompactionReport;
|
|
1071
1084
|
/** Populated when `compacted` is false to explain why (not-found / no-op / error). */
|
|
1072
1085
|
readonly reason?: string;
|
|
1073
1086
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { eg as WorkflowProcessTrackerOptions, dO as WorkflowEvent, ea as WorkflowProcessSnapshot, e4 as WorkflowProcessEvent } from './types.d-sRLugmjy.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* FEATURE_246 Part A0 (ADR-046) — neutral workflow run lifecycle manager.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as CreatableHistoryItem, a8 as ToolCall } from './public-api.d-
|
|
1
|
+
import { g as CreatableHistoryItem, a8 as ToolCall } from './public-api.d-CX4B11qY.js';
|
|
2
2
|
import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-CSmF0t0n.js';
|
|
3
|
-
import {
|
|
3
|
+
import { bX as KodaXSessionUiHistoryItem, b$ as KodaXSessionUiToolCall } from './types.d-sRLugmjy.js';
|
|
4
4
|
|
|
5
5
|
interface RestoreHistoryItemsFromSessionInput {
|
|
6
6
|
messages: readonly KodaXMessage[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-CSmF0t0n.js';
|
|
2
2
|
import { K as KodaXBaseProvider } from './base.d-ChvpaKjZ.js';
|
|
3
3
|
import { C as CapabilityKind, a as CapabilityProvider } from './capability.d-K664nHOS.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { by as KodaXJsonValue, bm as KodaXExtensionSessionRecord, bo as KodaXExtensionStore } from './types.d-sRLugmjy.js';
|
|
5
|
+
import { aG as KodaXToolExecutionContext, bn as ToolSideEffect } from './bash-prefix-extractor.d-r1beOESM.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* KodaX Constructed-World types (FEATURE_087, v0.7.28).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bw as KodaXInputArtifact } from './types.d-sRLugmjy.js';
|
|
2
2
|
import { S as KodaXTaskResultMetadata } from './types.d-CSmF0t0n.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -17,7 +17,14 @@ import { S as KodaXTaskResultMetadata } from './types.d-CSmF0t0n.js';
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
type MessagePriority = 'user' | 'background';
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Delivery semantics, independent of priority:
|
|
22
|
+
* - `prompt`: user-authored input; delivered as a real user turn.
|
|
23
|
+
* - `agent-message`: Runtime-authenticated Agent communication.
|
|
24
|
+
* - `task-notification`: structured Agent completion evidence.
|
|
25
|
+
* - `system-reminder`: Runtime-authored synthetic guidance.
|
|
26
|
+
*/
|
|
27
|
+
type MessageMode = 'prompt' | 'agent-message' | 'task-notification' | 'system-reminder';
|
|
21
28
|
type QueuedInputArtifact = KodaXInputArtifact;
|
|
22
29
|
interface QueuedMessage {
|
|
23
30
|
/** Stable id for tracing / dedup. Format: `msg-<sequence>`. */
|