@kodax-ai/kodax 0.7.43 → 0.7.44
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 +31 -0
- package/dist/chunks/{chunk-YMRZBS4G.js → chunk-35BDEEC5.js} +1 -1
- package/dist/chunks/{chunk-7G5PSL6C.js → chunk-4YPL2UVZ.js} +253 -235
- package/dist/chunks/chunk-DI2G3YWL.js +31 -0
- package/dist/chunks/chunk-HHQ7YTGM.js +425 -0
- package/dist/chunks/chunk-QHILHQBB.js +519 -0
- package/dist/chunks/{chunk-IYSK7LUK.js → chunk-RUDYNAK7.js} +1 -1
- package/dist/chunks/{compaction-config-3E57ABCT.js → compaction-config-NAPRF7XR.js} +1 -1
- package/dist/chunks/{construction-bootstrap-JR63KI5N.js → construction-bootstrap-PHTGBRNU.js} +1 -1
- package/dist/chunks/dist-CCYBJJZY.js +2 -0
- package/dist/chunks/{dist-XANXEVTU.js → dist-RHIHZAYX.js} +1 -1
- package/dist/chunks/{utils-HQ2QCKJA.js → utils-TV3UYCHQ.js} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +2 -2
- package/dist/kodax_cli.js +624 -589
- package/dist/provider-capabilities.json +167 -0
- package/dist/sdk-agent.d.ts +62 -7
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +367 -13
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.d.ts +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-repl.d.ts +6 -6
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-session.d.ts +2 -2
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-DMrGImMl.d.ts → bash-prefix-extractor.d-DdoSeghD.d.ts} +417 -5
- package/dist/types-chunks/file-tracker.d-DOfaoCbJ.d.ts +633 -0
- package/dist/types-chunks/{resolver.d-CA68_NeH.d.ts → resolver.d-B7ZnVuuf.d.ts} +16 -13
- package/dist/types-chunks/{storage.d-DPAEX7zS.d.ts → storage.d-DFD9ln5c.d.ts} +1 -1
- package/dist/types-chunks/{file-tracker.d-zaLZeNBK.d.ts → types.d-DM8zEJgF.d.ts} +1029 -535
- package/dist/types-chunks/{types.d-mM8vqvhT.d.ts → types.d-HBbWT-iA.d.ts} +41 -3
- package/dist/types-chunks/{utils.d-DkLZD_wa.d.ts → utils.d-C5fzCE9W.d.ts} +3 -3
- package/package.json +2 -2
- package/dist/chunks/chunk-K75O2CAE.js +0 -31
- package/dist/chunks/chunk-UG4262JI.js +0 -502
- package/dist/chunks/chunk-VHKAJDQD.js +0 -425
- package/dist/chunks/dist-KWHUKXEL.js +0 -2
- package/dist/types-chunks/types.d-CKJtjo-6.d.ts +0 -1127
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 Lt,$a as Wn,$b as Fo,A as Q,Aa as pn,Ab as lo,B as T,Ba as ln,Bb as uo,C as U,Ca as un,Cb as fo,D as V,Da as fn,Db as go,E as Y,Ea as gn,Eb as Co,F as Z,Fa as Cn,Fb as xo,G as tt,Ga as xn,Gb as yo,H as nt,Ha as yn,Hb as Ko,I as ot,Ia as Kn,Ib as Xo,J as et,Ja as Xn,Jb as ho,K as rt,Ka as hn,Kb as Do,L as at,La as Dn,Lb as Po,M as mt,Ma as Pn,Mb as Mo,N as it,Na as Mn,Nb as wo,O as st,Oa as wn,Ob as No,P as ct,Pa as Nn,Pb as _o,Q as dt,Qa as _n,Qb as bo,R as pt,Ra as bn,Rb as jo,S as lt,Sa as jn,Sb as ko,T as ut,Ta as kn,Tb as Ao,U as ft,Ua as An,Ub as Oo,V as gt,Va as On,Vb as Ro,W as Ct,Wa as Rn,Wb as So,X as xt,Xa as Sn,Xb as vo,Y as yt,Ya as vn,Yb as Io,Z as Kt,Za as In,Zb as Lo,_ as It,_a as Ln,_b as Wo,a as D,aa as Wt,ab as Fn,ac as $o,b as P,ba as Ft,bb as $n,bc as qo,c as M,ca as $t,cb as qn,cc as zo,d as w,da as qt,db as zn,dc as Bo,e as N,ea as zt,eb as Bn,ec as Eo,f as _,fa as Bt,fb as En,fc as Go,g as b,ga as Et,gb as Gn,gc as Ho,h as j,ha as Gt,hb as Hn,hc as Jo,i as k,ia as Ht,ib as Jn,ic as Qo,j as A,ja as Jt,jb as Qn,jc as To,k as O,ka as Qt,kb as Tn,l as R,la as Tt,lb as Un,m as S,ma as Ut,mb as Vn,n as v,na as Vt,nb as Yn,o as I,oa as Yt,ob as Zn,p as L,pa as Zt,pb as to,q as W,qa as tn,qb as no,r as F,ra as nn,rb as oo,s as $,sa as on,sb as eo,t as q,ta as en,tb as ro,u as z,ua as rn,ub as ao,v as B,va as an,vb as mo,w as E,wa as mn,wb as io,x as G,xa as sn,xb as so,y as H,ya as cn,yb as co,z as J,za as dn,zb as po}from"./chunks/chunk-
|
|
2
|
+
import{$ as Lt,$a as Wn,$b as Fo,A as Q,Aa as pn,Ab as lo,B as T,Ba as ln,Bb as uo,C as U,Ca as un,Cb as fo,D as V,Da as fn,Db as go,E as Y,Ea as gn,Eb as Co,F as Z,Fa as Cn,Fb as xo,G as tt,Ga as xn,Gb as yo,H as nt,Ha as yn,Hb as Ko,I as ot,Ia as Kn,Ib as Xo,J as et,Ja as Xn,Jb as ho,K as rt,Ka as hn,Kb as Do,L as at,La as Dn,Lb as Po,M as mt,Ma as Pn,Mb as Mo,N as it,Na as Mn,Nb as wo,O as st,Oa as wn,Ob as No,P as ct,Pa as Nn,Pb as _o,Q as dt,Qa as _n,Qb as bo,R as pt,Ra as bn,Rb as jo,S as lt,Sa as jn,Sb as ko,T as ut,Ta as kn,Tb as Ao,U as ft,Ua as An,Ub as Oo,V as gt,Va as On,Vb as Ro,W as Ct,Wa as Rn,Wb as So,X as xt,Xa as Sn,Xb as vo,Y as yt,Ya as vn,Yb as Io,Z as Kt,Za as In,Zb as Lo,_ as It,_a as Ln,_b as Wo,a as D,aa as Wt,ab as Fn,ac as $o,b as P,ba as Ft,bb as $n,bc as qo,c as M,ca as $t,cb as qn,cc as zo,d as w,da as qt,db as zn,dc as Bo,e as N,ea as zt,eb as Bn,ec as Eo,f as _,fa as Bt,fb as En,fc as Go,g as b,ga as Et,gb as Gn,gc as Ho,h as j,ha as Gt,hb as Hn,hc as Jo,i as k,ia as Ht,ib as Jn,ic as Qo,j as A,ja as Jt,jb as Qn,jc as To,k as O,ka as Qt,kb as Tn,l as R,la as Tt,lb as Un,m as S,ma as Ut,mb as Vn,n as v,na as Vt,nb as Yn,o as I,oa as Yt,ob as Zn,p as L,pa as Zt,pb as to,q as W,qa as tn,qb as no,r as F,ra as nn,rb as oo,s as $,sa as on,sb as eo,t as q,ta as en,tb as ro,u as z,ua as rn,ub as ao,v as B,va as an,vb as mo,w as E,wa as mn,wb as io,x as G,xa as sn,xb as so,y as H,ya as cn,yb as co,z as J,za as dn,zb as po}from"./chunks/chunk-QHILHQBB.js";import{D as vt,b as Xt,c as ht,d as Dt,e as Pt,f as Mt,h as wt,i as Nt,j as _t,k as bt,u as jt,v as kt,w as At,x as Ot,y as Rt,z as St}from"./chunks/chunk-35BDEEC5.js";import"./chunks/chunk-RUDYNAK7.js";import"./chunks/chunk-EVIDQWMF.js";import"./chunks/chunk-4YPL2UVZ.js";import"./chunks/chunk-DI2G3YWL.js";import"./chunks/chunk-HHQ7YTGM.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).split(/\s+/,2);if(n.length===0)return null;let[o,r]=n;return o?[o,r]:null}a(h,"parseCommandCall");export{Cn as App,Vt as AutocompleteContextProvider,Qt as BUILTIN_COMMANDS,qn as BackgroundTaskBar,No as ConsoleCapturer,dt as DEFAULT_UI_STATE,In as DialogSurface,mn as DotsIndicator,$o as FileSessionStorage,yn as FullscreenTranscriptLayout,pn as HistoryItemRenderer,en as InputPrompt,u as KODAX_COMMANDS_DIR,Dt as KODAX_CONFIG_FILE,Xt as KODAX_DIR,ht as KODAX_SESSIONS_DIR,_t as KODAX_VERSION,ft as KeyMatchers,ct as KeypressHandlerPriority,ot as KeypressParser,lt as KeypressProvider,L as LRUCache,dn as LoadingIndicator,no as MemorySessionStorage,Kn as MessageActions,ln as MessageList,Xn as MessageSelector,Wn as NotificationsSurface,gt as PERMISSION_MODES,Pt as PREVIEW_MAX_LENGTH,yo as PendingInputsIndicator,sn as ProgressIndicator,Dn as PromptComposer,wn as PromptFooter,Pn as PromptFooterLeftSide,Mn as PromptFooterRightSide,Nn as PromptHelpMenu,vn as PromptSuggestionsSurface,Ln as QueuedCommandsSurface,xn as SimpleApp,rn as SimpleInputPrompt,un as SimpleMessageDisplay,gn as SimpleStatusBar,tt as SingleLineTextInput,an as Spinner,$n as StashNotice,fn as StatusBar,Fn as StatusNoticesSurface,Bn as StreamingProvider,mt as StreamingState,Sn as SuggestionsDisplay,st as TOOL_STATUS_ICONS,nn as TextBuffer,Z as TextInput,cn as ThinkingIndicator,Co as ToolCallDisplay,it as ToolCallStatus,xo as ToolGroup,go as ToolProgressBar,fo as ToolStatusBadge,hn as TranscriptViewport,kn as UIStateProvider,Vn as _resetQueuedPromptsCacheForTests,to as bootstrapAutoMode,J as calculateVisualCursorFromLayout,H as calculateVisualLayout,zt as collectBashWriteTargets,xt as computeConfirmTools,lo as createCliEvents,bn as createHistoryItem,Yn as createInteractiveContext,uo as createJsonEvents,Qn as createKeyMatcher,pt as createKeypressManager,oo as createMemorySessionStorage,so as createRecoveryHistoryItem,mo as createRetryHistoryItem,To as createSessionManager,zn as createStreamingManager,jn as createToolCall,Q as darkTheme,Jo as deleteSession,wo as detectTerminalCapabilities,j as detectTerminalHostProfile,b as detectTerminalRenderHost,co as emitRecoveryHistoryItem,io as emitRetryHistoryItem,Ut as executeCommand,eo as executeShellCommand,Gt as extractTextContent,Ht as extractTitle,Bo as forkSession,Jt as formatMessagePreview,_n as generateId,Ft as generateSavePattern,Bt as getBashOutsideProjectWriteRisk,q as getCharAtCodePoint,W as getCodePointLength,Oo as getCustomProviderConfig,y as getDefaultCommandDir,St as getGitRoot,at as getKeyDisplayName,Io as getMcpServerConfig,Et as getPlanModeBlockReason,jt as getProviderList,bt as getProviderModel,S as getTerminalHostCapabilities,Po as getTerminalWidth,V as getTheme,Y as getThemeNames,Nt as getVersion,$ as getVisualWidth,G as getVisualWidthCached,P as hasCursorUpViewportYankRisk,w 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,Mo as isScreenReader,ro as isShellCommand,ao as isShellCommandSuccess,N as isTmuxControlMode,Wt as isToolCallAllowed,D as isVsCodeTerminalHostEnv,F as isWideChar,Ao as listCustomProviders,vo as listMcpServers,Ho as listRunningSessions,qo as listSessions,K as loadCommands,At as loadConfig,zo as loadSession,T as minimalTheme,Kt as normalizePermissionMode,Tt as parseCommand,h as parseCommandCall,nt as parseKeypress,Ct as permissionModeDisplayName,Ot as prepareRuntimeConfig,X as processCommandCall,ko as processSpecialSyntax,vt as rateLimitedCall,wt as registerConfiguredCustomProviders,So as removeCustomProvider,Wo as removeMcpServer,_ as resetTmuxControlModeProbeForTesting,k as resolveConfiguredTuiRendererMode,A as resolveEffectiveTuiRendererMode,R as resolveFullscreenPolicy,O as resolveInteractiveSurfacePreference,Eo as rewindSession,po as runInkInteractiveMode,jo as runInteractiveMode,Rt as saveConfig,Go as setActiveEntry,z as splitByCodePoints,Xo as supports256Colors,Do as supportsEmoji,Ko as supportsTrueColor,ho as supportsUnicode,U as themes,Zn as touchContext,B as truncateByVisualWidth,Ro as upsertCustomProvider,Lo as upsertMcpServer,Zt as useAutocomplete,Yt as useAutocompleteContext,tn as useInputHistory,Jn as useKeypress,ut as useKeypressManager,Un as useQueuedPromptContents,Tn as useQueuedPrompts,Hn as useStreaming,Gn as useStreamingActions,En as useStreamingState,on as useTextBuffer,Rn as useUI,On as useUIActions,An as useUIState,Fo as validateMcpServerConfig,E as visualWidthCache,Qo as watchSessions,_o as withCapture,bo as withCaptureSync};
|
package/dist/sdk-session.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SessionData, F as FileSessionStorage } from './types-chunks/storage.d-
|
|
2
|
-
import './types-chunks/types.d-
|
|
1
|
+
import { S as SessionData, F as FileSessionStorage } from './types-chunks/storage.d-DFD9ln5c.js';
|
|
2
|
+
import './types-chunks/types.d-HBbWT-iA.js';
|
|
3
3
|
import './types-chunks/types.d-B1uGoVTE.js';
|
|
4
4
|
|
|
5
5
|
/**
|
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{bc as s,cc as e,dc as n,ec as i,fc as o,gc as t,hc as S,ic as a,jc as r}from"./chunks/chunk-
|
|
2
|
+
import{bc as s,cc as e,dc as n,ec as i,fc as o,gc as t,hc as S,ic as a,jc as r}from"./chunks/chunk-QHILHQBB.js";import"./chunks/chunk-35BDEEC5.js";import"./chunks/chunk-RUDYNAK7.js";import"./chunks/chunk-EVIDQWMF.js";import"./chunks/chunk-4YPL2UVZ.js";import"./chunks/chunk-DI2G3YWL.js";import"./chunks/chunk-HHQ7YTGM.js";import"./chunks/chunk-V4WSBIXB.js";export{r as createSessionManager,S as deleteSession,n as forkSession,t as listRunningSessions,s as listSessions,e as loadSession,i as rewindSession,o as setActiveEntry,a as watchSessions};
|
package/dist/sdk-skills.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{Ab as o,Eb as k,Fb as r,Gb as S,Hb as s,Ib as n,Jb as g,Kb as u,Lb as c,Mb as x,Nb as d,Ob as P,Pb as R,Qb as h,Rb as p,Sb as v,Tb as y,Ub as M,Vb as f,Wb as m,Xb as E,vb as l,wb as e,xb as i,yb as t,zb as a}from"./chunks/chunk-
|
|
2
|
+
import{Ab as o,Eb as k,Fb as r,Gb as S,Hb as s,Ib as n,Jb as g,Kb as u,Lb as c,Mb as x,Nb as d,Ob as P,Pb as R,Qb as h,Rb as p,Sb as v,Tb as y,Ub as M,Vb as f,Wb as m,Xb as E,vb as l,wb as e,xb as i,yb as t,zb as a}from"./chunks/chunk-HHQ7YTGM.js";import"./chunks/chunk-V4WSBIXB.js";export{y as SkillExecutor,R as SkillRegistry,x as VariableResolver,t as clearPluginSkillPaths,M as createExecutor,d as createResolver,n as discoverSkills,u as discoverSkillsWithMonorepo,f as executeSkill,m as expandSkillForLLM,E as formatSkillActivationMessage,a as getDefaultSkillPaths,g as getNestedSkillPaths,o as getSkillPathsFlat,h as getSkillRegistry,p as initializeSkillRegistry,i as listPluginSkillPaths,S as loadFullSkill,s as loadSkillFileContent,r as loadSkillMetadata,c as parseArguments,k as parseSkillMarkdown,l as registerPluginSkillPath,v as resetSkillRegistry,P as resolveSkillContent,e as unregisterPluginSkillPath};
|
|
@@ -1,11 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { g as KodaXGoalState, s as KodaXSessionLineage, x as KodaXSessionScope, y as KodaXSessionStorage, i as KodaXJsonValue, k as KodaXSessionArtifactLedgerEntry, S as SessionErrorMetadata } from './types.d-HBbWT-iA.js';
|
|
2
|
+
import { W as KodaXTokenUsage, m as KodaXMessage, D as KodaXReasoningMode, k as KodaXHarnessProfile, R as KodaXTaskWorkIntent, H as KodaXReviewScale, N as KodaXTaskComplexity, a as KodaXAmaFanoutClass, P as KodaXTaskRoutingDecision, Q as KodaXTaskType, I as KodaXRiskLevel, i as KodaXExecutionMode, c as KodaXAmaProfile, d as KodaXAmaTactic, b as KodaXAmaFanoutPolicy } from './types.d-B1uGoVTE.js';
|
|
3
|
+
import { f as AgentMessage, av as StopHookFn, C as ChildTaskRegistry, p as CompactionUpdate, v as Guardrail, s as DiscoveredInstance, az as TaskAbortRegistry, aa as RunnerToolCall, aE as ToolGuardrail } from './types.d-DM8zEJgF.js';
|
|
4
4
|
import { M as McpConnectMode, a as McpServerConfig, b as McpServersConfig, c as McpTransportKind } from './config.d-BfJUXxC0.js';
|
|
5
5
|
import { C as CapabilityKind, b as CapabilityResult } from './capability.d-3C62G8Eq.js';
|
|
6
6
|
import { K as KodaXBaseProvider } from './base.d-FUJahC0i.js';
|
|
7
7
|
import { a as CostTracker } from './cost-tracker.d-wRtyEW9d.js';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* FEATURE_192 v0.7.44 Phase C — Goal-tools execution context.
|
|
11
|
+
*
|
|
12
|
+
* The 3 goal tools (`get_goal`, `create_goal`, `update_goal`) read +
|
|
13
|
+
* mutate persistent goal state. The coding layer does NOT own that
|
|
14
|
+
* state — it lives in the REPL-side session lineage. Tools call into
|
|
15
|
+
* this interface, which the runner-driven adapter wires at task start.
|
|
16
|
+
*
|
|
17
|
+
* Why an interface (not direct lineage access from the tool):
|
|
18
|
+
* 1. Lineage mutations need to round-trip through session storage
|
|
19
|
+
* (persistence + UI events); the tool shouldn't know that pipe.
|
|
20
|
+
* 2. The Sidecar Verifier call for `update_goal({complete})` needs
|
|
21
|
+
* runtime provider + transcript snapshot — wired at the boundary
|
|
22
|
+
* where verifier-provider-resolver runs, not inside the tool.
|
|
23
|
+
* 3. The 3-turn blocker rule has process-lifetime state that lives
|
|
24
|
+
* with the goal runtime, not with the tool registration.
|
|
25
|
+
*
|
|
26
|
+
* All three methods are async — both reads (because they may touch
|
|
27
|
+
* the session storage) and writes (because they persist).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
interface GoalCompleteResult {
|
|
31
|
+
readonly ok: boolean;
|
|
32
|
+
/** Present iff `!ok` — explains why complete was rejected. */
|
|
33
|
+
readonly reason?: string;
|
|
34
|
+
/** Optional one-line how-to-fix from the verifier. */
|
|
35
|
+
readonly suggestedFix?: string;
|
|
36
|
+
}
|
|
37
|
+
interface GoalBlockedResult {
|
|
38
|
+
readonly ok: boolean;
|
|
39
|
+
/** Status message: success summary or rejection reason. Always set. */
|
|
40
|
+
readonly statusMessage: string;
|
|
41
|
+
/** Counter snapshot for transparency / debugging. */
|
|
42
|
+
readonly counter: {
|
|
43
|
+
readonly current: number;
|
|
44
|
+
readonly required: number;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
interface GoalCreateInput {
|
|
48
|
+
readonly objective: string;
|
|
49
|
+
readonly tokenBudget?: number | null;
|
|
50
|
+
}
|
|
51
|
+
interface GoalToolsContext {
|
|
52
|
+
/** Read current goal state from the session lineage. */
|
|
53
|
+
readonly readGoal: () => Promise<KodaXGoalState | null>;
|
|
54
|
+
/** Create a new goal. Throws if an active goal already exists. */
|
|
55
|
+
readonly createGoal: (input: GoalCreateInput) => Promise<KodaXGoalState>;
|
|
56
|
+
/**
|
|
57
|
+
* Request transition to `complete`. Implementation runs the Sidecar
|
|
58
|
+
* Verifier and returns `{ok:false, reason}` on non-accept. On accept
|
|
59
|
+
* the lineage gets a new goal entry with `status: 'complete'`.
|
|
60
|
+
*/
|
|
61
|
+
readonly requestComplete: () => Promise<GoalCompleteResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Request transition to `blocked`. Implementation applies the
|
|
64
|
+
* 3-turn rule via `recordBlockerAttempt` and persists the updated
|
|
65
|
+
* counter regardless of whether the transition was allowed.
|
|
66
|
+
*/
|
|
67
|
+
readonly requestBlocked: (blockerKind: string) => Promise<GoalBlockedResult>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Module-scoped fallback: when the tool runs without a goal context
|
|
71
|
+
* wired (e.g. dispatched from a non-REPL test harness), each method
|
|
72
|
+
* returns a uniform "feature disabled" error so the model gets a
|
|
73
|
+
* clear signal rather than a silent failure.
|
|
74
|
+
*/
|
|
75
|
+
declare function makeDisabledGoalToolsContext(): GoalToolsContext;
|
|
76
|
+
|
|
9
77
|
/** One tool-call breadcrumb. Captures only the name + a 60-char input
|
|
10
78
|
* hint so the snapshot stays compact under fan-out. Mirrors the
|
|
11
79
|
* `inputHint` extraction in `buildChildEvents.onToolUseStart`. */
|
|
@@ -323,6 +391,245 @@ interface TodoStore {
|
|
|
323
391
|
reset(): void;
|
|
324
392
|
}
|
|
325
393
|
|
|
394
|
+
/**
|
|
395
|
+
* FEATURE_192 v0.7.44 Phase B — Goal lifecycle hook composer.
|
|
396
|
+
*
|
|
397
|
+
* Wraps the existing `Runner.run` lifecycle hooks (`beforeNextTurn`,
|
|
398
|
+
* `stopHook`) with goal-aware behaviour. Does NOT modify substrate —
|
|
399
|
+
* the agent runtime exposes `beforeNextTurn` (FEATURE_164 v0.7.41) and
|
|
400
|
+
* `stopHook` (FEATURE_184 v0.7.42) as already-stable hook surfaces;
|
|
401
|
+
* this module is a thin composer the caller (REPL / driver) opts into.
|
|
402
|
+
*
|
|
403
|
+
* Wiring:
|
|
404
|
+
* - turn-end accounting → `beforeNextTurn` (fires after each tool
|
|
405
|
+
* execution, before the next LLM call)
|
|
406
|
+
* - agent_end continuation → `stopHook` (fires on text-only
|
|
407
|
+
* termination, can return a continuation prompt to reanimate)
|
|
408
|
+
*
|
|
409
|
+
* `enabled: false` returns pass-through wrappers — useful for hosts
|
|
410
|
+
* that build the binding eagerly but want to no-op when no goal is
|
|
411
|
+
* active. Goal feature ships default ON in v0.7.44; the `enabled`
|
|
412
|
+
* knob is for embedders, not user-facing gating.
|
|
413
|
+
*/
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Caller-supplied accessors for the goal lifecycle context. The
|
|
417
|
+
* composer does NOT own goal state — it reads via getters and writes
|
|
418
|
+
* via the persist callback. This keeps the composer reentrant and
|
|
419
|
+
* test-friendly (no global mutable cache).
|
|
420
|
+
*/
|
|
421
|
+
interface GoalLifecycleContext {
|
|
422
|
+
/** Returns the current goal state, or null when no active goal. */
|
|
423
|
+
readonly getGoal: () => KodaXGoalState | null;
|
|
424
|
+
/**
|
|
425
|
+
* Returns the latest LLM token usage from the just-completed turn.
|
|
426
|
+
* Returns undefined when usage is unavailable (e.g. mid-turn
|
|
427
|
+
* before any LLM call). Optional — accounting is skipped when null.
|
|
428
|
+
*/
|
|
429
|
+
readonly getLatestUsage?: () => KodaXTokenUsage | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* Returns the wall-clock timestamp (Date.now() ms) at the start of
|
|
432
|
+
* the turn just completed. The composer pairs this with Date.now()
|
|
433
|
+
* at hook fire time to derive `timeUsedSeconds` delta. Optional —
|
|
434
|
+
* when unset, wall-time is not charged (mirror legacy behaviour;
|
|
435
|
+
* callers without a per-turn clock anchor get token accounting only).
|
|
436
|
+
*/
|
|
437
|
+
readonly getTurnStartMs?: () => number | undefined;
|
|
438
|
+
/**
|
|
439
|
+
* Returns the current permission mode. When `'plan'`, accounting is
|
|
440
|
+
* skipped (plan mode runs are not charged against the goal budget).
|
|
441
|
+
* Optional — when not provided, accounting always runs on active goals.
|
|
442
|
+
*/
|
|
443
|
+
readonly getPermissionMode?: () => string | undefined;
|
|
444
|
+
/**
|
|
445
|
+
* Persist a goal state transition. Caller wires this to
|
|
446
|
+
* `appendGoalEntry` + session storage. The composer awaits — failures
|
|
447
|
+
* propagate to the runner (deliberate: a broken persist is a real
|
|
448
|
+
* bug worth surfacing, not silently swallowing).
|
|
449
|
+
*/
|
|
450
|
+
readonly persistEvent: (state: KodaXGoalState | null, event: 'updated' | 'budget_limited' | 'complete' | 'blocked') => Promise<void>;
|
|
451
|
+
/**
|
|
452
|
+
* Build the continuation prompt body the stop-hook returns when the
|
|
453
|
+
* active goal should resume. Caller controls the prompt content so
|
|
454
|
+
* the same composer works for both Codex-parity literal continuation
|
|
455
|
+
* and any future variants.
|
|
456
|
+
*/
|
|
457
|
+
readonly buildContinuationPrompt: (goal: KodaXGoalState) => string;
|
|
458
|
+
/**
|
|
459
|
+
* Returns true when the queue has pending user-priority messages.
|
|
460
|
+
* When pending messages exist, the goal SHOULD NOT autonomously
|
|
461
|
+
* continue — the user is steering and the next turn will pick up
|
|
462
|
+
* their input naturally. Optional — defaults to "no pending".
|
|
463
|
+
*/
|
|
464
|
+
readonly hasPendingUserInput?: () => boolean;
|
|
465
|
+
}
|
|
466
|
+
interface BeforeNextTurnFnCtx {
|
|
467
|
+
readonly transcript: readonly AgentMessage[];
|
|
468
|
+
readonly iteration: number;
|
|
469
|
+
}
|
|
470
|
+
type BeforeNextTurnFn = (ctx: BeforeNextTurnFnCtx) => Promise<readonly AgentMessage[]>;
|
|
471
|
+
/**
|
|
472
|
+
* Wrap an existing `beforeNextTurn` callback with goal accounting.
|
|
473
|
+
* Returned hook:
|
|
474
|
+
* 1. Calls into the goal lifecycle ctx FIRST (read latest usage,
|
|
475
|
+
* apply token delta, persist on budget cross)
|
|
476
|
+
* 2. Delegates to the inner hook for the original behaviour
|
|
477
|
+
* (mid-turn user-prompt injection, etc.)
|
|
478
|
+
*
|
|
479
|
+
* Errors thrown by `persistEvent` propagate. Errors from `inner` also
|
|
480
|
+
* propagate. We don't swallow either — goal lifecycle bugs are real.
|
|
481
|
+
*/
|
|
482
|
+
declare function withGoalBeforeNextTurn(ctx: GoalLifecycleContext, inner: BeforeNextTurnFn, options?: {
|
|
483
|
+
enabled: boolean;
|
|
484
|
+
}): BeforeNextTurnFn;
|
|
485
|
+
/**
|
|
486
|
+
* Wrap an existing `stopHook` with goal-driven continuation.
|
|
487
|
+
*
|
|
488
|
+
* Returned hook fires the inner hook FIRST (sidecar verifier wins on
|
|
489
|
+
* `revise` / `blocked`). If the inner hook returns `undefined` AND
|
|
490
|
+
* there's an active goal AND no pending user input, the wrapper
|
|
491
|
+
* returns a continuation string so the Runner reanimates the loop —
|
|
492
|
+
* Codex `/goal` parity.
|
|
493
|
+
*
|
|
494
|
+
* Budget exhaustion semantics: when the active goal has already
|
|
495
|
+
* flipped to `budget_limited`, the wrapper does NOT continue. The user
|
|
496
|
+
* must explicitly resume (`/goal resume`) or set a new budget.
|
|
497
|
+
*
|
|
498
|
+
* Reanimate budget: the Runner caps reanimate via
|
|
499
|
+
* `stopHookReanimateBudget` (default 2). The composer does not need to
|
|
500
|
+
* track its own budget — exceeding the budget is converted by the
|
|
501
|
+
* Runner to an abort with reason "reanimate budget exhausted", which
|
|
502
|
+
* surfaces to the user.
|
|
503
|
+
*/
|
|
504
|
+
declare function withGoalStopHook(ctx: GoalLifecycleContext, inner: StopHookFn | undefined, options?: {
|
|
505
|
+
enabled: boolean;
|
|
506
|
+
}): StopHookFn;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* FEATURE_192 v0.7.44 Phase F — Goal runtime binding factory.
|
|
510
|
+
*
|
|
511
|
+
* REPL (or any host that owns a `KodaXSessionLineage`) calls
|
|
512
|
+
* `buildGoalRuntimeBinding(deps)` once per `runManagedTask` invocation
|
|
513
|
+
* and passes the returned binding via
|
|
514
|
+
* `KodaXOptions.context.goalRuntime`. The runner-driven adapter wires:
|
|
515
|
+
* - `binding.goalContext` onto the tool-execution context (so the
|
|
516
|
+
* 3 goal tools can read/mutate state),
|
|
517
|
+
* - `binding.lifecycleCtx` into `withGoalBeforeNextTurn` /
|
|
518
|
+
* `withGoalStopHook` (turn-end accounting + continuation reanimate).
|
|
519
|
+
*
|
|
520
|
+
* Why a factory instead of host-side ad-hoc wiring:
|
|
521
|
+
* - Pulls the lineage-read + persist + sidecar-verifier-call wiring
|
|
522
|
+
* into one well-tested entry point so the host (REPL today; any
|
|
523
|
+
* future SDK consumer) doesn't have to re-implement the same glue.
|
|
524
|
+
* - The factory is the seam where v0.7.45+ extensions (e.g.
|
|
525
|
+
* objective-updated steering, multi-goal across forks) land
|
|
526
|
+
* without breaking the runner-driven contract.
|
|
527
|
+
*
|
|
528
|
+
* The factory does NOT own state — every accessor is a function the
|
|
529
|
+
* caller wires (`getLineage` reads from REPL's `context.lineage`,
|
|
530
|
+
* `saveSession` flushes to disk, etc.). This keeps the binding
|
|
531
|
+
* reentrant and test-friendly.
|
|
532
|
+
*
|
|
533
|
+
* Codex parity: the default `buildContinuationPrompt` mirrors codex's
|
|
534
|
+
* `core/templates/goals/continuation.md` verbatim in structure and
|
|
535
|
+
* intent — Continuation behavior / Budget / Work from evidence /
|
|
536
|
+
* Progress visibility / Fidelity / Completion audit / Blocked audit —
|
|
537
|
+
* with 6 documented KodaX-specific deviations (see the function
|
|
538
|
+
* JSDoc below for the full list). Two of the six are trailing
|
|
539
|
+
* "Runtime enforcement" paragraphs that make the KodaX runtime gates
|
|
540
|
+
* legible to the model (Sidecar Verifier on Completion audit + 3-turn
|
|
541
|
+
* counter on Blocked audit) so the model does not waste a turn being
|
|
542
|
+
* rejected; they do not replace the Codex teaching, they complement it.
|
|
543
|
+
*
|
|
544
|
+
* The earlier v0.7.44 draft trimmed this prompt aggressively under
|
|
545
|
+
* ADR-033 §4 ("no enumerated taxonomies"). That was a mechanical
|
|
546
|
+
* misapplication — Codex's Completion-audit enumerated list
|
|
547
|
+
* ("requirements / artifacts / commands / tests / gates / invariants /
|
|
548
|
+
* deliverables") names AUDIT DIMENSIONS, not the classification
|
|
549
|
+
* taxonomies §4 was written against ("RULE A/B/C/D" labels). The
|
|
550
|
+
* trim correlated with a Layer 2 C1 simple-continuation panel rate
|
|
551
|
+
* of 53% on the canonical 3-active-alias panel; restoring the Codex-
|
|
552
|
+
* faithful sections is the v0.7.44 follow-up before tagging.
|
|
553
|
+
* See: [[feedback_adr_033_scope_clarification_new_feature]].
|
|
554
|
+
*
|
|
555
|
+
* Progress visibility cites KodaX's `todo_*` tools (FEATURE_170 v0.7.41
|
|
556
|
+
* todo V2) rather than Codex's `update_plan`, since KodaX does not have
|
|
557
|
+
* `update_plan` but the equivalent multi-step planning surface lives
|
|
558
|
+
* in `todo_create` / `todo_update` / `todo_list` / `todo_get`.
|
|
559
|
+
*/
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Dependencies the host (REPL) wires into the binding. Everything is
|
|
563
|
+
* a callback because the binding has no opinion on storage — the host
|
|
564
|
+
* owns the lineage handle + flush pipe.
|
|
565
|
+
*/
|
|
566
|
+
interface GoalRuntimeBindingDeps {
|
|
567
|
+
/** Returns the current session lineage. May throw if no lineage. */
|
|
568
|
+
readonly getLineage: () => KodaXSessionLineage;
|
|
569
|
+
/** Replace the host's lineage handle after a goal entry is appended. */
|
|
570
|
+
readonly setLineage: (next: KodaXSessionLineage) => void;
|
|
571
|
+
/** Flush the host's session storage. Awaited by the binding. */
|
|
572
|
+
readonly saveSession: () => Promise<void>;
|
|
573
|
+
/**
|
|
574
|
+
* Returns the latest LLM token usage from the just-completed turn.
|
|
575
|
+
* Wired by the host to the runner-driven `tokenStateRef.current.lastUsage`.
|
|
576
|
+
* Returns undefined before the first LLM call.
|
|
577
|
+
*/
|
|
578
|
+
readonly getLatestUsage: () => KodaXTokenUsage | undefined;
|
|
579
|
+
/**
|
|
580
|
+
* Returns the wall-clock `Date.now()` ms at the start of the
|
|
581
|
+
* just-completed turn. The binding pairs it with `Date.now()` at
|
|
582
|
+
* hook fire time to derive `timeUsedSeconds` delta.
|
|
583
|
+
*/
|
|
584
|
+
readonly getTurnStartMs: () => number | undefined;
|
|
585
|
+
/**
|
|
586
|
+
* Returns the current permission mode (`'plan'` skips accounting).
|
|
587
|
+
* Optional — host may omit if it never enters plan mode.
|
|
588
|
+
*/
|
|
589
|
+
readonly getPermissionMode?: () => string | undefined;
|
|
590
|
+
/**
|
|
591
|
+
* Returns true when user-priority messages are pending on the main
|
|
592
|
+
* queue. When pending, the binding does NOT autonomously continue —
|
|
593
|
+
* the next turn's drain handles user input naturally.
|
|
594
|
+
*/
|
|
595
|
+
readonly hasPendingUserInput: () => boolean;
|
|
596
|
+
/**
|
|
597
|
+
* Verifier hook for `update_goal({complete})`. Implemented by the
|
|
598
|
+
* coding layer's sidecar-verifier-bind helper; host passes the same
|
|
599
|
+
* function through.
|
|
600
|
+
*/
|
|
601
|
+
readonly verifyComplete: (goal: KodaXGoalState) => Promise<GoalCompleteResult>;
|
|
602
|
+
}
|
|
603
|
+
interface GoalRuntimeBinding {
|
|
604
|
+
readonly goalContext: GoalToolsContext;
|
|
605
|
+
readonly lifecycleCtx: GoalLifecycleContext;
|
|
606
|
+
/**
|
|
607
|
+
* Replace the verifyComplete implementation at runtime.
|
|
608
|
+
*
|
|
609
|
+
* The REPL constructs the binding eagerly (before the runner exists)
|
|
610
|
+
* and supplies a stub verifyComplete. The runner-driven adapter
|
|
611
|
+
* then has access to runner-local context the REPL doesn't
|
|
612
|
+
* (transcript ref, mutation tracker, resolved verifier provider/
|
|
613
|
+
* model) and installs a real F184-backed verifier via this method.
|
|
614
|
+
*
|
|
615
|
+
* Idempotent: calling more than once just replaces the slot. The
|
|
616
|
+
* `goalContext.requestComplete` closure reads the slot fresh on
|
|
617
|
+
* every invocation, so any later swap is observed immediately.
|
|
618
|
+
*
|
|
619
|
+
* Called only from `buildRunnerGoalAdapter` in production; tests
|
|
620
|
+
* may also call it directly when exercising the goal-complete
|
|
621
|
+
* verifier path without a full runner harness.
|
|
622
|
+
*/
|
|
623
|
+
readonly installVerifyComplete: (fn: GoalRuntimeBindingDeps['verifyComplete']) => void;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Build the binding. Pure factory — no global state, no side effects
|
|
627
|
+
* at construction; effects happen when the runner-driven adapter
|
|
628
|
+
* invokes the wrapped hooks or when a tool calls
|
|
629
|
+
* `goalContext.{readGoal,createGoal,requestComplete,requestBlocked}`.
|
|
630
|
+
*/
|
|
631
|
+
declare function buildGoalRuntimeBinding(deps: GoalRuntimeBindingDeps): GoalRuntimeBinding;
|
|
632
|
+
|
|
326
633
|
/**
|
|
327
634
|
* FEATURE_093 (v0.7.24): minimal contract interface for the coding extension
|
|
328
635
|
* runtime. Extracted so `@kodax-ai/coding/src/types.ts` can reference the
|
|
@@ -1302,6 +1609,49 @@ interface KodaXContextOptions {
|
|
|
1302
1609
|
* plan-mode enforcement.
|
|
1303
1610
|
*/
|
|
1304
1611
|
planModeBlockCheck?: (tool: string, input: Record<string, unknown>) => string | null;
|
|
1612
|
+
/**
|
|
1613
|
+
* FEATURE_123 v0.7.44 — propagate the current agent's id into the
|
|
1614
|
+
* spawned runtime so its tools can self-identify (and so peer
|
|
1615
|
+
* `send_message` calls can stamp a `from=...` framing tag + reject
|
|
1616
|
+
* self-targeted sends).
|
|
1617
|
+
*/
|
|
1618
|
+
currentAgentId?: string;
|
|
1619
|
+
/**
|
|
1620
|
+
* FEATURE_123 v0.7.44 — propagate the dispatching agent's id (the
|
|
1621
|
+
* parent of the soon-to-be-spawned runtime) so `send_message(to:
|
|
1622
|
+
* "worker")` from a grand-child routes to its direct parent rather
|
|
1623
|
+
* than the top-level Worker.
|
|
1624
|
+
*/
|
|
1625
|
+
parentAgentId?: string;
|
|
1626
|
+
/**
|
|
1627
|
+
* FEATURE_123 v0.7.44 — when set, the spawned runtime's
|
|
1628
|
+
* `ctx.childTaskRegistry` reuses this Map instead of allocating a
|
|
1629
|
+
* fresh one. Children pass the parent's registry through so peer
|
|
1630
|
+
* routing (`send_message` to a sibling task_id) finds the target.
|
|
1631
|
+
* Children remain unable to mutate the registry because
|
|
1632
|
+
* `dispatch_child_task` stays in `CHILD_EXCLUDE_TOOLS_BASE`.
|
|
1633
|
+
*/
|
|
1634
|
+
inheritedChildTaskRegistry?: ChildTaskRegistry<KodaXChildExecutionResult>;
|
|
1635
|
+
/**
|
|
1636
|
+
* FEATURE_192 v0.7.44 Phase F — `/goal` runtime binding.
|
|
1637
|
+
*
|
|
1638
|
+
* When set, the runner-driven adapter:
|
|
1639
|
+
* 1. Wires `binding.goalContext` onto the tool-execution context
|
|
1640
|
+
* so the 3 goal tools (get_goal / create_goal / update_goal)
|
|
1641
|
+
* read + mutate live state.
|
|
1642
|
+
* 2. Wraps the `beforeNextTurn` hook with `withGoalBeforeNextTurn`
|
|
1643
|
+
* for turn-end token + wall-time accounting and budget-limit
|
|
1644
|
+
* transitions.
|
|
1645
|
+
* 3. Wraps the `stopHook` with `withGoalStopHook` so a Worker
|
|
1646
|
+
* text-only termination with an active goal returns a
|
|
1647
|
+
* continuation prompt (auto-continue on goal).
|
|
1648
|
+
*
|
|
1649
|
+
* Constructed by the REPL via `buildGoalRuntimeBinding(deps)` from
|
|
1650
|
+
* `packages/coding/src/goal/runtime-wiring.ts`. When undefined, the
|
|
1651
|
+
* tool context falls back to `makeDisabledGoalToolsContext()` and
|
|
1652
|
+
* the lifecycle hooks pass through unmodified.
|
|
1653
|
+
*/
|
|
1654
|
+
goalRuntime?: GoalRuntimeBinding;
|
|
1305
1655
|
}
|
|
1306
1656
|
interface KodaXOptions {
|
|
1307
1657
|
provider: string;
|
|
@@ -1657,6 +2007,56 @@ interface KodaXToolExecutionContext {
|
|
|
1657
2007
|
readonly model?: string;
|
|
1658
2008
|
readonly reasoningMode?: KodaXReasoningMode;
|
|
1659
2009
|
};
|
|
2010
|
+
/**
|
|
2011
|
+
* FEATURE_123 v0.7.44 — agentId of the agent whose tool call this
|
|
2012
|
+
* context backs. `undefined` for the top-level Worker (main runtime
|
|
2013
|
+
* loop); set to the child's `bundle.id` for sub-agent runtimes.
|
|
2014
|
+
*
|
|
2015
|
+
* Consumed by `send_message` to:
|
|
2016
|
+
* - know who "self" is for broadcast self-exclusion and for the
|
|
2017
|
+
* `from=...` framing tag,
|
|
2018
|
+
* - reject self-targeted sends as a single-hop cycle guard.
|
|
2019
|
+
*
|
|
2020
|
+
* Wired by `child-executor.executeReadChild` / `executeWriteChild`
|
|
2021
|
+
* via `options.context.currentAgentId`.
|
|
2022
|
+
*/
|
|
2023
|
+
currentAgentId?: string;
|
|
2024
|
+
/**
|
|
2025
|
+
* FEATURE_123 v0.7.44 — agentId of the agent that dispatched the one
|
|
2026
|
+
* owning this context. `undefined` for the Worker (top of the tree)
|
|
2027
|
+
* and for first-tier children (parent == Worker; routing uses the
|
|
2028
|
+
* `'worker'` sentinel rather than an agentId). Set for grand-child
|
|
2029
|
+
* runtimes whose parent is itself a child.
|
|
2030
|
+
*
|
|
2031
|
+
* Consumed by `send_message` when `to === 'worker'`:
|
|
2032
|
+
* - If `parentAgentId` is set, route to that specific id.
|
|
2033
|
+
* - If `parentAgentId` is undefined, route to `agentId: undefined`
|
|
2034
|
+
* (the main loop / top Worker).
|
|
2035
|
+
*/
|
|
2036
|
+
parentAgentId?: string;
|
|
2037
|
+
/**
|
|
2038
|
+
* FEATURE_123 v0.7.44 — per-turn `send_message` flood throttle counter.
|
|
2039
|
+
*
|
|
2040
|
+
* Mutable ref that the `send_message` tool increments on every
|
|
2041
|
+
* outbound enqueue (broadcast counts as N — one per recipient).
|
|
2042
|
+
* `runner-driven.ts`' `beforeNextTurn` resets `count = 0` at every
|
|
2043
|
+
* turn boundary so the limit is "per LLM turn", matching the
|
|
2044
|
+
* design's "≤5 per child-turn / ≤20 per Worker-turn".
|
|
2045
|
+
*
|
|
2046
|
+
* The cap chosen by `send_message` is per-call:
|
|
2047
|
+
* - Worker (`currentAgentId === undefined`): 20 outbound enqueues
|
|
2048
|
+
* per turn — Worker is the coordinator + has the higher fan-out
|
|
2049
|
+
* budget.
|
|
2050
|
+
* - Child (`currentAgentId !== undefined`): 5 outbound enqueues
|
|
2051
|
+
* per turn — peer chatter that goes over this is almost always
|
|
2052
|
+
* a misfire (storm vs coordination).
|
|
2053
|
+
*
|
|
2054
|
+
* When undefined (sync-mode dispatch, no async substrate), the
|
|
2055
|
+
* throttle is bypassed.
|
|
2056
|
+
*/
|
|
2057
|
+
sendMessageTurnCounter?: {
|
|
2058
|
+
count: number;
|
|
2059
|
+
};
|
|
1660
2060
|
/**
|
|
1661
2061
|
* @deprecated FEATURE_067: Removed — use reportToolProgress instead.
|
|
1662
2062
|
* Previously fired onManagedTaskStatus with activeWorkerId='child',
|
|
@@ -1817,6 +2217,18 @@ interface KodaXToolExecutionContext {
|
|
|
1817
2217
|
* it into child `runKodaX` calls).
|
|
1818
2218
|
*/
|
|
1819
2219
|
childProgressSnapshots?: Map<string, ChildProgressSnapshot>;
|
|
2220
|
+
/**
|
|
2221
|
+
* FEATURE_192 v0.7.44 — `/goal` Persistent Goal runtime hook.
|
|
2222
|
+
*
|
|
2223
|
+
* Wired by the REPL adapter for every session with a lineage. When
|
|
2224
|
+
* undefined (sync-dispatch / isolated test harness), the 3 goal
|
|
2225
|
+
* tools (`get_goal` / `create_goal` / `update_goal`) fall back to a
|
|
2226
|
+
* uniform-error context (`makeDisabledGoalToolsContext`) so the
|
|
2227
|
+
* model gets a clear signal rather than a silent failure.
|
|
2228
|
+
*
|
|
2229
|
+
* See `packages/coding/src/goal/tools-context.ts`.
|
|
2230
|
+
*/
|
|
2231
|
+
goalContext?: GoalToolsContext;
|
|
1820
2232
|
}
|
|
1821
2233
|
|
|
1822
2234
|
/**
|
|
@@ -2466,5 +2878,5 @@ interface CreateBashPrefixExtractorOptions {
|
|
|
2466
2878
|
*/
|
|
2467
2879
|
declare function createBashPrefixExtractor(opts: CreateBashPrefixExtractorOptions): BashPrefixExtractor;
|
|
2468
2880
|
|
|
2469
|
-
export { BASH_POLICY_SPEC as B, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E,
|
|
2470
|
-
export type {
|
|
2881
|
+
export { BASH_POLICY_SPEC as B, CONSECUTIVE_THRESHOLD as C, ERROR_THRESHOLD as E, createCircuitBreaker as a$, WINDOW_MS as aV, buildGoalRuntimeBinding as aW, collectAllSignals as aX, computeRulesFingerprint as aY, createAutoModeToolGuardrail as aZ, createBashPrefixExtractor as a_, createDenialTracker as b0, extractCommandPrefix as b1, formatAgentsForPrompt as b2, getKodaxGlobalDir as b3, loadAgentsFiles as b4, loadAutoRules as b5, makeDisabledGoalToolsContext as b6, parseAutoRules as b7, readTrustState as b8, recordAllow as b9, recordBlock as ba, recordError as bb, shouldFallback$1 as bc, shouldFallback as bd, trustProjectRules as be, withGoalBeforeNextTurn as bf, withGoalStopHook as bg, CUMULATIVE_THRESHOLD as n };
|
|
2882
|
+
export type { KodaXMcpTransport as $, AgentsFile as A, DenialTracker as D, FailureStage as F, GoalBlockedResult as G, KodaXChildAgentResult as H, KodaXChildContextBundle as I, KodaXContextOptions as J, KodaXAgentMode as K, KodaXContextTokenSnapshot as L, KodaXEvents as M, KodaXFanoutBranchLifecycle as N, KodaXFanoutBranchRecord as O, KodaXFanoutBranchTransition as P, KodaXFanoutSchedulerInput as Q, KodaXFanoutSchedulerPlan as R, KodaXInputArtifact as S, KodaXManagedBudgetSnapshot as T, KodaXManagedProtocolPayload as U, KodaXManagedTask as V, KodaXManagedTaskRuntimeState as W, KodaXManagedTaskStatusEvent as X, KodaXMcpConnectMode as Y, KodaXMcpServerConfig as Z, KodaXMcpServersConfig as _, AskUserMultiOptions as a, KodaXMemoryStrategy as a0, KodaXOptions as a1, KodaXOrchestrationVerdict as a2, KodaXParentReductionContract as a3, KodaXProviderPolicyHints as a4, KodaXRepoIntelligenceCapability as a5, KodaXRepoIntelligenceMode as a6, KodaXRepoIntelligenceResolvedMode as a7, KodaXRepoIntelligenceTrace as a8, KodaXRepoIntelligenceTraceEvent as a9, LoadAgentsOptions as aA, LoadedRulesSource as aB, ProviderExecutionState as aC, ProviderRecoveryEvent as aD, ProviderResilienceConfig as aE, ProviderResiliencePolicy as aF, RecoveryAction as aG, RecoveryDecision as aH, RecoveryLadderStep as aI, RecoveryResult as aJ, ResilienceClassification as aK, ResilienceErrorClass as aL, RulesLoadError as aM, RulesLoadResult as aN, SignalCollector as aO, SkippedRulesSource as aP, TodoItem as aQ, TodoList as aR, TodoStatus as aS, ToolCallSignal as aT, TrustState as aU, KodaXRepoRoutingSignals as aa, KodaXResult as ab, KodaXRoleRoundSummary as ac, KodaXRuntimeVerificationContract as ad, KodaXSessionControl as ae, KodaXSessionMutators as af, KodaXSessionOptions as ag, KodaXSkillInvocationContext as ah, KodaXSkillMap as ai, KodaXSkillProjectionConfidence as aj, KodaXTaskCapabilityHint as ak, KodaXTaskContract as al, KodaXTaskEvidenceArtifact as am, KodaXTaskEvidenceBundle as an, KodaXTaskEvidenceEntry as ao, KodaXTaskRole as ap, KodaXTaskRoleAssignment as aq, KodaXTaskStatus as ar, KodaXTaskSurface as as, KodaXTaskToolPolicy as at, KodaXTaskVerificationContract as au, KodaXTaskVerificationCriterion as av, KodaXTaskWorkItem as aw, KodaXToolExecutionContext as ax, KodaXVerificationScorecard as ay, KodaXVerificationScorecardCriterion as az, AskUserQuestionItem as b, AskUserQuestionOptions as c, AutoModeAskUser as d, AutoModeAskUserVerdict as e, AutoModeEngine as f, AutoModeGuardrailConfig as g, AutoModeSharedState as h, AutoModeStats as i, AutoModeToolGuardrail as j, AutoRules as k, BashPrefixExtractor as l, BashPrefixResult as m, CircuitBreaker as o, CreateBashPrefixExtractorOptions as p, ExtensionRuntimeContract as q, ExtractCommandPrefixOptions as r, GoalCompleteResult as s, GoalCreateInput as t, GoalLifecycleContext as u, GoalRuntimeBinding as v, GoalRuntimeBindingDeps as w, GoalToolsContext as x, KodaXBudgetDisclosureZone as y, KodaXBudgetExtensionRequest as z };
|