@kodax-ai/kodax 0.7.72 → 0.7.74
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 +226 -0
- package/README.md +72 -18
- package/README_CN.md +55 -14
- package/config-templates/config.example.jsonc +7 -0
- package/dist/chunks/agent-2ABIG5NW.js +2 -0
- package/dist/chunks/argument-completer-C45DEO34.js +2 -0
- package/dist/chunks/chunk-5GH3SVI3.js +74 -0
- package/dist/chunks/{chunk-SQODXBLX.js → chunk-64M5HOCA.js} +1 -1
- package/dist/chunks/{chunk-PKQOEDHJ.js → chunk-7W6KYJU2.js} +224 -230
- package/dist/chunks/chunk-C7TZAT3S.js +369 -0
- package/dist/chunks/chunk-F7AIEHSS.js +46 -0
- package/dist/chunks/{chunk-E27LHEIP.js → chunk-GAFFYJU3.js} +1 -1
- package/dist/chunks/chunk-KPGVY6PF.js +321 -0
- package/dist/chunks/{chunk-44QXPEEE.js → chunk-MBAPT2R5.js} +1 -1
- package/dist/chunks/{chunk-IR5KIK7E.js → chunk-MVCAFD6M.js} +1 -1
- package/dist/chunks/chunk-PP53SIIL.js +5 -0
- package/dist/chunks/chunk-QH56WEHK.js +2 -0
- package/dist/chunks/chunk-UJS7JAO6.js +770 -0
- package/dist/chunks/{chunk-MVARIMQV.js → chunk-VK5QTHS6.js} +6 -6
- package/dist/chunks/chunk-VPURXE2F.js +427 -0
- package/dist/chunks/chunk-XM724XAA.js +329 -0
- package/dist/chunks/{chunk-WIBLZK4G.js → chunk-XMP66YWG.js} +11 -4
- package/dist/chunks/chunk-XXQLPTAN.js +78 -0
- package/dist/chunks/compaction-config-QYCDOW3Q.js +2 -0
- package/dist/chunks/{construction-bootstrap-ZJPXUPXQ.js → construction-bootstrap-BKNPJI7O.js} +1 -1
- package/dist/chunks/dist-6EK4H7TP.js +2 -0
- package/dist/chunks/{dist-GOUP4YVE.js → dist-EVEJAII2.js} +1 -1
- package/dist/chunks/host-KS4TJKWQ.js +2 -0
- package/dist/chunks/run-manager-L7MKGQNX.js +2 -0
- package/dist/chunks/{utils-OTT5CG5J.js → utils-GTJLL4GT.js} +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/index.js +5 -5
- package/dist/kodax_cli.js +1357 -1294
- package/dist/provider-capabilities.json +184 -5
- package/dist/runtime-worker.js +1277 -1224
- package/dist/sdk-a2a.d.ts +11 -10
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-agent.d.ts +110 -62
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +114 -32
- 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 +153 -24
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +238 -19
- 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 +16 -14
- 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-r1beOESM.d.ts} +50 -14
- 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-zeqV4IQX.d.ts} +11 -3
- package/dist/types-chunks/{commands.d-DZxHzH5-.d.ts → commands.d-DUxnK2TU.d.ts} +67 -8
- package/dist/types-chunks/{guardrail.d-DlpMnd-Y.d.ts → guardrail.d-CWYD1bdL.d.ts} +2 -1
- package/dist/types-chunks/{guardrail.d-auV61_h5.d.ts → guardrail.d-qjuKJZ31.d.ts} +79 -18
- package/dist/types-chunks/history-retrieval.d-BKTJIrVd.d.ts +57 -0
- package/dist/types-chunks/{public-api.d--IDNJsu1.d.ts → public-api.d-CX4B11qY.d.ts} +19 -5
- package/dist/types-chunks/{run-manager.d-Bh50OdVl.d.ts → run-manager.d-B9fEIjZk.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-Cfw6NFu-.d.ts → sdk-session-B0fhAOPa.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-EqQmHztg.d.ts → types.d-Bm_y6YuM.d.ts} +16 -9
- package/dist/types-chunks/{types.d-Cqaw71Ax.d.ts → types.d-CSmF0t0n.d.ts} +6 -5
- package/dist/types-chunks/{types.d-CNZgY52F.d.ts → types.d-DEctY20M.d.ts} +10 -3
- package/dist/types-chunks/{types.d-DH1mvdcl.d.ts → types.d-sRLugmjy.d.ts} +64 -15
- package/dist/types-chunks/{utils.d-gmn3c5U4.d.ts → utils.d-D0wPxz8y.d.ts} +94 -10
- package/docs/SDK_EMBEDDER_GUIDE.md +1952 -1573
- package/package.json +9 -2
- package/dist/chunks/agent-YKGU4USA.js +0 -2
- package/dist/chunks/argument-completer-QZETLNAB.js +0 -2
- package/dist/chunks/chunk-23X6REO4.js +0 -46
- package/dist/chunks/chunk-2RI252RN.js +0 -2
- 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-JSDLBXME.js +0 -755
- 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,11 +1,94 @@
|
|
|
1
|
-
import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { d as AgentsFile,
|
|
1
|
+
import { k as KodaXMessage, F as KodaXReasoningMode, d as KodaXCustomProviderConfig, p as KodaXProviderCapabilityProfile } from './types.d-CSmF0t0n.js';
|
|
2
|
+
import { O as KodaXContextTokenSnapshot, aj as KodaXSkillDynamicContextPolicy, t as KodaXAgentMode, a6 as KodaXRepoIntelligenceMode, a1 as KodaXOptions, ak as KodaXSkillInvocationContext } from './bash-prefix-extractor.d-r1beOESM.js';
|
|
3
|
+
import { bX as KodaXSessionUiHistoryItem, bM as KodaXSessionLineage, bD as KodaXSessionArtifactLedgerEntry, bn as KodaXExtensionSessionState, bm as KodaXExtensionSessionRecord, bT as KodaXSessionRuntimeInfo, eb as WorkflowProcessSource } from './types.d-sRLugmjy.js';
|
|
4
|
+
import { d as AgentsFile, r as AutoModeStats, x as KodaXMcpServersConfig } from './guardrail.d-qjuKJZ31.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-CX4B11qY.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; deterministic workspace/temp Tier 2 applies
|
|
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 };
|