@kodax-ai/kodax 0.7.46 → 0.7.48
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 +37 -1
- package/dist/chunks/{chunk-2GEKCIIW.js → chunk-66B6ZOU7.js} +13 -13
- package/dist/chunks/{chunk-K4RBLNSY.js → chunk-6Z75SHX3.js} +1 -1
- package/dist/chunks/{chunk-Z4UT32NN.js → chunk-DEODZG6Q.js} +1 -1
- package/dist/chunks/chunk-EP46H5P3.js +415 -0
- package/dist/chunks/{chunk-XUEINS3X.js → chunk-LNJNRREL.js} +317 -263
- package/dist/chunks/{chunk-JRT447X5.js → chunk-UHAP234X.js} +244 -242
- package/dist/chunks/{compaction-config-PFTBIGQT.js → compaction-config-YWCHOP2U.js} +1 -1
- package/dist/chunks/{construction-bootstrap-2FKNOZZE.js → construction-bootstrap-AIWATBWW.js} +1 -1
- package/dist/chunks/dist-4WABQRJU.js +2 -0
- package/dist/chunks/{dist-QTV5M2JW.js → dist-IDNOAB4M.js} +1 -1
- package/dist/chunks/{utils-LY3LB65Z.js → utils-OG57XTPC.js} +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.js +5 -5
- package/dist/kodax_cli.js +765 -719
- package/dist/provider-capabilities.json +3 -8
- package/dist/sdk-agent.d.ts +38 -7
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +102 -11
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +3 -3
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +10 -9
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-BICYx8pt.d.ts → bash-prefix-extractor.d-DNO2-ycp.d.ts} +283 -31
- package/dist/types-chunks/{config.d-BfJUXxC0.d.ts → config.d-CJy1WENT.d.ts} +17 -7
- package/dist/types-chunks/{file-tracker.d-BNTIvsdb.d.ts → file-tracker.d-D7L_SbRm.d.ts} +1 -1
- package/dist/types-chunks/manager.d-DLmDhX3i.d.ts +696 -0
- package/dist/types-chunks/{types.d-D2RNa5Y7.d.ts → types.d-BCnbYG_A.d.ts} +68 -2
- package/dist/types-chunks/{utils.d-pzHPkrb8.d.ts → utils.d-Dgy5SVrq.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/chunks/chunk-VBIVZOSD.js +0 -425
- package/dist/chunks/dist-JLMKDPEL.js +0 -2
- package/dist/types-chunks/manager.d-87belpiS.d.ts +0 -370
|
@@ -1816,6 +1816,72 @@ declare function runToolBeforeGuardrails(call: RunnerToolCall, guardrails: reado
|
|
|
1816
1816
|
*/
|
|
1817
1817
|
declare function runToolAfterGuardrails(call: RunnerToolCall, result: RunnerToolResult, guardrails: readonly ToolGuardrail[], ctx: GuardrailContext, agentSpan: Span | null): Promise<RunnerToolResult>;
|
|
1818
1818
|
|
|
1819
|
+
/**
|
|
1820
|
+
* FEATURE_222 — user-interaction primitive (agent layer).
|
|
1821
|
+
*
|
|
1822
|
+
* "Ask the user a question" is needed at BOTH layers: the coding `ask_user_*`
|
|
1823
|
+
* tools (LLM-initiated) AND the MCP elicitation reverse capability
|
|
1824
|
+
* (server-initiated). The capability historically lived only in
|
|
1825
|
+
* `@kodax-ai/coding`, but the MCP runtime lives one layer below in
|
|
1826
|
+
* `@kodax-ai/agent` and cannot reach up to it. So the primitive is owned here,
|
|
1827
|
+
* at the agent layer, and the host injects ONE implementation that both layers
|
|
1828
|
+
* share — coding re-exports these types for backward compatibility.
|
|
1829
|
+
*
|
|
1830
|
+
* The agent layer is UI-less by design: these are the contract the host
|
|
1831
|
+
* (REPL / ACP / SDK) fulfils with its real interaction surface. A headless host
|
|
1832
|
+
* leaves them undefined and consumers degrade gracefully (cancel / decline).
|
|
1833
|
+
*/
|
|
1834
|
+
/** A single question item used in multi-question mode. */
|
|
1835
|
+
interface AskUserQuestionItem {
|
|
1836
|
+
question: string;
|
|
1837
|
+
header?: string;
|
|
1838
|
+
options: Array<{
|
|
1839
|
+
label: string;
|
|
1840
|
+
description?: string;
|
|
1841
|
+
value: string;
|
|
1842
|
+
}>;
|
|
1843
|
+
multiSelect?: boolean;
|
|
1844
|
+
}
|
|
1845
|
+
/** Options for multi-question mode — multiple independent questions in one call. */
|
|
1846
|
+
interface AskUserMultiOptions {
|
|
1847
|
+
questions: AskUserQuestionItem[];
|
|
1848
|
+
}
|
|
1849
|
+
/** Options for a single question (select or free-text input). */
|
|
1850
|
+
interface AskUserQuestionOptions {
|
|
1851
|
+
question: string;
|
|
1852
|
+
kind?: 'select' | 'input';
|
|
1853
|
+
/** Required for kind="select", ignored for kind="input". */
|
|
1854
|
+
options?: Array<{
|
|
1855
|
+
label: string;
|
|
1856
|
+
description?: string;
|
|
1857
|
+
value: string;
|
|
1858
|
+
}>;
|
|
1859
|
+
multiSelect?: boolean;
|
|
1860
|
+
default?: string;
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* The host-provided user-interaction surface. Each method is optional — a
|
|
1864
|
+
* headless host omits them and callers degrade gracefully. This is the single
|
|
1865
|
+
* primitive shared by the coding `ask_user_*` tools and the agent's MCP
|
|
1866
|
+
* elicitation reverse capability.
|
|
1867
|
+
*/
|
|
1868
|
+
interface UserInteraction {
|
|
1869
|
+
/** Ask one question (select mode by default). Resolves the chosen value. */
|
|
1870
|
+
askUser?: (options: AskUserQuestionOptions) => Promise<string>;
|
|
1871
|
+
/** Ask several independent questions sequentially. Resolves a value map, or
|
|
1872
|
+
* undefined when the user cancels. */
|
|
1873
|
+
askUserMulti?: (options: AskUserMultiOptions) => Promise<Record<string, string> | undefined>;
|
|
1874
|
+
/** Ask for free-text input. Resolves the text, or undefined when cancelled. */
|
|
1875
|
+
askUserInput?: (options: {
|
|
1876
|
+
question: string;
|
|
1877
|
+
default?: string;
|
|
1878
|
+
}) => Promise<string | undefined>;
|
|
1879
|
+
}
|
|
1880
|
+
/** Register the live user-interaction surface (host calls this when interactive). */
|
|
1881
|
+
declare function setActiveUserInteraction(interaction: UserInteraction | undefined): void;
|
|
1882
|
+
/** The live user-interaction surface, or undefined when none is active. */
|
|
1883
|
+
declare function getActiveUserInteraction(): UserInteraction | undefined;
|
|
1884
|
+
|
|
1819
1885
|
/**
|
|
1820
1886
|
* Child task registry primitive — generic fan-out tracking.
|
|
1821
1887
|
*
|
|
@@ -2273,5 +2339,5 @@ interface FileOperations {
|
|
|
2273
2339
|
modifiedFiles: string[];
|
|
2274
2340
|
}
|
|
2275
2341
|
|
|
2276
|
-
export { DEFAULT_SYSTEM_CAP as D, InvariantSession as
|
|
2277
|
-
export type {
|
|
2342
|
+
export { DEFAULT_SYSTEM_CAP as D, GuardrailEscalateError as H, InvariantSession as R, MAX_TOOL_LOOP_ITERATIONS as S, detectInstructionsInjection as a$, Runner as a9, Tracer as aL, _resetAdmittedAgentBindings as aO, _resetPresetDispatchers as aP, buildAssistantMessageFromLlmResult as aQ, buildSystemPrompt as aR, buildToolResultMessage as aS, collectGuardrails as aT, createAgent as aU, createHandoff as aV, createInMemorySession as aW, createInvariantSessionForAgent as aX, createStateWriter as aY, createTrace as aZ, defaultTracer as a_, SpanImpl as ar, discoverInstances as b0, executeRunnerToolCall as b1, extractAssistantTextFromMessage as b2, getActiveUserInteraction as b3, getAdmittedAgentBindings as b4, isRunnableTool as b5, isRunnerLlmResult as b6, registerChildTask as b7, registerPresetDispatcher as b8, requestTaskStop as b9, runAdmissionAudit as ba, runInputGuardrails as bb, runOutputGuardrails as bc, runToolAfterGuardrails as bd, runToolBeforeGuardrails as be, setActiveUserInteraction as bf, setAdmittedAgentBindings as bg, GuardrailBlockedError as z };
|
|
2343
|
+
export type { ReadonlyMutationTracker as $, AdmissionAuditOptions as A, GuardrailContext as B, ChildTaskRegistry as C, EvidenceSpanData as E, FanoutSpanData as F, GenerationSpanData as G, GuardrailSpanData as I, GuardrailVerdict as J, Handoff as K, HandoffSpanData as L, InMemorySessionOptions as M, InputGuardrail as N, InstanceDiscoveryFs as O, InvariantId as P, InvariantResult as Q, ManifestPatch as T, MessageEntry as U, ObserveCtx as V, OutputGuardrail as W, PersistedSessionState as X, PresetDispatcher as Y, PresetTracingContext as Z, QualityInvariant as _, AdmissionCtx as a, ReadonlyRecorder as a0, ReasoningDepth as a1, RecentlyModifiedFile as a2, RequestTaskStopOptions as a3, RequestTaskStopResult as a4, RunEvent as a5, RunOptions as a6, RunResult as a7, RunnableTool as a8, StopHookSpanData as aA, SystemCap as aB, TaskAbortRegistry as aC, TerminalCtx as aD, ToolBeforeOutcome as aE, ToolCallSpanData as aF, ToolCapability as aG, ToolGuardrail as aH, ToolPermission as aI, Trace as aJ, TraceOptions as aK, TracerOptions as aM, UserInteraction as aN, RunnerEvent as aa, RunnerLlmResult as ab, RunnerLlmReturn as ac, RunnerToolCall as ad, RunnerToolContext as ae, RunnerToolObserver as af, RunnerToolResult as ag, Session as ah, SessionDispatchResult as ai, SessionEntry as aj, SessionExtension as ak, SessionForkOptions as al, SessionMeta as am, SessionStateSnapshot as an, Span as ao, SpanData as ap, SpanError as aq, SpanImplOptions as as, StartTraceOptions as at, StateWriter as au, StateWriterFs as av, StateWriterOptions as aw, StopHookContext as ax, StopHookFn as ay, StopHookResult as az, AdmissionVerdict as b, AdmittedHandle as c, Agent as d, AgentManifest as e, AgentMessage as f, AgentMiddlewareDeclaration as g, AgentReasoningProfile as h, AgentSpanData as i, AgentTool as j, AskUserMultiOptions as k, AskUserQuestionItem as l, AskUserQuestionOptions as m, CompactionAnchor as n, CompactionConfig as o, CompactionDetails as p, CompactionResult as q, CompactionSpanData as r, CompactionUpdate as s, CurrentTodoSummary as t, Deliverable as u, DiscoveredInstance as v, DiscoveryOptions as w, FileOperations as x, Guardrail as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as BashPrefixExtractor, a1 as KodaXOptions, I as KodaXContextTokenSnapshot, K as KodaXAgentMode, a6 as KodaXRepoIntelligenceMode, A as AgentsFile, f as AutoModeStats, ai as KodaXSkillInvocationContext, _ as KodaXMcpServersConfig } from './bash-prefix-extractor.d-DNO2-ycp.js';
|
|
2
2
|
import { a as SessionStorage$1 } from './storage.d-B1Jk6ryM.js';
|
|
3
3
|
import { y as KodaXSessionStorage, n as KodaXSessionData, A as KodaXSessionUiHistoryItem, s as KodaXSessionLineage, k as KodaXSessionArtifactLedgerEntry, w as KodaXSessionRuntimeInfo } from './types.d-B_MIIApc.js';
|
|
4
4
|
import { n as KodaXMessage, E as KodaXReasoningMode, r as KodaXProviderCapabilityProfile, F as KodaXReasoningOverride, h as KodaXCustomProviderConfig } from './types.d-Cf-GCzac.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodax-ai/kodax",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.48",
|
|
4
4
|
"description": "极致轻量化 Coding Agent - TypeScript 实现,支持 12 个 LLM 提供商,可发布为免 Node 单文件二进制",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"terminal-size": "^4.0.1",
|
|
123
123
|
"tsx": "^4.21.0",
|
|
124
124
|
"typescript": "^5.9.3",
|
|
125
|
+
"vscode-languageserver-protocol": "^3.17.5",
|
|
125
126
|
"widest-line": "^6.0.0",
|
|
126
127
|
"wrap-ansi": "^8.1.0",
|
|
127
128
|
"ws": "^8.18.0",
|