@kodax-ai/kodax 0.7.55 → 0.7.56
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 +17 -0
- package/README.md +1 -1
- package/README_CN.md +1 -1
- package/dist/chunks/agent-MAAKRAF2.js +2 -0
- package/dist/chunks/argument-completer-OWEXGWNL.js +2 -0
- package/dist/chunks/{chunk-RGPPZOD5.js → chunk-4OHXHC2S.js} +4 -4
- package/dist/chunks/{chunk-HQCLPWRI.js → chunk-5YJIAP6C.js} +2 -2
- package/dist/chunks/{chunk-FRI7UQSB.js → chunk-7EAGBLRV.js} +1 -1
- package/dist/chunks/{chunk-7C2QUBLE.js → chunk-CDGOEK3T.js} +6 -6
- package/dist/chunks/{chunk-MX4G42EV.js → chunk-DHETLULC.js} +3 -3
- package/dist/chunks/{chunk-THAKTCPE.js → chunk-NZVJ3DFC.js} +174 -170
- package/dist/chunks/chunk-QI3MRJGU.js +5 -0
- package/dist/chunks/chunk-XXQ3RLA2.js +2 -0
- package/dist/chunks/{construction-bootstrap-4CIVZMQ5.js → construction-bootstrap-EDDVNP2B.js} +1 -1
- package/dist/chunks/dist-2267YGB5.js +2 -0
- package/dist/chunks/dist-GW32CHO5.js +2 -0
- package/dist/chunks/paste-5IDBBQQ3.js +2 -0
- package/dist/chunks/utils-J7XBBZGB.js +2 -0
- package/dist/index.d.ts +12 -11
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +874 -870
- package/dist/provider-capabilities.json +2 -0
- package/dist/sdk-agent.d.ts +9 -8
- package/dist/sdk-coding.d.ts +99 -14
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +10 -5
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-media.d.ts +99 -0
- package/dist/sdk-media.js +2 -0
- package/dist/sdk-repl.d.ts +11 -10
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +6 -5
- package/dist/sdk-session.js +1 -1
- package/dist/types-chunks/base.d-CwPfI8WQ.d.ts +271 -0
- package/dist/types-chunks/{bash-prefix-extractor.d-LUGkQHcd.d.ts → bash-prefix-extractor.d-DZF1gDDz.d.ts} +14 -10
- package/dist/types-chunks/{capsule.d-CNonpwAZ.d.ts → capsule.d-D0kjnqYy.d.ts} +3 -3
- package/dist/types-chunks/{guardrail.d-B18oO1gt.d.ts → guardrail.d-DQQknOfb.d.ts} +3 -3
- package/dist/types-chunks/{process.d-Bj82oJhD.d.ts → process.d-BdiIUr8T.d.ts} +1 -1
- package/dist/types-chunks/{resolver.d-CCX9NXWP.d.ts → resolver.d-Djq8KlCE.d.ts} +2 -1
- package/dist/types-chunks/{sdk-session-SjrnWb4-.d.ts → sdk-session-BP6ZNpOp.d.ts} +4 -4
- package/dist/types-chunks/{storage.d-BAuJ0Ks7.d.ts → storage.d-CkydxFsV.d.ts} +2 -2
- package/dist/types-chunks/{base.d-BBNUF9nz.d.ts → types.d-BJmoMf5H.d.ts} +1 -269
- package/dist/types-chunks/{types.d-D4jL-gAA.d.ts → types.d-BKuHSiR0.d.ts} +1 -1
- package/dist/types-chunks/{utils.d-C9MUY8n3.d.ts → utils.d-bC97IuQZ.d.ts} +5 -5
- package/package.json +5 -1
- package/dist/chunks/agent-PYSVWY7M.js +0 -2
- package/dist/chunks/argument-completer-CTDNNWV3.js +0 -2
- package/dist/chunks/chunk-EVIDQWMF.js +0 -5
- package/dist/chunks/dist-7KTO2PUU.js +0 -2
- package/dist/chunks/dist-BNKIZRCP.js +0 -2
- package/dist/chunks/paste-5DSTHQGK.js +0 -2
- package/dist/chunks/utils-2QXBKYPJ.js +0 -2
package/dist/sdk-repl.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
import { A as AppProps, M as Message, $ as UIState, c as CreatableHistoryItem, f as HistoryItem, Y as ToolCall, _ as UIActions, K as KeyInfo, t as KeypressHandler, N as StreamingState, w as PromptEditingMode, I as InputPromptProps, J as StatusBarProps, V as Theme, Z as ToolCallStatus, O as Suggestion, a0 as UseTextBufferReturn, H as HistoryEntry, P as PastedContent, l as HistoryItemInfo } from './types-chunks/sdk-session-
|
|
3
|
-
export { a as AppState, C as Completer, b as Completion, d as CursorPosition, D as DEFAULT_UI_STATE, e as DeleteSessionResult, F as FullTranscriptSessionData, g as HistoryItemAssistant, h as HistoryItemBase, i as HistoryItemError, j as HistoryItemEvent, k as HistoryItemHint, m as HistoryItemSystem, n as HistoryItemThinking, o as HistoryItemToolGroup, p as HistoryItemType, q as HistoryItemUser, r as HistorySeedSourceMessage, s as KeypressEvent, u as KeypressHandlerPriority, L as LegacyMessageListProps, v as ListSessionsOptions, x as PromptSubmitPayload, R as RestoreHistoryItemsFromSessionInput, y as RestoredHistorySeed, z as RunningSessionInfo, S as SessionManager, B as SessionSummary, E as SessionTranscriptEntry, G as SessionTranscriptEntryType, T as TOOL_STATUS_ICONS, Q as TextBuffer, U as TextBufferOptions, W as ThemeColors, X as ThemeSymbols, a1 as VisualCursor, a2 as VisualLayout, a3 as WatchSessionsCallback, a4 as archiveSession, a5 as createSessionManager, a6 as deleteSession, a7 as extractHistorySeedsFromMessage, a8 as extractHistorySeedsFromMessages, a9 as extractTextContent, aa as extractTitle, ab as forkSession, ac as formatMessagePreview, ad as listRunningSessions, ae as listSessions, af as loadFullTranscript, ag as loadSession, ah as restoreHistoryItemsFromSession, ai as rewindSession, aj as seedToHistoryItem, ak as setActiveEntry, al as toolCallSeedToHistoryToolCall, am as trimPersistedUiHistorySnapshot, an as unarchiveSession, ao as watchSessions } from './types-chunks/sdk-session-
|
|
4
|
-
export { B as BUILTIN_COMMANDS, C as Command, a as CommandCallbacks, b as CurrentConfig, I as InkREPLOptions, c as InteractiveContext, d as InteractiveMode, K as KODAX_CONFIG_FILE, e as KODAX_DIR, f as KODAX_SESSIONS_DIR, g as KODAX_VERSION, P as PREVIEW_MAX_LENGTH, R as RepLOptions, h as createInteractiveContext, i as executeCommand, j as getGitRoot, k as getProviderList, l as getProviderModel, m as getVersion, n as hydrateProcessEnvFromShell, o as isProviderConfigured, p as loadConfig, q as parseCommand, r as prepareRuntimeConfig, s as processSpecialSyntax, t as rateLimitedCall, u as registerConfiguredCustomProviders, v as runInkInteractiveMode, w as runInteractiveMode, x as saveConfig, y as touchContext } from './types-chunks/utils.d-
|
|
5
|
-
import { v as KodaXEvents, m as KodaXAgentMode,
|
|
6
|
-
import { e as QueuedMessage } from './types-chunks/types.d-
|
|
7
|
-
import { b as PermissionMode } from './types-chunks/storage.d-
|
|
8
|
-
export { C as ConfirmResult, F as FileSessionStorage, M as MemorySessionStorage, P as PERMISSION_MODES, a as PermissionContext, S as SessionData, c as SessionStorage, d as computeConfirmTools, e as createMemorySessionStorage, i as isPermissionMode, n as normalizePermissionMode, p as permissionModeDisplayName } from './types-chunks/storage.d-
|
|
9
|
-
import {
|
|
10
|
-
import { k as KodaXMcpServerConfig, l as KodaXMcpServersConfig, a as AutoModeAskUser, A as AgentsFile, S as SignalCollector, g as AutoModeToolGuardrail, o as RulesLoadResult } from './types-chunks/guardrail.d-
|
|
11
|
-
export { ac as KodaXSessionUiHistoryItem, ad as KodaXSessionUiHistoryItemType, ae as KodaXSessionUiTextHistoryItem, af as KodaXSessionUiTextHistoryItemType, ag as KodaXSessionUiToolCall, ah as KodaXSessionUiToolCallStatus, ai as KodaXSessionUiToolGroupHistoryItem } from './types-chunks/process.d-
|
|
2
|
+
import { A as AppProps, M as Message, $ as UIState, c as CreatableHistoryItem, f as HistoryItem, Y as ToolCall, _ as UIActions, K as KeyInfo, t as KeypressHandler, N as StreamingState, w as PromptEditingMode, I as InputPromptProps, J as StatusBarProps, V as Theme, Z as ToolCallStatus, O as Suggestion, a0 as UseTextBufferReturn, H as HistoryEntry, P as PastedContent, l as HistoryItemInfo } from './types-chunks/sdk-session-BP6ZNpOp.js';
|
|
3
|
+
export { a as AppState, C as Completer, b as Completion, d as CursorPosition, D as DEFAULT_UI_STATE, e as DeleteSessionResult, F as FullTranscriptSessionData, g as HistoryItemAssistant, h as HistoryItemBase, i as HistoryItemError, j as HistoryItemEvent, k as HistoryItemHint, m as HistoryItemSystem, n as HistoryItemThinking, o as HistoryItemToolGroup, p as HistoryItemType, q as HistoryItemUser, r as HistorySeedSourceMessage, s as KeypressEvent, u as KeypressHandlerPriority, L as LegacyMessageListProps, v as ListSessionsOptions, x as PromptSubmitPayload, R as RestoreHistoryItemsFromSessionInput, y as RestoredHistorySeed, z as RunningSessionInfo, S as SessionManager, B as SessionSummary, E as SessionTranscriptEntry, G as SessionTranscriptEntryType, T as TOOL_STATUS_ICONS, Q as TextBuffer, U as TextBufferOptions, W as ThemeColors, X as ThemeSymbols, a1 as VisualCursor, a2 as VisualLayout, a3 as WatchSessionsCallback, a4 as archiveSession, a5 as createSessionManager, a6 as deleteSession, a7 as extractHistorySeedsFromMessage, a8 as extractHistorySeedsFromMessages, a9 as extractTextContent, aa as extractTitle, ab as forkSession, ac as formatMessagePreview, ad as listRunningSessions, ae as listSessions, af as loadFullTranscript, ag as loadSession, ah as restoreHistoryItemsFromSession, ai as rewindSession, aj as seedToHistoryItem, ak as setActiveEntry, al as toolCallSeedToHistoryToolCall, am as trimPersistedUiHistorySnapshot, an as unarchiveSession, ao as watchSessions } from './types-chunks/sdk-session-BP6ZNpOp.js';
|
|
4
|
+
export { B as BUILTIN_COMMANDS, C as Command, a as CommandCallbacks, b as CurrentConfig, I as InkREPLOptions, c as InteractiveContext, d as InteractiveMode, K as KODAX_CONFIG_FILE, e as KODAX_DIR, f as KODAX_SESSIONS_DIR, g as KODAX_VERSION, P as PREVIEW_MAX_LENGTH, R as RepLOptions, h as createInteractiveContext, i as executeCommand, j as getGitRoot, k as getProviderList, l as getProviderModel, m as getVersion, n as hydrateProcessEnvFromShell, o as isProviderConfigured, p as loadConfig, q as parseCommand, r as prepareRuntimeConfig, s as processSpecialSyntax, t as rateLimitedCall, u as registerConfiguredCustomProviders, v as runInkInteractiveMode, w as runInteractiveMode, x as saveConfig, y as touchContext } from './types-chunks/utils.d-bC97IuQZ.js';
|
|
5
|
+
import { v as KodaXEvents, m as KodaXAgentMode, aA as ProviderRecoveryEvent, a as BashPrefixExtractor, a2 as KodaXResult } from './types-chunks/bash-prefix-extractor.d-DZF1gDDz.js';
|
|
6
|
+
import { e as QueuedMessage } from './types-chunks/types.d-BKuHSiR0.js';
|
|
7
|
+
import { b as PermissionMode } from './types-chunks/storage.d-CkydxFsV.js';
|
|
8
|
+
export { C as ConfirmResult, F as FileSessionStorage, M as MemorySessionStorage, P as PERMISSION_MODES, a as PermissionContext, S as SessionData, c as SessionStorage, d as computeConfirmTools, e as createMemorySessionStorage, i as isPermissionMode, n as normalizePermissionMode, p as permissionModeDisplayName } from './types-chunks/storage.d-CkydxFsV.js';
|
|
9
|
+
import { h as KodaXCustomProviderConfig } from './types-chunks/types.d-BJmoMf5H.js';
|
|
10
|
+
import { k as KodaXMcpServerConfig, l as KodaXMcpServersConfig, a as AutoModeAskUser, A as AgentsFile, S as SignalCollector, g as AutoModeToolGuardrail, o as RulesLoadResult } from './types-chunks/guardrail.d-DQQknOfb.js';
|
|
11
|
+
export { ac as KodaXSessionUiHistoryItem, ad as KodaXSessionUiHistoryItemType, ae as KodaXSessionUiTextHistoryItem, af as KodaXSessionUiTextHistoryItemType, ag as KodaXSessionUiToolCall, ah as KodaXSessionUiToolCallStatus, ai as KodaXSessionUiToolGroupHistoryItem } from './types-chunks/process.d-BdiIUr8T.js';
|
|
12
12
|
import 'readline';
|
|
13
13
|
import 'child_process';
|
|
14
14
|
import 'vscode-languageserver-protocol';
|
|
15
15
|
import './types-chunks/capability.d-3C62G8Eq.js';
|
|
16
|
+
import './types-chunks/base.d-CwPfI8WQ.js';
|
|
16
17
|
import './types-chunks/cost-tracker.d-wRtyEW9d.js';
|
|
17
18
|
import './types-chunks/config.d-CJy1WENT.js';
|
|
18
19
|
|
package/dist/sdk-repl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$ as un,$a as fo,A as Q,Aa as $n,Ab as qo,B as T,Ba as qn,Bb as zo,C as U,Ca as zn,Cb as Bo,D as V,Da as Bn,Db as Eo,E as Y,Ea as En,Eb as Go,F as Z,Fa as Gn,Fb as Ho,G as tt,Ga as Hn,Gb as Jo,H as nt,Ha as Jn,Hb as Qo,I as ot,Ia as Qn,Ib as To,J as et,Ja as Tn,Jb as Uo,K as rt,Ka as Un,Kb as Vo,L as at,La as Vn,Lb as Yo,M as pt,Ma as Yn,Mb as Zo,N as lt,Na as Zn,Nb as te,O as ut,Oa as to,Ob as ne,P as ft,Pa as no,Pb as oe,Q as nn,Qa as oo,Qb as ee,R as on,Ra as eo,Rb as re,S as en,Sa as ro,Sb as ae,T as rn,Ta as ao,Tb as me,U as an,Ua as mo,Ub as ie,V as mn,Va as io,W as sn,Wa as so,X as cn,Xa as co,Y as dn,Ya as po,Z as pn,Za as lo,_ as ln,_a as uo,a as D,aa as fn,ab as go,b as P,ba as gn,bb as Co,c as M,ca as Cn,cb as xo,d as b,da as xn,db as yo,e as w,ea as yn,eb as Ko,f as N,fa as Kn,fb as Xo,g as _,ga as Xn,gb as ho,h as j,ha as hn,hb as Do,i as k,ia as Dn,ib as Po,j as A,ja as Pn,jb as Mo,k as O,ka as Mn,kb as bo,l as R,la as bn,lb as wo,m as S,ma as wn,mb as No,n as v,na as Nn,nb as _o,o as I,oa as _n,ob as jo,p as L,pa as jn,pb as ko,q as W,qa as kn,qb as Ao,r as F,ra as An,rb as Oo,s as $,sa as On,sb as Ro,t as q,ta as Rn,tb as So,u as z,ua as Sn,ub as vo,v as B,va as vn,vb as Io,w as E,wa as In,wb as Lo,x as G,xa as Ln,xb as Wo,y as H,ya as Wn,yb as Fo,z as J,za as Fn,zb as $o}from"./chunks/chunk-
|
|
2
|
+
import{$ as un,$a as fo,A as Q,Aa as $n,Ab as qo,B as T,Ba as qn,Bb as zo,C as U,Ca as zn,Cb as Bo,D as V,Da as Bn,Db as Eo,E as Y,Ea as En,Eb as Go,F as Z,Fa as Gn,Fb as Ho,G as tt,Ga as Hn,Gb as Jo,H as nt,Ha as Jn,Hb as Qo,I as ot,Ia as Qn,Ib as To,J as et,Ja as Tn,Jb as Uo,K as rt,Ka as Un,Kb as Vo,L as at,La as Vn,Lb as Yo,M as pt,Ma as Yn,Mb as Zo,N as lt,Na as Zn,Nb as te,O as ut,Oa as to,Ob as ne,P as ft,Pa as no,Pb as oe,Q as nn,Qa as oo,Qb as ee,R as on,Ra as eo,Rb as re,S as en,Sa as ro,Sb as ae,T as rn,Ta as ao,Tb as me,U as an,Ua as mo,Ub as ie,V as mn,Va as io,W as sn,Wa as so,X as cn,Xa as co,Y as dn,Ya as po,Z as pn,Za as lo,_ as ln,_a as uo,a as D,aa as fn,ab as go,b as P,ba as gn,bb as Co,c as M,ca as Cn,cb as xo,d as b,da as xn,db as yo,e as w,ea as yn,eb as Ko,f as N,fa as Kn,fb as Xo,g as _,ga as Xn,gb as ho,h as j,ha as hn,hb as Do,i as k,ia as Dn,ib as Po,j as A,ja as Pn,jb as Mo,k as O,ka as Mn,kb as bo,l as R,la as bn,lb as wo,m as S,ma as wn,mb as No,n as v,na as Nn,nb as _o,o as I,oa as _n,ob as jo,p as L,pa as jn,pb as ko,q as W,qa as kn,qb as Ao,r as F,ra as An,rb as Oo,s as $,sa as On,sb as Ro,t as q,ta as Rn,tb as So,u as z,ua as Sn,ub as vo,v as B,va as vn,vb as Io,w as E,wa as In,wb as Lo,x as G,xa as Ln,xb as Wo,y as H,ya as Wn,yb as Fo,z as J,za as Fn,zb as $o}from"./chunks/chunk-4OHXHC2S.js";import"./chunks/chunk-XXQ3RLA2.js";import{I as Gt,J as Ht,K as Jt,L as Qt,M as Tt,R as Ut,S as Vt,a as mt,b as it,c as st,d as ct,e as dt,f as gt,h as Ct,k as xt,l as yt,m as Kt,n as It,p as Lt,q as Wt,r as Ft,s as $t,sa as Yt,ta as Zt,u as qt,ua as tn,v as zt,w as Bt,x as Et}from"./chunks/chunk-5YJIAP6C.js";import{D as vt,b as Xt,c as ht,d as Dt,e as Pt,f as Mt,h as bt,i as wt,j as Nt,k as _t,u as jt,v as kt,w as At,x as Ot,y as Rt,z as St}from"./chunks/chunk-7EAGBLRV.js";import"./chunks/chunk-ZBK3DZ3S.js";import"./chunks/chunk-DHETLULC.js";import"./chunks/chunk-NZVJ3DFC.js";import"./chunks/chunk-QI3MRJGU.js";import"./chunks/chunk-CDGOEK3T.js";import"./chunks/chunk-JCDO2FR4.js";import{a}from"./chunks/chunk-V4WSBIXB.js";import l from"fs/promises";import c from"path";import x from"os";var u=c.join(x.homedir(),".kodax","commands");function y(){return u}a(y,"getDefaultCommandDir");async function K(e){let n=new Map,o=e??u;try{await l.mkdir(o,{recursive:!0});let r=await l.readdir(o);for(let t of r){let m=c.extname(t),f=t.replace(m,"");if(m===".md"){try{let d=await l.readFile(c.join(o,t),"utf-8"),i=(d.split(`
|
|
3
3
|
`)[0]?.replace(/^#\s*/,"").trim()??"").slice(0,60)||"(prompt command)";n.set(f,{name:f,description:i,content:d,type:"prompt"})}catch{}continue}if(m===".js"||m===".ts")try{let g=await import(c.join(o,t));for(let[i,p]of Object.entries(g))if(i.startsWith("command_")&&typeof p=="function"){let s=i.replace("command_",""),C=p.description??s;n.set(s,{name:s,description:String(C).slice(0,60),content:`[Programmable command: ${s}]`,type:"programmable",execute:p})}}catch{}}}catch{}return n}a(K,"loadCommands");async function X(e,n,o,r){let t=o.get(e);return t?t.type==="prompt"?n?t.content.replace(/{args}/g,n):t.content:t.type==="programmable"&&t.execute?t.execute({args:n,runAgent:r}):null:null}a(X,"processCommandCall");function h(e){if(!e.startsWith("/"))return null;let n=e.slice(1).trim();if(!n)return null;let o=n.search(/\s/);if(o===-1)return[n];let r=n.slice(0,o),t=n.slice(o).trim();return t?[r,t]:[r]}a(h,"parseCommandCall");export{Xn as App,nn as AutocompleteContextProvider,Yt as BUILTIN_COMMANDS,Gn as BackgroundTaskBar,Jn as ChildActivitySurface,So as ConsoleCapturer,dt as DEFAULT_UI_STATE,$n as DialogSurface,pn as DotsIndicator,Qo as FileSessionStorage,Dn as FullscreenTranscriptLayout,gn as HistoryItemRenderer,sn as InputPrompt,u as KODAX_COMMANDS_DIR,Dt as KODAX_CONFIG_FILE,Xt as KODAX_DIR,ht as KODAX_SESSIONS_DIR,Nt as KODAX_VERSION,ft as KeyMatchers,ct as KeypressHandlerPriority,ot as KeypressParser,lt as KeypressProvider,L as LRUCache,fn as LoadingIndicator,io as MemorySessionStorage,Pn as MessageActions,Cn as MessageList,Mn as MessageSelector,zn as NotificationsSurface,gt as PERMISSION_MODES,Pt as PREVIEW_MAX_LENGTH,wo as PendingInputsIndicator,ln as ProgressIndicator,wn as PromptComposer,jn as PromptFooter,Nn as PromptFooterLeftSide,_n as PromptFooterRightSide,kn as PromptHelpMenu,Fn as PromptSuggestionsSurface,qn as QueuedCommandsSurface,hn as SimpleApp,cn as SimpleInputPrompt,xn as SimpleMessageDisplay,Kn as SimpleStatusBar,tt as SingleLineTextInput,dn as Spinner,En as StashNotice,yn as StatusBar,Bn as StatusNoticesSurface,Tn as StreamingProvider,mt as StreamingState,Wn as SuggestionsDisplay,st as TOOL_STATUS_ICONS,an as TextBuffer,Z as TextInput,un as ThinkingIndicator,Mo as ToolCallDisplay,it as ToolCallStatus,bo as ToolGroup,Po as ToolProgressBar,Do as ToolStatusBadge,bn as TranscriptViewport,Sn as UIStateProvider,eo as _resetQueuedPromptsCacheForTests,re as archiveSession,mo as bootstrapAutoMode,J as calculateVisualCursorFromLayout,H as calculateVisualLayout,zt as collectBashWriteTargets,xt as computeConfirmTools,Xo as createCliEvents,On as createHistoryItem,ro as createInteractiveContext,ho as createJsonEvents,to as createKeyMatcher,pt as createKeypressManager,so as createMemorySessionStorage,xo as createRecoveryHistoryItem,go as createRetryHistoryItem,ie as createSessionManager,Qn as createStreamingManager,Rn as createToolCall,Q as darkTheme,To as dedupeSessions,ee as deleteSession,Ro as detectTerminalCapabilities,j as detectTerminalHostProfile,_ as detectTerminalRenderHost,yo as emitRecoveryHistoryItem,Co as emitRetryHistoryItem,tn as executeCommand,co as executeShellCommand,Jt as extractHistorySeedsFromMessage,Qt as extractHistorySeedsFromMessages,Tt as extractTextContent,Ut as extractTitle,Zo as forkSession,Vt as formatMessagePreview,An as generateId,Ft as generateSavePattern,Bt as getBashOutsideProjectWriteRisk,q as getCharAtCodePoint,W as getCodePointLength,$o as getCustomProviderConfig,y as getDefaultCommandDir,St as getGitRoot,at as getKeyDisplayName,Eo as getMcpServerConfig,Et as getPlanModeBlockReason,jt as getProviderList,_t as getProviderModel,S as getTerminalHostCapabilities,Ao as getTerminalWidth,V as getTheme,Y as getThemeNames,wt as getVersion,$ as getVisualWidth,G as getVisualWidthCached,P as hasCursorUpViewportYankRisk,b as hasMainScreenRenderScrollRisk,Mt as hydrateProcessEnvFromShell,$t as isAlwaysConfirmPath,It as isBashReadCommand,Lt as isBashWriteCommand,I as isClassicReplForced,et as isFunctionKey,v as isOwnedRendererPreferred,qt as isPathInsideProject,yt as isPermissionMode,rt as isPrintable,kt as isProviderConfigured,M as isRemoteConptyHost,Oo as isScreenReader,po as isShellCommand,lo as isShellCommandSuccess,w as isTmuxControlMode,Wt as isToolCallAllowed,D as isVsCodeTerminalHostEnv,F as isWideChar,Fo as listCustomProviders,Bo as listMcpServers,oe as listRunningSessions,Uo as listSessions,K as loadCommands,At as loadConfig,Yo as loadFullTranscript,Vo as loadSession,Hn as measureChildActivitySurfaceRows,T as minimalTheme,Kt as normalizePermissionMode,Zt as parseCommand,h as parseCommandCall,nt as parseKeypress,Ct as permissionModeDisplayName,Ot as prepareRuntimeConfig,X as processCommandCall,Wo as processSpecialSyntax,vt as rateLimitedCall,bt as registerConfiguredCustomProviders,zo as removeCustomProvider,Ho as removeMcpServer,N as resetTmuxControlModeProbeForTesting,k as resolveConfiguredTuiRendererMode,A as resolveEffectiveTuiRendererMode,R as resolveFullscreenPolicy,O as resolveInteractiveSurfacePreference,fo as restoreHistoryItemsFromSession,te as rewindSession,Ko as runInkInteractiveMode,Lo as runInteractiveMode,Rt as saveConfig,Gt as seedToHistoryItem,ne as setActiveEntry,z as splitByCodePoints,_o as supports256Colors,ko as supportsEmoji,No as supportsTrueColor,jo as supportsUnicode,U as themes,Ht as toolCallSeedToHistoryToolCall,ao as touchContext,uo as trimPersistedUiHistorySnapshot,B as truncateByVisualWidth,ae as unarchiveSession,qo as upsertCustomProvider,Go as upsertMcpServer,en as useAutocomplete,on as useAutocompleteContext,rn as useInputHistory,Zn as useKeypress,ut as useKeypressManager,oo as useQueuedPromptContents,no as useQueuedPrompts,Yn as useStreaming,Vn as useStreamingActions,Un as useStreamingState,mn as useTextBuffer,Ln as useUI,In as useUIActions,vn as useUIState,Jo as validateMcpServerConfig,E as visualWidthCache,me as watchSessions,vo as withCapture,Io as withCaptureSync};
|
package/dist/sdk-session.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { c as CreatableHistoryItem, e as DeleteSessionResult, F as FullTranscriptSessionData, r as HistorySeedSourceMessage, v as ListSessionsOptions, R as RestoreHistoryItemsFromSessionInput, y as RestoredHistorySeed, z as RunningSessionInfo, S as SessionManager, B as SessionSummary, E as SessionTranscriptEntry, G as SessionTranscriptEntryType, a3 as WatchSessionsCallback, a4 as archiveSession, a5 as createSessionManager, a6 as deleteSession, a7 as extractHistorySeedsFromMessage, a8 as extractHistorySeedsFromMessages, ab as forkSession, ad as listRunningSessions, ae as listSessions, af as loadFullTranscript, ag as loadSession, ah as restoreHistoryItemsFromSession, ai as rewindSession, ak as setActiveEntry, an as unarchiveSession, ao as watchSessions } from './types-chunks/sdk-session-
|
|
2
|
-
export { ac as KodaXSessionUiHistoryItem, ad as KodaXSessionUiHistoryItemType, ae as KodaXSessionUiTextHistoryItem, af as KodaXSessionUiTextHistoryItemType, ag as KodaXSessionUiToolCall, ah as KodaXSessionUiToolCallStatus, ai as KodaXSessionUiToolGroupHistoryItem } from './types-chunks/process.d-
|
|
3
|
-
import './types-chunks/storage.d-
|
|
4
|
-
import './types-chunks/bash-prefix-extractor.d-
|
|
5
|
-
import './types-chunks/
|
|
1
|
+
export { c as CreatableHistoryItem, e as DeleteSessionResult, F as FullTranscriptSessionData, r as HistorySeedSourceMessage, v as ListSessionsOptions, R as RestoreHistoryItemsFromSessionInput, y as RestoredHistorySeed, z as RunningSessionInfo, S as SessionManager, B as SessionSummary, E as SessionTranscriptEntry, G as SessionTranscriptEntryType, a3 as WatchSessionsCallback, a4 as archiveSession, a5 as createSessionManager, a6 as deleteSession, a7 as extractHistorySeedsFromMessage, a8 as extractHistorySeedsFromMessages, ab as forkSession, ad as listRunningSessions, ae as listSessions, af as loadFullTranscript, ag as loadSession, ah as restoreHistoryItemsFromSession, ai as rewindSession, ak as setActiveEntry, an as unarchiveSession, ao as watchSessions } from './types-chunks/sdk-session-BP6ZNpOp.js';
|
|
2
|
+
export { ac as KodaXSessionUiHistoryItem, ad as KodaXSessionUiHistoryItemType, ae as KodaXSessionUiTextHistoryItem, af as KodaXSessionUiTextHistoryItemType, ag as KodaXSessionUiToolCall, ah as KodaXSessionUiToolCallStatus, ai as KodaXSessionUiToolGroupHistoryItem } from './types-chunks/process.d-BdiIUr8T.js';
|
|
3
|
+
import './types-chunks/storage.d-CkydxFsV.js';
|
|
4
|
+
import './types-chunks/bash-prefix-extractor.d-DZF1gDDz.js';
|
|
5
|
+
import './types-chunks/types.d-BJmoMf5H.js';
|
|
6
6
|
import 'vscode-languageserver-protocol';
|
|
7
7
|
import './types-chunks/capability.d-3C62G8Eq.js';
|
|
8
|
+
import './types-chunks/base.d-CwPfI8WQ.js';
|
|
8
9
|
import './types-chunks/cost-tracker.d-wRtyEW9d.js';
|
package/dist/sdk-session.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$a as o,Jb as i,Kb as t,Lb as r,Mb as n,Nb as a,Ob as S,Pb as l,Qb as y,Rb as d,Sb as m,Tb as p,Ub as c}from"./chunks/chunk-
|
|
2
|
+
import{$a as o,Jb as i,Kb as t,Lb as r,Mb as n,Nb as a,Ob as S,Pb as l,Qb as y,Rb as d,Sb as m,Tb as p,Ub as c}from"./chunks/chunk-4OHXHC2S.js";import"./chunks/chunk-XXQ3RLA2.js";import{K as s,L as e}from"./chunks/chunk-5YJIAP6C.js";import"./chunks/chunk-7EAGBLRV.js";import"./chunks/chunk-ZBK3DZ3S.js";import"./chunks/chunk-DHETLULC.js";import"./chunks/chunk-NZVJ3DFC.js";import"./chunks/chunk-QI3MRJGU.js";import"./chunks/chunk-CDGOEK3T.js";import"./chunks/chunk-JCDO2FR4.js";import"./chunks/chunk-V4WSBIXB.js";export{d as archiveSession,c as createSessionManager,y as deleteSession,s as extractHistorySeedsFromMessage,e as extractHistorySeedsFromMessages,n as forkSession,l as listRunningSessions,i as listSessions,r as loadFullTranscript,t as loadSession,o as restoreHistoryItemsFromSession,a as rewindSession,S as setActiveEntry,m as unarchiveSession,p as watchSessions};
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { s as KodaXProviderConfig, n as KodaXMessage, Y as KodaXToolDefinition, G as KodaXReasoningRequest, A as KodaXProviderStreamOptions, L as KodaXStreamResult, a2 as KodaXVerifyCredentialResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, D as KodaXReasoningCapability, F as KodaXReasoningOverride } from './types.d-BJmoMf5H.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Retry-After header parsing — FEATURE_130 (v0.7.36).
|
|
5
|
+
*
|
|
6
|
+
* Handles the four forms KodaX's 12 provider adapters encounter when a
|
|
7
|
+
* model returns 429 (rate limit) or 503/529 (overloaded):
|
|
8
|
+
*
|
|
9
|
+
* 1. `Retry-After: 120` — integer seconds (HTTP 7231 standard)
|
|
10
|
+
* 2. `Retry-After: <HTTP-date>` — RFC 7231 IMF-fixdate
|
|
11
|
+
* e.g. "Wed, 21 Oct 2026 07:28:00 GMT"
|
|
12
|
+
* 3. `retry-after-ms: 45000` — Anthropic millisecond extension
|
|
13
|
+
* 4. (no Retry-After header present) — falls back to exponential backoff
|
|
14
|
+
* capped at `maxBackoffMs`, with optional jitter for the
|
|
15
|
+
* "thundering herd" protection.
|
|
16
|
+
*
|
|
17
|
+
* All return values are normalized to whole milliseconds and clamped to
|
|
18
|
+
* a sensible upper bound — never block the user for more than 120s, and
|
|
19
|
+
* never honor a header advertising a wait longer than `maxHeaderWaitMs`
|
|
20
|
+
* (default 120s). Beyond that limit we still extract the header but cap
|
|
21
|
+
* it; the calling provider can check `cappedFromHeader` to decide
|
|
22
|
+
* whether to surface a "rate limit exceeded — please wait" error to the
|
|
23
|
+
* user instead of silently sleeping for two minutes.
|
|
24
|
+
*
|
|
25
|
+
* Pattern-B (FEATURE_119) interaction: the helper is referentially
|
|
26
|
+
* transparent and stateless — it can be invoked concurrently by N
|
|
27
|
+
* parallel children without coordination. The retry loop in each
|
|
28
|
+
* provider holds its own attempt counter; this helper only translates
|
|
29
|
+
* headers/attempts into wait durations.
|
|
30
|
+
*
|
|
31
|
+
* Reference: opencode session/retry.ts:14-123 (4-form coverage).
|
|
32
|
+
*/
|
|
33
|
+
type RetryAfterSource = 'retry-after-seconds' | 'retry-after-date' | 'retry-after-ms' | 'exponential-backoff';
|
|
34
|
+
type RetryAfterResult = {
|
|
35
|
+
readonly type: 'header';
|
|
36
|
+
readonly waitMs: number;
|
|
37
|
+
readonly source: 'retry-after-seconds' | 'retry-after-date' | 'retry-after-ms';
|
|
38
|
+
/** True when the header value exceeded `maxHeaderWaitMs` and was clamped. */
|
|
39
|
+
readonly cappedFromHeader: boolean;
|
|
40
|
+
} | {
|
|
41
|
+
readonly type: 'backoff';
|
|
42
|
+
readonly waitMs: number;
|
|
43
|
+
readonly source: 'exponential-backoff';
|
|
44
|
+
readonly attempt: number;
|
|
45
|
+
};
|
|
46
|
+
interface ParseRetryAfterOptions {
|
|
47
|
+
/** Zero-based attempt index used by the backoff branch (0 = first retry). */
|
|
48
|
+
readonly attempt: number;
|
|
49
|
+
/** Base delay for exponential backoff. Default 1000ms. */
|
|
50
|
+
readonly baseBackoffMs?: number;
|
|
51
|
+
/** Maximum exponential backoff cap. Default 30000ms. */
|
|
52
|
+
readonly maxBackoffMs?: number;
|
|
53
|
+
/** Maximum wait honored from a header. Default 120000ms. */
|
|
54
|
+
readonly maxHeaderWaitMs?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Override the "now" reference used by the HTTP-date branch.
|
|
57
|
+
* Test-only escape hatch — production code should leave this undefined.
|
|
58
|
+
*/
|
|
59
|
+
readonly now?: () => number;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the backoff branch adds 0-25% jitter on top of the base
|
|
62
|
+
* exponential. Default true (matches the legacy `withRateLimit`
|
|
63
|
+
* jitter contract). Tests can pass `false` for deterministic output.
|
|
64
|
+
*/
|
|
65
|
+
readonly withJitter?: boolean;
|
|
66
|
+
}
|
|
67
|
+
type HeadersLike = Headers | Record<string, string | string[] | undefined> | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Parse rate-limit/overload retry-after headers (4 forms) and decide
|
|
70
|
+
* how long the caller should sleep before retrying. Returns either:
|
|
71
|
+
*
|
|
72
|
+
* - `{type: 'header', ...}` when one of the supported headers was found
|
|
73
|
+
* and converted into a wait duration; OR
|
|
74
|
+
* - `{type: 'backoff', ...}` falling back to exponential backoff for
|
|
75
|
+
* the given `attempt` index when no header is present.
|
|
76
|
+
*/
|
|
77
|
+
declare function parseRetryAfter(headers: HeadersLike, options: ParseRetryAfterOptions): RetryAfterResult;
|
|
78
|
+
/**
|
|
79
|
+
* Pull headers off a thrown error in the various shapes produced across
|
|
80
|
+
* provider SDKs (Anthropic, OpenAI, fetch-based custom providers).
|
|
81
|
+
* Returns `undefined` when no headers can be located — the helper then
|
|
82
|
+
* falls through to exponential backoff.
|
|
83
|
+
*/
|
|
84
|
+
declare function extractHeadersFromError(error: unknown): HeadersLike;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* KodaX Base Provider
|
|
88
|
+
*
|
|
89
|
+
* Provider 抽象基类 - 所有 Provider 的公共基础
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* FEATURE_130 (v0.7.36): structured payload fired through
|
|
94
|
+
* `KodaXEvents.onRetryAfter` whenever a provider's `withRateLimit`
|
|
95
|
+
* loop catches a 429 / 503 / 529 response and decides to wait. The
|
|
96
|
+
* `source` field carries which retry-after header form (or fallback)
|
|
97
|
+
* produced the wait duration so UI surfaces can show "provider asked
|
|
98
|
+
* us to wait 45s" vs "no header, exp-backoff guess of 4s".
|
|
99
|
+
*/
|
|
100
|
+
interface KodaXRetryAfterEvent {
|
|
101
|
+
readonly provider: string;
|
|
102
|
+
readonly waitMs: number;
|
|
103
|
+
readonly reason: 'rate-limit' | 'overloaded';
|
|
104
|
+
readonly source: RetryAfterSource;
|
|
105
|
+
readonly attempt: number;
|
|
106
|
+
readonly maxAttempts: number;
|
|
107
|
+
}
|
|
108
|
+
type KodaXOnRetryAfterCallback = (event: KodaXRetryAfterEvent) => void;
|
|
109
|
+
declare abstract class KodaXBaseProvider {
|
|
110
|
+
abstract readonly name: string;
|
|
111
|
+
abstract readonly supportsThinking: boolean;
|
|
112
|
+
protected abstract readonly config: KodaXProviderConfig;
|
|
113
|
+
/**
|
|
114
|
+
* Per-request override for `max_tokens` in the next provider call. Consumed
|
|
115
|
+
* once and cleared in `withRateLimit` after the next successful response.
|
|
116
|
+
* Two callers set this:
|
|
117
|
+
* 1. Context-overflow recovery inside `withRateLimit` (reduces budget
|
|
118
|
+
* when the model reports "prompt too long").
|
|
119
|
+
* 2. The agent loop's max_tokens escalation path, which flips this to
|
|
120
|
+
* `KODAX_ESCALATED_MAX_OUTPUT_TOKENS` when a capped-budget turn
|
|
121
|
+
* returns `stop_reason: max_tokens`. See `coding/src/agent.ts`.
|
|
122
|
+
*/
|
|
123
|
+
protected maxOutputTokensOverride?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Public setter for the one-shot override above. Callers outside the
|
|
126
|
+
* provider package (notably the agent loop's escalation branch) use this
|
|
127
|
+
* to stage a larger budget for the next stream call in the same logical
|
|
128
|
+
* turn. Pass `undefined` to clear a stale override explicitly.
|
|
129
|
+
*/
|
|
130
|
+
setMaxOutputTokensOverride(value: number | undefined): void;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the max_tokens value the provider will currently use on its
|
|
133
|
+
* next request. Precedence (highest to lowest):
|
|
134
|
+
* 1. One-shot override (agent escalation, context-overflow recovery)
|
|
135
|
+
* 2. User env var `KODAX_MAX_OUTPUT_TOKENS` (explicit user intent)
|
|
136
|
+
* 3. Active model descriptor's `maxOutputTokens` (FEATURE_098)
|
|
137
|
+
* 4. Provider config default
|
|
138
|
+
* 5. Global `KODAX_MAX_TOKENS` fallback
|
|
139
|
+
* Used by provider stream() paths and by the agent loop to decide
|
|
140
|
+
* whether escalation is applicable (see `coding/src/agent.ts`).
|
|
141
|
+
*/
|
|
142
|
+
getEffectiveMaxOutputTokens(model?: string): number;
|
|
143
|
+
/**
|
|
144
|
+
* Hard cap on a single streaming request's wall-clock duration (ms).
|
|
145
|
+
* Returns undefined when no cap is configured. Consumed by the
|
|
146
|
+
* resilience layer to abort a doomed stream before the server-side
|
|
147
|
+
* kill window fires; routed through `non_streaming_fallback`.
|
|
148
|
+
*
|
|
149
|
+
* Cascade (highest to lowest):
|
|
150
|
+
* 1. Active model descriptor's `streamMaxDurationMs`
|
|
151
|
+
* 2. Provider config default
|
|
152
|
+
* 3. undefined (watchdog disabled)
|
|
153
|
+
*/
|
|
154
|
+
getStreamMaxDurationMs(model?: string): number | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Resolves whether OpenAI-compat `reasoning_content` should echo back
|
|
157
|
+
* on replayed assistant messages for the given model. Same cascade as
|
|
158
|
+
* `getStreamMaxDurationMs`. Defaults to false when neither layer sets it.
|
|
159
|
+
*/
|
|
160
|
+
getEffectiveReplayReasoningContent(model?: string): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Resolves whether Anthropic-style thinking signatures must verify
|
|
163
|
+
* strictly (Anthropic proper only). Same cascade as
|
|
164
|
+
* `getStreamMaxDurationMs`. Defaults to false (lenient) when neither
|
|
165
|
+
* layer sets it — matches third-party Anthropic-compat behavior.
|
|
166
|
+
*/
|
|
167
|
+
getEffectiveStrictThinkingSignature(model?: string): boolean;
|
|
168
|
+
abstract stream(messages: KodaXMessage[], tools: KodaXToolDefinition[], system: string, reasoning?: boolean | KodaXReasoningRequest, streamOptions?: KodaXProviderStreamOptions, signal?: AbortSignal): Promise<KodaXStreamResult>;
|
|
169
|
+
supportsNonStreamingFallback(): boolean;
|
|
170
|
+
complete(_messages: KodaXMessage[], _tools: KodaXToolDefinition[], _system: string, _reasoning?: boolean | KodaXReasoningRequest, _streamOptions?: KodaXProviderStreamOptions, _signal?: AbortSignal): Promise<KodaXStreamResult>;
|
|
171
|
+
isConfigured(): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* FEATURE_216 v0.7.45 — Lightweight credential verification. Returns
|
|
174
|
+
* a never-throws envelope with `ok` + categorized `error`. Concrete
|
|
175
|
+
* compat base classes (`KodaXAnthropicCompatProvider`,
|
|
176
|
+
* `KodaXOpenAICompatProvider`) override this to dispatch by the
|
|
177
|
+
* `verifyStrategy` field. The default here returns `unsupported` so
|
|
178
|
+
* Provider classes that don't extend a compat base — or future ones
|
|
179
|
+
* yet to be wired — fail safely instead of throwing.
|
|
180
|
+
*
|
|
181
|
+
* Distinct from `isConfigured()`: that one is env-only (no network);
|
|
182
|
+
* this one hits the wire (zero or ~7 tokens depending on strategy)
|
|
183
|
+
* and verifies the key is actually accepted by the upstream.
|
|
184
|
+
*/
|
|
185
|
+
verifyCredential(_opts?: {
|
|
186
|
+
timeoutMs?: number;
|
|
187
|
+
signal?: AbortSignal;
|
|
188
|
+
}): Promise<KodaXVerifyCredentialResult>;
|
|
189
|
+
getModel(): string;
|
|
190
|
+
getAvailableModels(): string[];
|
|
191
|
+
getModelDescriptor(modelId?: string): KodaXModelDescriptor | undefined;
|
|
192
|
+
getBaseUrl(): string | undefined;
|
|
193
|
+
getApiKeyEnv(): string;
|
|
194
|
+
getCapabilityProfile(): KodaXProviderCapabilityProfile;
|
|
195
|
+
getConfiguredReasoningCapability(modelOverride?: string): KodaXReasoningCapability;
|
|
196
|
+
getReasoningCapability(modelOverride?: string): KodaXReasoningCapability;
|
|
197
|
+
getReasoningOverride(modelOverride?: string): KodaXReasoningOverride | undefined;
|
|
198
|
+
getReasoningOverrideKey(modelOverride?: string): string;
|
|
199
|
+
protected persistReasoningCapabilityOverride(capability: KodaXReasoningCapability, modelOverride?: string): void;
|
|
200
|
+
protected shouldFallbackForReasoningError(error: unknown, ...terms: string[]): boolean;
|
|
201
|
+
protected shouldFallbackForSpecificReasoningError(error: unknown, ...terms: string[]): boolean;
|
|
202
|
+
protected shouldFallbackForForcedToolChoiceError(error: unknown): boolean;
|
|
203
|
+
protected isServerError(error: unknown): boolean;
|
|
204
|
+
protected getReasoningFallbackChain(capability: KodaXReasoningCapability): KodaXReasoningCapability[];
|
|
205
|
+
/**
|
|
206
|
+
* 获取模型的上下文窗口大小
|
|
207
|
+
*
|
|
208
|
+
* Backwards-compatible no-arg form: resolves against the provider's
|
|
209
|
+
* default model descriptor. New call sites that know the active
|
|
210
|
+
* model should use `getEffectiveContextWindow(model)` directly.
|
|
211
|
+
* @returns 上下文窗口大小 (tokens)
|
|
212
|
+
*/
|
|
213
|
+
getContextWindow(): number;
|
|
214
|
+
/**
|
|
215
|
+
* Resolves the context window for a specific model.
|
|
216
|
+
* Precedence (highest to lowest):
|
|
217
|
+
* 1. Active model descriptor's `contextWindow` (FEATURE_098)
|
|
218
|
+
* 2. Provider config default
|
|
219
|
+
* 3. 200_000 fallback
|
|
220
|
+
* The user-level `compaction.contextWindow` is layered on top of
|
|
221
|
+
* this at the call site, so it remains the highest-priority manual
|
|
222
|
+
* override.
|
|
223
|
+
*/
|
|
224
|
+
getEffectiveContextWindow(model?: string): number;
|
|
225
|
+
protected getApiKey(): string;
|
|
226
|
+
protected shouldLogStreamDiagnostics(): boolean;
|
|
227
|
+
protected logStreamDiagnostic(...args: unknown[]): void;
|
|
228
|
+
protected normalizeReasoning(reasoning?: boolean | KodaXReasoningRequest): Required<KodaXReasoningRequest>;
|
|
229
|
+
/**
|
|
230
|
+
* Called when ECONNRESET/EPIPE is detected, indicating a stale keep-alive
|
|
231
|
+
* socket. Subclasses should override to rebuild their HTTP client with a
|
|
232
|
+
* fresh connection pool so the next retry uses a new TCP connection.
|
|
233
|
+
*/
|
|
234
|
+
protected onStaleConnection(): void;
|
|
235
|
+
protected isRateLimitError(error: unknown): boolean;
|
|
236
|
+
/**
|
|
237
|
+
* FEATURE_130: classify a rate-limit error as either a 429-style
|
|
238
|
+
* "rate-limit" or a 503/529-style "overloaded" condition. The
|
|
239
|
+
* distinction matters for UI: "rate-limit" usually surfaces a
|
|
240
|
+
* provider-supplied retry-after window; "overloaded" tends to fall
|
|
241
|
+
* through to exponential backoff with no header. Both flow through
|
|
242
|
+
* the same retry path; this only labels the event.
|
|
243
|
+
*/
|
|
244
|
+
protected classifyRateLimitReason(error: unknown): 'rate-limit' | 'overloaded';
|
|
245
|
+
/**
|
|
246
|
+
* Extract Retry-After delay from error headers (429/529 responses).
|
|
247
|
+
* Returns milliseconds, or undefined when no usable header is present.
|
|
248
|
+
*
|
|
249
|
+
* FEATURE_130 (v0.7.36): now delegates to the shared `parseRetryAfter`
|
|
250
|
+
* helper so all 12 provider adapters get 4-form coverage without each
|
|
251
|
+
* adapter rolling its own parser. The 4 forms supported are:
|
|
252
|
+
* - `Retry-After: <integer-seconds>`
|
|
253
|
+
* - `Retry-After: <HTTP-date>`
|
|
254
|
+
* - `retry-after-ms: <milliseconds>` (Anthropic extension)
|
|
255
|
+
* - exponential-backoff fallback (returned via `withRateLimit`,
|
|
256
|
+
* not through this helper — it is `undefined` here when no
|
|
257
|
+
* header is present, which the caller then resolves to backoff)
|
|
258
|
+
*/
|
|
259
|
+
protected extractRetryAfterMs(error: unknown): number | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* Detect "prompt too long / context window exceeded" errors and compute
|
|
262
|
+
* a reduced max_tokens for retry. Returns undefined if not a context
|
|
263
|
+
* overflow error.
|
|
264
|
+
*/
|
|
265
|
+
protected parseContextOverflow(error: unknown): number | undefined;
|
|
266
|
+
protected isContextOverflowError(error: unknown): boolean;
|
|
267
|
+
protected withRateLimit<T>(fn: () => Promise<T>, signal?: AbortSignal, retries?: number, onRateLimit?: (attempt: number, maxRetries: number, delayMs: number) => void, onRetryAfter?: KodaXOnRetryAfterCallback): Promise<T>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { KodaXBaseProvider as K, extractHeadersFromError as e, parseRetryAfter as p };
|
|
271
|
+
export type { ParseRetryAfterOptions as P, RetryAfterResult as R, KodaXOnRetryAfterCallback as a, KodaXRetryAfterEvent as b, RetryAfterSource as c };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { U as KodaXGoalState, f as AgentMessage, b0 as StopHookFn, a4 as KodaXSessionLineage, W as KodaXJsonValue, P as KodaXExtensionSessionRecord, a9 as KodaXSessionScope, aa as KodaXSessionStorage, Q as KodaXExtensionSessionState, C as ChildTaskRegistry, bl as WorkflowEventCorrelation, s as CompactionUpdate, bx as WorkflowProcessEvent, m as AskUserQuestionOptions, k as AskUserMultiOptions, y as Guardrail, bo as WorkflowIsolation, Y as KodaXSessionArtifactLedgerEntry, aN as SessionErrorMetadata, v as DiscoveredInstance, b4 as TaskAbortRegistry } from './process.d-
|
|
2
|
-
import {
|
|
1
|
+
import { U as KodaXGoalState, f as AgentMessage, b0 as StopHookFn, a4 as KodaXSessionLineage, W as KodaXJsonValue, P as KodaXExtensionSessionRecord, a9 as KodaXSessionScope, aa as KodaXSessionStorage, Q as KodaXExtensionSessionState, C as ChildTaskRegistry, bl as WorkflowEventCorrelation, s as CompactionUpdate, bx as WorkflowProcessEvent, m as AskUserQuestionOptions, k as AskUserMultiOptions, y as Guardrail, bo as WorkflowIsolation, Y as KodaXSessionArtifactLedgerEntry, aN as SessionErrorMetadata, v as DiscoveredInstance, b4 as TaskAbortRegistry } from './process.d-BdiIUr8T.js';
|
|
2
|
+
import { X as KodaXTokenUsage, E as KodaXReasoningMode, n as KodaXMessage, k as KodaXHarnessProfile, S as KodaXTaskWorkIntent, I as KodaXReviewScale, O as KodaXTaskComplexity, a as KodaXAmaFanoutClass, Q as KodaXTaskRoutingDecision, R as KodaXTaskType, J as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-BJmoMf5H.js';
|
|
3
3
|
import { Diagnostic, Position, Location, Hover, DocumentSymbol, SymbolInformation } from 'vscode-languageserver-protocol';
|
|
4
4
|
import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
|
|
5
|
+
import { K as KodaXBaseProvider } from './base.d-CwPfI8WQ.js';
|
|
5
6
|
import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -2225,13 +2226,16 @@ interface KodaXTaskEvidenceArtifact {
|
|
|
2225
2226
|
path: string;
|
|
2226
2227
|
description?: string;
|
|
2227
2228
|
}
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2229
|
+
type KodaXImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
2230
|
+
type KodaXInputArtifactSource = 'user-inline' | 'clipboard' | 'drag-drop' | 'file-picker';
|
|
2231
|
+
interface KodaXImageInputArtifact {
|
|
2232
|
+
readonly kind: 'image';
|
|
2233
|
+
readonly path: string;
|
|
2234
|
+
readonly mediaType?: KodaXImageMediaType;
|
|
2235
|
+
readonly source?: KodaXInputArtifactSource;
|
|
2236
|
+
readonly description?: string;
|
|
2234
2237
|
}
|
|
2238
|
+
type KodaXInputArtifact = KodaXImageInputArtifact;
|
|
2235
2239
|
interface KodaXTaskEvidenceEntry {
|
|
2236
2240
|
assignmentId: string;
|
|
2237
2241
|
role: KodaXTaskRole;
|
|
@@ -2865,5 +2869,5 @@ interface CreateBashPrefixExtractorOptions {
|
|
|
2865
2869
|
*/
|
|
2866
2870
|
declare function createBashPrefixExtractor(opts: CreateBashPrefixExtractorOptions): BashPrefixExtractor;
|
|
2867
2871
|
|
|
2868
|
-
export { BASH_POLICY_SPEC as B,
|
|
2869
|
-
export type {
|
|
2872
|
+
export { BASH_POLICY_SPEC as B, getDefaultLspService as a$, buildGoalRuntimeBinding as aX, createBashPrefixExtractor as aY, decideWorkflowInvocation as aZ, extractCommandPrefix as a_, LSP_SERVERS as av, LspService as ax, makeDisabledGoalToolsContext as b0, shutdownDefaultLspService as b1, withGoalBeforeNextTurn as b2, withGoalStopHook as b3, workflowStartOutcomeConsumesTurn as b4 };
|
|
2873
|
+
export type { KodaXRepoIntelligenceTrace as $, KodaXFanoutSchedulerPlan as A, CapabilityRuntimeContract as C, DiagnosticsRequest as D, ExtensionRuntimeContract as E, FailureStage as F, GoalBlockedResult as G, KodaXImageInputArtifact as H, KodaXImageMediaType as I, KodaXInputArtifact as J, KodaXActivityEventMeta as K, KodaXInputArtifactSource as L, KodaXManagedBudgetSnapshot as M, KodaXManagedProtocolPayload as N, KodaXManagedTask as O, KodaXManagedTaskRuntimeState as P, KodaXManagedTaskStatusEvent as Q, KodaXManualTopicId as R, KodaXManualTopicInput as S, KodaXMemoryStrategy as T, KodaXOptions as U, KodaXOrchestrationVerdict as V, KodaXParentReductionContract as W, KodaXProviderPolicyHints as X, KodaXRepoIntelligenceCapability as Y, KodaXRepoIntelligenceMode as Z, KodaXRepoIntelligenceResolvedMode as _, BashPrefixExtractor as a, KodaXRepoIntelligenceTraceEvent as a0, KodaXRepoRoutingSignals as a1, KodaXResult as a2, KodaXRoleRoundSummary as a3, KodaXRuntimeVerificationContract as a4, KodaXSelfManualConfig as a5, KodaXSessionControl as a6, KodaXSessionMutators as a7, KodaXSessionOptions as a8, KodaXSidecarMessageEvent as a9, ProviderRecoveryEvent as aA, ProviderResilienceConfig as aB, ProviderResiliencePolicy as aC, RecoveryAction as aD, RecoveryDecision as aE, RecoveryLadderStep as aF, RecoveryResult as aG, ResilienceClassification as aH, ResilienceErrorClass as aI, ResolveKodaXManualInput as aJ, ResolveKodaXManualOptions as aK, ResolveKodaXManualResult as aL, RuntimeDefaultsSnapshot as aM, TodoItem as aN, TodoList as aO, TodoStatus as aP, WorkflowHostPolicy as aQ, WorkflowInvocationAction as aR, WorkflowInvocationPolicyDecision as aS, WorkflowInvocationPolicyInput as aT, WorkflowInvocationSource as aU, WorkflowInvocationTrigger as aV, WorkflowStartOutcome as aW, KodaXSkillInvocationContext as aa, KodaXSkillMap as ab, KodaXSkillProjectionConfidence as ac, KodaXTaskCapabilityHint as ad, KodaXTaskContract as ae, KodaXTaskEvidenceArtifact as af, KodaXTaskEvidenceBundle as ag, KodaXTaskEvidenceEntry as ah, KodaXTaskRole as ai, KodaXTaskRoleAssignment as aj, KodaXTaskStatus as ak, KodaXTaskSurface as al, KodaXTaskToolPolicy as am, KodaXTaskVerificationContract as an, KodaXTaskVerificationCriterion as ao, KodaXTaskWorkItem as ap, KodaXToolEventMeta as aq, KodaXToolExecutionContext as ar, KodaXVerificationScorecard as as, KodaXVerificationScorecardCriterion as at, KodaXWorkflowEventMeta as au, LspServerInfo as aw, LspServiceConfig as ay, ProviderExecutionState as az, BashPrefixResult as b, BoundExtensionRuntimeController as c, ChildSnapshotEvent as d, CreateBashPrefixExtractorOptions as e, ExtractCommandPrefixOptions as f, GoalCompleteResult as g, GoalCreateInput as h, GoalLifecycleContext as i, GoalRuntimeBinding as j, GoalRuntimeBindingDeps as k, GoalToolsContext as l, KodaXAgentMode as m, KodaXBudgetDisclosureZone as n, KodaXBudgetExtensionRequest as o, KodaXChildAgentResult as p, KodaXChildContextBundle as q, KodaXChildExecutionResult as r, KodaXCompactionOverride as s, KodaXContextOptions as t, KodaXContextTokenSnapshot as u, KodaXEvents as v, KodaXFanoutBranchLifecycle as w, KodaXFanoutBranchRecord as x, KodaXFanoutBranchTransition as y, KodaXFanoutSchedulerInput as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Q as QueueEventListener, e as QueuedMessage, E as EnqueueInput, D as DequeueFilter } from './types.d-
|
|
3
|
-
import { f as AgentMessage, aM as SessionEntry, aK as Session, aO as SessionExtension, a4 as KodaXSessionLineage, W as KodaXJsonValue, p as CompactionDetails, O as KodaXCompactMemorySeed, a0 as KodaXSessionEntry, ab as KodaXSessionTreeNode, a3 as KodaXSessionLabelEntry, a2 as KodaXSessionGoalEntry, a7 as KodaXSessionNavigationOptions, Y as KodaXSessionArtifactLedgerEntry, x as FileOperations, br as WorkflowMeta, bs as WorkflowModelHint, bt as WorkflowModule } from './process.d-
|
|
1
|
+
import { n as KodaXMessage } from './types.d-BJmoMf5H.js';
|
|
2
|
+
import { Q as QueueEventListener, e as QueuedMessage, E as EnqueueInput, D as DequeueFilter } from './types.d-BKuHSiR0.js';
|
|
3
|
+
import { f as AgentMessage, aM as SessionEntry, aK as Session, aO as SessionExtension, a4 as KodaXSessionLineage, W as KodaXJsonValue, p as CompactionDetails, O as KodaXCompactMemorySeed, a0 as KodaXSessionEntry, ab as KodaXSessionTreeNode, a3 as KodaXSessionLabelEntry, a2 as KodaXSessionGoalEntry, a7 as KodaXSessionNavigationOptions, Y as KodaXSessionArtifactLedgerEntry, x as FileOperations, br as WorkflowMeta, bs as WorkflowModelHint, bt as WorkflowModule } from './process.d-BdiIUr8T.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @kodax-ai/agent Constants
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-CJy1WENT.js';
|
|
2
|
-
import {
|
|
2
|
+
import { K as KodaXBaseProvider } from './base.d-CwPfI8WQ.js';
|
|
3
3
|
import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
|
|
4
|
-
import { aG as RunnerToolCall } from './process.d-
|
|
5
|
-
import { f as ToolGuardrail } from './types.d-
|
|
4
|
+
import { aG as RunnerToolCall } from './process.d-BdiIUr8T.js';
|
|
5
|
+
import { f as ToolGuardrail } from './types.d-BKuHSiR0.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* FEATURE_200 Phase F (v0.7.45) — MCP domain types extracted from types.ts.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as KodaXMessage, Y as KodaXToolDefinition, E as KodaXReasoningMode, _ as KodaXToolResultContentItem, U as KodaXThinkingBlock, H as KodaXRedactedThinkingBlock } from './types.d-BJmoMf5H.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @kodax-ai/agent Types
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as KodaXReasoningMode, V as KodaXThinkingBudgetMap, W as KodaXThinkingDepth, s as KodaXProviderConfig, D as KodaXReasoningCapability, G as KodaXReasoningRequest, R as KodaXTaskType, F as KodaXReasoningOverride, a2 as KodaXVerifyCredentialResult, Y as KodaXToolDefinition, n as KodaXMessage, A as KodaXProviderStreamOptions, L as KodaXStreamResult, o as KodaXModelDescriptor, r as KodaXProviderCapabilityProfile, a3 as KodaXVerifyStrategy, h as KodaXCustomProviderConfig, m as KodaXListModelsResult } from './types.d-BJmoMf5H.js';
|
|
2
2
|
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
+
import { K as KodaXBaseProvider } from './base.d-CwPfI8WQ.js';
|
|
3
4
|
import OpenAI from 'openai';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as PermissionMode, S as SessionData, F as FileSessionStorage } from './storage.d-
|
|
2
|
-
import {
|
|
3
|
-
import { m as KodaXAgentMode } from './bash-prefix-extractor.d-
|
|
4
|
-
import { ac as KodaXSessionUiHistoryItem, ag as KodaXSessionUiToolCall } from './process.d-
|
|
1
|
+
import { b as PermissionMode, S as SessionData, F as FileSessionStorage } from './storage.d-CkydxFsV.js';
|
|
2
|
+
import { E as KodaXReasoningMode, n as KodaXMessage, g as KodaXContentBlock } from './types.d-BJmoMf5H.js';
|
|
3
|
+
import { m as KodaXAgentMode } from './bash-prefix-extractor.d-DZF1gDDz.js';
|
|
4
|
+
import { ac as KodaXSessionUiHistoryItem, ag as KodaXSessionUiToolCall } from './process.d-BdiIUr8T.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* TextBuffer - Text buffer management class - 文本缓冲区管理类
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-
|
|
2
|
-
import { $ as KodaXSessionData, a4 as KodaXSessionLineage, a7 as KodaXSessionNavigationOptions, a8 as KodaXSessionRuntimeInfo, aa as KodaXSessionStorage } from './process.d-
|
|
1
|
+
import { a as BashPrefixExtractor } from './bash-prefix-extractor.d-DZF1gDDz.js';
|
|
2
|
+
import { $ as KodaXSessionData, a4 as KodaXSessionLineage, a7 as KodaXSessionNavigationOptions, a8 as KodaXSessionRuntimeInfo, aa as KodaXSessionStorage } from './process.d-BdiIUr8T.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Permission Types
|