@kodax-ai/kodax 0.7.78 → 0.7.80
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 +3556 -3197
- package/README.md +371 -277
- package/README_CN.md +295 -215
- package/config-templates/config.example.jsonc +24 -2
- package/config-templates/integrations/a2a.example.jsonc +23 -7
- package/dist/builtin/skill-creator/scripts/aggregate-benchmark.js +2 -1
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/analyze-benchmark.js +4 -3
- package/dist/builtin/skill-creator/scripts/compare-runs.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/compare-runs.js +4 -3
- package/dist/builtin/skill-creator/scripts/generate-review.js +2 -1
- package/dist/builtin/skill-creator/scripts/grade-evals.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/grade-evals.js +4 -3
- package/dist/builtin/skill-creator/scripts/improve-description.js +2 -1
- package/dist/builtin/skill-creator/scripts/init-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/init-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/install-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/install-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/package-skill.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/package-skill.js +4 -3
- package/dist/builtin/skill-creator/scripts/quick-validate.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/quick-validate.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-eval.d.ts +1 -0
- package/dist/builtin/skill-creator/scripts/run-eval.js +4 -3
- package/dist/builtin/skill-creator/scripts/run-loop.js +2 -1
- package/dist/builtin/skill-creator/scripts/run-trigger-eval.js +2 -1
- package/dist/builtin/skill-creator/scripts/utils.d.ts +3 -0
- package/dist/builtin/skill-creator/scripts/utils.js +5 -1
- package/dist/chunks/agent-5PHGNFW3.js +2 -0
- package/dist/chunks/argument-completer-FXRZFMTC.js +2 -0
- package/dist/chunks/chunk-6UENDY33.js +89 -0
- package/dist/chunks/{chunk-6FOJVETH.js → chunk-BWX4YZX3.js} +7 -7
- package/dist/chunks/chunk-CDCCTM5I.js +278 -0
- package/dist/chunks/chunk-CEB5FDND.js +810 -0
- package/dist/chunks/{chunk-2CFHBKRE.js → chunk-E7C4DRD2.js} +2 -2
- package/dist/chunks/chunk-EVXIJPZ6.js +218 -0
- package/dist/chunks/chunk-FQ7NVMSU.js +319 -0
- package/dist/chunks/chunk-GC4JBMBS.js +385 -0
- package/dist/chunks/{chunk-Z3KFRTSB.js → chunk-HTVLCHWH.js} +1 -1
- package/dist/chunks/chunk-IHPH3444.js +655 -0
- package/dist/chunks/{chunk-YAZQTC2L.js → chunk-KHEFUT6O.js} +1 -1
- package/dist/chunks/{chunk-7OEBJGHK.js → chunk-PMKAG4SZ.js} +1 -1
- package/dist/chunks/chunk-RPF5RGWZ.js +479 -0
- package/dist/chunks/{chunk-UID7BLAB.js → chunk-RXXKDR6Y.js} +1 -1
- package/dist/chunks/chunk-T5U4OP2N.js +292 -0
- package/dist/chunks/chunk-TRNAWSXP.js +123 -0
- package/dist/chunks/chunk-UZSHBQER.js +30 -0
- package/dist/chunks/{chunk-TQDBTTIM.js → chunk-VECRQTSD.js} +44 -44
- package/dist/chunks/compaction-config-6J6XCBJS.js +2 -0
- package/dist/chunks/{construction-bootstrap-VQLQGWPY.js → construction-bootstrap-KPCAE3VN.js} +1 -1
- package/dist/chunks/dist-RWEVZOFK.js +2 -0
- package/dist/chunks/{dist-BFT5YIGU.js → dist-WWL2DNIJ.js} +1 -1
- package/dist/chunks/host-OGS2R5J4.js +2 -0
- package/dist/chunks/run-manager-2YMM3BOT.js +2 -0
- package/dist/chunks/{utils-SID4HW2Q.js → utils-2YHRUZYC.js} +1 -1
- package/dist/index.d.ts +21 -20
- package/dist/index.js +4 -4
- package/dist/kodax_bootstrap.js +2 -1
- package/dist/kodax_cli.js +1850 -1476
- package/dist/kodax_resume.js +570 -34
- package/dist/provider-capabilities.json +85 -50
- package/dist/runtime-worker.js +1737 -1369
- package/dist/sandbox-workspace-session.js +285 -19
- package/dist/sdk-a2a.d.ts +19 -13
- package/dist/sdk-a2a.js +8 -8
- package/dist/sdk-agent.d.ts +80 -150
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +186 -66
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-experimental-memory.d.ts +3 -3
- package/dist/sdk-experimental-memory.js +1 -1
- package/dist/sdk-llm.d.ts +7 -7
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +1 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.d.ts +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +31 -213
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +230 -31
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.d.ts +8 -8
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +283 -18
- package/dist/types-chunks/{base.d-4e74xDdy.d.ts → base.d-DxG0m09Z.d.ts} +1 -1
- package/dist/types-chunks/{bash-prefix-extractor.d-uAe2Oqda.d.ts → bash-prefix-extractor.d-DStqKIlu.d.ts} +31 -8
- package/dist/types-chunks/{capability-learning.d-CVsdHw4j.d.ts → capability-learning.d-iPSiAmc_.d.ts} +1 -1
- package/dist/types-chunks/{capsule.d-BlSv9l3V.d.ts → capsule.d-BuFJaYxA.d.ts} +14 -21
- package/dist/types-chunks/{types.d-BA-Jwpfs.d.ts → controller.d-C2aHqzHj.d.ts} +344 -11
- package/dist/types-chunks/{guardrail.d-CXDYRgZ3.d.ts → guardrail.d-DM-OK0m3.d.ts} +187 -116
- package/dist/types-chunks/{history-retrieval.d-DtCy7x64.d.ts → history-retrieval.d-DImTKgO6.d.ts} +16 -3
- package/dist/types-chunks/{oauth-login.d-Bgb4rdLN.d.ts → oauth-login.d-6i-vidxv.d.ts} +6 -2
- package/dist/types-chunks/{public-api.d-B3AohsxN.d.ts → public-api.d-CewTvUKV.d.ts} +335 -38
- package/dist/types-chunks/{repl.d-Ie_ZXb_U.d.ts → repl.d-DvXQtgr7.d.ts} +5 -5
- package/dist/types-chunks/{resolver.d-iAQ9ocLB.d.ts → resolver.d-C9IW4fmU.d.ts} +5 -2
- package/dist/types-chunks/{run-manager.d-D1twIhF9.d.ts → run-manager.d-C6ahvZqK.d.ts} +1 -1
- package/dist/types-chunks/{sdk-session-DB9KksIx.d.ts → sdk-session-C59RUrri.d.ts} +3 -3
- package/dist/types-chunks/shell-command-sets.d-Dp4UvPLL.d.ts +297 -0
- package/dist/types-chunks/{side-query.d-DTuLPcC5.d.ts → side-query.d-CP1LiRiH.d.ts} +8 -2
- package/dist/types-chunks/{types-D3g6XUQr.d.ts → types-Bf3Y3mW-.d.ts} +1 -1
- package/dist/types-chunks/{types.d-BH0ZkTGf.d.ts → types.d-BzpPDBPV.d.ts} +2 -2
- package/dist/types-chunks/{types.d-DIpZJKUl.d.ts → types.d-CgrXrFrq.d.ts} +16 -2
- package/dist/types-chunks/{types.d-DVDTIfB_.d.ts → types.d-yuJzE82x.d.ts} +4 -4
- package/dist/types-chunks/{utils.d-CVp6bFl9.d.ts → utils.d-BpACJmzt.d.ts} +24 -6
- package/docs/SDK_EMBEDDER_GUIDE.md +1148 -598
- package/package.json +6 -3
- package/dist/chunks/agent-ASP4MS3X.js +0 -2
- package/dist/chunks/argument-completer-JYQ7FX3W.js +0 -2
- package/dist/chunks/chunk-35PPHOQ2.js +0 -292
- package/dist/chunks/chunk-43QNNDHR.js +0 -29
- package/dist/chunks/chunk-5GO6FH7L.js +0 -458
- package/dist/chunks/chunk-5NDCSFOP.js +0 -78
- package/dist/chunks/chunk-6XM4B6K2.js +0 -48
- package/dist/chunks/chunk-6YZUE6NC.js +0 -240
- package/dist/chunks/chunk-KQLQYHWU.js +0 -386
- package/dist/chunks/chunk-NXO6GWSY.js +0 -46
- package/dist/chunks/chunk-T2XZTLYE.js +0 -316
- package/dist/chunks/chunk-VAT2QYXM.js +0 -765
- package/dist/chunks/chunk-YVRYHC4C.js +0 -655
- package/dist/chunks/compaction-config-BQSSIWK5.js +0 -2
- package/dist/chunks/dist-PCFE24YP.js +0 -2
- package/dist/chunks/host-UTFXCYYM.js +0 -2
- package/dist/chunks/run-manager-PJU3WIFJ.js +0 -2
- package/dist/types-chunks/guardrail.d-BRE_ErEj.d.ts +0 -156
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as KodaXProviderConfig, k as KodaXMessage, a2 as KodaXToolDefinition, I as KodaXReasoningRequest, z as KodaXProviderStreamOptions, O as KodaXStreamResult, a8 as KodaXVerifyCredentialResult, l as KodaXModelDescriptor, q as KodaXProviderCapabilityProfile, C as KodaXReasoningCapability, H as KodaXReasoningProfile, n as KodaXNormalizedReasoningRequest, aa as KodaXWireReasoningEffort } from './types.d-CgrXrFrq.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Retry-After header parsing — FEATURE_130 (v0.7.36).
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a0 as KodaXTokenUsage, k as KodaXMessage, a1 as KodaXToolDefinition, a9 as KodaXWireReasoningEffort, U as KodaXTaskRoutingDecision, V as KodaXTaskType, W as KodaXTaskWorkIntent, Q as KodaXTaskComplexity, L as KodaXRiskLevel, h as KodaXHarnessProfile, f as KodaXExecutionMode, b as KodaXChildFanoutClass, F as KodaXReasoningMode, J as KodaXReviewScale } from './types.d-DIpZJKUl.js';
|
|
3
|
-
import { d as SkillDynamicContextExecutor, I as ISkillRegistry } from './types.d-BbtGlKZu.js';
|
|
1
|
+
import { bI as KodaXGoalState, ae as AgentMessage, er as StopHookFn, c1 as KodaXSessionLineage, o as AgentActorStore, aI as AgentTurnExecutor, x as AgentBudgetPort, j as AgentActorOwner, D as AgentControllerHealth, h as AgentActorClient, T as AgentExecutionResult, $ as AgentExecutorPlaneBinding, bO as KodaXJsonValue, bC as KodaXExtensionSessionRecord, f as Agent, eT as WorkflowIsolation, bD as KodaXExtensionSessionState, bU as KodaXSessionArtifactLedgerEntry, eb as SessionErrorMetadata, c9 as KodaXSessionScope, ca as KodaXSessionStorage, bp as GuardrailPermissionIntent, db as MemoryContextIdentity, dn as MemoryPack, aQ as AskUserQuestionOptions, aM as AskUserAnswer, aO as AskUserMultiOptions, eQ as WorkflowEventCorrelation, a_ as CompactionUpdate, f5 as WorkflowProcessEvent, eP as WorkflowEvent, dC as MemoryReviewPlan, bR as KodaXMemoryOutcomeDigest, bl as Guardrail, b5 as DiscoveredInstance, bM as KodaXInputArtifact, dD as MemoryReviewRunner, eH as UnifiedLearningReviewRunner } from './controller.d-C2aHqzHj.js';
|
|
4
2
|
import { Diagnostic, Position, Location, Hover, DocumentSymbol, SymbolInformation, WorkspaceSymbol, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-protocol';
|
|
3
|
+
import { a1 as KodaXTokenUsage, k as KodaXMessage, a2 as KodaXToolDefinition, aa as KodaXWireReasoningEffort, V as KodaXTaskRoutingDecision, W as KodaXTaskType, X as KodaXTaskWorkIntent, R as KodaXTaskComplexity, M as KodaXRiskLevel, h as KodaXHarnessProfile, f as KodaXExecutionMode, b as KodaXChildFanoutClass, G as KodaXReasoningMode, L as KodaXReviewScale } from './types.d-CgrXrFrq.js';
|
|
4
|
+
import { d as SkillDynamicContextExecutor, I as ISkillRegistry } from './types.d-BbtGlKZu.js';
|
|
5
5
|
import { K as KodaXLlmTimeoutConfig, a as CostTracker } from './cost-tracker.d-BeaenODW.js';
|
|
6
|
-
import { t as MemoryRecallRunner } from './types-
|
|
6
|
+
import { t as MemoryRecallRunner } from './types-Bf3Y3mW-.js';
|
|
7
7
|
import { C as CapabilityKind, f as CapabilitySearchSnapshot, b as CapabilityResult } from './capability.d-K664nHOS.js';
|
|
8
|
-
import { K as KodaXBaseProvider } from './base.d-
|
|
8
|
+
import { K as KodaXBaseProvider } from './base.d-DxG0m09Z.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* FEATURE_192 v0.7.44 Phase C — Goal-tools execution context.
|
|
@@ -393,6 +393,7 @@ declare function workflowStartOutcomeConsumesTurn(input: {
|
|
|
393
393
|
interface LspServerLaunch {
|
|
394
394
|
readonly command: string;
|
|
395
395
|
readonly args: readonly string[];
|
|
396
|
+
readonly kind?: 'javascript';
|
|
396
397
|
readonly initializationOptions?: Record<string, unknown>;
|
|
397
398
|
}
|
|
398
399
|
interface DiscoverContext {
|
|
@@ -839,6 +840,7 @@ interface CodingActorSessionOptions {
|
|
|
839
840
|
readonly budget?: AgentBudgetPort;
|
|
840
841
|
readonly owner?: AgentActorOwner;
|
|
841
842
|
readonly isOwnerAlive?: (owner: AgentActorOwner) => boolean | Promise<boolean>;
|
|
843
|
+
readonly onHealthChanged?: (health: AgentControllerHealth) => void;
|
|
842
844
|
}
|
|
843
845
|
/** One Runtime-owned Actor tree for one KodaX session. */
|
|
844
846
|
declare class CodingActorSession {
|
|
@@ -851,6 +853,7 @@ declare class CodingActorSession {
|
|
|
851
853
|
initialize(): Promise<void>;
|
|
852
854
|
attach(parentCtx: KodaXToolExecutionContext, options: KodaXOptions, callerPath?: string): AgentActorClient;
|
|
853
855
|
rootControl(): AgentActorClient;
|
|
856
|
+
health(): AgentControllerHealth;
|
|
854
857
|
ownerId(): string | undefined;
|
|
855
858
|
ownsDurableFence(): boolean;
|
|
856
859
|
createWorkflowOwner(parentPath: string, runId: string): Promise<AgentActorClient>;
|
|
@@ -1361,7 +1364,7 @@ interface ExtensionRuntimeContract extends CapabilityRuntimeContract {
|
|
|
1361
1364
|
* eligibility is still driven by `planModeAllowed`,
|
|
1362
1365
|
* unchanged.
|
|
1363
1366
|
* - `'mutates-network'` — performs a network request that may mutate remote
|
|
1364
|
-
* state (
|
|
1367
|
+
* state (for example mcp_call).
|
|
1365
1368
|
* - `'mutates-state'` — changes internal session/agent state without
|
|
1366
1369
|
* FS or shell side effects (todo_update,
|
|
1367
1370
|
* send_message, spawn_agent, followup_task,
|
|
@@ -1847,10 +1850,12 @@ interface KodaXEvents {
|
|
|
1847
1850
|
onTurnStarted?: (event: KodaXTurnStartedEvent) => void;
|
|
1848
1851
|
onTurnCompleted?: (event: KodaXTurnCompletedEvent) => void;
|
|
1849
1852
|
onTurnFailed?: (event: KodaXTurnFailedEvent) => void;
|
|
1853
|
+
/** `maxIter` is the active Runner invocation's fuse, not a task-wide budget. */
|
|
1850
1854
|
onIterationStart?: (iter: number, maxIter: number, meta?: KodaXActivityEventMeta) => void;
|
|
1851
1855
|
/** Called after each iteration with current token count for UI updates */
|
|
1852
1856
|
onIterationEnd?: (info: {
|
|
1853
1857
|
iter: number;
|
|
1858
|
+
/** Active Runner invocation fuse; zero is reserved for unbounded callers. */
|
|
1854
1859
|
maxIter: number;
|
|
1855
1860
|
tokenCount: number;
|
|
1856
1861
|
tokenSource: 'api' | 'estimate';
|
|
@@ -2794,6 +2799,12 @@ interface KodaXShellSandbox {
|
|
|
2794
2799
|
prepare(input: KodaXShellSandboxPrepareInput): Promise<KodaXPreparedShellSandboxInvocation | undefined>;
|
|
2795
2800
|
}
|
|
2796
2801
|
interface KodaXContextOptions {
|
|
2802
|
+
/**
|
|
2803
|
+
* Runtime-authenticated authority for permission review. Child runtimes must
|
|
2804
|
+
* preserve the root request and add delegation metadata instead of treating
|
|
2805
|
+
* their generated briefing as a new user authorization.
|
|
2806
|
+
*/
|
|
2807
|
+
permissionIntent?: GuardrailPermissionIntent;
|
|
2797
2808
|
/** Runtime-owner config home used by Memory, review inbox, and Learned Area routing. */
|
|
2798
2809
|
configHome?: string;
|
|
2799
2810
|
/** Runtime-internal shared work ledger inherited by every descendant Agent run. */
|
|
@@ -3167,6 +3178,8 @@ interface KodaXOptions {
|
|
|
3167
3178
|
workflow?: {
|
|
3168
3179
|
readonly maxConcurrency?: number;
|
|
3169
3180
|
};
|
|
3181
|
+
/** Host environment names exposed only to final command targets. Defaults to none. */
|
|
3182
|
+
sandbox?: KodaXSandboxOptions;
|
|
3170
3183
|
/** FEATURE_221: SDK-consumer self-manual injection (product name + topics). */
|
|
3171
3184
|
selfManual?: KodaXSelfManualConfig;
|
|
3172
3185
|
/**
|
|
@@ -3209,6 +3222,10 @@ interface KodaXOptions {
|
|
|
3209
3222
|
*/
|
|
3210
3223
|
timeouts?: KodaXTimeoutConfig;
|
|
3211
3224
|
}
|
|
3225
|
+
interface KodaXSandboxOptions {
|
|
3226
|
+
/** Exact host environment-variable names; values are never carried in this option. */
|
|
3227
|
+
readonly envPass?: readonly string[];
|
|
3228
|
+
}
|
|
3212
3229
|
/**
|
|
3213
3230
|
* Low-level mutators handed to a `KodaXSessionControl` by the substrate.
|
|
3214
3231
|
* Each setter writes directly into the live `RuntimeSessionState`. Called
|
|
@@ -3474,6 +3491,8 @@ interface KodaXToolExecutionContext {
|
|
|
3474
3491
|
};
|
|
3475
3492
|
/** Shared root-run work ledger; descendant runtimes retain this exact object. */
|
|
3476
3493
|
managedWorkBudget?: KodaXManagedWorkBudget;
|
|
3494
|
+
/** Trusted permission authority inherited independently of child transcripts. */
|
|
3495
|
+
permissionIntent?: GuardrailPermissionIntent;
|
|
3477
3496
|
/** Trusted host operations that are intentionally absent from model-facing clients. */
|
|
3478
3497
|
actorHost?: KodaXActorHost;
|
|
3479
3498
|
/** FEATURE_260: current exactly-scoped read-only MemorySession query binding. */
|
|
@@ -3547,6 +3566,8 @@ interface KodaXToolExecutionContext {
|
|
|
3547
3566
|
executionCwd?: string;
|
|
3548
3567
|
/** Validated shell execution policy inherited by native child runtimes. */
|
|
3549
3568
|
shellExecution?: KodaXShellExecutionContract;
|
|
3569
|
+
/** Run-scoped command-target environment policy supplied by the SDK host. */
|
|
3570
|
+
sandbox?: KodaXSandboxOptions;
|
|
3550
3571
|
/** Runtime-owned OS sandbox broker for selected concrete shell calls. */
|
|
3551
3572
|
shellSandbox?: KodaXShellSandbox;
|
|
3552
3573
|
/** Structured containment metadata; never model-visible or persisted as conversation text. */
|
|
@@ -3640,6 +3661,8 @@ interface KodaXToolExecutionContext {
|
|
|
3640
3661
|
readonly contextDiagnostics?: boolean;
|
|
3641
3662
|
readonly disablePromptCache?: boolean;
|
|
3642
3663
|
readonly shellExecution?: KodaXShellExecutionContract;
|
|
3664
|
+
readonly sandbox?: KodaXSandboxOptions;
|
|
3665
|
+
readonly permissionIntent?: GuardrailPermissionIntent;
|
|
3643
3666
|
};
|
|
3644
3667
|
/** Parent SDK/REPL callback surface used to preserve nested Agent telemetry. */
|
|
3645
3668
|
parentEvents?: KodaXEvents;
|
|
@@ -3999,5 +4022,5 @@ interface CreateBashPrefixExtractorOptions {
|
|
|
3999
4022
|
*/
|
|
4000
4023
|
declare function createBashPrefixExtractor(opts: CreateBashPrefixExtractorOptions): BashPrefixExtractor;
|
|
4001
4024
|
|
|
4002
|
-
export { ALWAYS_RESIDENT_TOOL_NAMES as A, BASH_POLICY_SPEC as B,
|
|
4003
|
-
export type { KodaXManualTopicInput as $, CapabilityRuntimeContract as C, DiagnosticsRequest as D, ExtensionRuntimeContract as E, FailureStage as F, GoalBlockedResult as G, KodaXChildContextBundle as H, KodaXChildExecutionResult as I, KodaXCompactionOverride as J, KodaXActivityEventMeta as K, KodaXContextCompactionFinishedEvent as L, KodaXContextIdentity as M, KodaXContextOptions as N, KodaXContextTokenSnapshot as O, KodaXEffectiveTaskConfig as P, KodaXEvents as Q, KodaXLiveEventMeta as R, KodaXManagedBudgetSnapshot as S, KodaXManagedProtocolPayload as T, KodaXManagedTask as U, KodaXManagedTaskRuntimeState as V, KodaXManagedTaskStatusEvent as W, KodaXManualIndexTopic as X, KodaXManualSource as Y, KodaXManualTopic as Z, KodaXManualTopicId as _, BashPrefixExtractor as a,
|
|
4025
|
+
export { ALWAYS_RESIDENT_TOOL_NAMES as A, BASH_POLICY_SPEC as B, recordCompactionSavings as b$, LSP_SERVERS as b1, LspService as b3, buildGoalRuntimeBinding as bJ, consumeCompactionCooldown as bK, createBashPrefixExtractor as bL, createCompactionAntiThrashState as bM, createExternalActorTurnExecutor as bN, createLocalCodingActorControl as bO, createRuntimeContextBudgetSnapshot as bP, decideWorkflowInvocation as bQ, drainPendingSwaps as bR, estimateToolSchemaTokens as bS, extractCommandPrefix as bT, getDefaultLspService as bU, hasExplicitNaturalLanguageWorkflowIntent as bV, hasPendingSwap as bW, makeDisabledGoalToolsContext as bX, normalizeKodaXAgentMode as bY, planToolExposure as bZ, providerResilienceConfigFromTimeouts as b_, resolveConstructedAgent as c0, shouldSkipLlmCompaction as c1, shutdownDefaultLspService as c2, withGoalBeforeNextTurn as c3, withGoalStopHook as c4, workflowStartOutcomeConsumesTurn as c5, CodingActorSession as d };
|
|
4026
|
+
export type { KodaXManualTopicInput as $, CapabilityRuntimeContract as C, DiagnosticsRequest as D, ExtensionRuntimeContract as E, FailureStage as F, GoalBlockedResult as G, KodaXChildContextBundle as H, KodaXChildExecutionResult as I, KodaXCompactionOverride as J, KodaXActivityEventMeta as K, KodaXContextCompactionFinishedEvent as L, KodaXContextIdentity as M, KodaXContextOptions as N, KodaXContextTokenSnapshot as O, KodaXEffectiveTaskConfig as P, KodaXEvents as Q, KodaXLiveEventMeta as R, KodaXManagedBudgetSnapshot as S, KodaXManagedProtocolPayload as T, KodaXManagedTask as U, KodaXManagedTaskRuntimeState as V, KodaXManagedTaskStatusEvent as W, KodaXManualIndexTopic as X, KodaXManualSource as Y, KodaXManualTopic as Z, KodaXManualTopicId as _, BashPrefixExtractor as a, KodaXWorkflowEventMeta as a$, KodaXMemoryStrategy as a0, KodaXOptions as a1, KodaXOrchestrationVerdict as a2, KodaXParentReductionContract as a3, KodaXPreparedShellSandboxInvocation as a4, KodaXPromptCacheDiagnosticEvent as a5, KodaXProviderPolicyHints as a6, KodaXRepoIntelligenceCapability as a7, KodaXRepoIntelligenceMode as a8, KodaXRepoIntelligenceResolvedMode as a9, KodaXSkillScriptRunner as aA, KodaXTaskCapabilityHint as aB, KodaXTaskContract as aC, KodaXTaskEvidenceArtifact as aD, KodaXTaskEvidenceBundle as aE, KodaXTaskEvidenceEntry as aF, KodaXTaskRole as aG, KodaXTaskRoleAssignment as aH, KodaXTaskStatus as aI, KodaXTaskSurface as aJ, KodaXTaskToolPolicy as aK, KodaXTaskVerificationContract as aL, KodaXTaskVerificationCriterion as aM, KodaXTaskWorkItem as aN, KodaXTimeoutConfig as aO, KodaXToolEventMeta as aP, KodaXToolExecutionContext as aQ, KodaXToolSandboxObservationUpdate as aR, KodaXToolVisibilityMeta as aS, KodaXToolVisibilityPolicy as aT, KodaXTurnCompletedEvent as aU, KodaXTurnDeliveryKind as aV, KodaXTurnFailedEvent as aW, KodaXTurnStartedEvent as aX, KodaXVerificationScorecard as aY, KodaXVerificationScorecardCriterion as aZ, KodaXWorkflowAgentDigestEvent as a_, KodaXRepoIntelligenceTrace as aa, KodaXRepoIntelligenceTraceEvent as ab, KodaXRepoRoutingSignals as ac, KodaXResult as ad, KodaXRoleRoundSummary as ae, KodaXRuntimeVerificationContract as af, KodaXSandboxOptions as ag, KodaXSelfManualConfig as ah, KodaXSessionControl as ai, KodaXSessionMutators as aj, KodaXSessionOptions as ak, KodaXShellExecutionContract as al, KodaXShellKind as am, KodaXShellProfileMode as an, KodaXShellSandbox as ao, KodaXShellSandboxBackend as ap, KodaXShellSandboxObservation as aq, KodaXShellSandboxPrepareInput as ar, KodaXSidecarMessageEvent as as, KodaXSkillDynamicContextPolicy as at, KodaXSkillInvocationContext as au, KodaXSkillMap as av, KodaXSkillProjectionConfidence as aw, KodaXSkillScriptInputFile as ax, KodaXSkillScriptOutputFile as ay, KodaXSkillScriptRunInput as az, BashPrefixResult as b, KodaXWorkflowTimeoutConfig as b0, LspServerInfo as b2, LspServiceConfig as b4, ProviderExecutionState as b5, ProviderRecoveryEvent as b6, ProviderResilienceConfig as b7, ProviderResiliencePolicy as b8, RecoveryAction as b9, WorkflowInvocationAction as bA, WorkflowInvocationPolicyDecision as bB, WorkflowInvocationPolicyInput as bC, WorkflowInvocationSource as bD, WorkflowStartOutcome as bE, WorkflowToolHost as bF, WorkflowToolHostInlineInput as bG, WorkflowToolHostResult as bH, WorkflowToolHostStartResult as bI, RecoveryDecision as ba, RecoveryLadderStep as bb, RecoveryResult as bc, ResilienceClassification as bd, ResilienceErrorClass as be, ResolveKodaXManualInput as bf, ResolveKodaXManualOptions as bg, ResolveKodaXManualResult as bh, RuntimeCompactionSkippedEvent as bi, RuntimeContextBudgetBreakdown as bj, RuntimeContextBudgetRecommendation as bk, RuntimeContextBudgetSnapshot as bl, RuntimeContextBudgetSnapshotInput as bm, RuntimeContextOptimizationProfile as bn, RuntimeContextPressure as bo, RuntimeDefaultsSnapshot as bp, RuntimeToolExposureDecision as bq, RuntimeToolExposureMode as br, RuntimeToolExposurePlan as bs, RuntimeToolExposurePlanInput as bt, RuntimeToolExposureReason as bu, TodoItem as bv, TodoList as bw, TodoStatus as bx, ToolSideEffect as by, WorkflowHostPolicy as bz, BoundExtensionRuntimeController as c, CodingActorSessionOptions as e, CompactionAntiThrashConfig as f, CompactionAntiThrashState as g, CompactionSavingsDecision as h, CompactionSavingsSample as i, CompactionSkipReason as j, CreateBashPrefixExtractorOptions as k, ExtractCommandPrefixOptions as l, GoalCompleteResult as m, GoalCreateInput as n, GoalLifecycleContext as o, GoalRuntimeBinding as p, GoalRuntimeBindingDeps as q, GoalToolsContext as r, KodaXActorHost as s, KodaXAgentMode as t, KodaXAgentProfile as u, KodaXAgentScope as v, KodaXBudgetDisclosureZone as w, KodaXBudgetExtensionRequest as x, KodaXCanonicalAgentMode as y, KodaXChildAgentResult as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as KodaXMessage } from './types.d-
|
|
2
|
-
import {
|
|
1
|
+
import { k as KodaXMessage } from './types.d-CgrXrFrq.js';
|
|
2
|
+
import { ae as AgentMessage, ea as SessionEntry, e8 as Session, ec as SessionExtension, c1 as KodaXSessionLineage, bO as KodaXJsonValue, aW as CompactionDetails, bB as KodaXCompactMemorySeed, bZ as KodaXSessionEntry, cb as KodaXSessionTreeNode, c0 as KodaXSessionLabelEntry, b$ as KodaXSessionGoalEntry, bW as KodaXSessionClientNoticeEntry, c7 as KodaXSessionRewindMarkerEntry, c2 as KodaXSessionMemoryOutcomeDigestEntry, c3 as KodaXSessionMemoryReviewReceiptEntry, c6 as KodaXSessionNavigationOptions, bU as KodaXSessionArtifactLedgerEntry, bj as FileOperations, eW as WorkflowMeta, eX as WorkflowModelHint, eY as WorkflowModule } from './controller.d-C2aHqzHj.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @kodax-ai/agent Constants
|
|
@@ -18,24 +18,15 @@ declare const KODAX_API_MIN_INTERVAL = 0.5;
|
|
|
18
18
|
declare const PROMISE_PATTERN: RegExp;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Provider-neutral, non-blocking token estimation.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* This intentionally avoids Provider-specific BPE vocabularies on the main
|
|
24
|
+
* runtime thread. Provider usage remains the authoritative context baseline;
|
|
25
|
+
* these estimates account for new messages and enforce protective budgets.
|
|
24
26
|
*/
|
|
25
27
|
|
|
26
|
-
/**
|
|
27
|
-
* 估算消息的 token 数量
|
|
28
|
-
*
|
|
29
|
-
* 精确计算包括:
|
|
30
|
-
* - 消息结构开销(每条约 4 tokens)
|
|
31
|
-
* - 角色标识
|
|
32
|
-
* - 内容文本
|
|
33
|
-
* - 工具调用和结果
|
|
34
|
-
*/
|
|
35
28
|
declare function estimateTokens(messages: readonly KodaXMessage[]): number;
|
|
36
|
-
/**
|
|
37
|
-
* 计算单个文本的 token 数量(便捷函数)
|
|
38
|
-
*/
|
|
29
|
+
/** Estimate a text value without loading a BPE vocabulary or token array. */
|
|
39
30
|
declare function countTokens(text: string): number;
|
|
40
31
|
|
|
41
32
|
/**
|
|
@@ -481,7 +472,7 @@ declare class LineageCompaction implements CompactionPolicy {
|
|
|
481
472
|
|
|
482
473
|
/**
|
|
483
474
|
* 生成会话 ID
|
|
484
|
-
* 格式: YYYYMMDD_HHMMSS_<suffix> (suffix = ms
|
|
475
|
+
* 格式: YYYYMMDD_HHMMSS_<suffix> (suffix = ms base36 + 48-bit random hex)
|
|
485
476
|
*
|
|
486
477
|
* FEATURE_219 (v0.7.46): the date-prefix is preserved (sortable +
|
|
487
478
|
* human-readable), but a per-call suffix makes the id GLOBALLY unique.
|
|
@@ -490,6 +481,8 @@ declare class LineageCompaction implements CompactionPolicy {
|
|
|
490
481
|
* directory layout the same id could otherwise exist in two project folders
|
|
491
482
|
* and make `loadSession(id)` ambiguous. See ADR-038 §7.
|
|
492
483
|
*/
|
|
484
|
+
declare function generateSessionIdSync(): string;
|
|
485
|
+
/** Preserve the established async public API for existing consumers. */
|
|
493
486
|
declare function generateSessionId(): Promise<string>;
|
|
494
487
|
/**
|
|
495
488
|
* 从消息中提取标题
|
|
@@ -510,7 +503,7 @@ declare function createSessionLineage(messages: KodaXMessage[], previous?: KodaX
|
|
|
510
503
|
*
|
|
511
504
|
* Traversal stops safely if malformed data introduces a parent cycle.
|
|
512
505
|
*/
|
|
513
|
-
declare function getSessionLineagePath(lineage: KodaXSessionLineage, targetId?: string | null): NavigableSessionEntry[];
|
|
506
|
+
declare function getSessionLineagePath(lineage: KodaXSessionLineage, targetId?: string | null, checkpoint?: () => void): NavigableSessionEntry[];
|
|
514
507
|
/**
|
|
515
508
|
* Build the effective LLM-visible message context for the active lineage path.
|
|
516
509
|
*
|
|
@@ -528,7 +521,7 @@ declare function getSessionMessagesFromLineage(lineage: KodaXSessionLineage, tar
|
|
|
528
521
|
/**
|
|
529
522
|
* Resolve an entry selector using either a direct entry id or the latest label.
|
|
530
523
|
*/
|
|
531
|
-
declare function resolveSessionLineageTarget(lineage: KodaXSessionLineage, selector: string): NavigableSessionEntry | undefined;
|
|
524
|
+
declare function resolveSessionLineageTarget(lineage: KodaXSessionLineage, selector: string, checkpoint?: () => void): NavigableSessionEntry | undefined;
|
|
532
525
|
/**
|
|
533
526
|
* Move the active leaf to a selected target, optionally appending a
|
|
534
527
|
* branch-summary node that captures the abandoned path.
|
|
@@ -593,7 +586,7 @@ declare function applyLineageTruncation(lineage: KodaXSessionLineage | undefined
|
|
|
593
586
|
declare function evictOldIslandMessageContent(lineage: KodaXSessionLineage): KodaXSessionLineage;
|
|
594
587
|
declare function findPreviousUserEntryId(lineage: KodaXSessionLineage): string | null;
|
|
595
588
|
declare function rewindSessionLineage(lineage: KodaXSessionLineage, targetEntryId: string): KodaXSessionLineage | null;
|
|
596
|
-
declare function forkSessionLineage(lineage: KodaXSessionLineage, selector?: string): KodaXSessionLineage | null;
|
|
589
|
+
declare function forkSessionLineage(lineage: KodaXSessionLineage, selector?: string, checkpoint?: () => void): KodaXSessionLineage | null;
|
|
597
590
|
/**
|
|
598
591
|
* Convert a lineage into a nested tree structure for UI presentation.
|
|
599
592
|
*/
|
|
@@ -768,5 +761,5 @@ declare function buildWorkflowCapsuleIntent(manifest: {
|
|
|
768
761
|
readonly originalRequest?: string;
|
|
769
762
|
}): WorkflowCapsuleIntent;
|
|
770
763
|
|
|
771
|
-
export { createSessionLineage as $, DefaultSummaryCompaction as D, KODAX_API_MIN_INTERVAL as K, LINEAGE_ENTRY_TYPES as L, actorQueueId as N, appendSessionLineageLabel as O, PROMISE_PATTERN as P, applyLineageTruncation as Q, applySessionCompaction as R, archiveOldIslands as S, assertRestrictedWorkflowQuality as T, buildSessionTree as U, buildWorkflowCapsuleIntent as V, WORKFLOW_CAPSULE_API_VERSION as W, cleanupIncompleteToolCalls as X, countActiveLineageMessages as Y, countTokens as Z, _resetActiveRootQueueRoutesForTests as _, createWorkflowCapsule as a0, createWorkflowModuleFromCapsule as a1, estimateTokens as a2, evictOldIslandMessageContent as a3, extractArtifactLedger as a4, extractFileOps as a5, extractTitleFromMessages as a6, findPreviousUserEntryId as a7, forkSessionLineage as a8, generateSessionId as a9,
|
|
764
|
+
export { createSessionLineage as $, DefaultSummaryCompaction as D, KODAX_API_MIN_INTERVAL as K, LINEAGE_ENTRY_TYPES as L, actorQueueId as N, appendSessionLineageLabel as O, PROMISE_PATTERN as P, applyLineageTruncation as Q, applySessionCompaction as R, archiveOldIslands as S, assertRestrictedWorkflowQuality as T, buildSessionTree as U, buildWorkflowCapsuleIntent as V, WORKFLOW_CAPSULE_API_VERSION as W, cleanupIncompleteToolCalls as X, countActiveLineageMessages as Y, countTokens as Z, _resetActiveRootQueueRoutesForTests as _, createWorkflowCapsule as a0, createWorkflowModuleFromCapsule as a1, estimateTokens as a2, evictOldIslandMessageContent as a3, extractArtifactLedger as a4, extractFileOps as a5, extractTitleFromMessages as a6, findPreviousUserEntryId as a7, forkSessionLineage as a8, generateSessionId as a9, generateSessionIdSync as aa, getAgentConfigHome as ab, getAgentConfigPath as ac, getAppDataDir as ad, getSessionLineagePath as ae, getSessionMessagesFromLineage as af, isPathInsideDirectory as ag, lintRestrictedWorkflowSource as ah, mergeArtifactLedger as ai, mergeFileOps as aj, registerActiveRootQueueRoute as ak, resolveActiveRootQueueRoute as al, resolveExecutionPath as am, resolveSessionLineageTarget as an, rewindSessionLineage as ao, setAgentConfigHome as ap, setSessionLineageActiveEntry as aq, validateAndFixToolHistory as ar, validateWorkflowCapsule as as, validateWorkflowScriptManifest as at, KODAX_DEFAULT_TIMEOUT as f, KODAX_HARD_TIMEOUT as g, KODAX_MAX_INCOMPLETE_RETRIES as h, KODAX_MAX_MAXTOKENS_RETRIES as i, KODAX_MAX_RETRIES as j, KODAX_MAX_TOKENS as k, KODAX_RETRY_BASE_DELAY as l, KODAX_STAGGER_DELAY as m, LineageCompaction as o, LineageExtension as r, WORKFLOW_CAPSULE_FORMAT as v, WORKFLOW_CAPSULE_VERSION as w, WORKFLOW_PATTERN_IDS as x };
|
|
772
765
|
export type { WorkflowCapsuleInputs as A, WorkflowCapsuleIntent as B, CompactionContext as C, WorkflowCapsuleProvenance as E, WorkflowCapsuleRequirements as F, WorkflowPatternId as G, WorkflowQualityLintFinding as H, WorkflowQualityLintOptions as I, WorkflowQualityLintSeverity as J, WorkflowScriptManifest as M, CompactionEntry as a, CompactionEntryPayload as b, CompactionPolicy as c, CreateWorkflowCapsuleInput as d, DefaultSummaryCompactionOptions as e, LineageArtifactLedgerPayload as n, LineageCompactionDelegates as p, LineageEntryType as q, LineageLabelPayload as s, LineageTreeNode as t, PolicyCompactionResult as u, WorkflowCapsule as y, WorkflowCapsuleEnvironmentRequirement as z };
|