@kodax-ai/kodax 0.7.72 → 0.7.73
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 +92 -0
- package/README.md +48 -14
- package/README_CN.md +33 -10
- package/dist/chunks/{agent-YKGU4USA.js → agent-T6PGT6AU.js} +1 -1
- package/dist/chunks/argument-completer-QGMWA2C3.js +2 -0
- package/dist/chunks/{chunk-SQODXBLX.js → chunk-64M5HOCA.js} +1 -1
- package/dist/chunks/{chunk-PKQOEDHJ.js → chunk-6JTWXGVU.js} +217 -223
- package/dist/chunks/{chunk-IR5KIK7E.js → chunk-6RI2RBTF.js} +1 -1
- package/dist/chunks/chunk-AGDDM5AW.js +329 -0
- package/dist/chunks/chunk-BUPJGG3C.js +5 -0
- package/dist/chunks/chunk-EAD4SF3Z.js +413 -0
- package/dist/chunks/chunk-F7AIEHSS.js +46 -0
- package/dist/chunks/{chunk-E27LHEIP.js → chunk-GAFFYJU3.js} +1 -1
- package/dist/chunks/chunk-HVCNAZ52.js +365 -0
- package/dist/chunks/{chunk-MVARIMQV.js → chunk-M7FXNPWV.js} +2 -2
- package/dist/chunks/{chunk-44QXPEEE.js → chunk-MBAPT2R5.js} +1 -1
- package/dist/chunks/{chunk-WIBLZK4G.js → chunk-MLEAQTCD.js} +2 -2
- package/dist/chunks/{chunk-JSDLBXME.js → chunk-OG6DRNKV.js} +63 -63
- package/dist/chunks/{chunk-2RI252RN.js → chunk-PFH53O4M.js} +1 -1
- package/dist/chunks/chunk-V4F6IYNK.js +73 -0
- package/dist/chunks/chunk-WQ6PWGK5.js +320 -0
- package/dist/chunks/chunk-XXQLPTAN.js +78 -0
- package/dist/chunks/compaction-config-IHJBP4GO.js +2 -0
- package/dist/chunks/{construction-bootstrap-ZJPXUPXQ.js → construction-bootstrap-EGRUHKLP.js} +1 -1
- package/dist/chunks/dist-5N3I2RTW.js +2 -0
- package/dist/chunks/{dist-GOUP4YVE.js → dist-EVEJAII2.js} +1 -1
- package/dist/chunks/host-MECITNE3.js +2 -0
- package/dist/chunks/run-manager-AY7RQOWM.js +2 -0
- package/dist/chunks/{utils-OTT5CG5J.js → utils-2GAE4XIM.js} +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +5 -5
- package/dist/kodax_cli.js +1341 -1320
- package/dist/provider-capabilities.json +184 -5
- package/dist/runtime-worker.js +1227 -1216
- package/dist/sdk-a2a.d.ts +10 -10
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +13 -13
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +96 -30
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +1 -1
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +8 -49
- package/dist/sdk-llm.js +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 +138 -16
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +99 -17
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-session.d.ts +6 -6
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +10 -10
- package/dist/types-chunks/{base.d-Cz_rwpOi.d.ts → base.d-ChvpaKjZ.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-CHJO5y94.d.ts → bash-prefix-extractor.d-bApf5nGw.d.ts} +3 -3
- package/dist/types-chunks/{capability-learning.d-_lR0J4iR.d.ts → capability-learning.d-DPrYxRjF.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-DxtdE-GD.d.ts → capsule.d-CGWltwno.d.ts} +2 -2
- package/dist/types-chunks/{commands.d-DZxHzH5-.d.ts → commands.d-CEHGwRok.d.ts} +62 -6
- package/dist/types-chunks/{guardrail.d-DlpMnd-Y.d.ts → guardrail.d-CC4vAQl7.d.ts} +2 -1
- package/dist/types-chunks/{guardrail.d-auV61_h5.d.ts → guardrail.d-CXIPlWP3.d.ts} +10 -10
- package/dist/types-chunks/{public-api.d--IDNJsu1.d.ts → public-api.d-FBmX0kxo.d.ts} +4 -3
- package/dist/types-chunks/{run-manager.d-Bh50OdVl.d.ts → run-manager.d-DUNnJcpE.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-Cfw6NFu-.d.ts → sdk-session-XqacVOs8.d.ts} +3 -3
- package/dist/types-chunks/{resolver.d-ssgNSlrh.d.ts → side-query.d-DWTMsndP.d.ts} +68 -5
- package/dist/types-chunks/{types.d-DH1mvdcl.d.ts → types.d-BnPhGmar.d.ts} +3 -1
- package/dist/types-chunks/{types.d-Cqaw71Ax.d.ts → types.d-CSmF0t0n.d.ts} +6 -5
- package/dist/types-chunks/{types.d-EqQmHztg.d.ts → types.d-DKr6TCXL.d.ts} +16 -9
- package/dist/types-chunks/{types.d-CNZgY52F.d.ts → types.d-DgciGHoG.d.ts} +2 -2
- package/dist/types-chunks/{utils.d-gmn3c5U4.d.ts → utils.d-BPYX7-KN.d.ts} +94 -10
- package/docs/SDK_EMBEDDER_GUIDE.md +128 -21
- package/package.json +2 -2
- package/dist/chunks/argument-completer-QZETLNAB.js +0 -2
- package/dist/chunks/chunk-23X6REO4.js +0 -46
- package/dist/chunks/chunk-CLFP6UGU.js +0 -71
- package/dist/chunks/chunk-EDZ5KJFT.js +0 -5
- package/dist/chunks/chunk-GIK4SGAT.js +0 -364
- package/dist/chunks/chunk-GVWPHE23.js +0 -310
- package/dist/chunks/chunk-VDGCGOQH.js +0 -328
- package/dist/chunks/chunk-VVE3UM4F.js +0 -410
- package/dist/chunks/chunk-ZJIMT5I3.js +0 -78
- package/dist/chunks/compaction-config-TWCDFLX6.js +0 -2
- package/dist/chunks/dist-JT4ATXVM.js +0 -2
- package/dist/chunks/host-SVEDZUC5.js +0 -2
- package/dist/chunks/run-manager-RX42UNEM.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as KodaXProviderConfig, k as KodaXMessage, a1 as KodaXToolDefinition, H as KodaXReasoningRequest, y as KodaXProviderStreamOptions, N as KodaXStreamResult, a7 as KodaXVerifyCredentialResult, l as KodaXModelDescriptor, p as KodaXProviderCapabilityProfile, B as KodaXReasoningCapability, G as KodaXReasoningProfile, n as KodaXNormalizedReasoningRequest, a9 as KodaXWireReasoningEffort } from './types.d-
|
|
1
|
+
import { q as KodaXProviderConfig, k as KodaXMessage, a1 as KodaXToolDefinition, H as KodaXReasoningRequest, y as KodaXProviderStreamOptions, N as KodaXStreamResult, a7 as KodaXVerifyCredentialResult, l as KodaXModelDescriptor, p as KodaXProviderCapabilityProfile, B as KodaXReasoningCapability, G as KodaXReasoningProfile, n as KodaXNormalizedReasoningRequest, a9 as KodaXWireReasoningEffort } from './types.d-CSmF0t0n.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Retry-After header parsing — FEATURE_130 (v0.7.36).
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { br as KodaXGoalState, a8 as AgentMessage, du as StopHookFn, bL as KodaXSessionLineage, k as AgentActorStore, aC as AgentTurnExecutor, t as AgentBudgetPort, h as AgentActorClient, N as AgentExecutionResult, V as AgentExecutorPlaneBinding, bx as KodaXJsonValue, bl as KodaXExtensionSessionRecord, f as Agent, dR as WorkflowIsolation, bm as KodaXExtensionSessionState, bC as KodaXSessionArtifactLedgerEntry, de as SessionErrorMetadata, bT as KodaXSessionScope, bU as KodaXSessionStorage, ci as MemoryContextIdentity, cu as MemoryPack, aK as AskUserQuestionOptions, aG as AskUserAnswer, aI as AskUserMultiOptions, dO as WorkflowEventCorrelation, aS as CompactionUpdate, e3 as WorkflowProcessEvent, dN as WorkflowEvent, cI as MemoryReviewPlan, bz as KodaXMemoryOutcomeDigest, ba as Guardrail, aX as DiscoveredInstance, bv as KodaXInputArtifact, cJ as MemoryReviewRunner } from './types.d-
|
|
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-
|
|
1
|
+
import { br as KodaXGoalState, a8 as AgentMessage, du as StopHookFn, bL as KodaXSessionLineage, k as AgentActorStore, aC as AgentTurnExecutor, t as AgentBudgetPort, h as AgentActorClient, N as AgentExecutionResult, V as AgentExecutorPlaneBinding, bx as KodaXJsonValue, bl as KodaXExtensionSessionRecord, f as Agent, dR as WorkflowIsolation, bm as KodaXExtensionSessionState, bC as KodaXSessionArtifactLedgerEntry, de as SessionErrorMetadata, bT as KodaXSessionScope, bU as KodaXSessionStorage, ci as MemoryContextIdentity, cu as MemoryPack, aK as AskUserQuestionOptions, aG as AskUserAnswer, aI as AskUserMultiOptions, dO as WorkflowEventCorrelation, aS as CompactionUpdate, e3 as WorkflowProcessEvent, dN as WorkflowEvent, cI as MemoryReviewPlan, bz as KodaXMemoryOutcomeDigest, ba as Guardrail, aX as DiscoveredInstance, bv as KodaXInputArtifact, cJ as MemoryReviewRunner } from './types.d-BnPhGmar.js';
|
|
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';
|
|
5
5
|
import { K as KodaXLlmTimeoutConfig, a as CostTracker } from './cost-tracker.d-BeaenODW.js';
|
|
6
6
|
import { C as CapabilityKind, f as CapabilitySearchSnapshot, b as CapabilityResult } from './capability.d-K664nHOS.js';
|
|
7
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
7
|
+
import { K as KodaXBaseProvider } from './base.d-ChvpaKjZ.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* FEATURE_192 v0.7.44 Phase C — Goal-tools execution context.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as KodaXMessage } from './types.d-
|
|
2
|
-
import { a8 as AgentMessage, dd as SessionEntry, db as Session, df as SessionExtension, bL as KodaXSessionLineage, bx as KodaXJsonValue, aP as CompactionDetails, bk as KodaXCompactMemorySeed, bH as KodaXSessionEntry, bV as KodaXSessionTreeNode, bK as KodaXSessionLabelEntry, bJ as KodaXSessionGoalEntry, bE as KodaXSessionClientNoticeEntry, bR as KodaXSessionRewindMarkerEntry, bM as KodaXSessionMemoryOutcomeDigestEntry, bN as KodaXSessionMemoryReviewReceiptEntry, bQ as KodaXSessionNavigationOptions, bC as KodaXSessionArtifactLedgerEntry, b8 as FileOperations, dU as WorkflowMeta, dV as WorkflowModelHint, dW as WorkflowModule } from './types.d-
|
|
1
|
+
import { k as KodaXMessage } from './types.d-CSmF0t0n.js';
|
|
2
|
+
import { a8 as AgentMessage, dd as SessionEntry, db as Session, df as SessionExtension, bL as KodaXSessionLineage, bx as KodaXJsonValue, aP as CompactionDetails, bk as KodaXCompactMemorySeed, bH as KodaXSessionEntry, bV as KodaXSessionTreeNode, bK as KodaXSessionLabelEntry, bJ as KodaXSessionGoalEntry, bE as KodaXSessionClientNoticeEntry, bR as KodaXSessionRewindMarkerEntry, bM as KodaXSessionMemoryOutcomeDigestEntry, bN as KodaXSessionMemoryReviewReceiptEntry, bQ as KodaXSessionNavigationOptions, bC as KodaXSessionArtifactLedgerEntry, b8 as FileOperations, dU as WorkflowMeta, dV as WorkflowModelHint, dW as WorkflowModule } from './types.d-BnPhGmar.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @kodax-ai/agent Constants
|
|
@@ -1,7 +1,53 @@
|
|
|
1
|
-
import { X as SessionStorage$1, R as PermissionMode, L as LearningBinding } from './public-api.d
|
|
2
|
-
import { $ as KodaXOptions, a9 as KodaXResult } from './bash-prefix-extractor.d-
|
|
3
|
-
import { n 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 { bU as KodaXSessionStorage, bG as KodaXSessionData } from './types.d-
|
|
1
|
+
import { X as SessionStorage$1, R as PermissionMode, L as LearningBinding } from './public-api.d-FBmX0kxo.js';
|
|
2
|
+
import { $ as KodaXOptions, a9 as KodaXResult } from './bash-prefix-extractor.d-bApf5nGw.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-BPYX7-KN.js';
|
|
4
|
+
import { bU as KodaXSessionStorage, bG as KodaXSessionData } from './types.d-BnPhGmar.js';
|
|
5
|
+
import { j as AutoModeStats } from './guardrail.d-CXIPlWP3.js';
|
|
6
|
+
|
|
7
|
+
interface ReplRuntimePermissionGrantSuggestion {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly kind: 'session' | 'persistent';
|
|
10
|
+
readonly label: string;
|
|
11
|
+
}
|
|
12
|
+
interface ReplRuntimePermissionRequest {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly toolName: string;
|
|
15
|
+
readonly toolCallId?: string;
|
|
16
|
+
readonly input: Readonly<Record<string, unknown>>;
|
|
17
|
+
readonly reason?: string;
|
|
18
|
+
readonly risk?: 'low' | 'medium' | 'high';
|
|
19
|
+
readonly executionCwd?: string;
|
|
20
|
+
readonly grantSuggestions?: readonly ReplRuntimePermissionGrantSuggestion[];
|
|
21
|
+
}
|
|
22
|
+
type ReplRuntimePermissionDecision = {
|
|
23
|
+
readonly type: 'allow_once';
|
|
24
|
+
} | {
|
|
25
|
+
readonly type: 'allow_session';
|
|
26
|
+
readonly suggestionId: string;
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: 'allow_always';
|
|
29
|
+
readonly suggestionId: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly type: 'reject';
|
|
32
|
+
readonly reason?: string;
|
|
33
|
+
};
|
|
34
|
+
type ReplRuntimePermissionPrompt = (request: ReplRuntimePermissionRequest) => Promise<ReplRuntimePermissionDecision>;
|
|
35
|
+
declare const RUNTIME_PERMISSION_PENDING_NOTICE = "Runtime state: run active until this approval is resolved.";
|
|
36
|
+
interface ReplRuntimeAutoModeControl {
|
|
37
|
+
getStats(sessionId: string): Promise<AutoModeStats | undefined>;
|
|
38
|
+
setEngine(sessionId: string, engine: 'llm' | 'rules'): Promise<AutoModeStats | undefined>;
|
|
39
|
+
syncSettings?(sessionId: string, permissionMode: string, settings: ReplRuntimeAutoModeSettings): Promise<AutoModeStats | undefined>;
|
|
40
|
+
subscribe?(sessionId: string, listener: (stats: AutoModeStats | undefined) => void): {
|
|
41
|
+
close(): void;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface ReplRuntimeAutoModeSettings {
|
|
45
|
+
readonly engine: 'llm' | 'rules';
|
|
46
|
+
readonly classifierModel?: string;
|
|
47
|
+
readonly timeoutMs?: number;
|
|
48
|
+
readonly speculativeWindowMs?: number;
|
|
49
|
+
}
|
|
50
|
+
declare function toReplRuntimeAutoModeSettings(settings: ResolvedAutoModeSettings): ReplRuntimeAutoModeSettings;
|
|
5
51
|
|
|
6
52
|
/**
|
|
7
53
|
* InkREPL - Ink-based REPL Adapter
|
|
@@ -20,6 +66,10 @@ interface InkRuntimeRunnerInput {
|
|
|
20
66
|
readonly prompt: string;
|
|
21
67
|
readonly sessionId: string;
|
|
22
68
|
readonly permissionMode: PermissionMode;
|
|
69
|
+
readonly autoModeSettings?: ReplRuntimeAutoModeSettings;
|
|
70
|
+
readonly requestPermission?: ReplRuntimePermissionPrompt;
|
|
71
|
+
/** Marks the callback installed by the REPL's legacy permission UI. */
|
|
72
|
+
readonly legacyPermissionHook?: true;
|
|
23
73
|
}
|
|
24
74
|
type InkRuntimeRunner = (input: InkRuntimeRunnerInput) => Promise<KodaXResult>;
|
|
25
75
|
type InkRuntimeStatusProvider = () => Promise<RuntimeSurfaceStatus | undefined>;
|
|
@@ -27,6 +77,7 @@ interface InkREPLOptions extends KodaXOptions {
|
|
|
27
77
|
storage?: SessionStorage$1;
|
|
28
78
|
hardExitOnClose?: boolean;
|
|
29
79
|
runtimeRunner?: InkRuntimeRunner;
|
|
80
|
+
runtimeAutoModeControl?: ReplRuntimeAutoModeControl;
|
|
30
81
|
getRuntimeStatus?: InkRuntimeStatusProvider;
|
|
31
82
|
learning?: LearningBinding;
|
|
32
83
|
}
|
|
@@ -49,12 +100,17 @@ interface ReplRuntimeRunnerInput {
|
|
|
49
100
|
readonly prompt: string;
|
|
50
101
|
readonly sessionId: string;
|
|
51
102
|
readonly permissionMode: PermissionMode;
|
|
103
|
+
readonly autoModeSettings?: ReplRuntimeAutoModeSettings;
|
|
104
|
+
readonly requestPermission?: ReplRuntimePermissionPrompt;
|
|
105
|
+
/** Marks the callback installed by the REPL's legacy permission UI. */
|
|
106
|
+
readonly legacyPermissionHook?: true;
|
|
52
107
|
}
|
|
53
108
|
type ReplRuntimeRunner = (input: ReplRuntimeRunnerInput) => Promise<KodaXResult>;
|
|
54
109
|
type ReplRuntimeStatusProvider = () => Promise<RuntimeSurfaceStatus | undefined>;
|
|
55
110
|
interface RepLOptions extends KodaXOptions {
|
|
56
111
|
storage?: SessionStorage;
|
|
57
112
|
runtimeRunner?: ReplRuntimeRunner;
|
|
113
|
+
runtimeAutoModeControl?: ReplRuntimeAutoModeControl;
|
|
58
114
|
getRuntimeStatus?: ReplRuntimeStatusProvider;
|
|
59
115
|
learning?: LearningBinding;
|
|
60
116
|
}
|
|
@@ -211,5 +267,5 @@ declare function executeCommand(parsed: {
|
|
|
211
267
|
};
|
|
212
268
|
}, context: InteractiveContext, callbacks: CommandCallbacks, currentConfig: CurrentConfig): Promise<CommandResult>;
|
|
213
269
|
|
|
214
|
-
export { BUILTIN_COMMANDS as B, executeCommand as
|
|
215
|
-
export type { Command as C, InkREPLOptions as I,
|
|
270
|
+
export { BUILTIN_COMMANDS as B, RUNTIME_PERMISSION_PENDING_NOTICE as R, executeCommand as n, getCommandRegistry as o, parseCommand as p, processSpecialSyntax as q, runInkInteractiveMode as r, runInteractiveMode as s, toReplRuntimeAutoModeSettings as t };
|
|
271
|
+
export type { Command as C, InkREPLOptions as I, InkRuntimeRunner as a, InkRuntimeRunnerInput as b, InkRuntimeStatusProvider as c, RepLOptions as d, ReplRuntimeAutoModeControl as e, ReplRuntimeAutoModeSettings as f, ReplRuntimePermissionDecision as g, ReplRuntimePermissionGrantSuggestion as h, ReplRuntimePermissionPrompt as i, ReplRuntimePermissionRequest as j, ReplRuntimeRunner as k, ReplRuntimeRunnerInput as l, ReplRuntimeStatusProvider as m };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ba as Guardrail, d5 as RunnerToolCall, f as Agent, a8 as AgentMessage, d8 as RunnerToolResult, dj as Span } from './types.d-
|
|
1
|
+
import { ba as Guardrail, d5 as RunnerToolCall, f as Agent, a8 as AgentMessage, d8 as RunnerToolResult, dj as Span } from './types.d-BnPhGmar.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Guardrail Runtime — FEATURE_085 (v0.7.26).
|
|
@@ -137,6 +137,7 @@ type ToolBeforeOutcome = {
|
|
|
137
137
|
readonly call: RunnerToolCall;
|
|
138
138
|
} | {
|
|
139
139
|
readonly kind: 'block';
|
|
140
|
+
readonly call: RunnerToolCall;
|
|
140
141
|
readonly result: RunnerToolResult;
|
|
141
142
|
};
|
|
142
143
|
/**
|
|
@@ -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
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
2
|
+
import { K as KodaXBaseProvider } from './base.d-ChvpaKjZ.js';
|
|
3
3
|
import { a as CostTracker } from './cost-tracker.d-BeaenODW.js';
|
|
4
|
-
import { d5 as RunnerToolCall } from './types.d-
|
|
5
|
-
import { d as ToolGuardrail } from './guardrail.d-
|
|
4
|
+
import { d5 as RunnerToolCall } from './types.d-BnPhGmar.js';
|
|
5
|
+
import { d as ToolGuardrail } from './guardrail.d-CC4vAQl7.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* FEATURE_200 Phase F (v0.7.45) — MCP domain types extracted from types.ts.
|
|
@@ -365,10 +365,10 @@ declare function checkAbsoluteDeny(call: RunnerToolCall, projectRoot: string, ex
|
|
|
365
365
|
*
|
|
366
366
|
* Decision flow (per design doc "三层权限金字塔"):
|
|
367
367
|
*
|
|
368
|
-
* 1.
|
|
369
|
-
* 2.
|
|
370
|
-
* 3.
|
|
371
|
-
* 4.
|
|
368
|
+
* 1. Tier-0 deterministic deny → block
|
|
369
|
+
* 2. Tool projection is '' (Tier 1) → allow (zero token cost)
|
|
370
|
+
* 3. Engine has been downgraded to rules → escalate (user confirms)
|
|
371
|
+
* 4. denial/circuit threshold → engine downgrade, then escalate
|
|
372
372
|
* 5. classify(...) sideQuery
|
|
373
373
|
* allow → allow (record allow → reset consecutive)
|
|
374
374
|
* block → block + reason (record block)
|
|
@@ -451,9 +451,8 @@ interface AutoModeGuardrailConfig {
|
|
|
451
451
|
readonly askUser?: AutoModeAskUser;
|
|
452
452
|
/**
|
|
453
453
|
* Look up a tool's `toClassifierInput` projection by tool name.
|
|
454
|
-
* Returns `undefined` when the tool isn't in the registry
|
|
455
|
-
*
|
|
456
|
-
* unknown tools is debatable; v1 favors not blocking on noise).
|
|
454
|
+
* Returns `undefined` when the tool isn't in the registry. Unknown tools
|
|
455
|
+
* receive a metadata-only fail-closed projection rather than a Tier-1 skip.
|
|
457
456
|
*/
|
|
458
457
|
readonly getToolProjection: (toolName: string) => ((input: unknown) => string) | undefined;
|
|
459
458
|
/**
|
|
@@ -585,6 +584,7 @@ interface AutoModeGuardrailConfig {
|
|
|
585
584
|
*/
|
|
586
585
|
interface AutoModeStats {
|
|
587
586
|
readonly engine: AutoModeEngine;
|
|
587
|
+
readonly classifierModel?: string;
|
|
588
588
|
readonly denials: DenialTracker;
|
|
589
589
|
readonly breaker: CircuitBreaker;
|
|
590
590
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-
|
|
2
|
-
import { F as KodaXReasoningMode, k as KodaXMessage, S as KodaXTaskResultMetadata } from './types.d-
|
|
1
|
+
import { a as BashPrefixExtractor, t as KodaXAgentMode } from './bash-prefix-extractor.d-bApf5nGw.js';
|
|
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 { bG as KodaXSessionData, bL as KodaXSessionLineage, bQ as KodaXSessionNavigationOptions, bS as KodaXSessionRuntimeInfo, bU as KodaXSessionStorage, i as AgentActorSnapshot, bx as KodaXJsonValue } from './types.d-
|
|
4
|
+
import { bG as KodaXSessionData, bL as KodaXSessionLineage, bQ as KodaXSessionNavigationOptions, bS as KodaXSessionRuntimeInfo, bU as KodaXSessionStorage, i as AgentActorSnapshot, bx as KodaXJsonValue } from './types.d-BnPhGmar.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* TextBuffer - Text buffer management class - 文本缓冲区管理类
|
|
@@ -265,6 +265,7 @@ declare function permissionModeDisplayName(mode: PermissionMode): string;
|
|
|
265
265
|
interface ConfirmResult {
|
|
266
266
|
confirmed: boolean;
|
|
267
267
|
always?: boolean;
|
|
268
|
+
runtimeGrantKind?: 'session' | 'persistent';
|
|
268
269
|
}
|
|
269
270
|
/**
|
|
270
271
|
* Tools that mutate the local filesystem AND accept a `path` input.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ef as WorkflowProcessTrackerOptions, dN as WorkflowEvent, e9 as WorkflowProcessSnapshot, e3 as WorkflowProcessEvent } from './types.d-
|
|
1
|
+
import { ef as WorkflowProcessTrackerOptions, dN as WorkflowEvent, e9 as WorkflowProcessSnapshot, e3 as WorkflowProcessEvent } from './types.d-BnPhGmar.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
|
|
2
|
-
import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-
|
|
3
|
-
import { bW as KodaXSessionUiHistoryItem, b_ as KodaXSessionUiToolCall } from './types.d-
|
|
1
|
+
import { g as CreatableHistoryItem, a8 as ToolCall } from './public-api.d-FBmX0kxo.js';
|
|
2
|
+
import { k as KodaXMessage, c as KodaXContentBlock } from './types.d-CSmF0t0n.js';
|
|
3
|
+
import { bW as KodaXSessionUiHistoryItem, b_ as KodaXSessionUiToolCall } from './types.d-BnPhGmar.js';
|
|
4
4
|
|
|
5
5
|
interface RestoreHistoryItemsFromSessionInput {
|
|
6
6
|
messages: readonly KodaXMessage[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as KodaXReasoningMode, M as KodaXStableEffortIntent, a9 as KodaXWireReasoningEffort, G as KodaXReasoningProfile, Z as KodaXThinkingBudgetMap, _ as KodaXThinkingDepth, q as KodaXProviderConfig, B as KodaXReasoningCapability, H as KodaXReasoningRequest, n as KodaXNormalizedReasoningRequest, V as KodaXTaskType, a7 as KodaXVerifyCredentialResult, a1 as KodaXToolDefinition, k as KodaXMessage, y as KodaXProviderStreamOptions, N as KodaXStreamResult, l as KodaXModelDescriptor, p as KodaXProviderCapabilityProfile, a8 as KodaXVerifyStrategy, d as KodaXCustomProviderConfig, j as KodaXListModelsResult } from './types.d-
|
|
1
|
+
import { F as KodaXReasoningMode, M as KodaXStableEffortIntent, a9 as KodaXWireReasoningEffort, G as KodaXReasoningProfile, Z as KodaXThinkingBudgetMap, _ as KodaXThinkingDepth, q as KodaXProviderConfig, B as KodaXReasoningCapability, H as KodaXReasoningRequest, n as KodaXNormalizedReasoningRequest, V as KodaXTaskType, a7 as KodaXVerifyCredentialResult, a1 as KodaXToolDefinition, k as KodaXMessage, y as KodaXProviderStreamOptions, N as KodaXStreamResult, l as KodaXModelDescriptor, p as KodaXProviderCapabilityProfile, a8 as KodaXVerifyStrategy, d as KodaXCustomProviderConfig, j as KodaXListModelsResult, a0 as KodaXTokenUsage } from './types.d-CSmF0t0n.js';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
3
|
+
import { K as KodaXBaseProvider } from './base.d-ChvpaKjZ.js';
|
|
4
4
|
import OpenAI from 'openai';
|
|
5
|
+
import { a as CostTracker } from './cost-tracker.d-BeaenODW.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* KodaX AI Errors
|
|
@@ -352,7 +353,7 @@ declare abstract class KodaXOpenAICompatProvider extends KodaXBaseProvider {
|
|
|
352
353
|
* Provider 注册表 - 统一管理所有 Provider
|
|
353
354
|
*/
|
|
354
355
|
|
|
355
|
-
type ProviderName = 'anthropic' | 'openai' | 'deepseek' | 'kimi' | 'kimi-code' | 'qwen' | 'zhipu' | 'zhipu-coding' | 'zai-coding' | 'minimax-coding' | 'mimo-coding' | 'mimo' | 'ark-coding' | 'gemini-cli' | 'codex-cli';
|
|
356
|
+
type ProviderName = 'anthropic' | 'openai' | 'deepseek' | 'kimi' | 'kimi-code' | 'qwen' | 'qwen-token-plan' | 'zhipu' | 'zhipu-coding' | 'zai-coding' | 'minimax-coding' | 'mimo-coding' | 'mimo' | 'ark-coding' | 'gemini-cli' | 'codex-cli';
|
|
356
357
|
/**
|
|
357
358
|
* Per-provider static metadata. v0.7.43 promoted this from a partial
|
|
358
359
|
* descriptor (`models: string[]`) to the full capability surface so
|
|
@@ -648,5 +649,67 @@ declare function listProviderModels(name: string, _opts?: {
|
|
|
648
649
|
signal?: AbortSignal;
|
|
649
650
|
}): Promise<KodaXListModelsResult>;
|
|
650
651
|
|
|
651
|
-
|
|
652
|
-
|
|
652
|
+
/**
|
|
653
|
+
* sideQuery — independent one-shot LLM invocation.
|
|
654
|
+
*
|
|
655
|
+
* Used by features that need a clean LLM call outside the main agent loop.
|
|
656
|
+
* The auto mode classifier (FEATURE_092) is the first consumer; future
|
|
657
|
+
* users include compaction, title generation, and SA mutation reflection.
|
|
658
|
+
*
|
|
659
|
+
* Constraints (deliberate):
|
|
660
|
+
* - tools=[] hardcoded — sideQuery is single-turn, no tool loop
|
|
661
|
+
* - text-only output — tool_use blocks from the model produce stopReason='error'
|
|
662
|
+
* - independent timeout (default 30s; callers may supply a bounded deadline)
|
|
663
|
+
* - independent cost bucket via querySource (mapped to TokenUsageRecord.role)
|
|
664
|
+
*
|
|
665
|
+
* Failure handling: never throws. Timeout, abort, provider error, and
|
|
666
|
+
* unexpected tool_use all produce a result with stopReason='timeout' /
|
|
667
|
+
* 'aborted' / 'error' so callers implement their own degradation.
|
|
668
|
+
*/
|
|
669
|
+
|
|
670
|
+
type SideQueryStopReason = 'end_turn' | 'max_tokens' | 'timeout' | 'aborted' | 'error';
|
|
671
|
+
interface SideQueryRequest {
|
|
672
|
+
readonly provider: KodaXBaseProvider;
|
|
673
|
+
readonly model: string;
|
|
674
|
+
readonly system: string;
|
|
675
|
+
readonly messages: readonly KodaXMessage[];
|
|
676
|
+
readonly reasoning?: KodaXReasoningRequest;
|
|
677
|
+
/** Optional per-request cap for small structured sidecar responses. */
|
|
678
|
+
readonly maxOutputTokens?: number;
|
|
679
|
+
readonly timeoutMs?: number;
|
|
680
|
+
readonly abortSignal?: AbortSignal;
|
|
681
|
+
readonly querySource: string;
|
|
682
|
+
readonly costTracker?: CostTracker;
|
|
683
|
+
}
|
|
684
|
+
interface SideQueryResult {
|
|
685
|
+
readonly text: string;
|
|
686
|
+
readonly usage: KodaXTokenUsage;
|
|
687
|
+
readonly costTracker?: CostTracker;
|
|
688
|
+
readonly stopReason: SideQueryStopReason;
|
|
689
|
+
/**
|
|
690
|
+
* Bounded request metadata only; prompts and response text are never copied.
|
|
691
|
+
* The built-in `sideQuery()` always supplies it. Optionality preserves source
|
|
692
|
+
* compatibility for existing SDK mocks and structural result adapters.
|
|
693
|
+
*/
|
|
694
|
+
readonly diagnostics?: SideQueryDiagnostics;
|
|
695
|
+
readonly error?: Error;
|
|
696
|
+
}
|
|
697
|
+
type SideQueryTerminalPhase = 'completed' | 'pre_output' | 'streaming' | 'contract_error';
|
|
698
|
+
interface SideQueryDiagnostics {
|
|
699
|
+
readonly provider: string;
|
|
700
|
+
readonly model: string;
|
|
701
|
+
readonly timeoutMs: number;
|
|
702
|
+
readonly elapsedMs: number;
|
|
703
|
+
readonly retryCount: number;
|
|
704
|
+
readonly retryWaitMs: number;
|
|
705
|
+
/** Time until the first non-empty text delta, when the adapter exposes it. */
|
|
706
|
+
readonly firstOutputMs?: number;
|
|
707
|
+
/** Time from the first observed text delta until termination. */
|
|
708
|
+
readonly streamMs?: number;
|
|
709
|
+
/** Honest coarse phase; provider adapters cannot split DNS/connect/remote queue. */
|
|
710
|
+
readonly terminalPhase: SideQueryTerminalPhase;
|
|
711
|
+
}
|
|
712
|
+
declare function sideQuery(req: SideQueryRequest): Promise<SideQueryResult>;
|
|
713
|
+
|
|
714
|
+
export { listBuiltinModelCapabilities as $, getCustomProviderList as A, getCustomProviderModelDescriptors as B, getCustomProviderModels as C, getCustomProviderNames as D, getDefaultThinkingDepthForMode as E, getModelCapabilities as F, getProvider as G, getProviderConfiguredCapabilityProfile as H, getProviderConfiguredReasoningCapability as I, getProviderList as J, KODAX_DEFAULT_PROVIDER as K, getProviderModel as L, getProviderModelDescriptors as M, getProviderModels as N, getReasoningCapability as O, getRuntimeModelProvider as Q, getRuntimeModelProviderNames as T, isCustomProviderName as U, isKnownProvider as V, isProviderConfigured as W, isProviderName as X, isReasoningEnabled as Y, isRuntimeModelProviderName as Z, listAllModelCapabilities as _, KODAX_DEFAULT_THINKING_BUDGETS as a, listCustomProviderModelCapabilities as a0, listProviderModels as a1, mapDepthToOpenAIReasoningEffort as a2, mapLegacyReasoningModeToEffortIntent as a3, normalizeReasoningEffortValue as a4, normalizeReasoningRequest as a5, parseReasoningEffortEnv as a6, registerCustomProviders as a7, registerModelProvider as a8, resolveModelCapabilities as a9, resolveProvider as aa, resolveProviderModelDescriptors as ab, resolveReasoningEffort as ac, resolveReasoningEffortForModelSwitch as ad, resolveThinkingBudget as ae, resolveWireEffort as af, sideQuery as ag, validateCustomProviderConfig as ah, verifyProviderCredential as ai, KODAX_PROVIDERS as b, KODAX_PROVIDER_SNAPSHOTS as c, KODAX_REASONING_MODE_SEQUENCE as d, KODAX_REASONING_SAFETY_RESERVE as e, KODAX_STABLE_EFFORT_INTENTS as f, KodaXAnthropicCompatProvider as g, KodaXError as h, KodaXNetworkError as j, KodaXOpenAICompatProvider as k, KodaXProviderError as l, KodaXRateLimitError as m, KodaXToolCallIdError as n, clampThinkingBudget as t, clearRuntimeModelProviders as u, createCustomProvider as v, effortToLegacyReasoningMode as w, getAvailableProviderNames as x, getCustomModelCapabilities as y, getCustomProvider as z };
|
|
715
|
+
export type { ProviderName as P, ResolveWireEffortInput as R, SideQueryDiagnostics as S, KodaXModelCapabilities as i, ResolvedWireEffort as o, SideQueryRequest as p, SideQueryResult as q, SideQueryStopReason as r, SideQueryTerminalPhase as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as KodaXMessage, a1 as KodaXToolDefinition, F as KodaXReasoningMode, a9 as KodaXWireReasoningEffort, a3 as KodaXToolResultContentItem, Y as KodaXThinkingBlock, I as KodaXRedactedThinkingBlock } from './types.d-
|
|
1
|
+
import { k as KodaXMessage, a1 as KodaXToolDefinition, F as KodaXReasoningMode, a9 as KodaXWireReasoningEffort, a3 as KodaXToolResultContentItem, Y as KodaXThinkingBlock, I as KodaXRedactedThinkingBlock } from './types.d-CSmF0t0n.js';
|
|
2
2
|
|
|
3
3
|
type AgentActorState = 'running' | 'idle' | 'closed';
|
|
4
4
|
type AgentTurnState = 'accepted' | 'running' | 'completed' | 'failed' | 'interrupted';
|
|
@@ -1001,6 +1001,8 @@ interface GuardrailSpanData {
|
|
|
1001
1001
|
readonly kind: 'guardrail';
|
|
1002
1002
|
readonly guardrailName: string;
|
|
1003
1003
|
readonly hookPoint: 'input' | 'output' | 'tool';
|
|
1004
|
+
/** True between span start and the guardrail callback settling. */
|
|
1005
|
+
readonly pending?: boolean;
|
|
1004
1006
|
readonly decision: 'pass' | 'veto' | 'rewrite' | 'error';
|
|
1005
1007
|
readonly reason?: string;
|
|
1006
1008
|
readonly error?: string;
|
|
@@ -138,14 +138,15 @@ interface KodaXMessage {
|
|
|
138
138
|
* Identifies which subsystem injected a synthetic message so consumers can
|
|
139
139
|
* render/attribute it distinctly instead of treating it like a user query.
|
|
140
140
|
* Absent on genuine user/assistant/system messages. Known values include
|
|
141
|
-
* `'sidecar-verifier'` (Sidecar Verifier revise feedback)
|
|
142
|
-
* (
|
|
143
|
-
*
|
|
144
|
-
*
|
|
141
|
+
* `'sidecar-verifier'` (Sidecar Verifier revise feedback),
|
|
142
|
+
* `'agent-completed'` (an Actor `<agent-completed>` result banner), and the
|
|
143
|
+
* legacy `'task-completed'` workflow banner. A rare same-wake mix with a
|
|
144
|
+
* system-reminder shares the completion label, content preserved. Exposed
|
|
145
|
+
* verbatim through `KodaXResult.messages`
|
|
145
146
|
* and session-load APIs for SDK consumers.
|
|
146
147
|
*/
|
|
147
148
|
_source?: string;
|
|
148
|
-
/** Structured task/workflow result metadata for synthetic
|
|
149
|
+
/** Structured task/workflow result metadata for synthetic completion messages. */
|
|
149
150
|
_taskResult?: KodaXTaskResultMetadata;
|
|
150
151
|
/** Multiple task results when one synthetic wake message contains several banners. */
|
|
151
152
|
_taskResults?: KodaXTaskResultMetadata[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-
|
|
2
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
1
|
+
import { a9 as KodaXWireReasoningEffort, a1 as KodaXToolDefinition, a3 as KodaXToolResultContentItem, k as KodaXMessage } from './types.d-CSmF0t0n.js';
|
|
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 { bx as KodaXJsonValue, bl as KodaXExtensionSessionRecord, bn as KodaXExtensionStore } from './types.d-
|
|
5
|
-
import { aE as KodaXToolExecutionContext, bl as ToolSideEffect } from './bash-prefix-extractor.d-
|
|
4
|
+
import { bx as KodaXJsonValue, bl as KodaXExtensionSessionRecord, bn as KodaXExtensionStore } from './types.d-BnPhGmar.js';
|
|
5
|
+
import { aE as KodaXToolExecutionContext, bl as ToolSideEffect } from './bash-prefix-extractor.d-bApf5nGw.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* KodaX Constructed-World types (FEATURE_087, v0.7.28).
|
|
@@ -438,17 +438,18 @@ interface LocalToolDefinition extends KodaXToolDefinition {
|
|
|
438
438
|
* THREE-TIER STRATEGY (pick by tool's risk profile):
|
|
439
439
|
*
|
|
440
440
|
* 1. ZERO RISK (read-only, structural):
|
|
441
|
-
* → return ''
|
|
442
|
-
*
|
|
441
|
+
* → return '' (Tier 1; classifier is skipped, zero token cost)
|
|
442
|
+
* Non-readonly tools need an explicit `classifierExemptReason`.
|
|
443
|
+
* Examples: read, grep, glob, ask_user_question
|
|
443
444
|
*
|
|
444
445
|
* 2. HIGH RISK (mutates state, network, exec, spawn):
|
|
445
446
|
* → write a CUSTOM projection that surfaces the risk-bearing fields
|
|
446
447
|
* Examples: bash (`Bash: ${i.command}`), web_fetch (`WebFetch ${i.url}`)
|
|
447
448
|
* See `classifier-projection.ts` for examples by category.
|
|
448
449
|
*
|
|
449
|
-
* 3.
|
|
450
|
-
* →
|
|
451
|
-
*
|
|
450
|
+
* 3. UNKNOWN / EXTENSION INPUT:
|
|
451
|
+
* → use `safeFallbackToClassifierInput(name, input)`. It retains
|
|
452
|
+
* operational metadata and body sizes without serializing raw JSON.
|
|
452
453
|
*
|
|
453
454
|
* KEEP IT SHORT: ≤ 100 chars typical. Variable-length user-provided fields
|
|
454
455
|
* (bash command, URL, `spawn_agent` objective) may legitimately
|
|
@@ -462,6 +463,12 @@ interface LocalToolDefinition extends KodaXToolDefinition {
|
|
|
462
463
|
* See `docs/features/v0.7.33.md` "Tool 接口扩展" for design rationale.
|
|
463
464
|
*/
|
|
464
465
|
toClassifierInput: (input: unknown) => string;
|
|
466
|
+
/**
|
|
467
|
+
* Required justification when a non-readonly tool intentionally returns
|
|
468
|
+
* an empty classifier projection. This makes classifier bypasses auditable
|
|
469
|
+
* instead of allowing an accidental `() => ''` to fail open.
|
|
470
|
+
*/
|
|
471
|
+
classifierExemptReason?: string;
|
|
465
472
|
}
|
|
466
473
|
interface ToolDefinitionSource {
|
|
467
474
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bv as KodaXInputArtifact } from './types.d-
|
|
2
|
-
import { S as KodaXTaskResultMetadata } from './types.d-
|
|
1
|
+
import { bv as KodaXInputArtifact } from './types.d-BnPhGmar.js';
|
|
2
|
+
import { S as KodaXTaskResultMetadata } from './types.d-CSmF0t0n.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @kodax-ai/agent/messaging — Message queue types
|
|
@@ -1,11 +1,94 @@
|
|
|
1
|
-
import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-
|
|
2
|
-
import { M as KodaXContextTokenSnapshot, ah as KodaXSkillDynamicContextPolicy, t as KodaXAgentMode, a4 as KodaXRepoIntelligenceMode, $ as KodaXOptions, ai as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-
|
|
3
|
-
import { bW as KodaXSessionUiHistoryItem, bL as KodaXSessionLineage, bC as KodaXSessionArtifactLedgerEntry, bm as KodaXExtensionSessionState, bl as KodaXExtensionSessionRecord, bS as KodaXSessionRuntimeInfo, ea as WorkflowProcessSource } from './types.d-
|
|
4
|
-
import { d as AgentsFile, j as AutoModeStats, p as KodaXMcpServersConfig } from './guardrail.d-
|
|
1
|
+
import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-CSmF0t0n.js';
|
|
2
|
+
import { M as KodaXContextTokenSnapshot, ah as KodaXSkillDynamicContextPolicy, t as KodaXAgentMode, a4 as KodaXRepoIntelligenceMode, $ as KodaXOptions, ai as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-bApf5nGw.js';
|
|
3
|
+
import { bW as KodaXSessionUiHistoryItem, bL as KodaXSessionLineage, bC as KodaXSessionArtifactLedgerEntry, bm as KodaXExtensionSessionState, bl as KodaXExtensionSessionRecord, bS as KodaXSessionRuntimeInfo, ea as WorkflowProcessSource } from './types.d-BnPhGmar.js';
|
|
4
|
+
import { d as AgentsFile, j as AutoModeStats, p as KodaXMcpServersConfig } from './guardrail.d-CXIPlWP3.js';
|
|
5
5
|
import * as readline from 'readline';
|
|
6
|
-
import { R as PermissionMode, L as LearningBinding, E as LearningSurfaceSnapshot } from './public-api.d
|
|
6
|
+
import { R as PermissionMode, L as LearningBinding, E as LearningSurfaceSnapshot } from './public-api.d-FBmX0kxo.js';
|
|
7
7
|
import { SpawnSyncReturns } from 'child_process';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Permission Config - 2-level permission configuration load/save
|
|
11
|
+
*
|
|
12
|
+
* Priority: project-level (.kodax/config.local.json) > user-level (~/.kodax/config.json)
|
|
13
|
+
* 优先级:项目级 (.kodax/config.local.json) > 用户级 (~/.kodax/config.json)
|
|
14
|
+
*
|
|
15
|
+
* Pattern format (ONLY for Bash tool in accept-edits mode):
|
|
16
|
+
* - "Bash(npm install)" - exact command match
|
|
17
|
+
* - "Bash(git commit:*)" - prefix wildcard (matches "git commit -m 'msg'" etc.)
|
|
18
|
+
* - "Bash(npm:*)" - command prefix wildcard (matches "npm install", "npm run" etc.)
|
|
19
|
+
*
|
|
20
|
+
* Note: Bash(*) is REJECTED for safety. Use specific command patterns.
|
|
21
|
+
* Note: Other tools don't need patterns:
|
|
22
|
+
* - Read/Glob/Grep: Always allowed (project-external is enforced confirmation)
|
|
23
|
+
* - Edit/Write: Auto-allowed in accept-edits, blocked in plan
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Auto-mode classifier configuration. Read from `~/.kodax/config.json` (user-
|
|
28
|
+
* level only — project-level is intentionally not consulted, matching
|
|
29
|
+
* `permissionMode`'s scope) plus the `KODAX_AUTO_MODE_*` env override family.
|
|
30
|
+
*/
|
|
31
|
+
interface AutoModeSettings {
|
|
32
|
+
/**
|
|
33
|
+
* Starting engine for the session.
|
|
34
|
+
* - `'llm'` (default): classifier runs on every non-Tier-1 tool call
|
|
35
|
+
* - `'rules'`: classifier skipped; every non-Tier-1 call escalates to askUser
|
|
36
|
+
* Engine downgrades stay sticky within the session regardless of this value.
|
|
37
|
+
*/
|
|
38
|
+
engine?: 'llm' | 'rules';
|
|
39
|
+
/**
|
|
40
|
+
* Classifier model spec — `"provider:model"` or `"model"` (provider then
|
|
41
|
+
* inherits from the main session). Feeds layer 4 of `resolveClassifierModel`.
|
|
42
|
+
*/
|
|
43
|
+
classifierModel?: string;
|
|
44
|
+
/** sideQuery timeout in ms. Default 20_000. */
|
|
45
|
+
timeoutMs?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Issue 143 (WS3): speculative-classify quiet window in ms. Default 500.
|
|
48
|
+
* The window only controls "resolve instantly vs wait for the verdict" — the
|
|
49
|
+
* classifier verdict is always adopted (WS1), so this never decides
|
|
50
|
+
* "dialog vs no dialog". `0` disables the speculative race (synchronous
|
|
51
|
+
* classify). Lets users on slow/remote providers widen the window so a fast
|
|
52
|
+
* local classify still short-circuits while a slow one simply waits.
|
|
53
|
+
*/
|
|
54
|
+
speculativeWindowMs?: number;
|
|
55
|
+
}
|
|
56
|
+
interface ResolvedAutoModeSettings {
|
|
57
|
+
readonly engine: 'llm' | 'rules';
|
|
58
|
+
readonly classifierModel?: string;
|
|
59
|
+
readonly classifierModelEnv?: string;
|
|
60
|
+
readonly timeoutMs?: number;
|
|
61
|
+
readonly speculativeWindowMs?: number;
|
|
62
|
+
}
|
|
63
|
+
interface ResolveAutoModeSettingsInput {
|
|
64
|
+
readonly settings?: AutoModeSettings;
|
|
65
|
+
readonly env?: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Load auto-mode settings from `~/.kodax/config.json` and apply the
|
|
69
|
+
* `KODAX_AUTO_MODE_*` env override family. This wrapper performs one
|
|
70
|
+
* filesystem read; `resolveAutoModeSettings()` is the pure counterpart.
|
|
71
|
+
*
|
|
72
|
+
* Env priority (highest first):
|
|
73
|
+
* - KODAX_AUTO_MODE_ENGINE: 'llm' | 'rules' — overrides settings.engine
|
|
74
|
+
* - KODAX_AUTO_MODE_CLASSIFIER_MODEL: model spec — surfaced as `classifierModelEnv`
|
|
75
|
+
* so it reaches `AutoModeGuardrailConfig.envVar` (the resolver's layer 2)
|
|
76
|
+
* - KODAX_AUTO_MODE_TIMEOUT_MS: integer ms — overrides settings.timeoutMs
|
|
77
|
+
* - KODAX_AUTO_SPECULATIVE_WINDOW_MS: integer ms (0 disables) — overrides
|
|
78
|
+
* settings.speculativeWindowMs (Issue 143 WS3; reuses the same env name
|
|
79
|
+
* speculative.ts reads, so a single var controls the knob everywhere)
|
|
80
|
+
*
|
|
81
|
+
* Invalid env values fall through to settings (defensive: a typo in an env
|
|
82
|
+
* var must not silently disable the classifier).
|
|
83
|
+
*/
|
|
84
|
+
declare function loadAutoModeSettings(env?: NodeJS.ProcessEnv): ResolvedAutoModeSettings;
|
|
85
|
+
/**
|
|
86
|
+
* Resolve Auto settings from caller-owned data without reading global files.
|
|
87
|
+
* SDK hosts can therefore share the REPL's validation and precedence rules
|
|
88
|
+
* while retaining ownership of their own configuration source.
|
|
89
|
+
*/
|
|
90
|
+
declare function resolveAutoModeSettings(input?: ResolveAutoModeSettingsInput): ResolvedAutoModeSettings;
|
|
91
|
+
|
|
9
92
|
/**
|
|
10
93
|
* KodaX Interactive Context Management - 交互式上下文管理
|
|
11
94
|
*/
|
|
@@ -165,7 +248,7 @@ interface CommandCallbacks {
|
|
|
165
248
|
setThinking?: (enabled: boolean) => void;
|
|
166
249
|
setReasoningMode?: (mode: KodaXReasoningMode) => void;
|
|
167
250
|
setAgentMode?: (mode: KodaXAgentMode) => void;
|
|
168
|
-
setPermissionMode?: (mode: PermissionMode) => void
|
|
251
|
+
setPermissionMode?: (mode: PermissionMode) => void | Promise<void>;
|
|
169
252
|
setRepoIntelligenceRuntime?: (update: {
|
|
170
253
|
mode?: KodaXRepoIntelligenceMode;
|
|
171
254
|
trace?: boolean;
|
|
@@ -238,13 +321,13 @@ interface CommandCallbacks {
|
|
|
238
321
|
* guardrail state through it. Used by `/auto-engine` (show), `/auto-denials`,
|
|
239
322
|
* and the status bar engine indicator.
|
|
240
323
|
*/
|
|
241
|
-
getAutoModeStats?: () => AutoModeStats | undefined
|
|
324
|
+
getAutoModeStats?: () => AutoModeStats | undefined | Promise<AutoModeStats | undefined>;
|
|
242
325
|
/**
|
|
243
326
|
* FEATURE_092 phase 2b.8: manual engine setter for `/auto-engine llm|rules`.
|
|
244
327
|
* No-op when the guardrail hasn't been constructed yet. Threshold downgrades
|
|
245
328
|
* still operate normally — a subsequent denial cross will downgrade again.
|
|
246
329
|
*/
|
|
247
|
-
setAutoModeEngine?: (engine: 'llm' | 'rules') => void
|
|
330
|
+
setAutoModeEngine?: (engine: 'llm' | 'rules') => void | Promise<void>;
|
|
248
331
|
ui: UIContext;
|
|
249
332
|
}
|
|
250
333
|
interface CommandResultData {
|
|
@@ -428,6 +511,7 @@ declare function loadConfig(): {
|
|
|
428
511
|
reasoningCeiling?: KodaXReasoningMode;
|
|
429
512
|
agentMode?: KodaXAgentMode;
|
|
430
513
|
permissionMode?: string;
|
|
514
|
+
autoMode?: AutoModeSettings;
|
|
431
515
|
locale?: string;
|
|
432
516
|
providerModels?: Record<string, string[]>;
|
|
433
517
|
customProviders?: KodaXCustomProviderConfig[];
|
|
@@ -599,5 +683,5 @@ declare function resolveRuntimeEffortSelection(input: {
|
|
|
599
683
|
declare function getGitRoot(cwd?: string): Promise<string | null>;
|
|
600
684
|
declare function rateLimitedCall<T>(fn: () => Promise<T>): Promise<T>;
|
|
601
685
|
|
|
602
|
-
export { registerConfiguredCustomProviders as
|
|
603
|
-
export type { Command as C, InteractiveContext as I,
|
|
686
|
+
export { loadConfig as B, prepareRuntimeConfig as D, rateLimitedCall as E, registerConfiguredCustomProviders as F, resolveAutoModeSettings as G, resolveRuntimeEffortSelection as H, resolveRuntimeModelSelection as J, KODAX_CONFIG_FILE as K, resolveRuntimeProviderSelection as L, saveConfig as M, touchContext as N, PREVIEW_MAX_LENGTH as P, KODAX_DIR as i, KODAX_EXAMPLE_CONFIG_FILE as j, KODAX_INTEGRATION_EXAMPLE_FILES as k, KODAX_SESSIONS_DIR as l, KODAX_VERSION as m, createInteractiveContext as q, ensureExampleConfigFile as r, ensureExampleConfigFiles as s, getGitRoot as t, getProviderList as u, getProviderModel as v, getVersion as w, hydrateProcessEnvFromShell as x, isProviderConfigured as y, loadAutoModeSettings as z };
|
|
687
|
+
export type { AutoModeSettings as A, Command as C, InteractiveContext as I, ResolveAutoModeSettingsInput as R, CommandCallbacks as a, CommandDefinition as b, CommandInfo as c, CommandInvocationRequest as d, CommandSource as e, CommandWorkflowInvocationRequest as f, CurrentConfig as g, InteractiveMode as h, ResolvedAutoModeSettings as n, RuntimeSurfaceMode as o, RuntimeSurfaceStatus as p };
|