@kodax-ai/kodax 0.7.39
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 +1350 -0
- package/LICENSE +191 -0
- package/README.md +1170 -0
- package/README_CN.md +659 -0
- package/dist/acp_events.d.ts +109 -0
- package/dist/acp_logger.d.ts +20 -0
- package/dist/acp_server.d.ts +92 -0
- package/dist/builtin/code-review/SKILL.md +63 -0
- package/dist/builtin/git-workflow/SKILL.md +84 -0
- package/dist/builtin/skill-creator/SKILL.md +122 -0
- package/dist/builtin/skill-creator/agents/analyzer.md +12 -0
- package/dist/builtin/skill-creator/agents/comparator.md +13 -0
- package/dist/builtin/skill-creator/agents/grader.md +13 -0
- package/dist/builtin/skill-creator/references/schemas.md +227 -0
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.d.ts +46 -0
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +209 -0
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +46 -0
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +289 -0
- package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +62 -0
- package/dist/builtin/skill-creator/scripts/compare-runs.js +333 -0
- package/dist/builtin/skill-creator/scripts/generate-review.d.ts +33 -0
- package/dist/builtin/skill-creator/scripts/generate-review.js +415 -0
- package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +73 -0
- package/dist/builtin/skill-creator/scripts/grade-evals.js +405 -0
- package/dist/builtin/skill-creator/scripts/improve-description.d.ts +23 -0
- package/dist/builtin/skill-creator/scripts/improve-description.js +161 -0
- package/dist/builtin/skill-creator/scripts/init-skill.d.ts +14 -0
- package/dist/builtin/skill-creator/scripts/init-skill.js +153 -0
- package/dist/builtin/skill-creator/scripts/install-skill.d.ts +29 -0
- package/dist/builtin/skill-creator/scripts/install-skill.js +176 -0
- package/dist/builtin/skill-creator/scripts/package-skill.d.ts +38 -0
- package/dist/builtin/skill-creator/scripts/package-skill.js +124 -0
- package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +8 -0
- package/dist/builtin/skill-creator/scripts/quick-validate.js +166 -0
- package/dist/builtin/skill-creator/scripts/run-eval.d.ts +66 -0
- package/dist/builtin/skill-creator/scripts/run-eval.js +356 -0
- package/dist/builtin/skill-creator/scripts/run-loop.d.ts +49 -0
- package/dist/builtin/skill-creator/scripts/run-loop.js +243 -0
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.d.ts +58 -0
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +225 -0
- package/dist/builtin/skill-creator/scripts/utils.js +273 -0
- package/dist/builtin/tdd/SKILL.md +56 -0
- package/dist/chunks/chunk-4E76FLZ3.js +2 -0
- package/dist/chunks/chunk-7LQ2NCHF.js +1221 -0
- package/dist/chunks/chunk-HUAU4KB3.js +2 -0
- package/dist/chunks/chunk-N2VZ2MJF.js +11 -0
- package/dist/chunks/chunk-SF7WD7E5.js +2 -0
- package/dist/chunks/chunk-SONW6AC7.js +14 -0
- package/dist/chunks/chunk-WEEQZYZS.js +460 -0
- package/dist/chunks/chunk-XI75LZIO.js +30 -0
- package/dist/chunks/compaction-config-YL4SWWII.js +2 -0
- package/dist/chunks/construction-bootstrap-XSE7ZABG.js +5 -0
- package/dist/chunks/devtools-MOFU7YQF.js +2 -0
- package/dist/chunks/dist-AMUYI7R5.js +2 -0
- package/dist/chunks/dist-WKW4CBG6.js +2 -0
- package/dist/chunks/utils-3HW4KOGE.js +2 -0
- package/dist/cli_commands.d.ts +17 -0
- package/dist/cli_option_helpers.d.ts +49 -0
- package/dist/cli_option_helpers.test.d.ts +1 -0
- package/dist/constructed_cli.d.ts +82 -0
- package/dist/constructed_cli.test.d.ts +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/kodax_cli.d.ts +7 -0
- package/dist/kodax_cli.js +1882 -0
- package/dist/sdk-agent.d.ts +15 -0
- package/dist/sdk-agent.js +2 -0
- package/dist/sdk-coding.d.ts +20 -0
- package/dist/sdk-coding.js +2 -0
- package/dist/sdk-llm.d.ts +15 -0
- package/dist/sdk-llm.js +2 -0
- package/dist/sdk-repl.d.ts +21 -0
- package/dist/sdk-repl.js +2 -0
- package/dist/sdk-skills.d.ts +16 -0
- package/dist/sdk-skills.js +2 -0
- package/dist/self_modify_cli.d.ts +81 -0
- package/dist/self_modify_cli.test.d.ts +9 -0
- package/dist/skill_cli.d.ts +15 -0
- package/dist/skill_cli.test.d.ts +1 -0
- package/package.json +143 -0
- package/scripts/kodax-bin.cjs +27 -0
- package/scripts/production-env.cjs +16 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK subpath entry — `@kodax-ai/kodax/agent`
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the entire `@kodax-ai/agent` public API so SDK consumers
|
|
5
|
+
* can pull agent primitives directly without going through the broader
|
|
6
|
+
* `runKodaX` surface.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { Runner } from '@kodax-ai/kodax/agent';
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* See docs/ADR.md ADR-024 for the SDK formalization decision.
|
|
14
|
+
*/
|
|
15
|
+
export * from '@kodax-ai/agent';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$,A,Aa as Bo,B,Ba as Co,C,Ca as Do,D,Da as Eo,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a as o,aa as oo,b as r,ba as ro,c as e,ca as eo,d as f,da as fo,e as m,ea as mo,f as p,fa as po,g as t,ga as to,h as x,ha as xo,i as a,ia as ao,j as b,ja as bo,k as c,ka as co,l as d,la as go,m as g,ma as ho,n as h,na as io,o as i,oa as jo,p as j,pa as ko,q as k,qa as lo,r as l,ra as no,s as n,sa as qo,t as q,ta as so,u as s,ua as uo,v as u,va as vo,w as v,wa as wo,x as w,xa as yo,y,ya as zo,z,za as Ao}from"./chunks/chunk-N2VZ2MJF.js";import"./chunks/chunk-4E76FLZ3.js";export{po as CORE_INVARIANTS,yo as DEFAULT_IDLE_YIELD_MAX_ITERATIONS,B as DEFAULT_SYSTEM_CAP,j as DefaultSummaryCompaction,P as GuardrailBlockedError,Q as GuardrailEscalateError,H as InvariantSession,a as KODAX_API_MIN_INTERVAL,r as KODAX_DEFAULT_TIMEOUT,e as KODAX_HARD_TIMEOUT,p as KODAX_MAX_INCOMPLETE_RETRIES,t as KODAX_MAX_MAXTOKENS_RETRIES,f as KODAX_MAX_RETRIES,o as KODAX_MAX_TOKENS,m as KODAX_RETRY_BASE_DELAY,x as KODAX_STAGGER_DELAY,J as MAX_TOOL_LOOP_ITERATIONS,co as MessageQueue,b as PROMISE_PATTERN,oo as Runner,io as YIELD_TOOL_NAMES,z as _resetAdmissionMetrics,G as _resetAdmittedAgentBindings,u as _resetInvariantRegistry,ho as _resetMessageQueueForTests,_ as _resetPresetDispatchers,k as applyManifestPatch,N as buildAssistantMessageFromLlmResult,$ as buildSystemPrompt,O as buildToolResultMessage,Eo as cleanupIncompleteToolCalls,R as collectGuardrails,wo as composeIdleYieldUserMessage,l as composePatches,so as countLastAssistantToolCalls,d as countTokens,g as createAgent,h as createHandoff,i as createInMemorySession,I as createInvariantSessionForAgent,W as detectHandoffSignal,uo as detectIdleYield,C as detectInstructionsInjection,Y as emitHandoffSpan,lo as enqueueChildTaskNotification,c as estimateTokens,eo as evidenceTrail,M as executeRunnerToolCall,ro as extractAssistantTextFromMessage,fo as finalOwner,y as getAdmissionMetricsSnapshot,F as getAdmittedAgentBindings,ao as getAgentConfigHome,bo as getAgentConfigPath,q as getInvariant,go as getMessageQueue,mo as handoffLegality,A as isAdmissionDebugEnabled,qo as isIdleYieldEnabled,K as isRunnableTool,L as isRunnerLlmResult,s as listRegisteredInvariants,ko as maybeDrainMidTurn,jo as midTurnDrainPriority,no as registerChildTask,to as registerCoreInvariants,n as registerInvariant,Z as registerPresetDispatcher,X as replaceSystemMessage,Co as requestTaskStop,w as resolveEffectiveInvariants,v as resolveRequiredInvariants,Bo as routeMessage,D as runAdmissionAudit,Ao as runFanOut,S as runInputGuardrails,T as runOutputGuardrails,V as runToolAfterGuardrails,U as runToolBeforeGuardrails,zo as runWithIdleYield,E as setAdmittedAgentBindings,xo as setAgentConfigHome,Do as validateAndFixToolHistory,vo as waitForWakeEvent};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK subpath entry — `@kodax-ai/kodax/coding`
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the entire `@kodax-ai/coding` public API — coding tools,
|
|
5
|
+
* prompts, AMA harness primitives, child task dispatch, idle-yield
|
|
6
|
+
* orchestration, etc.
|
|
7
|
+
*
|
|
8
|
+
* Note: the root entry `@kodax-ai/kodax` already does `export * from
|
|
9
|
+
* '@kodax-ai/coding'` for backward compatibility with v0.7.38's single-
|
|
10
|
+
* entry model. This subpath is provided as a tree-shake-friendly
|
|
11
|
+
* alternative when SDK consumers only need coding-package APIs.
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { runKodaX, dispatchChildTask } from '@kodax-ai/kodax/coding';
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* See docs/ADR.md ADR-024 for the SDK formalization decision.
|
|
19
|
+
*/
|
|
20
|
+
export * from '@kodax-ai/coding';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$ as mr,$a as me,$b as ff,$c as mm,$d as mp,A as Fo,Aa as Fr,Ab as Fe,Ac as Ff,Ad as Fm,B as Go,Ba as Gr,Bb as Ge,Bc as Gf,Bd as Gm,C as Ho,Ca as Hr,Cb as He,Cc as Hf,Cd as Hm,D as Io,Da as Ir,Db as Ie,Dc as If,Dd as Im,E as Jo,Ea as Jr,Eb as Je,Ec as Jf,Ed as Jm,F as Ko,Fa as Kr,Fb as Ke,Fc as Kf,Fd as Km,G as Lo,Ga as Lr,Gb as Le,Gc as Lf,Gd as Lm,H as Mo,Ha as Mr,Hb as Me,Hc as Mf,Hd as Mm,I as No,Ia as Nr,Ib as Ne,Ic as Nf,Id as Nm,J as Oo,Ja as Or,Jb as Oe,Jc as Of,Jd as Om,K as Po,Ka as Pr,Kb as Pe,Kc as Pf,Kd as Pm,L as Qo,La as Qr,Lb as Qe,Lc as Qf,Ld as Qm,M as Ro,Ma as Rr,Mb as Re,Mc as Rf,Md as Rm,N as So,Na as Sr,Nb as Se,Nc as Sf,Nd as Sm,O as To,Oa as Tr,Ob as Te,Oc as Tf,Od as Tm,P as Uo,Pa as Ur,Pb as Ue,Pc as Uf,Pd as Um,Q as Vo,Qa as Vr,Qb as Ve,Qc as Vf,Qd as Vm,R as Wo,Ra as Wr,Rb as We,Rc as Wf,Rd as Wm,S as Xo,Sa as Xr,Sb as Xe,Sc as Xf,Sd as Xm,T as Yo,Ta as Yr,Tb as Ye,Tc as Yf,Td as Ym,U as Zo,Ua as Zr,Ub as Ze,Uc as Zf,Ud as Zm,V as _o,Va as _r,Vb as _e,Vc as _f,Vd as _m,W as $o,Wa as $r,Wb as $e,Wc as $f,Wd as $m,X as or,Xa as oe,Xb as of,Xc as om,Xd as op,Y as rr,Ya as re,Yb as rf,Yc as rm,Yd as rp,Z as er,Za as ee,Zc as em,Zd as ep,_ as fr,_a as fe,_b as ef,_c as fm,_d as fp,a as N,aa as pr,ab as pe,ac as mf,ad as pm,ae as pp,b as O,ba as tr,bb as te,bc as pf,bd as tm,be as tp,c as P,ca as xr,cb as xe,cc as tf,cd as xm,ce as xp,d as Q,da as ar,db as ae,dc as xf,dd as am,de as ap,e as R,ea as br,eb as be,ec as af,ed as bm,ee as bp,f as bo,fa as cr,fb as ce,fc as bf,fd as cm,fe as cp,g as co,ga as dr,gb as de,gc as cf,gd as dm,ge as dp,h as go,ha as gr,hb as ge,hc as df,hd as gm,he as gp,i as ho,ia as hr,ib as he,ic as gf,id as hm,ie as hp,j as io,ja as ir,jb as ie,jc as hf,jd as im,je as ip,k as jo,ka as jr,kb as je,kc as jf,kd as jm,ke as jp,l as ko,la as kr,lb as ke,lc as kf,ld as km,le as kp,m as lo,ma as lr,mb as le,mc as lf,md as lm,me as lp,n as no,na as nr,nb as ne,nc as nf,nd as nm,ne as np,o as qo,oa as qr,ob as qe,oc as qf,od as qm,p as so,pa as sr,pb as se,pc as sf,pd as sm,q as uo,qa as ur,qb as ue,qc as uf,qd as um,r as vo,ra as vr,rb as ve,rc as vf,rd as vm,s as wo,sa as wr,sb as we,sc as wf,sd as wm,t as yo,ta as yr,tb as ye,tc as yf,td as ym,u as zo,ua as zr,ub as ze,uc as zf,ud as zm,v as Ao,va as Ar,vb as Ae,vc as Af,vd as Am,w as Bo,wa as Br,wb as Be,wc as Bf,wd as Bm,x as Co,xa as Cr,xb as Ce,xc as Cf,xd as Cm,y as Do,ya as Dr,yb as De,yc as Df,yd as Dm,z as Eo,za as Er,zb as Ee,zc as Ef,zd as Em}from"./chunks/chunk-7LQ2NCHF.js";import{Ca as xo,Da as ao,Z as po,a as S,aa as to,b as T,c as U,d as V,e as W,f as X,h as Y,i as Z,j as _,k as $,l as oo,m as ro,n as eo,o as fo,p as mo}from"./chunks/chunk-N2VZ2MJF.js";import"./chunks/chunk-SONW6AC7.js";import{$ as A,C as c,I as d,J as g,O as h,P as i,Q as j,R as k,S as l,T as n,U as q,V as s,W as u,X as v,Y as w,Z as y,_ as z,a as o,aa as B,b as r,ba as C,c as e,ca as D,da as E,ea as F,fa as G,ga as H,ha as I,ia as J,j as f,ja as K,ka as L,la as M,t as m,u as p,v as t,w as x,x as a,y as b}from"./chunks/chunk-XI75LZIO.js";import"./chunks/chunk-4E76FLZ3.js";export{Xm as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Ym as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,kp as BASH_POLICY_SPEC,rp as BREAKER_ERROR_THRESHOLD,ep as BREAKER_WINDOW_MS,co as CANCELLED_TOOL_RESULT_MESSAGE,bo as CANCELLED_TOOL_RESULT_PREFIX,Nm as CODING_AGENTS,Im as CODING_AGENT_MARKER,Pf as CODING_INVARIANTS,Ff as CODING_SUMMARY_PROMPT,Gf as CODING_UPDATE_SUMMARY_PROMPT,zr as CapabilityDeniedError,Rf as Client,Ar as ConstructionManifestError,Hf as DEFAULT_CODING_AGENT_NAME,Am as DEFAULT_DANGEROUS_PATTERNS,wr as DEFAULT_HANDLER_TIMEOUT_MS,tf as DEFAULT_RESILIENCE_CONFIG,zm as DEFAULT_SAFE_PATTERNS,Wr as DEFAULT_SELF_MODIFY_BUDGET,gp as DEFAULT_SPECULATIVE_WINDOW_MS,ho as DEFAULT_TOOL_OUTPUT_MAX_BYTES,go as DEFAULT_TOOL_OUTPUT_MAX_LINES,mo as DefaultSummaryCompaction,$f as EMIT_CONTRACT_TOOL_NAME,om as EMIT_HANDOFF_TOOL_NAME,_f as EMIT_SCOUT_VERDICT_TOOL_NAME,rm as EMIT_VERDICT_TOOL_NAME,Er as EVALUATOR_AGENT_NAME,Q as ErrorCategory,Dr as GENERATOR_AGENT_NAME,Z as KODAX_API_MIN_INTERVAL,j as KODAX_DEFAULT_PROVIDER,T as KODAX_DEFAULT_TIMEOUT,U as KODAX_HARD_TIMEOUT,X as KODAX_MAX_INCOMPLETE_RETRIES,V as KODAX_MAX_RETRIES,S as KODAX_MAX_TOKENS,i as KODAX_PROVIDERS,h as KODAX_PROVIDER_SNAPSHOTS,f as KODAX_REASONING_MODE_SEQUENCE,W as KODAX_RETRY_BASE_DELAY,Y as KODAX_STAGGER_DELAY,he as KODAX_TOOLS,d as KodaXAnthropicCompatProvider,c as KodaXBaseProvider,Rf as KodaXClient,o as KodaXError,Bf as KodaXExtensionRuntime,g as KodaXOpenAICompatProvider,r as KodaXProviderError,e as KodaXRateLimitError,O as KodaXSessionError,P as KodaXTerminalError,N as KodaXToolError,Ke as LINEAGE_ENTRY_TYPES,Me as LineageCompaction,Le as LineageExtension,lm as McpCapabilityProvider,km as McpServerRuntime,Cr as PLANNER_AGENT_NAME,_ as PROMISE_PATTERN,Ce as PROMPT_SECTION_REGISTRY,tm as PROTOCOL_EMITTER_TOOLS,df as ProviderRecoveryCoordinator,io as READ_DEFAULT_LIMIT,ko as READ_MAX_LINE_CHARS,jo as READ_PREFLIGHT_SIZE_BYTES,Uo as REPOINTEL_DEFAULT_ENDPOINT,to as Runner,Br as SCOUT_AGENT_NAME,Be as SYSTEM_PROMPT,bf as StableBoundaryTracker,Jr as TASK_ENGINE_ROLE_AGENTS,xm as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,re as _resetRuntimeForTesting,me as activate,Lo as analyzeChangedScope,Ur as appendAuditEntry,Ue as appendSessionLineageLabel,Wf as applyFanoutBranchTransition,Ve as applySessionCompaction,br as applyToolResultGuardrail,$e as archiveOldIslands,Xf as assignFanoutBranchWorker,op as autoModeDenialShouldFallback,bp as bashSignalCollector,Kf as boundedRevise,pp as breakerShouldFallback,Lf as budgetCeiling,uf as buildAmaControllerDecision,He as buildCapabilityContextSections,Om as buildClassifierPrompt,qf as buildFallbackRoutingDecision,Tf as buildFanoutSchedulerPlan,Rr as buildLlmReviewPrompt,ff as buildPromptMessageContent,vf as buildPromptOverlay,Ge as buildPromptSnapshot,gf as buildProviderCapabilitySnapshot,sf as buildProviderPolicyHintsForDecision,hf as buildProviderPolicyPromptNotes,t as buildReasoningOverrideKey,Ko as buildRepoIntelligenceContext,Zo as buildRepoIntelligenceIndex,Ho as buildRepoOverview,Ze as buildSessionTree,Je as buildSystemPrompt,Ie as buildSystemPromptSnapshot,ap as checkAbsoluteDeny,ef as checkIncompleteToolCalls,yf as checkPromiseSignal,Qm as classify,Cm as classifyBashCommand,R as classifyError,af as classifyResilienceError,ao as cleanupIncompleteToolCalls,b as clearReasoningOverride,J as clearRuntimeModelProviders,dp as collectAllSignals,Em as computeInputSignature,Rm as computeRulesFingerprint,oe as configureRuntime,hr as convertCapabilityReadResult,gr as convertProviderSearchResults,Vf as countActiveFanoutBranches,_e as countActiveLineageMessages,oo as countTokens,ro as createAgent,Zm as createAutoModeDenialTracker,jp as createAutoModeToolGuardrail,Bm as createBashClassifierConfig,np as createBashPrefixExtractor,ue as createBuiltinToolDefinition,fp as createCircuitBreaker,Nr as createCtxProxy,y as createCustomProvider,If as createDefaultCodingAgent,Dm as createDenialTracker,Cf as createExtensionRuntime,Sf as createFanoutSchedulerInput,eo as createHandoff,fo as createInMemorySession,um as createKodaXTaskRunner,dm as createMcpCapabilityId,jm as createMcpTransport,De as createPromptSection,wf as createReasoningPlan,Pe as createSessionLineage,am as createToolResultTruncationGuardrail,cm as defaultMcpCacheDir,yr as defaultPolicy,$r as disableSelfModify,Mr as drainPendingSwaps,fm as emitContract,mm as emitHandoff,em as emitScoutVerdict,pm as emitVerdict,$ as estimateTokens,jf as evaluateProviderPolicy,Ir as evaluatorAgent,Mm as evaluatorCodingAgent,zf as exec,Ae as executeTool,of as extractArtifactLedger,lp as extractCommandPrefix,pf as extractComparableUserMessageText,dr as extractHtmlTitle,mf as extractPromptComparableText,Oe as extractTitleFromMessages,cp as fileSignalCollector,jr as finalizeRetrievalResult,ce as findByVersion,We as findPreviousUserEntryId,Ye as forkSessionLineage,vr as formatAgentsForPrompt,wm as formatParallelDispatchResult,lo as formatSize,Ne as generateSessionId,Hr as generatorAgent,Lm as generatorCodingAgent,Ef as getActiveExtensionRuntime,M as getAvailableProviderNames,se as getBuiltinRegisteredToolDefinition,qe as getBuiltinToolDefinition,A as getCustomProvider,D as getCustomProviderList,E as getCustomProviderModels,C as getCustomProviderNames,Hm as getDenialContext,Uf as getFanoutBranch,er as getImpactEstimate,sr as getKodaxGlobalDir,im as getMcpCachePaths,$o as getModuleContext,rr as getProcessContext,k as getProvider,s as getProviderConfiguredCapabilityProfile,q as getProviderConfiguredReasoningCapability,u as getProviderList,n as getProviderModel,v as getProviderModels,le as getRegisteredToolDefinition,_o as getRepoIntelligenceIndex,Io as getRepoOverview,fr as getRepoRoutingSignals,we as getRequiredToolParams,G as getRuntimeModelProvider,I as getRuntimeModelProviderNames,Qe as getSessionLineagePath,Re as getSessionMessagesFromLineage,or as getSymbolContext,je as getTool,ke as getToolDefinition,ne as getToolRegistrations,ar as getToolResultPolicy,Lr as hasPendingSwap,Mf as independentReview,nf as inferTaskType,Ao as inspectEditFailure,Xo as inspectRepoIntelligenceRuntime,B as isCustomProviderName,Gm as isDeniedRecently,L as isKnownProvider,vm as isParallelDispatchDirective,l as isProviderConfigured,w as isProviderName,H as isRuntimeModelProviderName,de as listAll,xe as listArtifacts,ve as listBuiltinToolDefinitions,be as listConstructed,ze as listToolDefinitions,ye as listTools,ur as loadAgentsFiles,Vm as loadAutoRules,Or as loadHandler,x as loadReasoningOverride,Zf as markFanoutBranchCancelled,Yf as markFanoutBranchCompleted,rf as mergeArtifactLedger,Ee as orderPromptSections,Um as parseAutoRules,Pm as parseClassifierOutput,zo as parseEditToolError,Sr as parseLlmReviewVerdict,gm as parseMcpCapabilityId,tp as parseModelSpec,uo as persistToolOutput,Gr as plannerAgent,Km as plannerCodingAgent,ae as readArtifact,Vr as readAuditEntries,Xr as readBudget,_r as readDisableState,hp as readSpeculativeWindowFromEnv,Sm as readTrustState,m as reasoningCapabilityToOverride,lf as reasoningModeToDepth,p as reasoningOverrideToCapability,cf as reconstructMessagesWithToolGuard,$m as recordAutoModeAllow,_m as recordAutoModeBlock,mp as recordBreakerError,Fm as recordDenial,Qf as registerCodingInvariants,nm as registerConfiguredMcpCapabilityProvider,z as registerCustomProviders,F as registerModelProvider,qm as registerOfficialSandboxExtension,po as registerPresetDispatcher,ie as registerTool,pe as rehydrateActiveArtifacts,Yr as remainingSelfModifyBudget,Mo as renderChangedScope,To as renderImpactEstimate,Qo as renderModuleContext,So as renderProcessContext,Fe as renderPromptSections,Jo as renderRepoOverview,ir as renderRetrievalResult,Ro as renderSymbolContext,Zr as resetBudget,xp as resolveClassifierModel,Kr as resolveConstructedAgent,K as resolveProvider,kf as resolveReasoningMode,Wo as resolveRepoIntelligenceMode,Vo as resolveRepoIntelligenceRuntimeConfig,xf as resolveResilienceConfig,Se as resolveSessionLineageTarget,Nf as resolveToolCapability,te as revoke,Xe as rewindSessionLineage,ge as rollbackSelfModify,Pr as runAstRules,Jf as runKodaX,Tr as runLlmReview,bm as runManagedTask,sm as runOrchestration,a as saveReasoningOverride,Fr as scoutAgent,Jm as scoutCodingAgent,hm as searchMcpCatalog,Df as setActiveExtensionRuntime,Te as setSessionLineageActiveEntry,ip as speculativeRace,ee as stage,Wm as stripAssistantText,cr as stripHtmlToText,fe as testArtifact,Go as toolAskUserQuestion,Co as toolBash,Po as toolChangedDiff,Oo as toolChangedScope,nr as toolCodeSearch,yo as toolEdit,Do as toolGlob,Eo as toolGrep,xr as toolImpactEstimate,Bo as toolInsertAfterAnchor,mr as toolModuleContext,Of as toolPermission,tr as toolProcessContext,vo as toolRead,No as toolRepoOverview,qr as toolSemanticLookup,pr as toolSymbolContext,Fo as toolUndo,lr as toolWebFetch,kr as toolWebSearch,wo as toolWrite,no as truncateHead,so as truncateLine,qo as truncateTail,Tm as trustProjectRules,xo as validateAndFixToolHistory,ym as validateSubtaskIndependence,Qr as validateToolSchemaForProvider,Yo as warmRepoIntelligenceRuntime,Af as webhook};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK subpath entry — `@kodax-ai/kodax/llm`
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the entire `@kodax-ai/llm` public API — LLM provider
|
|
5
|
+
* abstraction layer covering 12 providers (Anthropic / OpenAI / DeepSeek /
|
|
6
|
+
* Kimi / Qwen / Zhipu / MiniMax / MiMo / Gemini / Codex / etc.).
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createProvider, resolveProvider } from '@kodax-ai/kodax/llm';
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* See docs/ADR.md ADR-024 for the SDK formalization decision.
|
|
14
|
+
*/
|
|
15
|
+
export * from '@kodax-ai/llm';
|
package/dist/sdk-llm.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a as o,aa as oo,b as r,ba as ro,c as e,ca as eo,d as f,da as fo,e as m,ea as mo,f as p,fa as po,g as t,ga as to,h as x,ha as xo,i as a,ia as ao,j as b,ja as bo,k as c,ka as co,l as d,la as go,m as g,ma as ho,n as h,na as io,o as i,oa as jo,p as j,pa as ko,q as k,qa as lo,r as l,ra as no,s as n,sa as qo,t as q,ta as so,u as s,ua as uo,v as u,va as vo,w as v,x as w,y,z}from"./chunks/chunk-XI75LZIO.js";import"./chunks/chunk-4E76FLZ3.js";export{ho as DEFAULT_COST_RATES,a as KODAX_API_MIN_INTERVAL,t as KODAX_CAPPED_MAX_OUTPUT_TOKENS,Q as KODAX_DEFAULT_PROVIDER,c as KODAX_DEFAULT_THINKING_BUDGETS,x as KODAX_ESCALATED_MAX_OUTPUT_TOKENS,p as KODAX_MAX_TOKENS,P as KODAX_PROVIDERS,O as KODAX_PROVIDER_SNAPSHOTS,b as KODAX_REASONING_MODE_SEQUENCE,d as KODAX_REASONING_SAFETY_RESERVE,I as KodaXAnthropicCompatProvider,C as KodaXBaseProvider,o as KodaXError,f as KodaXNetworkError,J as KodaXOpenAICompatProvider,r as KodaXProviderError,e as KodaXRateLimitError,m as KodaXToolCallIdError,u as buildReasoningOverrideKey,jo as calculateCost,l as clampThinkingBudget,y as clearReasoningOverride,ao as clearRuntimeModelProviders,ko as createCostTracker,Z as createCustomProvider,A as extractHeadersFromError,so as formatCost,uo as formatCostReport,go as getAvailableProviderNames,K as getCodexCliDefaultModel,M as getCodexCliKnownModels,io as getCostRate,$ as getCustomProvider,eo as getCustomProviderList,fo as getCustomProviderModels,ro as getCustomProviderNames,j as getDefaultThinkingDepthForMode,L as getGeminiCliDefaultModel,N as getGeminiCliKnownModels,R as getProvider,V as getProviderConfiguredCapabilityProfile,U as getProviderConfiguredReasoningCapability,W as getProviderList,T as getProviderModel,X as getProviderModels,g as getReasoningCapability,po as getRuntimeModelProvider,xo as getRuntimeModelProviderNames,qo as getSummary,E as insertCacheBoundary,F as isCacheBoundary,oo as isCustomProviderName,co as isKnownProvider,S as isProviderConfigured,Y as isProviderName,h as isReasoningEnabled,to as isRuntimeModelProviderName,v as loadReasoningOverride,G as lowerCacheBoundaries,n as mapDepthToOpenAIReasoningEffort,B as normalizeCapabilityProfile,i as normalizeReasoningRequest,z as parseRetryAfter,D as parseToolInputWithSalvage,q as reasoningCapabilityToOverride,s as reasoningOverrideToCapability,lo as recordRetry,no as recordUsage,_ as registerCustomProviders,mo as registerModelProvider,bo as resolveProvider,k as resolveThinkingBudget,w as saveReasoningOverride,vo as sideQuery,H as stripCacheBoundaries};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK subpath entry — `@kodax-ai/kodax/repl`
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the entire `@kodax-ai/repl` public API — full interactive
|
|
5
|
+
* terminal experience built on Ink: `runInkInteractiveMode`, configuration
|
|
6
|
+
* loaders (`loadConfig` / `saveConfig`), session storage primitives,
|
|
7
|
+
* provider resolution, etc.
|
|
8
|
+
*
|
|
9
|
+
* Note: this subpath pulls Ink + React as transitive deps via the
|
|
10
|
+
* `@kodax-ai/repl` package. SDK consumers who only need configuration
|
|
11
|
+
* helpers (no UI) get fine-grained named imports — ESM tree-shaking
|
|
12
|
+
* is friendly to the side-effect-free helper exports.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { loadConfig, FileSessionStorage } from '@kodax-ai/kodax/repl';
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* See docs/ADR.md ADR-024 for the SDK formalization decision.
|
|
20
|
+
*/
|
|
21
|
+
export * from '@kodax-ai/repl';
|
package/dist/sdk-repl.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{$ as ko,$a as kr,A,Aa as Ro,Ab as Rr,B,Ba as So,Bb as Sr,C,Ca as To,Cb as Tr,D,Da as Uo,Db as Ur,E,Ea as Vo,Eb as Vr,F,Fa as Wo,Fb as Wr,G,Ga as Xo,Gb as Xr,H,Ha as Yo,Hb as Yr,I,Ia as Zo,Ib as Zr,J,Ja as _o,Jb as _r,K,Ka as $o,Kb as $r,L,La as or,Lb as oe,M,Ma as rr,Mb as re,N,Na as er,Nb as ee,O,Oa as fr,Ob as fe,P,Pa as mr,Pb as me,Q,Qa as pr,R,Ra as tr,S,Sa as xr,T,Ta as ar,U,Ua as br,V,Va as cr,W,Wa as dr,X,Xa as gr,Y,Ya as hr,Z,Za as ir,_ as jo,_a as jr,a as o,aa as lo,ab as lr,b as r,ba as no,bb as nr,c as e,ca as qo,cb as qr,d as f,da as so,db as sr,e as m,ea as uo,eb as ur,f as p,fa as vo,fb as vr,g as t,ga as wo,gb as wr,h as x,ha as yo,hb as yr,i as a,ia as zo,ib as zr,j as b,ja as Ao,jb as Ar,k as c,ka as Bo,kb as Br,l as d,la as Co,lb as Cr,m as g,ma as Do,mb as Dr,n as h,na as Eo,nb as Er,o as i,oa as Fo,ob as Fr,p as j,pa as Go,pb as Gr,q as k,qa as Ho,qb as Hr,r as l,ra as Io,rb as Ir,s as n,sa as Jo,sb as Jr,t as q,ta as Ko,tb as Kr,u as s,ua as Lo,ub as Lr,v as u,va as Mo,vb as Mr,w as v,wa as No,wb as Nr,x as w,xa as Oo,xb as Or,y,ya as Po,yb as Pr,z,za as Qo,zb as Qr}from"./chunks/chunk-WEEQZYZS.js";import{D as io,b as _,c as $,d as oo,e as ro,f as eo,h as fo,i as mo,j as po,k as to,u as xo,v as ao,w as bo,x as co,y as go,z as ho}from"./chunks/chunk-SF7WD7E5.js";import"./chunks/chunk-HUAU4KB3.js";import"./chunks/chunk-7LQ2NCHF.js";import"./chunks/chunk-N2VZ2MJF.js";import"./chunks/chunk-SONW6AC7.js";import"./chunks/chunk-XI75LZIO.js";import"./chunks/chunk-4E76FLZ3.js";export{Wo as App,Eo as AutocompleteContextProvider,Bo as BUILTIN_COMMANDS,qr as BackgroundTaskBar,$r as ConsoleCapturer,Q as DEFAULT_UI_STATE,ir as DialogSurface,No as DotsIndicator,me as FileSessionStorage,Yo as FullscreenTranscriptLayout,Ro as HistoryItemRenderer,Ko as InputPrompt,oo as KODAX_CONFIG_FILE,_ as KODAX_DIR,$ as KODAX_SESSIONS_DIR,po as KODAX_VERSION,U as KeyMatchers,P as KeypressHandlerPriority,I as KeypressParser,S as KeypressProvider,j as LRUCache,Qo as LoadingIndicator,Dr as MemorySessionStorage,Zo as MessageActions,So as MessageList,_o as MessageSelector,kr as NotificationsSurface,V as PERMISSION_MODES,ro as PREVIEW_MAX_LENGTH,Tr as PendingInputsIndicator,Oo as ProgressIndicator,or as PromptComposer,fr as PromptFooter,rr as PromptFooterLeftSide,er as PromptFooterRightSide,mr as PromptHelpMenu,hr as PromptSuggestionsSurface,jr as QueuedCommandsSurface,Xo as SimpleApp,Lo as SimpleInputPrompt,To as SimpleMessageDisplay,Vo as SimpleStatusBar,G as SingleLineTextInput,Mo as Spinner,nr as StashNotice,Uo as StatusBar,lr as StatusNoticesSurface,ur as StreamingProvider,M as StreamingState,gr as SuggestionsDisplay,O as TOOL_STATUS_ICONS,Io as TextBuffer,F as TextInput,Po as ThinkingIndicator,Rr as ToolCallDisplay,N as ToolCallStatus,Sr as ToolGroup,Qr as ToolProgressBar,Pr as ToolStatusBadge,$o as TranscriptViewport,ar as UIStateProvider,z as calculateVisualCursorFromLayout,y as calculateVisualLayout,uo as collectBashWriteTargets,X as computeConfirmTools,Nr as createCliEvents,tr as createHistoryItem,Br as createInteractiveContext,Or as createJsonEvents,Ar as createKeyMatcher,R as createKeypressManager,Er as createMemorySessionStorage,Kr as createRecoveryHistoryItem,Ir as createRetryHistoryItem,sr as createStreamingManager,xr as createToolCall,A as darkTheme,_r as detectTerminalCapabilities,x as detectTerminalHostProfile,t as detectTerminalRenderHost,Lr as emitRecoveryHistoryItem,Jr as emitRetryHistoryItem,Do as executeCommand,Fr as executeShellCommand,yo as extractTextContent,zo as extractTitle,Ao as formatMessagePreview,pr as generateId,no as generateSavePattern,vo as getBashOutsideProjectWriteRisk,q as getCharAtCodePoint,k as getCodePointLength,ho as getGitRoot,L as getKeyDisplayName,wo as getPlanModeBlockReason,xo as getProviderList,to as getProviderModel,g as getTerminalHostCapabilities,Yr as getTerminalWidth,D as getTheme,E as getThemeNames,mo as getVersion,n as getVisualWidth,w as getVisualWidthCached,r as hasCursorUpViewportYankRisk,f as hasMainScreenRenderScrollRisk,eo as hydrateProcessEnvFromShell,qo as isAlwaysConfirmPath,jo as isBashReadCommand,ko as isBashWriteCommand,i as isClassicReplForced,J as isFunctionKey,h as isOwnedRendererPreferred,so as isPathInsideProject,Y as isPermissionMode,K as isPrintable,ao as isProviderConfigured,e as isRemoteConptyHost,Zr as isScreenReader,Gr as isShellCommand,Hr as isShellCommandSuccess,m as isTmuxControlMode,lo as isToolCallAllowed,o as isVsCodeTerminalHostEnv,l as isWideChar,bo as loadConfig,B as minimalTheme,Z as normalizePermissionMode,Co as parseCommand,H as parseKeypress,W as permissionModeDisplayName,co as prepareRuntimeConfig,fe as processSpecialSyntax,io as rateLimitedCall,fo as registerConfiguredCustomProviders,p as resetTmuxControlModeProbeForTesting,a as resolveConfiguredTuiRendererMode,b as resolveEffectiveTuiRendererMode,d as resolveFullscreenPolicy,c as resolveInteractiveSurfacePreference,Mr as runInkInteractiveMode,ee as runInteractiveMode,go as saveConfig,s as splitByCodePoints,Vr as supports256Colors,Xr as supportsEmoji,Ur as supportsTrueColor,Wr as supportsUnicode,C as themes,Cr as touchContext,u as truncateByVisualWidth,Go as useAutocomplete,Fo as useAutocompleteContext,Ho as useInputHistory,zr as useKeypress,T as useKeypressManager,yr as useStreaming,wr as useStreamingActions,vr as useStreamingState,Jo as useTextBuffer,dr as useUI,cr as useUIActions,br as useUIState,v as visualWidthCache,oe as withCapture,re as withCaptureSync};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK subpath entry — `@kodax-ai/kodax/skills`
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the entire `@kodax-ai/skills` public API — skill loader,
|
|
5
|
+
* resolver, registry, frontmatter parser, etc. The `@kodax-ai/skills`
|
|
6
|
+
* package has zero external dependencies, making it the cheapest
|
|
7
|
+
* subpath for SDK consumers to pull in.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { loadSkill, SkillRegistry } from '@kodax-ai/kodax/skills';
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* See docs/ADR.md ADR-024 for the SDK formalization decision.
|
|
15
|
+
*/
|
|
16
|
+
export * from '@kodax-ai/skills';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
+
import{A as w,B as y,C as z,a as o,b as r,c as e,d as f,e as m,f as p,j as t,k as x,l as a,m as b,n as c,o as d,p as g,q as h,r as i,s as j,t as k,u as l,v as n,w as q,x as s,y as u,z as v}from"./chunks/chunk-SONW6AC7.js";import"./chunks/chunk-4E76FLZ3.js";export{u as SkillExecutor,l as SkillRegistry,i as VariableResolver,f as clearPluginSkillPaths,v as createExecutor,j as createResolver,c as discoverSkills,g as discoverSkillsWithMonorepo,w as executeSkill,y as expandSkillForLLM,z as formatSkillActivationMessage,m as getDefaultSkillPaths,d as getNestedSkillPaths,p as getSkillPathsFlat,n as getSkillRegistry,q as initializeSkillRegistry,e as listPluginSkillPaths,a as loadFullSkill,b as loadSkillFileContent,x as loadSkillMetadata,h as parseArguments,t as parseSkillMarkdown,o as registerPluginSkillPath,s as resetSkillRegistry,k as resolveSkillContent,r as unregisterPluginSkillPath};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FEATURE_090 (v0.7.32) — `kodax constructed <action>` CLI surface.
|
|
3
|
+
*
|
|
4
|
+
* Parallels `constructed_cli.ts`'s `kodax tools <action>` group but
|
|
5
|
+
* targets constructed AGENTS (and their self-modify lifecycle) rather
|
|
6
|
+
* than constructed TOOLS. Lives in its own file to keep FEATURE_088
|
|
7
|
+
* (tool inventory) and FEATURE_090 (agent self-modify governance)
|
|
8
|
+
* orthogonal — a future cleanup of either feature can move freely.
|
|
9
|
+
*
|
|
10
|
+
* Commands implemented in this file:
|
|
11
|
+
* - `kodax constructed reset-self-modify-budget <name>` — clear the
|
|
12
|
+
* per-agent self-modify counter. Use after a deliberate, audited
|
|
13
|
+
* decision to allow further self-modifications past the default
|
|
14
|
+
* N=3 budget. Writes a `self_modify_budget_reset` audit entry so
|
|
15
|
+
* the unlock event is replayable.
|
|
16
|
+
*
|
|
17
|
+
* Commands that will live here once P6 lands:
|
|
18
|
+
* - `kodax constructed rollback <name>`
|
|
19
|
+
* - `kodax constructed audit <name>`
|
|
20
|
+
* - `kodax constructed disable-self-modify <name>`
|
|
21
|
+
*
|
|
22
|
+
* Bootstrap policy: same as `constructed_cli.ts` — reject all activate
|
|
23
|
+
* attempts. None of these commands trigger activation; they read /
|
|
24
|
+
* mutate the persisted state and exit.
|
|
25
|
+
*/
|
|
26
|
+
interface CliOpts {
|
|
27
|
+
readonly cwd: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* `kodax constructed reset-self-modify-budget <name>`.
|
|
31
|
+
*
|
|
32
|
+
* Verifies the agent has at least one manifest on disk (cheap sanity
|
|
33
|
+
* check — resetting the budget for a non-existent agent would be
|
|
34
|
+
* harmless on its own but tends to indicate a typo). Reads the
|
|
35
|
+
* pre-reset state so the audit entry can record both before/after
|
|
36
|
+
* counts. Writes the reset, then writes the audit entry. Confirmation
|
|
37
|
+
* is printed in green; warnings (e.g., budget was already zero) are
|
|
38
|
+
* printed dimmed but the command still succeeds.
|
|
39
|
+
*
|
|
40
|
+
* Exit codes:
|
|
41
|
+
* 0 — reset persisted (counter is now 0/N), audit recorded
|
|
42
|
+
* 1 — agent unknown / IO failure / invalid input
|
|
43
|
+
*/
|
|
44
|
+
export declare function runResetSelfModifyBudget(name: string, opts: CliOpts): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* `kodax constructed audit <name>`.
|
|
47
|
+
*
|
|
48
|
+
* Print every recorded self-modify lifecycle entry for `name`,
|
|
49
|
+
* sorted oldest-first. Read-only — no disk mutations. Exits 0 even
|
|
50
|
+
* on empty audit (legitimate state for a freshly-staged agent).
|
|
51
|
+
*/
|
|
52
|
+
export declare function runConstructedAudit(name: string, opts: CliOpts): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* `kodax constructed disable-self-modify <name>`.
|
|
55
|
+
*
|
|
56
|
+
* Permanently disable an agent's self-modify capability. Writes the
|
|
57
|
+
* marker file then records the audit entry. Idempotent — disabling
|
|
58
|
+
* an already-disabled agent rewrites the marker timestamp and
|
|
59
|
+
* appends a fresh audit row.
|
|
60
|
+
*
|
|
61
|
+
* No symmetrical re-enable command exists by design (FEATURE_090
|
|
62
|
+
* spec: "用户可以永久拒绝某个 agent 的 self-modify 能力"). To
|
|
63
|
+
* regain a self-modifiable agent, stage a separately-named
|
|
64
|
+
* replacement.
|
|
65
|
+
*/
|
|
66
|
+
export declare function runDisableSelfModify(name: string, opts: CliOpts): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* `kodax constructed rollback <name>`.
|
|
69
|
+
*
|
|
70
|
+
* Restore the previously-active version of an agent. Delegates to
|
|
71
|
+
* `rollbackSelfModify()` which performs the revoke + re-register
|
|
72
|
+
* dance and re-runs admission against the rollback target. Records
|
|
73
|
+
* an audit entry with the from/to version pair.
|
|
74
|
+
*
|
|
75
|
+
* Exit codes:
|
|
76
|
+
* 0 — rollback succeeded
|
|
77
|
+
* 1 — no current active / no rollback target / admission failed /
|
|
78
|
+
* agent unknown
|
|
79
|
+
*/
|
|
80
|
+
export declare function runConstructedRollback(name: string, opts: CliOpts): Promise<void>;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FEATURE_090 (v0.7.32) — `kodax constructed <action>` CLI tests.
|
|
3
|
+
*
|
|
4
|
+
* The CLI helpers call `process.exit(1)` on input / IO errors. Tests
|
|
5
|
+
* stub `process.exit` so a failure path doesn't tear the test runner
|
|
6
|
+
* down. Stdout / stderr are spied on to assert the human-facing
|
|
7
|
+
* messages.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const SKILL_CREATOR_TOOLS: {
|
|
2
|
+
readonly init: "init-skill.js";
|
|
3
|
+
readonly validate: "quick-validate.js";
|
|
4
|
+
readonly eval: "run-eval.js";
|
|
5
|
+
readonly grade: "grade-evals.js";
|
|
6
|
+
readonly analyze: "analyze-benchmark.js";
|
|
7
|
+
readonly compare: "compare-runs.js";
|
|
8
|
+
readonly package: "package-skill.js";
|
|
9
|
+
readonly install: "install-skill.js";
|
|
10
|
+
};
|
|
11
|
+
export type SkillCreatorToolAction = keyof typeof SKILL_CREATOR_TOOLS;
|
|
12
|
+
export declare function resolveSkillCreatorToolPath(action: SkillCreatorToolAction, builtinPath?: string): string;
|
|
13
|
+
export declare function defaultSkillToolRunner(scriptPath: string, args: string[]): Promise<number>;
|
|
14
|
+
export declare function runSkillCreatorTool(action: SkillCreatorToolAction, args: string[], runner?: (scriptPath: string, args: string[]) => Promise<number>): Promise<void>;
|
|
15
|
+
export declare function toFileUrl(filePath: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kodax-ai/kodax",
|
|
3
|
+
"version": "0.7.39",
|
|
4
|
+
"description": "极致轻量化 Coding Agent - TypeScript 实现,支持 12 个 LLM 提供商,可发布为免 Node 单文件二进制",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"workspaces": [
|
|
7
|
+
"packages/*"
|
|
8
|
+
],
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"bin": {
|
|
12
|
+
"kodax": "scripts/kodax-bin.cjs"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./agent": {
|
|
20
|
+
"types": "./dist/sdk-agent.d.ts",
|
|
21
|
+
"import": "./dist/sdk-agent.js"
|
|
22
|
+
},
|
|
23
|
+
"./llm": {
|
|
24
|
+
"types": "./dist/sdk-llm.d.ts",
|
|
25
|
+
"import": "./dist/sdk-llm.js"
|
|
26
|
+
},
|
|
27
|
+
"./coding": {
|
|
28
|
+
"types": "./dist/sdk-coding.d.ts",
|
|
29
|
+
"import": "./dist/sdk-coding.js"
|
|
30
|
+
},
|
|
31
|
+
"./repl": {
|
|
32
|
+
"types": "./dist/sdk-repl.d.ts",
|
|
33
|
+
"import": "./dist/sdk-repl.js"
|
|
34
|
+
},
|
|
35
|
+
"./skills": {
|
|
36
|
+
"types": "./dist/sdk-skills.d.ts",
|
|
37
|
+
"import": "./dist/sdk-skills.js"
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "npm run build:packages && npm run build:bundle && tsc --emitDeclarationOnly",
|
|
43
|
+
"build:packages": "tsc -b tsconfig.build.json && npm run copy:builtin -w @kodax-ai/skills",
|
|
44
|
+
"build:bundle": "node scripts/build-bundle.mjs",
|
|
45
|
+
"dev": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_cli.ts",
|
|
46
|
+
"dev:cli": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs --import tsx src/kodax_cli.ts",
|
|
47
|
+
"dev:mem-diag": "node scripts/mem-diag-launch.cjs",
|
|
48
|
+
"dev:mem-snapshot": "node scripts/mem-diag-launch.cjs 2",
|
|
49
|
+
"probe:reasoning": "tsx scripts/probe-reasoning.ts",
|
|
50
|
+
"repointel:install": "node clients/repointel/scripts/install.mjs",
|
|
51
|
+
"repointel:demo": "node clients/repointel/scripts/demo.mjs",
|
|
52
|
+
"repointel:doctor": "node clients/repointel/scripts/doctor.mjs",
|
|
53
|
+
"start": "node --max-old-space-size=4096 --require ./scripts/production-env.cjs dist/kodax_cli.js",
|
|
54
|
+
"build:binary": "node scripts/build-binary.mjs",
|
|
55
|
+
"build:binary:all": "node scripts/build-binary.mjs --all",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:watch": "vitest",
|
|
58
|
+
"test:eval": "vitest run -c vitest.eval.config.ts",
|
|
59
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
60
|
+
"clean:packages": "npm run clean --workspaces"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"ai",
|
|
64
|
+
"coding-agent",
|
|
65
|
+
"llm",
|
|
66
|
+
"anthropic",
|
|
67
|
+
"openai",
|
|
68
|
+
"cli"
|
|
69
|
+
],
|
|
70
|
+
"author": "",
|
|
71
|
+
"license": "Apache-2.0",
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@agentclientprotocol/sdk": "^0.15.0",
|
|
74
|
+
"@alcalzone/ansi-tokenize": "^0.2.5",
|
|
75
|
+
"@anthropic-ai/sdk": "^0.80.0",
|
|
76
|
+
"ansi-escapes": "^7.3.0",
|
|
77
|
+
"auto-bind": "^5.0.1",
|
|
78
|
+
"chalk": "^5.4.1",
|
|
79
|
+
"cli-boxes": "^3.0.0",
|
|
80
|
+
"cli-cursor": "^4.0.0",
|
|
81
|
+
"cli-truncate": "^5.2.0",
|
|
82
|
+
"clipboardy": "^4.0.0",
|
|
83
|
+
"code-excerpt": "^4.0.0",
|
|
84
|
+
"commander": "^13.1.0",
|
|
85
|
+
"es-toolkit": "^1.46.1",
|
|
86
|
+
"fflate": "^0.8.2",
|
|
87
|
+
"glob": "^11.0.1",
|
|
88
|
+
"iconv-lite": "^0.6.3",
|
|
89
|
+
"indent-string": "^5.0.0",
|
|
90
|
+
"ink": "^6.7.0",
|
|
91
|
+
"ink-spinner": "^5.0.0",
|
|
92
|
+
"ink-text-input": "^6.0.0",
|
|
93
|
+
"is-in-ci": "^2.0.0",
|
|
94
|
+
"js-tiktoken": "^1.0.12",
|
|
95
|
+
"openai": "^6.32.0",
|
|
96
|
+
"partial-json": "^0.1.7",
|
|
97
|
+
"patch-console": "^2.0.0",
|
|
98
|
+
"react": ">=19.0.0",
|
|
99
|
+
"react-devtools-core": "^7.0.1",
|
|
100
|
+
"react-reconciler": "^0.33.0",
|
|
101
|
+
"scheduler": "^0.27.0",
|
|
102
|
+
"signal-exit": "^4.1.0",
|
|
103
|
+
"slice-ansi": "^8.0.0",
|
|
104
|
+
"stack-utils": "^2.0.6",
|
|
105
|
+
"string-width": "^7.0.0",
|
|
106
|
+
"terminal-size": "^4.0.1",
|
|
107
|
+
"tsx": "^4.21.0",
|
|
108
|
+
"typescript": "^5.9.3",
|
|
109
|
+
"widest-line": "^6.0.0",
|
|
110
|
+
"wrap-ansi": "^8.1.0",
|
|
111
|
+
"ws": "^8.18.0",
|
|
112
|
+
"yaml": "^2.8.2",
|
|
113
|
+
"yoga-layout": "^3.2.1",
|
|
114
|
+
"zod": "^3.25.0"
|
|
115
|
+
},
|
|
116
|
+
"devDependencies": {
|
|
117
|
+
"@types/node": "^22.13.4",
|
|
118
|
+
"@types/react": "^19.0.0",
|
|
119
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
120
|
+
"esbuild": "^0.27.7",
|
|
121
|
+
"ink-testing-library": "^4.0.0",
|
|
122
|
+
"vitest": "^3.2.4"
|
|
123
|
+
},
|
|
124
|
+
"engines": {
|
|
125
|
+
"node": ">=18.0.0"
|
|
126
|
+
},
|
|
127
|
+
"repository": {
|
|
128
|
+
"type": "git",
|
|
129
|
+
"url": "https://github.com/icetomoyo/KodaX.git"
|
|
130
|
+
},
|
|
131
|
+
"files": [
|
|
132
|
+
"dist",
|
|
133
|
+
"scripts/kodax-bin.cjs",
|
|
134
|
+
"scripts/production-env.cjs",
|
|
135
|
+
"README.md",
|
|
136
|
+
"README_CN.md",
|
|
137
|
+
"LICENSE",
|
|
138
|
+
"CHANGELOG.md"
|
|
139
|
+
],
|
|
140
|
+
"publishConfig": {
|
|
141
|
+
"access": "public"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* KodaX bin entry — CJS shim.
|
|
4
|
+
*
|
|
5
|
+
* Purpose: set NODE_ENV=production BEFORE any ESM module is evaluated.
|
|
6
|
+
* Background: when users invoke `kodax` via `npm link` / global install,
|
|
7
|
+
* node runs this bin directly without the --require preload used by
|
|
8
|
+
* `npm run dev` / `npm run start`. ESM static imports are hoisted and
|
|
9
|
+
* evaluated before module-body code runs, so setting NODE_ENV inside
|
|
10
|
+
* `src/kodax_cli.ts` is too late — React would already have loaded its
|
|
11
|
+
* development reconciler, leaking ~100 MB/turn of profiling objects.
|
|
12
|
+
*
|
|
13
|
+
* This CJS file runs synchronously first, requires the env preload,
|
|
14
|
+
* then dynamic-imports the compiled ESM entry.
|
|
15
|
+
*
|
|
16
|
+
* Opt back into development by setting KODAX_DEV=1.
|
|
17
|
+
*/
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
require('./production-env.cjs');
|
|
21
|
+
|
|
22
|
+
import('../dist/kodax_cli.js').catch((err) => {
|
|
23
|
+
// Surface unexpected errors with a full stack — this path should be rare.
|
|
24
|
+
// eslint-disable-next-line no-console
|
|
25
|
+
console.error(err);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preload script — must execute before any ESM module evaluation.
|
|
3
|
+
* Loaded via: node --require ./scripts/production-env.cjs ...
|
|
4
|
+
*
|
|
5
|
+
* React ships two runtimes: development (with PerformanceMeasure tracking,
|
|
6
|
+
* prop diff strings, component profiling) and production (zero overhead).
|
|
7
|
+
* Development mode creates ~100 MB/turn of profiling objects that are never
|
|
8
|
+
* released, causing inevitable OOM after 10-20 conversation rounds.
|
|
9
|
+
*
|
|
10
|
+
* Default to production. Set KODAX_DEV=1 to opt-in to development mode.
|
|
11
|
+
*/
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
if (!process.env.NODE_ENV) {
|
|
15
|
+
process.env.NODE_ENV = process.env.KODAX_DEV === '1' ? 'development' : 'production';
|
|
16
|
+
}
|