@kodax-ai/kodax 0.7.63 → 0.7.67
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 +2390 -2189
- package/README.md +118 -16
- package/README_CN.md +78 -12
- package/dist/chunks/{agent-SL444XLN.js → agent-E4V5SLX6.js} +1 -1
- package/dist/chunks/argument-completer-N6RT5KYT.js +2 -0
- package/dist/chunks/{chunk-ARUWXX25.js → chunk-35P7QL2Q.js} +1 -1
- package/dist/chunks/chunk-AKMXJSGM.js +56 -0
- package/dist/chunks/{chunk-L3MF5V64.js → chunk-CW32NQFO.js} +1 -1
- package/dist/chunks/{chunk-KCFVGXVK.js → chunk-DEICMTHO.js} +9 -9
- package/dist/chunks/{chunk-7MPU7TP6.js → chunk-EN3O2C43.js} +270 -270
- package/dist/chunks/chunk-KBBGDRER.js +22 -0
- package/dist/chunks/chunk-NVDK375I.js +729 -0
- package/dist/chunks/{chunk-S4GVQO3W.js → chunk-O7N22GJ3.js} +1 -1
- package/dist/chunks/chunk-ONUPGMER.js +2 -0
- package/dist/chunks/{chunk-ZL5CEANW.js → chunk-PZTG2C33.js} +1 -1
- package/dist/chunks/chunk-QI6SQ2UQ.js +306 -0
- package/dist/chunks/{chunk-6OZ5KWG3.js → chunk-QJJKMNZF.js} +1 -1
- package/dist/chunks/chunk-RS2GAABJ.js +328 -0
- package/dist/chunks/chunk-W2XMNYLK.js +15 -0
- package/dist/chunks/chunk-WCSSXBHR.js +419 -0
- package/dist/chunks/chunk-YH5BTUQO.js +343 -0
- package/dist/chunks/{chunk-UA744TZM.js → chunk-YRBNXFHY.js} +1 -1
- package/dist/chunks/compaction-config-56NO42ZI.js +2 -0
- package/dist/chunks/{construction-bootstrap-EFZBONTK.js → construction-bootstrap-GLEHQ2KB.js} +1 -1
- package/dist/chunks/{devtools-4CRULTR2.js → devtools-CD6KSIHE.js} +1 -1
- package/dist/chunks/{devtools-YINBSZC7.js → devtools-XR5F2C6T.js} +1 -1
- package/dist/chunks/{dist-73L4OYPD.js → dist-4PXB7U22.js} +1 -1
- package/dist/chunks/dist-4UIRSSFS.js +2 -0
- package/dist/chunks/host-DMREFNSO.js +2 -0
- package/dist/chunks/{paste-FDYM7SZX.js → paste-C33GZQV5.js} +1 -1
- package/dist/chunks/run-manager-P5XMSGZ7.js +2 -0
- package/dist/chunks/utils-JENPFKAE.js +2 -0
- package/dist/constructed-handler-worker.js +2 -0
- package/dist/index.d.ts +25 -11
- package/dist/index.js +6 -6
- package/dist/kodax_cli.js +1282 -1232
- package/dist/runtime-worker.js +2872 -0
- package/dist/sdk-agent.d.ts +46 -10
- package/dist/sdk-agent.js +1 -1
- package/dist/sdk-coding.d.ts +337 -1020
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-mcp.d.ts +2 -1
- package/dist/sdk-mcp.js +1 -1
- package/dist/sdk-media.js +1 -1
- package/dist/sdk-repl.d.ts +208 -185
- package/dist/sdk-repl.js +2 -2
- package/dist/sdk-runtime.d.ts +1070 -0
- package/dist/sdk-runtime.js +2 -0
- package/dist/sdk-session.d.ts +4 -4
- package/dist/sdk-session.js +1 -1
- package/dist/sdk-skills.js +1 -1
- package/dist/semantic-worker.js +191 -10
- package/dist/types-chunks/{bash-prefix-extractor.d-CZW9fRoa.d.ts → bash-prefix-extractor.d-D57Gt6n8.d.ts} +186 -12
- package/dist/types-chunks/{run-manager.d-CYTnWhZY.d.ts → capsule.d-BZmqu_HL.d.ts} +5 -92
- package/dist/types-chunks/commands.d-Cg26ud-Y.d.ts +213 -0
- package/dist/types-chunks/{types.d-1CnTg7Sd.d.ts → guardrail.d-Ds7JHxR1.d.ts} +3 -128
- package/dist/types-chunks/{guardrail.d-MR6LwMB2.d.ts → guardrail.d-vSaBe64I.d.ts} +3 -3
- package/dist/types-chunks/{manager.d-DBD7SOTT.d.ts → manager.d-Zum9cGHU.d.ts} +3 -173
- package/dist/types-chunks/oauth-login.d-Bgb4rdLN.d.ts +174 -0
- package/dist/types-chunks/public-api.d-CPBMPDiU.d.ts +602 -0
- package/dist/types-chunks/run-manager.d-lnwnfyNC.d.ts +91 -0
- package/dist/types-chunks/{sdk-session-RBSBBKol.d.ts → sdk-session-ByoMLoUS.d.ts} +8 -306
- package/dist/types-chunks/{process.d-CY2g03Mb.d.ts → types.d-DG9B4SMm.d.ts} +369 -4
- package/dist/types-chunks/types.d-DU9lLkmE.d.ts +128 -0
- package/dist/types-chunks/types.d-DYv3a1ka.d.ts +975 -0
- package/dist/types-chunks/{utils.d-C14jZ9ZM.d.ts → utils.d-DMI-9GTR.d.ts} +88 -72
- package/docs/SDK_EMBEDDER_GUIDE.md +3079 -0
- package/package.json +8 -1
- package/dist/chunks/argument-completer-EN63ZVJK.js +0 -2
- package/dist/chunks/chunk-4MIHVNB7.js +0 -405
- package/dist/chunks/chunk-HP4FXMEM.js +0 -18
- package/dist/chunks/chunk-KHICMJIR.js +0 -310
- package/dist/chunks/chunk-LGR7ACBQ.js +0 -326
- package/dist/chunks/chunk-RR7W7UF6.js +0 -341
- package/dist/chunks/chunk-UGTK2JIJ.js +0 -731
- package/dist/chunks/chunk-V4WSBIXB.js +0 -2
- package/dist/chunks/chunk-VSWROENP.js +0 -52
- package/dist/chunks/compaction-config-4VIONMFB.js +0 -2
- package/dist/chunks/dist-EDF2YUF6.js +0 -2
- package/dist/chunks/host-J4HPDLFC.js +0 -2
- package/dist/chunks/run-manager-ZVSW2OWM.js +0 -2
- package/dist/chunks/utils-5HDLYTZJ.js +0 -2
- package/dist/types-chunks/storage.d-C6kkAEch.d.ts +0 -280
package/dist/sdk-coding.d.ts
CHANGED
|
@@ -1,315 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a0 as KodaXToolDefinition, a2 as KodaXToolResultContentItem, a5 as KodaXToolUseBlock, c as KodaXContentBlock, j as KodaXMessage, o as KodaXProviderCapabilityProfile, A as KodaXReasoningCapability, E as KodaXReasoningMode, U as KodaXTaskType, e as KodaXExecutionMode, T as KodaXTaskRoutingDecision, a8 as KodaXWireReasoningEffort, Z as KodaXThinkingDepth, $ as KodaXTokenUsage } from './types-chunks/types.d-Bp4Lm1jv.js';
|
|
2
2
|
export { b as KodaXChildFanoutClass, d as KodaXCustomProviderConfig, h as KodaXImageBlock, k as KodaXModelDescriptor, m as KodaXNormalizedReasoningRequest, n as KodaXProtocolFamily, p as KodaXProviderConfig, r as KodaXProviderConversationSemantics, u as KodaXProviderMcpSupport, x as KodaXProviderStreamOptions, z as KodaXProviderTransport, B as KodaXReasoningEffortPreset, C as KodaXReasoningEffortRequest, D as KodaXReasoningEffortWireStrategy, F as KodaXReasoningProfile, G as KodaXReasoningRequest, H as KodaXRedactedThinkingBlock, I as KodaXReviewScale, J as KodaXRiskLevel, L as KodaXStableEffortIntent, M as KodaXStreamResult, O as KodaXTaskBudgetOverrides, R as KodaXTaskResultMetadata, S as KodaXTaskResultSource, W as KodaXTextBlock, X as KodaXThinkingBlock, Y as KodaXThinkingBudgetMap, _ as KodaXThinkingWireStrategy, a1 as KodaXToolResultBlock } from './types-chunks/types.d-Bp4Lm1jv.js';
|
|
3
3
|
export { K as KODAX_DEFAULT_PROVIDER, b as KODAX_PROVIDERS, c as KODAX_PROVIDER_SNAPSHOTS, d as KODAX_REASONING_MODE_SEQUENCE, f as KODAX_STABLE_EFFORT_INTENTS, g as KodaXAnthropicCompatProvider, h as KodaXError, i as KodaXModelCapabilities, k as KodaXOpenAICompatProvider, l as KodaXProviderError, m as KodaXRateLimitError, P as ProviderName, R as ResolveWireEffortInput, o as ResolvedWireEffort, q as clearRuntimeModelProviders, r as createCustomProvider, s as effortToLegacyReasoningMode, t as getAvailableProviderNames, u as getCustomModelCapabilities, v as getCustomProvider, w as getCustomProviderList, x as getCustomProviderModelDescriptors, y as getCustomProviderModels, z as getCustomProviderNames, B as getModelCapabilities, C as getProvider, D as getProviderConfiguredCapabilityProfile, E as getProviderConfiguredReasoningCapability, F as getProviderList, G as getProviderModel, H as getProviderModelDescriptors, I as getProviderModels, L as getRuntimeModelProvider, M as getRuntimeModelProviderNames, N as isCustomProviderName, O as isKnownProvider, Q as isProviderConfigured, S as isProviderName, U as isRuntimeModelProviderName, V as listAllModelCapabilities, W as listBuiltinModelCapabilities, X as listCustomProviderModelCapabilities, _ as mapLegacyReasoningModeToEffortIntent, $ as normalizeReasoningEffortValue, a1 as parseReasoningEffortEnv, a2 as registerCustomProviders, a3 as registerModelProvider, a4 as resolveModelCapabilities, a5 as resolveProvider, a6 as resolveProviderModelDescriptors, a7 as resolveReasoningEffort, a8 as resolveReasoningEffortForModelSwitch, aa as resolveWireEffort, ab as validateCustomProviderConfig } from './types-chunks/resolver.d-CGkfRULj.js';
|
|
4
4
|
import { a as CostTracker } from './types-chunks/cost-tracker.d-CBLk1fiD.js';
|
|
5
5
|
export { K as KodaXLlmTimeoutConfig, p as parseTimeoutSecEnvMs, t as timeoutSecToMs } from './types-chunks/cost-tracker.d-CBLk1fiD.js';
|
|
6
6
|
import { K as KodaXBaseProvider } from './types-chunks/base.d-DalIRhbb.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { b as CapabilityResult, a as CapabilityProvider } from './types-chunks/capability.d-3C62G8Eq.js';
|
|
8
|
+
export { C as CapabilityKind } from './types-chunks/capability.d-3C62G8Eq.js';
|
|
9
|
+
import { aw as KodaXToolExecutionContext, t as KodaXAgentScope, b3 as RuntimeContextPressure, b0 as RuntimeContextBudgetSnapshot, $ as KodaXRepoIntelligenceCapability, a2 as KodaXRepoIntelligenceTrace, a0 as KodaXRepoIntelligenceMode, a1 as KodaXRepoIntelligenceResolvedMode, a4 as KodaXRepoRoutingSignals, X as KodaXOptions, H as KodaXContextOptions, _ as KodaXProviderPolicyHints, aO as ProviderResilienceConfig, aP as ProviderResiliencePolicy, F as FailureStage, aU as ResilienceClassification, aM as ProviderExecutionState, aR as RecoveryDecision, aT as RecoveryResult, a5 as KodaXResult, a9 as KodaXSessionControl, aa as KodaXSessionMutators, O as KodaXManagedProtocolPayload, E as ExtensionRuntimeContract, b4 as RuntimeDefaultsSnapshot, c as BoundExtensionRuntimeController, L as KodaXEvents, l as GoalCompleteResult, aW as ResolveKodaXManualInput, aX as ResolveKodaXManualOptions, aY as ResolveKodaXManualResult, U as KodaXManualTopicId, T as KodaXManualTopic, d as ChildSnapshotEvent, x as KodaXChildContextBundle, y as KodaXChildExecutionResult, be as WorkflowHostPolicy, au as KodaXTimeoutConfig } from './types-chunks/bash-prefix-extractor.d-D57Gt6n8.js';
|
|
10
|
+
export { A as ALWAYS_RESIDENT_TOOL_NAMES, B as BASH_POLICY_SPEC, a as BashPrefixExtractor, b as BashPrefixResult, C as CapabilityRuntimeContract, e as CompactionAntiThrashConfig, f as CompactionAntiThrashState, g as CompactionSavingsDecision, h as CompactionSavingsSample, i as CompactionSkipReason, j as CreateBashPrefixExtractorOptions, D as DiagnosticsRequest, k as ExtractCommandPrefixOptions, G as GoalBlockedResult, m as GoalCreateInput, n as GoalLifecycleContext, o as GoalRuntimeBinding, p as GoalRuntimeBindingDeps, q as GoalToolsContext, K as KodaXActivityEventMeta, r as KodaXAgentMode, s as KodaXAgentProfile, u as KodaXBudgetDisclosureZone, v as KodaXBudgetExtensionRequest, w as KodaXChildAgentResult, z as KodaXCompactionOverride, I as KodaXContextTokenSnapshot, J as KodaXEffectiveTaskConfig, M as KodaXLiveEventMeta, N as KodaXManagedBudgetSnapshot, P as KodaXManagedTask, Q as KodaXManagedTaskRuntimeState, R as KodaXManagedTaskStatusEvent, S as KodaXManualSource, V as KodaXManualTopicInput, W as KodaXMemoryStrategy, Y as KodaXOrchestrationVerdict, Z as KodaXParentReductionContract, a3 as KodaXRepoIntelligenceTraceEvent, a6 as KodaXRoleRoundSummary, a7 as KodaXRuntimeVerificationContract, a8 as KodaXSelfManualConfig, ab as KodaXSessionOptions, ac as KodaXSidecarMessageEvent, ad as KodaXSkillDynamicContextPolicy, ae as KodaXSkillInvocationContext, af as KodaXSkillMap, ag as KodaXSkillProjectionConfidence, ah as KodaXTaskCapabilityHint, ai as KodaXTaskContract, aj as KodaXTaskEvidenceArtifact, ak as KodaXTaskEvidenceBundle, al as KodaXTaskEvidenceEntry, am as KodaXTaskRole, an as KodaXTaskRoleAssignment, ao as KodaXTaskStatus, ap as KodaXTaskSurface, aq as KodaXTaskToolPolicy, ar as KodaXTaskVerificationContract, as as KodaXTaskVerificationCriterion, at as KodaXTaskWorkItem, av as KodaXToolEventMeta, ax as KodaXToolVisibilityMeta, ay as KodaXToolVisibilityPolicy, az as KodaXTurnCompletedEvent, aA as KodaXTurnDeliveryKind, aB as KodaXTurnFailedEvent, aC as KodaXTurnStartedEvent, aD as KodaXVerificationScorecard, aE as KodaXVerificationScorecardCriterion, aF as KodaXWorkflowAgentDigestEvent, aG as KodaXWorkflowEventMeta, aH as KodaXWorkflowTimeoutConfig, aI as LSP_SERVERS, aJ as LspServerInfo, aK as LspService, aL as LspServiceConfig, aN as ProviderRecoveryEvent, aQ as RecoveryAction, aS as RecoveryLadderStep, aV as ResilienceErrorClass, aZ as RuntimeCompactionSkippedEvent, a_ as RuntimeContextBudgetBreakdown, a$ as RuntimeContextBudgetRecommendation, b1 as RuntimeContextBudgetSnapshotInput, b2 as RuntimeContextOptimizationProfile, b5 as RuntimeToolExposureDecision, b6 as RuntimeToolExposureMode, b7 as RuntimeToolExposurePlan, b8 as RuntimeToolExposurePlanInput, b9 as RuntimeToolExposureReason, ba as TodoItem, bb as TodoList, bc as TodoStatus, bd as ToolSideEffect, bf as WorkflowInvocationAction, bg as WorkflowInvocationPolicyDecision, bh as WorkflowInvocationPolicyInput, bi as WorkflowInvocationSource, bj as WorkflowRunProgressView, bk as WorkflowStartOutcome, bl as WorkflowToolHost, bm as WorkflowToolHostInlineInput, bn as WorkflowToolHostResult, bo as WorkflowToolHostStartResult, bp as buildGoalRuntimeBinding, bq as consumeCompactionCooldown, br as createBashPrefixExtractor, bs as createCompactionAntiThrashState, bt as createRuntimeContextBudgetSnapshot, bu as decideWorkflowInvocation, bv as drainPendingSwaps, bw as estimateToolSchemaTokens, bx as extractCommandPrefix, by as getDefaultLspService, bz as hasPendingSwap, bA as makeDisabledGoalToolsContext, bB as planToolExposure, bC as providerResilienceConfigFromTimeouts, bD as recordCompactionSavings, bE as resolveConstructedAgent, bF as shouldSkipLlmCompaction, bG as shutdownDefaultLspService, bH as withGoalBeforeNextTurn, bI as withGoalStopHook, bJ as workflowStartOutcomeConsumesTurn } from './types-chunks/bash-prefix-extractor.d-D57Gt6n8.js';
|
|
10
11
|
export { CreateFileArtifactFromPathOptions, CreateImageArtifactFromPathOptions, CreateVideoArtifactFromPathOptions, EnqueueWithArtifactsInput, GetModelInputCapabilitiesInput, ImageResizeError, KODAX_FILE_MEDIA_TYPES, KODAX_IMAGE_MEDIA_TYPES, KODAX_VIDEO_MEDIA_TYPES, KodaXInputCapabilityStatus, KodaXMediaError, KodaXMediaErrorCode, KodaXMediaErrorOptions, KodaXModalityInputCapability, MAX_DIMENSION, ModelInputCapabilities, NormalizeImageOptions, NormalizedImage, PASTE_TMP_DIR_ENV, PASTE_TMP_TTL_MS, PersistImageAsBlockOptions, TARGET_RAW_SIZE_BYTES, ValidateInputArtifactsOptions, createFileArtifactFromPath, createImageArtifactFromPath, createVideoArtifactFromPath, enqueueWithArtifacts, getModelInputCapabilities, inferImageMediaType, inferVideoMediaType, normalizePastedImage, persistImageAsBlock, prunePasteTmpDir, readAndNormalizeClipboardImage, readClipboardImage, validateInputArtifactsForModel } from './sdk-media.js';
|
|
11
|
-
import {
|
|
12
|
-
export {
|
|
13
|
-
import {
|
|
14
|
-
export {
|
|
12
|
+
import { J as LocalToolDefinition, P as RegisteredToolDefinition, X as ToolHandler, Z as ToolRegistrationOptions, C as Capabilities, a as AgentContent, T as StagedHandle, f as ConstructionPolicy, d as ConstructionArtifact, U as TestResult, S as ScriptSource, Y as ToolHandlerSync, H as KodaXRetrievalToolName, F as KodaXRetrievalResult, B as KodaXRetrievalItem, r as ExtensionLoadSource, p as ExtensionFailureStage, m as ExtensionContributionSource, q as ExtensionHookMap, n as ExtensionEventMap, j as ExtensionCommandDefinition, u as ExtensionRuntimeDiagnostics } from './types-chunks/types.d-DYv3a1ka.js';
|
|
13
|
+
export { A as AgentArtifact, b as ArtifactStatus, c as CapabilityDeniedError, e as ConstructionManifestError, g as ConstructionPolicyVerdict, D as DEFAULT_HANDLER_TIMEOUT_MS, E as ExecOptions, h as ExecResult, i as ExtensionCommandContext, k as ExtensionCommandInvocation, l as ExtensionCommandResult, o as ExtensionFailureDiagnostic, s as ExtensionLogger, t as ExtensionRuntimeController, v as ExtensionToolBeforeHookContext, K as KodaXExtensionAPI, w as KodaXExtensionActivationResult, x as KodaXExtensionModule, y as KodaXRetrievalArtifact, z as KodaXRetrievalFreshness, G as KodaXRetrievalScope, I as KodaXRetrievalTrust, L as LoadedExtensionDiagnostic, M as ModelProviderRegistration, R as RegisteredCapabilityProviderDiagnostic, N as RegisteredCommandDiagnostic, O as RegisteredHookDiagnostic, Q as RegisteredToolDiagnostic, V as ToolContent, W as ToolDefinitionSource, _ as ToolRegistry, $ as WebhookOptions, a0 as WebhookResult, a1 as defaultPolicy, a2 as exec, a3 as webhook } from './types-chunks/types.d-DYv3a1ka.js';
|
|
14
|
+
import { I as AgentMessage, f as Agent, ce as RunnerLlmReturn, aR as KodaXInputArtifact, cm as SessionErrorMetadata, c0 as QualityInvariant, cI as ToolCapability, ca as RunnableTool, aj as DispatchableAgentDescriptor, o as AgentDispatchContext, cf as RunnerToolCall, aN as KodaXGoalState, cW as WorkflowEventCorrelation, aw as Guardrail, du as WorkflowTaskSummaryEventUpdate, cP as WorkflowAgentBackend, d2 as WorkflowModule, di as WorkflowProcessTrackerOptions, cV as WorkflowEvent, cT as WorkflowArtifactRef, d0 as WorkflowMeta, dk as WorkflowRunState, cR as WorkflowApproval, d6 as WorkflowProcessEvent, cS as WorkflowApprovalSummary, c_ as WorkflowLimits, dc as WorkflowProcessSnapshot } from './types-chunks/types.d-DG9B4SMm.js';
|
|
15
|
+
export { M as AgentReasoningProfile, _ as AgentTool, $ as AskUserAnswer, a0 as AskUserCustomInputAnswer, a1 as AskUserMultiOptions, a2 as AskUserQuestionItem, a3 as AskUserQuestionOptions, a4 as AskUserSelectionAnswer, a7 as CompactionAnchor, aa as CompactionResult, ac as CompactionUpdate, ay as Handoff, aA as InMemorySessionOptions, aF as KodaXCompactMemoryProgress, aG as KodaXCompactMemorySeed, aH as KodaXExtensionSessionRecord, aI as KodaXExtensionSessionState, aL as KodaXFileInputArtifact, aP as KodaXImageInputArtifact, aQ as KodaXImageMediaType, aS as KodaXInputArtifactSource, aT as KodaXJsonValue, aV as KodaXSessionArtifactLedgerEntry, aW as KodaXSessionBranchSummaryEntry, aY as KodaXSessionCompactionEntry, aZ as KodaXSessionData, a_ as KodaXSessionEntry, a$ as KodaXSessionEntryBase, b1 as KodaXSessionLabelEntry, b2 as KodaXSessionLineage, b3 as KodaXSessionMessageEntry, b4 as KodaXSessionMeta, b5 as KodaXSessionNavigationOptions, b7 as KodaXSessionRuntimeInfo, b8 as KodaXSessionScope, b9 as KodaXSessionStorage, ba as KodaXSessionTreeNode, bb as KodaXSessionUiHistoryItem, bc as KodaXSessionUiHistoryItemType, bd as KodaXSessionUiTextHistoryItem, be as KodaXSessionUiTextHistoryItemType, bf as KodaXSessionUiToolCall, bg as KodaXSessionUiToolCallStatus, bh as KodaXSessionUiToolGroupHistoryItem, bi as KodaXSessionWorkspaceKind, bj as KodaXVideoInputArtifact, bk as KodaXVideoMediaType, bX as MessageEntry, b_ as PresetDispatcher, c3 as ReasoningDepth, c7 as RunEvent, c8 as RunOptions, c9 as RunResult, cb as Runner, cj as Session, cl as SessionEntry, cn as SessionExtension, co as SessionForkOptions, dH as createAgent, dI as createHandoff, dJ as createInMemorySession, d$ as registerPresetDispatcher } from './types-chunks/types.d-DG9B4SMm.js';
|
|
16
|
+
import { M as MessageQueue, N as WorkflowScriptManifest, y as WorkflowCapsule, B as WorkflowCapsuleIntent, A as WorkflowCapsuleInputs, F as WorkflowCapsuleRequirements, E as WorkflowCapsuleProvenance, H as WorkflowQualityLintFinding, G as WorkflowPatternId } from './types-chunks/capsule.d-BZmqu_HL.js';
|
|
17
|
+
export { C as CompactionContext, a as CompactionEntry, b as CompactionEntryPayload, c as CompactionPolicy, D as DefaultSummaryCompaction, e as DefaultSummaryCompactionOptions, K as KODAX_API_MIN_INTERVAL, f as KODAX_DEFAULT_TIMEOUT, g as KODAX_HARD_TIMEOUT, h as KODAX_MAX_INCOMPLETE_RETRIES, j as KODAX_MAX_RETRIES, k as KODAX_MAX_TOKENS, l as KODAX_RETRY_BASE_DELAY, m as KODAX_STAGGER_DELAY, L as LINEAGE_ENTRY_TYPES, n as LineageArtifactLedgerPayload, o as LineageCompaction, p as LineageCompactionDelegates, q as LineageEntryType, r as LineageExtension, s as LineageLabelPayload, t as LineageTreeNode, P as PROMISE_PATTERN, O as appendSessionLineageLabel, R as applySessionCompaction, S as archiveOldIslands, U as buildSessionTree, X as cleanupIncompleteToolCalls, Y as countActiveLineageMessages, Z as countTokens, $ as createSessionLineage, a2 as estimateTokens, a3 as extractArtifactLedger, a5 as extractTitleFromMessages, a6 as findPreviousUserEntryId, a7 as forkSessionLineage, a8 as generateSessionId, a9 as getAgentConfigHome, aa as getAgentConfigPath, ab as getAppDataDir, ad as getSessionLineagePath, ae as getSessionMessagesFromLineage, ag as mergeArtifactLedger, ai as resolveSessionLineageTarget, aj as rewindSessionLineage, ak as setAgentConfigHome, al as setSessionLineageActiveEntry, am as validateAndFixToolHistory } from './types-chunks/capsule.d-BZmqu_HL.js';
|
|
15
18
|
import { b as McpServersConfig } from './types-chunks/config.d-CJy1WENT.js';
|
|
16
19
|
export { M as McpConnectMode, a as McpServerConfig, c as McpTransportKind } from './types-chunks/config.d-CJy1WENT.js';
|
|
17
|
-
import {
|
|
18
|
-
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import { i as McpProviderOptions, b as McpCapabilityProvider, j as McpReverseCapabilities, k as McpRoot } from './types-chunks/manager.d-Zum9cGHU.js';
|
|
21
|
+
export { M as McpCapabilityDescriptor, a as McpCapabilityKind, c as McpCapabilityRisk, d as McpCatalogItem, e as McpElicitRequest, f as McpElicitResult, g as McpIcon, h as McpManager, l as McpSamplingRequest, m as McpSamplingResult, n as McpServerCatalog, o as McpServerCatalogSnapshot, p as McpServerLogs, q as McpServerRuntime, r as McpServerRuntimeDiagnostics, s as McpServerStatus, t as McpServerToolList, u as McpToolTaskSupport, v as buildInitializeCapabilities, w as createMcpCapabilityId, x as createMcpManager, y as defaultMcpCacheDir, z as getMcpCachePaths, A as normalizeMcpCapabilityId, B as parseMcpCapabilityId, C as searchMcpCatalog } from './types-chunks/manager.d-Zum9cGHU.js';
|
|
22
|
+
export { A as AuthorizationServerMetadata, D as DiscoveredOAuthEndpoints, M as McpAuthRequiredError, a as McpExpiredSessionError, b as McpTransport, c as McpTransportEvents, O as OAuthClientInfo, d as OAuthLoginConsent, P as PerformOAuthLoginOptions, e as ProtectedResourceMetadata, W as WwwAuthenticateChallenge, f as createMcpTransport, g as discoverAuthorizationServerMetadata, h as discoverOAuthEndpoints, i as discoverProtectedResourceMetadata, j as extractInsufficientScope, k as extractResourceMetadataUrl, l as loadValidToken, p as performOAuthLogin, r as registerOAuthClient } from './types-chunks/oauth-login.d-Bgb4rdLN.js';
|
|
23
|
+
import { c as ManagedWorkflowSnapshot$1, e as WorkflowRunManager$1 } from './types-chunks/run-manager.d-lnwnfyNC.js';
|
|
24
|
+
export { d as ManagedWorkflowStatus } from './types-chunks/run-manager.d-lnwnfyNC.js';
|
|
25
|
+
import { h as AutoRules, T as ToolCallSignal, S as SignalCollector } from './types-chunks/guardrail.d-vSaBe64I.js';
|
|
26
|
+
export { C as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD, i as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD, A as AgentsFile, a as AutoModeAskUser, b as AutoModeAskUserVerdict, D as AutoModeDenialTracker, c as AutoModeEngine, d as AutoModeGuardrailConfig, e as AutoModeSharedState, f as AutoModeStats, g as AutoModeToolGuardrail, E as BREAKER_ERROR_THRESHOLD, W as BREAKER_WINDOW_MS, j as CircuitBreaker, K as KodaXMcpConnectMode, k as KodaXMcpServerConfig, l as KodaXMcpServersConfig, m as KodaXMcpTransport, L as LoadAgentsOptions, n as LoadedRulesSource, R as RulesLoadError, o as RulesLoadResult, p as SkippedRulesSource, q as TrustState, J as autoModeDenialShouldFallback, M as breakerShouldFallback, r as collectAllSignals, s as computeRulesFingerprint, v as createAutoModeDenialTracker, t as createAutoModeToolGuardrail, u as createCircuitBreaker, w as formatAgentsForPrompt, x as getKodaxGlobalDir, y as loadAgentsFiles, z as loadAutoRules, B as parseAutoRules, F as readTrustState, G as recordAutoModeAllow, H as recordAutoModeBlock, I as recordBreakerError, N as trustProjectRules } from './types-chunks/guardrail.d-vSaBe64I.js';
|
|
27
|
+
import { d as ToolGuardrail } from './types-chunks/guardrail.d-Ds7JHxR1.js';
|
|
22
28
|
import { Diagnostic } from 'vscode-languageserver-protocol';
|
|
23
29
|
import '@anthropic-ai/sdk';
|
|
24
30
|
import 'openai';
|
|
25
31
|
import './types-chunks/types.d-vJExiRje.js';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* KodaX Constructed-World types (FEATURE_087, v0.7.28).
|
|
29
|
-
*
|
|
30
|
-
* Runtime-generated capabilities (tools / agents / skills / ...) live in
|
|
31
|
-
* `.kodax/constructed/` and are loaded into the same registries as builtin
|
|
32
|
-
* primitives. v0.7.28 only ships tool generation (FEATURE_088); other kinds
|
|
33
|
-
* land in FEATURE_089 / FEATURE_090.
|
|
34
|
-
*
|
|
35
|
-
* Cross-references:
|
|
36
|
-
* - DD §14 — lifecycle, security model, registry merge semantics.
|
|
37
|
-
* - docs/features/v0.7.28.md — capability schema, generation flow.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Handler script source. v0.7.28 limits language to `'javascript'` so that
|
|
42
|
-
* `loadHandler()` can `await import()` the file directly without an
|
|
43
|
-
* intermediate TS → JS compile step (no esbuild / tsx dependency).
|
|
44
|
-
*
|
|
45
|
-
* TypeScript handlers are explicitly out of scope; Coding Agent generates
|
|
46
|
-
* JS strings on the wire.
|
|
47
|
-
*/
|
|
48
|
-
interface ScriptSource {
|
|
49
|
-
readonly kind: 'script';
|
|
50
|
-
readonly language: 'javascript';
|
|
51
|
-
readonly code: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Capability declaration.
|
|
55
|
-
*
|
|
56
|
-
* v0.7.28 ships the single-dimension form: a whitelist of builtin tool
|
|
57
|
-
* names that the handler may invoke through `ctx.tools.<name>(...)`.
|
|
58
|
-
* All I/O — fs / net / env — must flow through builtin tools (`read` /
|
|
59
|
-
* `write` / `bash` / etc.); handlers do not receive direct `ctx.fs` /
|
|
60
|
-
* `ctx.net` / `ctx.env` entry points.
|
|
61
|
-
*
|
|
62
|
-
* Forward-compatible evolution: if the future demands path/domain-level
|
|
63
|
-
* constraints, this can grow to `(string | { name; constraints })[]`
|
|
64
|
-
* without breaking existing manifests.
|
|
65
|
-
*/
|
|
66
|
-
interface Capabilities {
|
|
67
|
-
readonly tools: readonly string[];
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Tool-kind artifact body (the `content` of `ConstructionArtifact` when
|
|
71
|
-
* `kind === 'tool'`).
|
|
72
|
-
*/
|
|
73
|
-
interface ToolContent {
|
|
74
|
-
readonly description: string;
|
|
75
|
-
readonly inputSchema: Record<string, unknown>;
|
|
76
|
-
readonly capabilities: Capabilities;
|
|
77
|
-
readonly handler: ScriptSource;
|
|
78
|
-
/**
|
|
79
|
-
* Per-tool timeout override. Defaults to {@link DEFAULT_HANDLER_TIMEOUT_MS}
|
|
80
|
-
* when omitted. Bounded by AbortController in `loadHandler()`.
|
|
81
|
-
*/
|
|
82
|
-
readonly timeoutMs?: number;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Default handler timeout. Picked to match the historical ceiling on
|
|
86
|
-
* builtin streaming tools (30s); revisit if a constructed tool demands
|
|
87
|
-
* longer-running computation.
|
|
88
|
-
*/
|
|
89
|
-
declare const DEFAULT_HANDLER_TIMEOUT_MS = 30000;
|
|
90
|
-
/**
|
|
91
|
-
* Lifecycle state on disk. Drives both the startup glob filter and the
|
|
92
|
-
* `revoke()` semantics. See DD §14.1 — file system is the single source
|
|
93
|
-
* of truth; no separate `_manifest.json` index file (C4 decision).
|
|
94
|
-
*/
|
|
95
|
-
type ArtifactStatus = 'staged' | 'active' | 'revoked';
|
|
96
|
-
/**
|
|
97
|
-
* Reference to a tool by stable id. v0.7.31 (FEATURE_089) introduces
|
|
98
|
-
* Agent manifests that bundle tool refs rather than inline tool bodies;
|
|
99
|
-
* the resolver expands these refs to concrete `KodaXToolDefinition`
|
|
100
|
-
* instances at activate time.
|
|
101
|
-
*
|
|
102
|
-
* `ref` shape:
|
|
103
|
-
* - `builtin:<name>` — a tool from the static registry
|
|
104
|
-
* (e.g. `builtin:read`, `builtin:bash`)
|
|
105
|
-
* - `constructed:<name>@<ver>` — a previously-activated constructed tool
|
|
106
|
-
*/
|
|
107
|
-
interface ToolRef {
|
|
108
|
-
readonly ref: string;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Reference to a Guardrail by stable id. The Layer A `Guardrail`
|
|
112
|
-
* declaration is name-only (no runtime hooks); resolvers map known
|
|
113
|
-
* names to constructed `ToolGuardrail` / `InputGuardrail` /
|
|
114
|
-
* `OutputGuardrail` instances at activation time.
|
|
115
|
-
*/
|
|
116
|
-
interface GuardrailRef {
|
|
117
|
-
readonly kind: 'input' | 'output' | 'tool';
|
|
118
|
-
readonly ref: string;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Reference to a handoff target by stable id (another constructed agent
|
|
122
|
-
* or a builtin role). The resolver expands `target.ref` to the actual
|
|
123
|
-
* `Agent` declaration at admission time so the handoff DAG check
|
|
124
|
-
* (`handoffLegality` invariant) sees the full graph.
|
|
125
|
-
*/
|
|
126
|
-
interface AgentHandoffRef {
|
|
127
|
-
readonly target: {
|
|
128
|
-
readonly ref: string;
|
|
129
|
-
};
|
|
130
|
-
readonly kind: 'continuation' | 'as-tool';
|
|
131
|
-
readonly description?: string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Reasoning profile declaration mirroring the Layer A
|
|
135
|
-
* `AgentReasoningProfile`. Kept structurally identical so the resolver
|
|
136
|
-
* passes the value through without re-shaping.
|
|
137
|
-
*/
|
|
138
|
-
interface AgentReasoningRef {
|
|
139
|
-
readonly default: 'quick' | 'balanced' | 'deep';
|
|
140
|
-
readonly max?: 'quick' | 'balanced' | 'deep';
|
|
141
|
-
readonly escalateOnRevise?: boolean;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Sandbox test case. Used by `sandbox_test_agent` to verify a
|
|
145
|
-
* constructed agent before it can activate. Each case feeds `input`
|
|
146
|
-
* to a sandbox Runner instance and grades the agent's final output:
|
|
147
|
-
*
|
|
148
|
-
* - `expectMatch` — final text must match this regex (string form)
|
|
149
|
-
* - `expectNotMatch` — final text must NOT match this regex
|
|
150
|
-
* - `expectFinalText` — exact substring match (case-sensitive)
|
|
151
|
-
*
|
|
152
|
-
* At least one of the three expect-fields must be present; the cases
|
|
153
|
-
* are graded by `runSandboxAgentTest()` (FEATURE_089 Phase 3.5).
|
|
154
|
-
*/
|
|
155
|
-
interface AgentTestCase {
|
|
156
|
-
readonly id: string;
|
|
157
|
-
readonly input: string;
|
|
158
|
-
readonly expectMatch?: string;
|
|
159
|
-
readonly expectNotMatch?: string;
|
|
160
|
-
readonly expectFinalText?: string;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Agent-kind artifact body (the `content` of `ConstructionArtifact`
|
|
164
|
-
* when `kind === 'agent'`).
|
|
165
|
-
*
|
|
166
|
-
* FEATURE_089 (v0.7.31): all fields except `instructions` are optional;
|
|
167
|
-
* a minimal "echo agent" can be expressed as `{ instructions: '...' }`.
|
|
168
|
-
* Tool / handoff / guardrail refs are resolved at admission time
|
|
169
|
-
* (Runner.admit's 5-step audit expands them and feeds the resolved
|
|
170
|
-
* Agent through the invariant chain).
|
|
171
|
-
*/
|
|
172
|
-
interface AgentContent {
|
|
173
|
-
readonly instructions: string;
|
|
174
|
-
readonly tools?: readonly ToolRef[];
|
|
175
|
-
readonly handoffs?: readonly AgentHandoffRef[];
|
|
176
|
-
readonly reasoning?: AgentReasoningRef;
|
|
177
|
-
readonly guardrails?: readonly GuardrailRef[];
|
|
178
|
-
readonly model?: string;
|
|
179
|
-
readonly provider?: string;
|
|
180
|
-
readonly effort?: KodaXWireReasoningEffort;
|
|
181
|
-
/**
|
|
182
|
-
* FEATURE_191 — one-sentence human-readable summary surfaced in the
|
|
183
|
-
* Worker system prompt's `=== Available specialist agents ===`
|
|
184
|
-
* block (FEATURE_191 A.3) and in `/agents list` UIs. Frontmatter
|
|
185
|
-
* `description` field of `~/.kodax/agents/<name>.md` and the
|
|
186
|
-
* `name`-paired argument of `KodaXExtensionAPI.registerAgent`
|
|
187
|
-
* funnel into this field. Optional for backward compatibility with
|
|
188
|
-
* FEATURE_089 minimal-agent shape (`{ instructions: '...' }`);
|
|
189
|
-
* the SP block renders `(no description)` when absent.
|
|
190
|
-
*/
|
|
191
|
-
readonly description?: string;
|
|
192
|
-
/**
|
|
193
|
-
* Optional structured-output schema mirroring `Agent.outputSchema`.
|
|
194
|
-
* Pure pass-through to the runtime — admission does not validate
|
|
195
|
-
* shape semantics here, only well-formed JSON.
|
|
196
|
-
*/
|
|
197
|
-
readonly outputSchema?: Record<string, unknown>;
|
|
198
|
-
/**
|
|
199
|
-
* Optional sandbox test cases. When present, `sandbox_test_agent`
|
|
200
|
-
* runs them; when absent, the test step performs only the static
|
|
201
|
-
* checks (manifest schema + admission audit).
|
|
202
|
-
*/
|
|
203
|
-
readonly testCases?: readonly AgentTestCase[];
|
|
204
|
-
/**
|
|
205
|
-
* Maximum total budget (iteration count) the agent may consume.
|
|
206
|
-
* Plumbed onto the resolved `AgentManifest.maxBudget` and clamped by
|
|
207
|
-
* `budgetCeiling` invariant during admission.
|
|
208
|
-
*/
|
|
209
|
-
readonly maxBudget?: number;
|
|
210
|
-
/**
|
|
211
|
-
* Voluntary additional invariants the LLM declares this agent
|
|
212
|
-
* commits to. Plumbed onto `AgentManifest.declaredInvariants`;
|
|
213
|
-
* unioned on top of the required set during admission.
|
|
214
|
-
*/
|
|
215
|
-
readonly declaredInvariants?: readonly string[];
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Persisted artifact shape (one JSON file per name/version under
|
|
219
|
-
* `.kodax/constructed/<kind>s/<name>/<version>.json`).
|
|
220
|
-
*
|
|
221
|
-
* Discriminated union over `kind`:
|
|
222
|
-
* - `kind: 'tool'` — v0.7.28 (FEATURE_088) tool generation
|
|
223
|
-
* - `kind: 'agent'` — v0.7.31 (FEATURE_089) agent generation; passes
|
|
224
|
-
* through `Runner.admit()` at activation time
|
|
225
|
-
*
|
|
226
|
-
* Lifecycle fields (status / timestamps / contentHash / sourceAgent /
|
|
227
|
-
* signedBy) are common to all kinds.
|
|
228
|
-
*/
|
|
229
|
-
type ConstructionArtifact = ToolArtifact | AgentArtifact;
|
|
230
|
-
interface ConstructionArtifactBase {
|
|
231
|
-
readonly name: string;
|
|
232
|
-
readonly version: string;
|
|
233
|
-
status: ArtifactStatus;
|
|
234
|
-
readonly signedBy?: string;
|
|
235
|
-
readonly createdAt: number;
|
|
236
|
-
readonly sourceAgent?: string;
|
|
237
|
-
testedAt?: number;
|
|
238
|
-
activatedAt?: number;
|
|
239
|
-
revokedAt?: number;
|
|
240
|
-
/**
|
|
241
|
-
* SHA-256 of `JSON.stringify(content)` captured at activate time.
|
|
242
|
-
* `rehydrateActiveArtifacts()` recomputes and compares — a mismatch
|
|
243
|
-
* indicates the manifest was edited between activation and the next
|
|
244
|
-
* boot (naive cross-session tampering, e.g. an LLM rewriting the .json
|
|
245
|
-
* via the Write tool without recomputing the hash). Mismatched
|
|
246
|
-
* artifacts are skipped at rehydrate with a stderr warning. This is
|
|
247
|
-
* NOT a defense against a coordinated attacker who recomputes the
|
|
248
|
-
* hash; the threat model is single-user CLI integrity, not multi-user
|
|
249
|
-
* supply chain.
|
|
250
|
-
*/
|
|
251
|
-
contentHash?: string;
|
|
252
|
-
}
|
|
253
|
-
interface ToolArtifact extends ConstructionArtifactBase {
|
|
254
|
-
readonly kind: 'tool';
|
|
255
|
-
readonly content: ToolContent;
|
|
256
|
-
}
|
|
257
|
-
interface AgentArtifact extends ConstructionArtifactBase {
|
|
258
|
-
readonly kind: 'agent';
|
|
259
|
-
readonly content: AgentContent;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Returned by {@link ConstructionRuntime.stage}; opaque handle that
|
|
263
|
-
* downstream `test()` / `activate()` calls bind to.
|
|
264
|
-
*/
|
|
265
|
-
interface StagedHandle {
|
|
266
|
-
readonly artifact: ConstructionArtifact;
|
|
267
|
-
readonly stagedAt: number;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Outcome of {@link ConstructionRuntime.test}. `ok=false` blocks
|
|
271
|
-
* activation; `warnings` surface but do not block.
|
|
272
|
-
*/
|
|
273
|
-
interface TestResult {
|
|
274
|
-
readonly ok: boolean;
|
|
275
|
-
readonly errors?: readonly string[];
|
|
276
|
-
readonly warnings?: readonly string[];
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* Policy gate — invoked once per `activate()` before the artifact is
|
|
280
|
-
* registered. Default rejects implicit auto-approval; the REPL surface
|
|
281
|
-
* binds a dialog-based policy in `packages/repl/src/common/construction-
|
|
282
|
-
* bootstrap.ts` so user approval flows through the live askUser channel.
|
|
283
|
-
*
|
|
284
|
-
* Modeled as a function type rather than an interface (D3 decision):
|
|
285
|
-
* keeps the contract surface tiny, no class boilerplate.
|
|
286
|
-
*
|
|
287
|
-
* No declarative `kodax.config.ts` override hatch is provided — see the
|
|
288
|
-
* "Deferred Design Decisions" section in `features/v0.7.28.md` for why
|
|
289
|
-
* a `risk_mode` enum (when truly needed) is preferred over user-authored
|
|
290
|
-
* policy functions.
|
|
291
|
-
*/
|
|
292
|
-
type ConstructionPolicy = (artifact: ConstructionArtifact) => Promise<ConstructionPolicyVerdict>;
|
|
293
|
-
type ConstructionPolicyVerdict = 'approve' | 'reject' | 'ask-user';
|
|
294
|
-
/** Default policy: always ask the user; no implicit approvals. */
|
|
295
|
-
declare const defaultPolicy: ConstructionPolicy;
|
|
296
|
-
/**
|
|
297
|
-
* Thrown by `CtxProxy` when handler attempts to access a tool not declared
|
|
298
|
-
* in `capabilities.tools`. Caught in tracer; surfaces as a tool error.
|
|
299
|
-
*/
|
|
300
|
-
declare class CapabilityDeniedError extends Error {
|
|
301
|
-
readonly toolName: string;
|
|
302
|
-
readonly declaredTools: readonly string[];
|
|
303
|
-
constructor(toolName: string, declaredTools: readonly string[]);
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Thrown when a manifest cannot be parsed / is missing required fields.
|
|
307
|
-
* Surfaces during stage() / startup glob; tracer records details.
|
|
308
|
-
*/
|
|
309
|
-
declare class ConstructionManifestError extends Error {
|
|
310
|
-
readonly path?: string;
|
|
311
|
-
constructor(message: string, path?: string);
|
|
312
|
-
}
|
|
32
|
+
import './types-chunks/types.d-DU9lLkmE.js';
|
|
313
33
|
|
|
314
34
|
/**
|
|
315
35
|
* KodaX Core Errors
|
|
@@ -371,208 +91,6 @@ declare const CANCELLED_TOOL_RESULT_PREFIX = "[Cancelled]";
|
|
|
371
91
|
/** Standard cancellation message returned when a tool is cancelled by the user. */
|
|
372
92
|
declare const CANCELLED_TOOL_RESULT_MESSAGE = "[Cancelled] Operation cancelled by user";
|
|
373
93
|
|
|
374
|
-
/**
|
|
375
|
-
* KodaX Tool Types
|
|
376
|
-
*/
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Progress yield from a streaming (async generator) tool.
|
|
380
|
-
* Each yield appears as a real-time status update in the REPL transcript.
|
|
381
|
-
*/
|
|
382
|
-
interface ToolProgress {
|
|
383
|
-
readonly stage: string;
|
|
384
|
-
readonly message: string;
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Final result a tool may return. Either a plain string (the default for
|
|
388
|
-
* text-only tools) OR a typed-array form for multimodal returns (e.g.
|
|
389
|
-
* `read` on an image path returns `[{type:'text',...}, {type:'image',...}]`).
|
|
390
|
-
* Providers serialize each shape to their wire format; OpenAI-compat
|
|
391
|
-
* gateways downgrade image items to a placeholder rather than rejecting.
|
|
392
|
-
*
|
|
393
|
-
* The array form mirrors claudecode's FileReadTool image return — Claude
|
|
394
|
-
* Code packs image data into `tool_result` content so the model can
|
|
395
|
-
* re-fetch images via the tool path. See
|
|
396
|
-
* `c:/Works/claudecode/src/tools/FileReadTool/FileReadTool.ts:866-891`.
|
|
397
|
-
*/
|
|
398
|
-
type ToolResult = string | readonly KodaXToolResultContentItem[];
|
|
399
|
-
/** Standard tool handler — returns a final result (text or multimodal). */
|
|
400
|
-
type ToolHandlerSync = (input: Record<string, unknown>, context: KodaXToolExecutionContext) => Promise<ToolResult>;
|
|
401
|
-
/** Streaming tool handler — yields progress updates, returns final result. */
|
|
402
|
-
type ToolHandlerStreaming = (input: Record<string, unknown>, context: KodaXToolExecutionContext) => AsyncGenerator<ToolProgress, ToolResult, void>;
|
|
403
|
-
/** Union of both handler types. Existing tools use ToolHandlerSync; new long-running tools may use ToolHandlerStreaming. */
|
|
404
|
-
type ToolHandler = ToolHandlerSync | ToolHandlerStreaming;
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* FEATURE_149 (v0.7.38) — interrupt-on-submit policy for in-flight tools.
|
|
408
|
-
*
|
|
409
|
-
* Controls whether submitting a new prompt while THIS tool is mid-execution
|
|
410
|
-
* triggers a fast-abort of the current agent round (so the new prompt starts
|
|
411
|
-
* immediately) or queues the prompt to run after the tool resolves.
|
|
412
|
-
*
|
|
413
|
-
* - `'cancel'` — long-running tools whose work the user is likely to want
|
|
414
|
-
* to abandon when they redirect (e.g., `bash` running a 30s script,
|
|
415
|
-
* `dispatch_child_task` synchronously awaiting a child, sleep-style
|
|
416
|
-
* tools). InkREPL submit handler aborts the round immediately.
|
|
417
|
-
*
|
|
418
|
-
* - `'wait'` (default) — atomic / fast tools (read, grep, glob, write,
|
|
419
|
-
* edit, …) where waiting for completion is cheaper than aborting and
|
|
420
|
-
* redoing.
|
|
421
|
-
*
|
|
422
|
-
* Mirrors Claude Code `interruptBehavior` (`utils/handlePromptSubmit.ts`).
|
|
423
|
-
*/
|
|
424
|
-
type ToolInterruptBehavior = 'cancel' | 'wait';
|
|
425
|
-
interface LocalToolDefinition extends KodaXToolDefinition {
|
|
426
|
-
handler: ToolHandler;
|
|
427
|
-
/**
|
|
428
|
-
* v0.7.42 — Required declarative side-effect class. See
|
|
429
|
-
* {@link ToolSideEffect} for category definitions and rationale. Plan
|
|
430
|
-
* mode and SDK embedders' permission brokers consume this; failure to
|
|
431
|
-
* declare is a TypeScript error (by design — `sideEffect` is required,
|
|
432
|
-
* not optional, to prevent silent drift when new tools are added).
|
|
433
|
-
*/
|
|
434
|
-
sideEffect: ToolSideEffect;
|
|
435
|
-
/**
|
|
436
|
-
* v0.7.42 — Optional plan-mode override.
|
|
437
|
-
*
|
|
438
|
-
* - `undefined` (default): plan-mode permits only `sideEffect ===
|
|
439
|
-
* 'readonly'` tools.
|
|
440
|
-
* - `true`: explicitly permitted in plan mode even when sideEffect is
|
|
441
|
-
* not `'readonly'`. Reserve for tools whose effect is itself part of
|
|
442
|
-
* the planning loop (`exit_plan_mode`, `task_stop`, `todo_update`,
|
|
443
|
-
* `todo_create`, `ask_user_question`).
|
|
444
|
-
* - `false`: explicitly blocked in plan mode even when sideEffect is
|
|
445
|
-
* `'readonly'`. Rare — useful for read-only tools whose output would
|
|
446
|
-
* leak content the planner should not see.
|
|
447
|
-
*/
|
|
448
|
-
planModeAllowed?: boolean;
|
|
449
|
-
/**
|
|
450
|
-
* FEATURE_149 (v0.7.38) — submit-time interrupt policy. See
|
|
451
|
-
* {@link ToolInterruptBehavior}. Default `'wait'` when undefined.
|
|
452
|
-
*/
|
|
453
|
-
interruptBehavior?: ToolInterruptBehavior;
|
|
454
|
-
/**
|
|
455
|
-
* Progressive disclosure — when `true`, the tool's full description is
|
|
456
|
-
* replaced with `searchHint` (a one-line summary) in the LLM-visible
|
|
457
|
-
* tool schema until the per-session unlock Set marks the tool name as
|
|
458
|
-
* unlocked. Unlocking happens via the `tool_search` tool: the LLM
|
|
459
|
-
* invokes `tool_search` with a query that selects this tool, and the
|
|
460
|
-
* full description + JSON schema are returned in the tool_result text.
|
|
461
|
-
* The next `getActiveToolDefinitions` call for the same session sees
|
|
462
|
-
* the unlock and emits the full description.
|
|
463
|
-
*
|
|
464
|
-
* Use for tools with rich descriptions (>500 bytes) whose teaching
|
|
465
|
-
* content the model only needs to consume when it actually plans to
|
|
466
|
-
* call the tool. Saves turn-1 context without dropping the tool.
|
|
467
|
-
*
|
|
468
|
-
* Mirrors claudecode `Tool.shouldDefer` — see
|
|
469
|
-
* `c:/Works/claudecode/src/tools/Tool.ts` for the parent design and
|
|
470
|
-
* `c:/Works/claudecode/src/tools/ToolSearchTool/` for the bootstrap.
|
|
471
|
-
*/
|
|
472
|
-
shouldDefer?: boolean;
|
|
473
|
-
/**
|
|
474
|
-
* One-line hint shown in place of the full description when this tool
|
|
475
|
-
* is deferred and not yet unlocked. Required when `shouldDefer: true`.
|
|
476
|
-
* Should answer "when would I want to look this up" in ≤ 100 chars
|
|
477
|
-
* so the LLM can decide whether to invoke `tool_search` for the full
|
|
478
|
-
* schema. Example: `'Fetch a specific remote URL — use tool_search to load full schema.'`
|
|
479
|
-
*/
|
|
480
|
-
searchHint?: string;
|
|
481
|
-
/**
|
|
482
|
-
* Classifier projection — REQUIRED (FEATURE_092 v0.7.33).
|
|
483
|
-
*
|
|
484
|
-
* Returns a one-line string that the auto-mode classifier sees as the
|
|
485
|
-
* `<action>` to evaluate. The classifier asks: "Given the user's
|
|
486
|
-
* intent + rules, should the agent be allowed to run this?"
|
|
487
|
-
*
|
|
488
|
-
* THREE-TIER STRATEGY (pick by tool's risk profile):
|
|
489
|
-
*
|
|
490
|
-
* 1. ZERO RISK (read-only, structural):
|
|
491
|
-
* → return '' (Tier 1 — classifier is skipped entirely, zero token cost)
|
|
492
|
-
* Examples: read, grep, glob, ask_user_question, exit_plan_mode
|
|
493
|
-
*
|
|
494
|
-
* 2. HIGH RISK (mutates state, network, exec, spawn):
|
|
495
|
-
* → write a CUSTOM projection that surfaces the risk-bearing fields
|
|
496
|
-
* Examples: bash (`Bash: ${i.command}`), web_fetch (`WebFetch ${i.url}`)
|
|
497
|
-
* See `classifier-projection.ts` for examples by category.
|
|
498
|
-
*
|
|
499
|
-
* 3. LOW RISK (structured input, side-effect-capable):
|
|
500
|
-
* → return defaultToClassifierInput(name, input) (one-line helper)
|
|
501
|
-
* Examples: semantic_lookup (refresh: true rebuilds index)
|
|
502
|
-
*
|
|
503
|
-
* KEEP IT SHORT: ≤ 100 chars typical. Variable-length user-provided fields
|
|
504
|
-
* (bash command, URL, dispatch_child_task objective) may legitimately
|
|
505
|
-
* exceed this — the projection's job is to make the risk visible, not to
|
|
506
|
-
* fit a fixed budget at the cost of hiding it.
|
|
507
|
-
*
|
|
508
|
-
* NEVER include: raw file contents, secrets, API keys, full LLM-emitted
|
|
509
|
-
* reasoning, or untrusted text passed through verbatim. Use byte/line
|
|
510
|
-
* counts as proxies (`Write ${path} (${content.length} bytes)`).
|
|
511
|
-
*
|
|
512
|
-
* See `docs/features/v0.7.33.md` "Tool 接口扩展" for design rationale.
|
|
513
|
-
*/
|
|
514
|
-
toClassifierInput: (input: unknown) => string;
|
|
515
|
-
}
|
|
516
|
-
interface ToolDefinitionSource {
|
|
517
|
-
/**
|
|
518
|
-
* Origin of the registered tool. `'constructed'` (FEATURE_087, v0.7.28)
|
|
519
|
-
* marks tools materialized at runtime by `ConstructionRuntime` from
|
|
520
|
-
* `.kodax/constructed/tools/<name>/<version>.json` artifacts.
|
|
521
|
-
*/
|
|
522
|
-
kind: 'builtin' | 'extension' | 'constructed';
|
|
523
|
-
id?: string;
|
|
524
|
-
label?: string;
|
|
525
|
-
/**
|
|
526
|
-
* Constructed-only: semver of the activated artifact. Used by
|
|
527
|
-
* `findByVersion()` and by `revoke()` to locate a specific stack entry.
|
|
528
|
-
*/
|
|
529
|
-
version?: string;
|
|
530
|
-
/**
|
|
531
|
-
* Constructed-only: absolute path to the artifact JSON on disk.
|
|
532
|
-
* Lets revoke / inspect operations round-trip back to the source of
|
|
533
|
-
* truth without re-globbing.
|
|
534
|
-
*/
|
|
535
|
-
manifestPath?: string;
|
|
536
|
-
}
|
|
537
|
-
interface RegisteredToolDefinition extends LocalToolDefinition {
|
|
538
|
-
registrationId: string;
|
|
539
|
-
requiredParams: string[];
|
|
540
|
-
source: ToolDefinitionSource;
|
|
541
|
-
}
|
|
542
|
-
interface ToolRegistrationOptions {
|
|
543
|
-
source?: ToolDefinitionSource;
|
|
544
|
-
}
|
|
545
|
-
type ToolRegistry = Map<string, RegisteredToolDefinition[]>;
|
|
546
|
-
type KodaXRetrievalToolName = 'web_search' | 'web_fetch' | 'code_search' | 'semantic_lookup' | 'mcp_search' | 'mcp_describe' | 'mcp_call' | 'mcp_read_resource' | 'mcp_get_prompt';
|
|
547
|
-
type KodaXRetrievalScope = 'workspace' | 'remote';
|
|
548
|
-
type KodaXRetrievalTrust = 'workspace' | 'provider' | 'open-world';
|
|
549
|
-
type KodaXRetrievalFreshness = 'fresh' | 'snapshot' | 'unknown';
|
|
550
|
-
interface KodaXRetrievalArtifact {
|
|
551
|
-
kind: 'url' | 'path' | 'symbol' | 'module' | 'process' | 'provider';
|
|
552
|
-
label: string;
|
|
553
|
-
value: string;
|
|
554
|
-
}
|
|
555
|
-
interface KodaXRetrievalItem {
|
|
556
|
-
title: string;
|
|
557
|
-
locator?: string;
|
|
558
|
-
snippet?: string;
|
|
559
|
-
score?: number;
|
|
560
|
-
metadata?: Record<string, unknown>;
|
|
561
|
-
}
|
|
562
|
-
interface KodaXRetrievalResult {
|
|
563
|
-
tool: KodaXRetrievalToolName;
|
|
564
|
-
query?: string;
|
|
565
|
-
scope: KodaXRetrievalScope;
|
|
566
|
-
trust: KodaXRetrievalTrust;
|
|
567
|
-
freshness: KodaXRetrievalFreshness;
|
|
568
|
-
provider?: string;
|
|
569
|
-
summary: string;
|
|
570
|
-
content?: string;
|
|
571
|
-
items: KodaXRetrievalItem[];
|
|
572
|
-
artifacts?: KodaXRetrievalArtifact[];
|
|
573
|
-
metadata?: Record<string, unknown>;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
94
|
declare const KODAX_TOOLS: KodaXToolDefinition[];
|
|
577
95
|
declare function registerTool(definition: LocalToolDefinition, options?: ToolRegistrationOptions): () => void;
|
|
578
96
|
declare function getTool(name: string): ToolHandler | undefined;
|
|
@@ -990,9 +508,9 @@ declare function _resetRuntimeForTesting(): void;
|
|
|
990
508
|
* refuses to overwrite. Bumping the semver is the supported update path.
|
|
991
509
|
*
|
|
992
510
|
* Why "any status", not just `'active'`:
|
|
993
|
-
* The handler's `.
|
|
511
|
+
* The handler's `.mjs` module is loaded via `await import(file://…)`
|
|
994
512
|
* which the ESM module cache keys by absolute file URL. Re-writing
|
|
995
|
-
* `<version>.
|
|
513
|
+
* `<version>.mjs` in place leaves the cached module pointing at the
|
|
996
514
|
* OLD code; subsequent loadHandler() calls return the cached export.
|
|
997
515
|
* Even revoking first does not flush the cache (Node has no public
|
|
998
516
|
* ESM cache eviction API). The only safe-by-construction policy is
|
|
@@ -1097,8 +615,9 @@ declare function activate(handle: StagedHandle): Promise<void>;
|
|
|
1097
615
|
* tools.
|
|
1098
616
|
*
|
|
1099
617
|
* Returns counts so callers can surface a loaded/failed/tampered banner.
|
|
1100
|
-
* Failures are
|
|
1101
|
-
* remaining artifacts; a single bad manifest must not
|
|
618
|
+
* Failures are emitted through the diagnostic channel and rehydration
|
|
619
|
+
* continues for the remaining artifacts; a single bad manifest must not
|
|
620
|
+
* break boot.
|
|
1102
621
|
*/
|
|
1103
622
|
declare function rehydrateActiveArtifacts(): Promise<{
|
|
1104
623
|
loaded: number;
|
|
@@ -1349,8 +868,8 @@ declare function ensureBuiltinRepoExplorerAgent(): Promise<boolean>;
|
|
|
1349
868
|
/**
|
|
1350
869
|
* CtxProxy — runtime gate for constructed tool handlers.
|
|
1351
870
|
*
|
|
1352
|
-
* Constructed handlers run in
|
|
1353
|
-
*
|
|
871
|
+
* Constructed handlers run in a disposable Worker. Capability and policy
|
|
872
|
+
* checks still execute in the host through reverse tool RPC.
|
|
1354
873
|
* Safety derives from a four-layer model — Guardrail static check,
|
|
1355
874
|
* `capabilities.tools` whitelist declaration, this CtxProxy at runtime,
|
|
1356
875
|
* and policy gate on activate.
|
|
@@ -1373,8 +892,9 @@ declare function ensureBuiltinRepoExplorerAgent(): Promise<boolean>;
|
|
|
1373
892
|
* keeps the parent agent loop alive and reportable.
|
|
1374
893
|
* - Direct `ctx.tools` enumeration / introspection is gated; the
|
|
1375
894
|
* proxied `tools` object only exposes whitelisted names.
|
|
1376
|
-
* -
|
|
1377
|
-
*
|
|
895
|
+
* - The host proxy retains the live execution context for reverse tool RPC.
|
|
896
|
+
* The handler Worker receives only cloneable informational fields plus a
|
|
897
|
+
* bridged AbortSignal; host callbacks and mutable services stay here.
|
|
1378
898
|
*
|
|
1379
899
|
* Anti-tampering:
|
|
1380
900
|
* - Returned proxy is `Object.freeze`d at the top level so handlers
|
|
@@ -1400,43 +920,13 @@ interface CreateCtxProxyOptions {
|
|
|
1400
920
|
}
|
|
1401
921
|
declare function createCtxProxy(ctx: unknown, capabilities: Capabilities, options?: CreateCtxProxyOptions): unknown;
|
|
1402
922
|
|
|
1403
|
-
/**
|
|
1404
|
-
* loadHandler — turns a manifest's handler script into a callable
|
|
1405
|
-
* `ToolHandler` ready to register into `TOOL_REGISTRY`.
|
|
1406
|
-
*
|
|
1407
|
-
* Pipeline:
|
|
1408
|
-
* 1. Validate language === 'javascript' (v0.7.28 hard limit).
|
|
1409
|
-
* 2. Materialize the handler source onto disk under
|
|
1410
|
-
* `<cwd>/.kodax/constructed/tools/<name>/<version>.js`.
|
|
1411
|
-
* 3. Dynamic `import()` of the file URL — host-process module load,
|
|
1412
|
-
* no worker / vm isolation (DD §14.4).
|
|
1413
|
-
* 4. Wrap with `createCtxProxy` + a Promise.race timeout.
|
|
1414
|
-
*
|
|
1415
|
-
* Design notes:
|
|
1416
|
-
* - Returning `ToolHandlerSync` (not the streaming variant) — v0.7.28
|
|
1417
|
-
* constructed tools are non-streaming computations.
|
|
1418
|
-
* - Handler return value is stringified for the agent loop, mirroring
|
|
1419
|
-
* builtin tool result conventions.
|
|
1420
|
-
* - ESM module cache is intentional: re-loading the same `<version>.js`
|
|
1421
|
-
* returns the cached module. Constructed artifacts are immutable per
|
|
1422
|
-
* version, so this is correct (revoke + new version is the proper
|
|
1423
|
-
* update path).
|
|
1424
|
-
* - Timeout is enforced via Promise.race; the underlying handler
|
|
1425
|
-
* promise is *not* hard-aborted (Node has no general task abort).
|
|
1426
|
-
* Long-running CPU loops will leak past timeout — accepted in the
|
|
1427
|
-
* v0.7.28 threat model (LLM hallucination, not adversarial DoS).
|
|
1428
|
-
*/
|
|
1429
|
-
|
|
1430
923
|
interface LoadHandlerScope {
|
|
1431
924
|
readonly name: string;
|
|
1432
925
|
readonly version: string;
|
|
1433
|
-
/** Workspace root; defaults to `process.cwd()`. */
|
|
1434
926
|
readonly cwd?: string;
|
|
1435
927
|
}
|
|
1436
928
|
interface LoadHandlerOptions {
|
|
1437
|
-
/** Per-tool override; falls back to {@link DEFAULT_HANDLER_TIMEOUT_MS}. */
|
|
1438
929
|
readonly timeoutMs?: number;
|
|
1439
|
-
/** Pass-through to {@link createCtxProxy}. */
|
|
1440
930
|
readonly ctxProxyOptions?: CreateCtxProxyOptions;
|
|
1441
931
|
}
|
|
1442
932
|
declare function loadHandler(scope: LoadHandlerScope, source: ScriptSource, capabilities: Capabilities, options?: LoadHandlerOptions): Promise<ToolHandlerSync>;
|
|
@@ -1830,484 +1320,6 @@ interface RollbackResult {
|
|
|
1830
1320
|
*/
|
|
1831
1321
|
declare function rollbackSelfModify(name: string): Promise<RollbackResult>;
|
|
1832
1322
|
|
|
1833
|
-
interface ExecOptions {
|
|
1834
|
-
/** Extra environment variables to inject (merged with safe base env). */
|
|
1835
|
-
readonly env?: Readonly<Record<string, string>>;
|
|
1836
|
-
/** Working directory. Defaults to process.cwd(). */
|
|
1837
|
-
readonly cwd?: string;
|
|
1838
|
-
/** Timeout in milliseconds. Defaults to 30000. */
|
|
1839
|
-
readonly timeout?: number;
|
|
1840
|
-
/** Shell to use. Defaults to 'bash' on Unix, 'powershell' on Windows. */
|
|
1841
|
-
readonly shell?: 'bash' | 'powershell';
|
|
1842
|
-
}
|
|
1843
|
-
interface ExecResult {
|
|
1844
|
-
readonly exitCode: number;
|
|
1845
|
-
readonly stdout: string;
|
|
1846
|
-
readonly stderr: string;
|
|
1847
|
-
}
|
|
1848
|
-
/**
|
|
1849
|
-
* Run a shell command with a sandboxed environment.
|
|
1850
|
-
*
|
|
1851
|
-
* SECURITY: Only a whitelist of safe environment variables is passed to the
|
|
1852
|
-
* subprocess. API keys and tokens from the parent environment are NOT inherited.
|
|
1853
|
-
*/
|
|
1854
|
-
declare function exec(command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
1855
|
-
interface WebhookOptions {
|
|
1856
|
-
/** HTTP method. Defaults to 'POST'. */
|
|
1857
|
-
readonly method?: 'POST' | 'PUT';
|
|
1858
|
-
/** Extra HTTP headers. */
|
|
1859
|
-
readonly headers?: Readonly<Record<string, string>>;
|
|
1860
|
-
/** Timeout in milliseconds. Defaults to 10000. */
|
|
1861
|
-
readonly timeout?: number;
|
|
1862
|
-
}
|
|
1863
|
-
interface WebhookResult {
|
|
1864
|
-
readonly ok: boolean;
|
|
1865
|
-
readonly status: number;
|
|
1866
|
-
readonly body?: string;
|
|
1867
|
-
}
|
|
1868
|
-
/**
|
|
1869
|
-
* Send an HTTP webhook with timeout support.
|
|
1870
|
-
* Returns a result object instead of throwing on errors.
|
|
1871
|
-
*/
|
|
1872
|
-
declare function webhook(url: string, payload: unknown, options?: WebhookOptions): Promise<WebhookResult>;
|
|
1873
|
-
|
|
1874
|
-
interface ModelProviderRegistration {
|
|
1875
|
-
name: string;
|
|
1876
|
-
factory: () => KodaXBaseProvider;
|
|
1877
|
-
}
|
|
1878
|
-
interface ExtensionCommandDefinition {
|
|
1879
|
-
name: string;
|
|
1880
|
-
aliases?: string[];
|
|
1881
|
-
description: string;
|
|
1882
|
-
usage?: string;
|
|
1883
|
-
metadata?: Record<string, unknown>;
|
|
1884
|
-
handler: (args: string[], context: ExtensionCommandContext) => Promise<ExtensionCommandResult | void> | ExtensionCommandResult | void;
|
|
1885
|
-
}
|
|
1886
|
-
interface ExtensionModelSelection {
|
|
1887
|
-
provider?: string;
|
|
1888
|
-
model?: string;
|
|
1889
|
-
}
|
|
1890
|
-
interface ExtensionLogger {
|
|
1891
|
-
debug: (...args: unknown[]) => void;
|
|
1892
|
-
info: (...args: unknown[]) => void;
|
|
1893
|
-
warn: (...args: unknown[]) => void;
|
|
1894
|
-
error: (...args: unknown[]) => void;
|
|
1895
|
-
}
|
|
1896
|
-
interface ExtensionFileContributionSource {
|
|
1897
|
-
kind: 'extension';
|
|
1898
|
-
id: string;
|
|
1899
|
-
label: string;
|
|
1900
|
-
path: string;
|
|
1901
|
-
}
|
|
1902
|
-
interface RuntimeContributionSource {
|
|
1903
|
-
kind: 'runtime';
|
|
1904
|
-
id: string;
|
|
1905
|
-
label: string;
|
|
1906
|
-
path?: string;
|
|
1907
|
-
}
|
|
1908
|
-
type ExtensionContributionSource = ExtensionFileContributionSource | RuntimeContributionSource;
|
|
1909
|
-
type ExtensionLoadSource = 'api' | 'cli' | 'config' | 'discovery';
|
|
1910
|
-
interface LoadedExtensionDiagnostic {
|
|
1911
|
-
path: string;
|
|
1912
|
-
label: string;
|
|
1913
|
-
loadSource: ExtensionLoadSource;
|
|
1914
|
-
sessionStateKeys?: string[];
|
|
1915
|
-
sessionRecordCounts?: Record<string, number>;
|
|
1916
|
-
}
|
|
1917
|
-
interface RegisteredCapabilityProviderDiagnostic {
|
|
1918
|
-
id: string;
|
|
1919
|
-
kinds: CapabilityKind[];
|
|
1920
|
-
source: ExtensionContributionSource;
|
|
1921
|
-
metadata?: Record<string, unknown>;
|
|
1922
|
-
}
|
|
1923
|
-
interface RegisteredCommandDiagnostic {
|
|
1924
|
-
name: string;
|
|
1925
|
-
aliases?: string[];
|
|
1926
|
-
description: string;
|
|
1927
|
-
usage?: string;
|
|
1928
|
-
metadata?: Record<string, unknown>;
|
|
1929
|
-
source: ExtensionContributionSource;
|
|
1930
|
-
}
|
|
1931
|
-
interface RegisteredToolDiagnostic {
|
|
1932
|
-
name: string;
|
|
1933
|
-
description: string;
|
|
1934
|
-
requiredParams: string[];
|
|
1935
|
-
source: RegisteredToolDefinition['source'];
|
|
1936
|
-
shadowedSources: RegisteredToolDefinition['source'][];
|
|
1937
|
-
}
|
|
1938
|
-
interface RegisteredHookDiagnostic {
|
|
1939
|
-
hook: keyof ExtensionHookMap;
|
|
1940
|
-
order: number;
|
|
1941
|
-
source: ExtensionContributionSource;
|
|
1942
|
-
}
|
|
1943
|
-
type ExtensionFailureStage = 'load' | 'reload' | 'event' | 'hook' | 'persistence';
|
|
1944
|
-
interface ExtensionFailureDiagnostic {
|
|
1945
|
-
stage: ExtensionFailureStage;
|
|
1946
|
-
target: string;
|
|
1947
|
-
message: string;
|
|
1948
|
-
occurredAt: string;
|
|
1949
|
-
source: ExtensionContributionSource;
|
|
1950
|
-
}
|
|
1951
|
-
interface ExtensionRuntimeDiagnostics {
|
|
1952
|
-
loadedExtensions: LoadedExtensionDiagnostic[];
|
|
1953
|
-
capabilityProviders: RegisteredCapabilityProviderDiagnostic[];
|
|
1954
|
-
commands: RegisteredCommandDiagnostic[];
|
|
1955
|
-
tools: RegisteredToolDiagnostic[];
|
|
1956
|
-
hooks: RegisteredHookDiagnostic[];
|
|
1957
|
-
failures: ExtensionFailureDiagnostic[];
|
|
1958
|
-
defaults: {
|
|
1959
|
-
activeTools?: string[];
|
|
1960
|
-
modelSelection: ExtensionModelSelection;
|
|
1961
|
-
thinkingLevel?: KodaXWireReasoningEffort;
|
|
1962
|
-
};
|
|
1963
|
-
}
|
|
1964
|
-
interface ExtensionCommandInvocation {
|
|
1965
|
-
prompt: string;
|
|
1966
|
-
displayName?: string;
|
|
1967
|
-
disableModelInvocation?: boolean;
|
|
1968
|
-
allowedTools?: string;
|
|
1969
|
-
context?: 'fork';
|
|
1970
|
-
model?: string;
|
|
1971
|
-
}
|
|
1972
|
-
interface ExtensionCommandResult {
|
|
1973
|
-
success?: boolean;
|
|
1974
|
-
message?: string;
|
|
1975
|
-
data?: unknown;
|
|
1976
|
-
invocation?: ExtensionCommandInvocation;
|
|
1977
|
-
}
|
|
1978
|
-
interface ExtensionCommandContext {
|
|
1979
|
-
sessionId?: string;
|
|
1980
|
-
gitRoot?: string;
|
|
1981
|
-
workingDirectory: string;
|
|
1982
|
-
reloadExtensions: () => Promise<void>;
|
|
1983
|
-
getDiagnostics: () => ExtensionRuntimeDiagnostics;
|
|
1984
|
-
logger: ExtensionLogger;
|
|
1985
|
-
}
|
|
1986
|
-
interface ExtensionToolBeforeHookContext {
|
|
1987
|
-
name: string;
|
|
1988
|
-
input: Record<string, unknown>;
|
|
1989
|
-
toolId?: string;
|
|
1990
|
-
executionCwd?: string;
|
|
1991
|
-
gitRoot?: string;
|
|
1992
|
-
}
|
|
1993
|
-
interface ExtensionProviderBeforeHookContext {
|
|
1994
|
-
provider: string;
|
|
1995
|
-
model?: string;
|
|
1996
|
-
reasoningMode?: KodaXWireReasoningEffort;
|
|
1997
|
-
systemPrompt: string;
|
|
1998
|
-
block: (reason: string) => void;
|
|
1999
|
-
replaceProvider: (provider: string) => void;
|
|
2000
|
-
replaceModel: (model?: string) => void;
|
|
2001
|
-
replaceSystemPrompt: (systemPrompt: string) => void;
|
|
2002
|
-
setThinkingLevel: (level: KodaXWireReasoningEffort) => void;
|
|
2003
|
-
}
|
|
2004
|
-
interface ExtensionTurnSettleHookContext {
|
|
2005
|
-
sessionId: string;
|
|
2006
|
-
lastText: string;
|
|
2007
|
-
hadToolCalls: boolean;
|
|
2008
|
-
success: boolean;
|
|
2009
|
-
signal?: 'COMPLETE' | 'BLOCKED' | 'DECIDE';
|
|
2010
|
-
queueUserMessage: (message: string | KodaXMessage) => void;
|
|
2011
|
-
setModelSelection: (next: ExtensionModelSelection) => void;
|
|
2012
|
-
setThinkingLevel: (level: KodaXWireReasoningEffort) => void;
|
|
2013
|
-
}
|
|
2014
|
-
/**
|
|
2015
|
-
* FEATURE_184 (v0.7.45) — Stop Hook bridge context for extensions.
|
|
2016
|
-
*
|
|
2017
|
-
* Fires ONLY when the model terminates a turn text-only (no tool_use)
|
|
2018
|
-
* — a strict subset of `turn:settle`, which fires on every turn end
|
|
2019
|
-
* including mid-task tool turns. Use this hook for verification or
|
|
2020
|
-
* "is the task actually done?" checks. The three-state return surface
|
|
2021
|
-
* mirrors `RunOptions.stopHook` at the agent layer; the bridge passes
|
|
2022
|
-
* the extension's return through unchanged.
|
|
2023
|
-
*
|
|
2024
|
-
* Coding-layer first-party consumers (Sidecar Verifier, FEATURE_184
|
|
2025
|
-
* Phase D) wire directly to the agent `stopHook`. Third-party
|
|
2026
|
-
* extensions write `api.hook('turn:complete', handler)` and the bridge
|
|
2027
|
-
* dispatches to them inside the agent's `stopHook` callback. Handlers
|
|
2028
|
-
* fire in registration order, first non-`void` return short-circuits
|
|
2029
|
-
* the chain (matches `tool:before` semantics).
|
|
2030
|
-
*
|
|
2031
|
-
* Scope note: this hook fires on the AMA `runner-driven` path only
|
|
2032
|
-
* (main loop, B1 retry, V2 worker). SA-path child agents dispatched
|
|
2033
|
-
* via `dispatch_child_task` go through `runKodaX` and do NOT trigger
|
|
2034
|
-
* this hook — observe their lifecycle via `turn:settle` on the SA
|
|
2035
|
-
* path. Extensions wanting "every agent termination" semantics must
|
|
2036
|
-
* register both hooks.
|
|
2037
|
-
*/
|
|
2038
|
-
interface ExtensionTurnCompleteHookContext {
|
|
2039
|
-
sessionId: string;
|
|
2040
|
-
lastAssistantText: string;
|
|
2041
|
-
signal: 'natural-end';
|
|
2042
|
-
reanimateCount: number;
|
|
2043
|
-
reanimateBudget: number;
|
|
2044
|
-
}
|
|
2045
|
-
/**
|
|
2046
|
-
* FEATURE_184 (v0.7.45) — Extension `turn:complete` return surface.
|
|
2047
|
-
*
|
|
2048
|
-
* - `void` / `undefined` → accept the termination, defer to next
|
|
2049
|
-
* handler (or fall through to agent terminal path if none).
|
|
2050
|
-
* - `string` → reanimate: synthesize a user message, run another
|
|
2051
|
-
* turn. Bounded by Runner's `stopHookReanimateBudget`.
|
|
2052
|
-
* - `{ abort: true, reason }` → halt the run, surface reason to
|
|
2053
|
-
* caller via `RunResult.output` + `stoppedByHook = true`.
|
|
2054
|
-
*/
|
|
2055
|
-
type ExtensionTurnCompleteHookResult = void | string | {
|
|
2056
|
-
readonly abort: true;
|
|
2057
|
-
readonly reason: string;
|
|
2058
|
-
};
|
|
2059
|
-
interface ExtensionSessionHydrateHookContext {
|
|
2060
|
-
sessionId: string;
|
|
2061
|
-
getState: <T = KodaXJsonValue>(key: string) => T | undefined;
|
|
2062
|
-
setState: (key: string, value: KodaXJsonValue | undefined) => void;
|
|
2063
|
-
listRecords: (type?: string) => KodaXExtensionSessionRecord[];
|
|
2064
|
-
appendRecord: (type: string, data?: KodaXJsonValue, options?: {
|
|
2065
|
-
dedupeKey?: string;
|
|
2066
|
-
}) => KodaXExtensionSessionRecord | undefined;
|
|
2067
|
-
clearRecords: (type?: string) => number;
|
|
2068
|
-
}
|
|
2069
|
-
interface ExtensionEventMap {
|
|
2070
|
-
'session:start': {
|
|
2071
|
-
provider: string;
|
|
2072
|
-
sessionId: string;
|
|
2073
|
-
};
|
|
2074
|
-
'turn:start': {
|
|
2075
|
-
sessionId: string;
|
|
2076
|
-
iteration: number;
|
|
2077
|
-
maxIter: number;
|
|
2078
|
-
};
|
|
2079
|
-
'text:delta': {
|
|
2080
|
-
text: string;
|
|
2081
|
-
};
|
|
2082
|
-
'thinking:delta': {
|
|
2083
|
-
text: string;
|
|
2084
|
-
};
|
|
2085
|
-
'thinking:end': {
|
|
2086
|
-
thinking: string;
|
|
2087
|
-
};
|
|
2088
|
-
'tool:start': {
|
|
2089
|
-
name: string;
|
|
2090
|
-
id: string;
|
|
2091
|
-
input?: Record<string, unknown>;
|
|
2092
|
-
};
|
|
2093
|
-
'tool:result': {
|
|
2094
|
-
id: string;
|
|
2095
|
-
name: string;
|
|
2096
|
-
content: string;
|
|
2097
|
-
};
|
|
2098
|
-
'provider:selected': {
|
|
2099
|
-
provider: string;
|
|
2100
|
-
model?: string;
|
|
2101
|
-
};
|
|
2102
|
-
'provider:rate-limit': {
|
|
2103
|
-
provider: string;
|
|
2104
|
-
attempt: number;
|
|
2105
|
-
maxRetries: number;
|
|
2106
|
-
delayMs: number;
|
|
2107
|
-
};
|
|
2108
|
-
'capability:search': {
|
|
2109
|
-
providerId: string;
|
|
2110
|
-
query: string;
|
|
2111
|
-
kind?: CapabilityKind;
|
|
2112
|
-
limit?: number;
|
|
2113
|
-
};
|
|
2114
|
-
'capability:describe': {
|
|
2115
|
-
providerId: string;
|
|
2116
|
-
capabilityId: string;
|
|
2117
|
-
};
|
|
2118
|
-
'capability:invoke': {
|
|
2119
|
-
providerId: string;
|
|
2120
|
-
capabilityId: string;
|
|
2121
|
-
kind: CapabilityKind;
|
|
2122
|
-
};
|
|
2123
|
-
'capability:refresh': {
|
|
2124
|
-
providerId: string;
|
|
2125
|
-
};
|
|
2126
|
-
'stream:end': undefined;
|
|
2127
|
-
'turn:end': {
|
|
2128
|
-
sessionId: string;
|
|
2129
|
-
iteration: number;
|
|
2130
|
-
lastText: string;
|
|
2131
|
-
hadToolCalls: boolean;
|
|
2132
|
-
signal?: 'COMPLETE' | 'BLOCKED' | 'DECIDE';
|
|
2133
|
-
};
|
|
2134
|
-
'complete': {
|
|
2135
|
-
success: boolean;
|
|
2136
|
-
signal?: 'COMPLETE' | 'BLOCKED' | 'DECIDE';
|
|
2137
|
-
};
|
|
2138
|
-
'error': {
|
|
2139
|
-
error: Error;
|
|
2140
|
-
};
|
|
2141
|
-
'todo:created': {
|
|
2142
|
-
id: string;
|
|
2143
|
-
item: KodaXTodoItem;
|
|
2144
|
-
source: TodoMutationSource;
|
|
2145
|
-
};
|
|
2146
|
-
'todo:updated': {
|
|
2147
|
-
id: string;
|
|
2148
|
-
before: KodaXTodoItem;
|
|
2149
|
-
after: KodaXTodoItem;
|
|
2150
|
-
changedFields: readonly (keyof KodaXTodoItem)[];
|
|
2151
|
-
source: TodoMutationSource;
|
|
2152
|
-
};
|
|
2153
|
-
'todo:deleted': {
|
|
2154
|
-
id: string;
|
|
2155
|
-
item: KodaXTodoItem;
|
|
2156
|
-
source: TodoMutationSource;
|
|
2157
|
-
};
|
|
2158
|
-
}
|
|
2159
|
-
/**
|
|
2160
|
-
* FEATURE_170 v0.7.41 — provenance tag for todo:* events / hooks. Lets
|
|
2161
|
-
* extension authors distinguish LLM-driven mutations (`tool`) from
|
|
2162
|
-
* runner-side automation (`internal`) — e.g. an extension that audits
|
|
2163
|
-
* todo churn should ignore `internal` flips to avoid false positives.
|
|
2164
|
-
*/
|
|
2165
|
-
type TodoMutationSource = 'tool' | 'internal';
|
|
2166
|
-
/**
|
|
2167
|
-
* FEATURE_170 v0.7.41 — seed shape passed to `'todo:before-create'`.
|
|
2168
|
-
* Mirrors `TodoAddSeed` from todo-store.ts (kept structurally compatible
|
|
2169
|
-
* to avoid coupling extension authors to the internal task-engine type).
|
|
2170
|
-
*
|
|
2171
|
-
* v0.7.42 — `content` renamed to `subject` + optional `description` to
|
|
2172
|
-
* match claudecode V2 `TaskCreateTool` schema. See `TodoItem` JSDoc in
|
|
2173
|
-
* packages/coding/src/types.ts.
|
|
2174
|
-
*/
|
|
2175
|
-
interface ExtensionTodoCreateSeed {
|
|
2176
|
-
readonly subject: string;
|
|
2177
|
-
readonly description?: string;
|
|
2178
|
-
readonly activeForm?: string;
|
|
2179
|
-
readonly evaluator?: 'build' | 'test' | 'lint';
|
|
2180
|
-
readonly owner?: string;
|
|
2181
|
-
readonly sourceObligationIndex?: number;
|
|
2182
|
-
readonly metadata?: Record<string, unknown>;
|
|
2183
|
-
}
|
|
2184
|
-
/**
|
|
2185
|
-
* FEATURE_170 v0.7.41 — minimal todo item shape exposed to extensions
|
|
2186
|
-
* via the todo:* events. Kept structurally identical to the engine's
|
|
2187
|
-
* `TodoItem` so the runtime can pass values straight through without
|
|
2188
|
-
* conversion, but redeclared here so extension consumers don't import
|
|
2189
|
-
* from `packages/coding/src/types.ts` (which is task-engine internal).
|
|
2190
|
-
*
|
|
2191
|
-
* Drift guard: a compile-time assignability assertion at the bottom of
|
|
2192
|
-
* this file fires if `TodoItem` (engine) gains a field that this
|
|
2193
|
-
* extension-facing shape does NOT mirror — see `__todoItemParity` below.
|
|
2194
|
-
*/
|
|
2195
|
-
interface KodaXTodoItem {
|
|
2196
|
-
readonly id: string;
|
|
2197
|
-
/** v0.7.42 — see TodoItem.subject JSDoc in packages/coding/src/types.ts. */
|
|
2198
|
-
readonly subject: string;
|
|
2199
|
-
readonly description?: string;
|
|
2200
|
-
readonly status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'skipped' | 'cancelled';
|
|
2201
|
-
readonly owner?: string;
|
|
2202
|
-
readonly sourceObligationIndex?: number;
|
|
2203
|
-
readonly note?: string;
|
|
2204
|
-
readonly evaluator?: 'build' | 'test' | 'lint';
|
|
2205
|
-
readonly activeForm?: string;
|
|
2206
|
-
readonly metadata?: Record<string, unknown>;
|
|
2207
|
-
}
|
|
2208
|
-
interface ExtensionHookMap {
|
|
2209
|
-
'tool:before': (context: ExtensionToolBeforeHookContext) => Promise<void | string | false> | void | string | false;
|
|
2210
|
-
'provider:before': (context: ExtensionProviderBeforeHookContext) => Promise<void> | void;
|
|
2211
|
-
'turn:settle': (context: ExtensionTurnSettleHookContext) => Promise<void> | void;
|
|
2212
|
-
'turn:complete': (context: ExtensionTurnCompleteHookContext) => Promise<ExtensionTurnCompleteHookResult> | ExtensionTurnCompleteHookResult;
|
|
2213
|
-
'session:hydrate': (context: ExtensionSessionHydrateHookContext) => Promise<void> | void;
|
|
2214
|
-
'todo:before-create': (context: {
|
|
2215
|
-
seed: ExtensionTodoCreateSeed;
|
|
2216
|
-
}) => Promise<void | string | false> | void | string | false;
|
|
2217
|
-
'todo:before-complete': (context: {
|
|
2218
|
-
id: string;
|
|
2219
|
-
item: KodaXTodoItem;
|
|
2220
|
-
}) => Promise<void | string | false> | void | string | false;
|
|
2221
|
-
}
|
|
2222
|
-
interface ExtensionRuntimeController {
|
|
2223
|
-
queueUserMessage(message: string | KodaXMessage): void;
|
|
2224
|
-
getSessionState<T = KodaXJsonValue>(key: string): T | undefined;
|
|
2225
|
-
setSessionState(key: string, value: KodaXJsonValue | undefined): void;
|
|
2226
|
-
appendSessionRecord(type: string, data?: KodaXJsonValue, options?: {
|
|
2227
|
-
dedupeKey?: string;
|
|
2228
|
-
}): KodaXExtensionSessionRecord | undefined;
|
|
2229
|
-
listSessionRecords(type?: string): KodaXExtensionSessionRecord[];
|
|
2230
|
-
clearSessionRecords(type?: string): number;
|
|
2231
|
-
getActiveTools(): string[];
|
|
2232
|
-
setActiveTools(toolNames: string[]): void;
|
|
2233
|
-
getModelSelection(): ExtensionModelSelection;
|
|
2234
|
-
setModelSelection(next: ExtensionModelSelection): void;
|
|
2235
|
-
getThinkingLevel(): KodaXWireReasoningEffort | undefined;
|
|
2236
|
-
setThinkingLevel(level: KodaXWireReasoningEffort): void;
|
|
2237
|
-
}
|
|
2238
|
-
interface KodaXExtensionAPI {
|
|
2239
|
-
registerTool: (definition: LocalToolDefinition) => () => void;
|
|
2240
|
-
getTool: (name: string) => RegisteredToolDefinition | undefined;
|
|
2241
|
-
getBuiltinTool: (name: string) => RegisteredToolDefinition | undefined;
|
|
2242
|
-
registerModelProvider: (registration: ModelProviderRegistration) => () => void;
|
|
2243
|
-
registerCapabilityProvider: (provider: CapabilityProvider) => () => void;
|
|
2244
|
-
registerCommand: (command: ExtensionCommandDefinition) => () => void;
|
|
2245
|
-
registerSkillPath: (skillPath: string) => () => void;
|
|
2246
|
-
/**
|
|
2247
|
-
* FEATURE_191 (v0.7.43) — register a constructed agent at extension
|
|
2248
|
-
* activate time. The extension supplies the agent name and an
|
|
2249
|
-
* `AgentContent` body (instructions + optional tools/handoffs/
|
|
2250
|
-
* reasoning/model/description); the runtime threads it through
|
|
2251
|
-
* `buildAdmissionManifest` + `Runner.admit` and registers the
|
|
2252
|
-
* activated Agent via `registerConstructedAgent({ source:
|
|
2253
|
-
* 'extension' })`. The returned dispose fn (also auto-pushed onto
|
|
2254
|
-
* the extension's disposables list) unregisters the agent on
|
|
2255
|
-
* extension deactivate.
|
|
2256
|
-
*
|
|
2257
|
-
* Returns `Promise<() => void>` — **you MUST `await` the call**
|
|
2258
|
-
* before invoking the dispose function. Unlike sibling
|
|
2259
|
-
* `registerTool` (sync), this is async because `Runner.admit` is
|
|
2260
|
-
* declared async (FEATURE_101 admission contract — admission may
|
|
2261
|
-
* consult disk for handoff-target staged-agent resolution).
|
|
2262
|
-
*
|
|
2263
|
-
* @example
|
|
2264
|
-
* ```ts
|
|
2265
|
-
* // CORRECT — await unwraps the Promise to a sync dispose
|
|
2266
|
-
* export default async function activate(api: KodaXExtensionAPI) {
|
|
2267
|
-
* const dispose = await api.registerAgent('db-reviewer', {
|
|
2268
|
-
* instructions: 'You review DB migrations.',
|
|
2269
|
-
* description: 'DB migration reviewer',
|
|
2270
|
-
* });
|
|
2271
|
-
* // dispose() is now callable on demand; the runtime also auto-
|
|
2272
|
-
* // disposes via the extension's disposables list at deactivate.
|
|
2273
|
-
* }
|
|
2274
|
-
* ```
|
|
2275
|
-
*
|
|
2276
|
-
* @example
|
|
2277
|
-
* ```ts
|
|
2278
|
-
* // WRONG — TypeScript catches this; .js / @ts-ignore consumers
|
|
2279
|
-
* // hit a runtime TypeError because Promise is not a function.
|
|
2280
|
-
* export default function activate(api: KodaXExtensionAPI) {
|
|
2281
|
-
* const dispose = api.registerAgent('x', { instructions: '...' });
|
|
2282
|
-
* dispose(); // TypeError: dispose is not a function
|
|
2283
|
-
* }
|
|
2284
|
-
* ```
|
|
2285
|
-
*
|
|
2286
|
-
* Throws on admission rejection (with the verdict reason) so the
|
|
2287
|
-
* extension author sees the failure at activate time rather than
|
|
2288
|
-
* having a silently-dropped registration. The throw also halts
|
|
2289
|
-
* extension loading — the extension's other registrations roll back
|
|
2290
|
-
* via `LoadedExtensionRecord.disposables` reverse-iterate.
|
|
2291
|
-
*/
|
|
2292
|
-
registerAgent: (name: string, content: AgentContent) => Promise<() => void>;
|
|
2293
|
-
on: <TEvent extends keyof ExtensionEventMap>(event: TEvent, handler: (payload: ExtensionEventMap[TEvent]) => Promise<void> | void) => () => void;
|
|
2294
|
-
hook: <THook extends keyof ExtensionHookMap>(hook: THook, handler: ExtensionHookMap[THook]) => () => void;
|
|
2295
|
-
logger: ExtensionLogger;
|
|
2296
|
-
config: Readonly<Record<string, unknown>>;
|
|
2297
|
-
runtime: ExtensionRuntimeController;
|
|
2298
|
-
/** Extension-scoped key-value store that persists across sessions. */
|
|
2299
|
-
persistence: KodaXExtensionStore;
|
|
2300
|
-
/** Run a shell command with sandboxed environment (no API key leakage). */
|
|
2301
|
-
exec: (command: string, options?: ExecOptions) => Promise<ExecResult>;
|
|
2302
|
-
/** Send an HTTP webhook with timeout support. */
|
|
2303
|
-
webhook: (url: string, payload: unknown, options?: WebhookOptions) => Promise<WebhookResult>;
|
|
2304
|
-
}
|
|
2305
|
-
type KodaXExtensionActivationResult = void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
|
|
2306
|
-
interface KodaXExtensionModule {
|
|
2307
|
-
default?: (api: KodaXExtensionAPI) => KodaXExtensionActivationResult;
|
|
2308
|
-
activate?: (api: KodaXExtensionAPI) => KodaXExtensionActivationResult;
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
1323
|
declare function stripHtmlToText(html: string): string;
|
|
2312
1324
|
declare function extractHtmlTitle(html: string): string | undefined;
|
|
2313
1325
|
declare function convertProviderSearchResults(results: unknown[], limit: number): KodaXRetrievalItem[];
|
|
@@ -2346,6 +1358,22 @@ declare function truncateLine(line: string, maxChars?: number): {
|
|
|
2346
1358
|
};
|
|
2347
1359
|
declare function persistToolOutput(toolName: string, content: string, ctx?: Pick<KodaXToolExecutionContext, 'gitRoot' | 'executionCwd'>): Promise<string>;
|
|
2348
1360
|
|
|
1361
|
+
type ToolResultBudgetReason = 'large_window' | 'normal_pressure' | 'small_window_pressure' | 'critical_pressure';
|
|
1362
|
+
interface ToolResultBudget {
|
|
1363
|
+
readonly pressure: RuntimeContextPressure;
|
|
1364
|
+
readonly contextWindow: number;
|
|
1365
|
+
readonly aggregateInlineBytes: number;
|
|
1366
|
+
readonly perResultInlineBytes: number;
|
|
1367
|
+
readonly reason: ToolResultBudgetReason;
|
|
1368
|
+
}
|
|
1369
|
+
interface ToolResultBudgetUsageInput {
|
|
1370
|
+
readonly contextWindow: number;
|
|
1371
|
+
readonly currentTokens: number;
|
|
1372
|
+
}
|
|
1373
|
+
declare function buildToolResultBudget(snapshot: RuntimeContextBudgetSnapshot): ToolResultBudget;
|
|
1374
|
+
declare function buildToolResultBudgetFromUsage(input: ToolResultBudgetUsageInput): ToolResultBudget;
|
|
1375
|
+
declare function clampToolResultPolicyToBudget(policy: ToolResultPolicy, budget: ToolResultBudget | undefined): ToolResultPolicy;
|
|
1376
|
+
|
|
2349
1377
|
interface ToolResultPolicy {
|
|
2350
1378
|
maxLines: number;
|
|
2351
1379
|
maxBytes: number;
|
|
@@ -2375,6 +1403,8 @@ interface ApplyToolResultGuardrailOptions {
|
|
|
2375
1403
|
* but together exceed the envelope cap.
|
|
2376
1404
|
*/
|
|
2377
1405
|
forceSpill?: boolean;
|
|
1406
|
+
/** Optional context-aware cap; omitted keeps the legacy per-tool policy. */
|
|
1407
|
+
toolResultBudget?: ToolResultBudget;
|
|
2378
1408
|
}
|
|
2379
1409
|
declare function applyToolResultGuardrail(toolName: string, content: string, ctx: KodaXToolExecutionContext, options?: ApplyToolResultGuardrailOptions): Promise<GuardedToolResult>;
|
|
2380
1410
|
|
|
@@ -2442,6 +1472,8 @@ interface ChangedScopeReport {
|
|
|
2442
1472
|
files: ChangedFileEntry[];
|
|
2443
1473
|
riskHints: string[];
|
|
2444
1474
|
}
|
|
1475
|
+
/** Pure path classifier shared by changed-scope and captured review packets. */
|
|
1476
|
+
declare function classifyFileCategory(relativePath: string): 'source' | 'docs' | 'tests' | 'config' | 'other';
|
|
2445
1477
|
declare function buildRepoOverview(context: Pick<KodaXToolExecutionContext, 'executionCwd' | 'gitRoot'>, targetPath?: string): Promise<RepoOverview>;
|
|
2446
1478
|
declare function getRepoOverview(context: Pick<KodaXToolExecutionContext, 'executionCwd' | 'gitRoot'>, options?: {
|
|
2447
1479
|
targetPath?: string;
|
|
@@ -2897,6 +1929,32 @@ declare function buildPromptMessageContent(prompt: string, inputArtifacts?: read
|
|
|
2897
1929
|
declare function extractPromptComparableText(content: string | readonly KodaXContentBlock[]): string;
|
|
2898
1930
|
declare function extractComparableUserMessageText(message: KodaXMessage | undefined): string | undefined;
|
|
2899
1931
|
|
|
1932
|
+
interface ToolSearchIndexEntry {
|
|
1933
|
+
readonly name: string;
|
|
1934
|
+
readonly text: string;
|
|
1935
|
+
readonly terms: ReadonlyMap<string, number>;
|
|
1936
|
+
readonly tokenCount: number;
|
|
1937
|
+
}
|
|
1938
|
+
interface ToolSearchIndex {
|
|
1939
|
+
readonly entries: readonly ToolSearchIndexEntry[];
|
|
1940
|
+
readonly documentFrequency: ReadonlyMap<string, number>;
|
|
1941
|
+
}
|
|
1942
|
+
interface ToolSearchQueryParts {
|
|
1943
|
+
readonly required: readonly string[];
|
|
1944
|
+
readonly loose: readonly string[];
|
|
1945
|
+
}
|
|
1946
|
+
interface ToolSearchIndexOptions {
|
|
1947
|
+
readonly hints?: Readonly<Record<string, string>>;
|
|
1948
|
+
}
|
|
1949
|
+
interface ToolSearchResult {
|
|
1950
|
+
readonly name: string;
|
|
1951
|
+
readonly score: number;
|
|
1952
|
+
readonly matchedTerms: readonly string[];
|
|
1953
|
+
}
|
|
1954
|
+
declare function buildToolSearchIndex(definitions: readonly KodaXToolDefinition[], options?: ToolSearchIndexOptions): ToolSearchIndex;
|
|
1955
|
+
declare function searchToolIndex(index: ToolSearchIndex, query: string | ToolSearchQueryParts, maxResults: number): readonly ToolSearchResult[];
|
|
1956
|
+
declare function parseToolSearchQuery(query: string): ToolSearchQueryParts;
|
|
1957
|
+
|
|
2900
1958
|
type KodaXProviderSourceKind = 'builtin' | 'runtime' | 'custom' | 'unknown';
|
|
2901
1959
|
interface KodaXProviderCapabilitySnapshot {
|
|
2902
1960
|
provider: string;
|
|
@@ -4083,6 +3141,14 @@ declare const TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME = "tool-result-truncation";
|
|
|
4083
3141
|
*/
|
|
4084
3142
|
declare function createToolResultTruncationGuardrail(ctx: KodaXToolExecutionContext): ToolGuardrail;
|
|
4085
3143
|
|
|
3144
|
+
interface CodingDispatchableAgentRoute {
|
|
3145
|
+
readonly kind: 'native' | 'constructed';
|
|
3146
|
+
readonly descriptor: DispatchableAgentDescriptor;
|
|
3147
|
+
readonly subagentType?: string;
|
|
3148
|
+
}
|
|
3149
|
+
declare function listCodingDispatchableAgents(context: AgentDispatchContext, scope?: KodaXAgentScope): readonly DispatchableAgentDescriptor[];
|
|
3150
|
+
declare function resolveCodingDispatchableAgent(agentId: string, context: AgentDispatchContext, scope?: KodaXAgentScope): CodingDispatchableAgentRoute | undefined;
|
|
3151
|
+
|
|
4086
3152
|
/**
|
|
4087
3153
|
* Auto-Mode Classifier Orchestrator — FEATURE_092 Phase 2b.3 (v0.7.33).
|
|
4088
3154
|
*
|
|
@@ -4989,6 +4055,13 @@ interface WorkflowChildDigestUpdate {
|
|
|
4989
4055
|
readonly digest?: string;
|
|
4990
4056
|
readonly digestFailed?: boolean;
|
|
4991
4057
|
readonly totalTokensUsed: number;
|
|
4058
|
+
readonly digestTokensUsed?: number;
|
|
4059
|
+
readonly usage?: {
|
|
4060
|
+
readonly inputTokens?: number;
|
|
4061
|
+
readonly outputTokens?: number;
|
|
4062
|
+
readonly totalTokens?: number;
|
|
4063
|
+
readonly cacheReadTokens?: number;
|
|
4064
|
+
};
|
|
4992
4065
|
}
|
|
4993
4066
|
interface ChildExecutorOptions {
|
|
4994
4067
|
readonly maxParallel: number;
|
|
@@ -5088,6 +4161,8 @@ interface CodingWorkflowBackendDeps {
|
|
|
5088
4161
|
/** Seam: workspace changed path reader. Defaults to git status/diff. */
|
|
5089
4162
|
readonly listChangedFiles?: (ctx: KodaXToolExecutionContext) => Promise<readonly string[]>;
|
|
5090
4163
|
readonly onTaskSummary?: (taskId: string, update: WorkflowTaskSummaryEventUpdate) => void;
|
|
4164
|
+
/** True only for scripts generated by KodaX in this run; never inferred from schema content. */
|
|
4165
|
+
readonly kodaxAuthored?: boolean;
|
|
5091
4166
|
}
|
|
5092
4167
|
/**
|
|
5093
4168
|
* Build a `WorkflowAgentBackend` over the coding child-dispatch substrate.
|
|
@@ -5130,6 +4205,214 @@ interface ParallelInvestigationResult {
|
|
|
5130
4205
|
}
|
|
5131
4206
|
declare const parallelInvestigation: WorkflowModule<ParallelInvestigationArgs, ParallelInvestigationResult>;
|
|
5132
4207
|
|
|
4208
|
+
type ReviewSeverity = 'critical' | 'high' | 'medium' | 'low';
|
|
4209
|
+
type SpecVerdict = 'compliant' | 'issues' | 'not-verifiable';
|
|
4210
|
+
type QualityVerdict = 'approved' | 'needs-fixes';
|
|
4211
|
+
interface RawScopedReviewResult {
|
|
4212
|
+
readonly specVerdict: SpecVerdict;
|
|
4213
|
+
readonly qualityVerdict: QualityVerdict;
|
|
4214
|
+
readonly findings: readonly {
|
|
4215
|
+
readonly severity: ReviewSeverity;
|
|
4216
|
+
readonly location: string;
|
|
4217
|
+
readonly claim: string;
|
|
4218
|
+
readonly evidence: string;
|
|
4219
|
+
readonly suggestedFix?: string;
|
|
4220
|
+
}[];
|
|
4221
|
+
readonly unverifiedRequirements: readonly string[];
|
|
4222
|
+
}
|
|
4223
|
+
interface ScopedReviewResult {
|
|
4224
|
+
readonly specVerdict: SpecVerdict;
|
|
4225
|
+
readonly qualityVerdict: QualityVerdict;
|
|
4226
|
+
readonly findings: readonly {
|
|
4227
|
+
readonly findingId: string;
|
|
4228
|
+
readonly severity: ReviewSeverity;
|
|
4229
|
+
readonly location: string;
|
|
4230
|
+
readonly claim: string;
|
|
4231
|
+
readonly evidence: string;
|
|
4232
|
+
readonly suggestedFix?: string;
|
|
4233
|
+
}[];
|
|
4234
|
+
readonly unverifiedRequirements: readonly string[];
|
|
4235
|
+
}
|
|
4236
|
+
interface MergedScopedReviewResult {
|
|
4237
|
+
readonly specVerdict: SpecVerdict;
|
|
4238
|
+
readonly qualityVerdict: QualityVerdict;
|
|
4239
|
+
readonly findings: readonly {
|
|
4240
|
+
readonly findingId: string;
|
|
4241
|
+
readonly severity: ReviewSeverity;
|
|
4242
|
+
readonly location: string;
|
|
4243
|
+
readonly claim: string;
|
|
4244
|
+
readonly evidence: readonly string[];
|
|
4245
|
+
readonly suggestedFixes: readonly string[];
|
|
4246
|
+
}[];
|
|
4247
|
+
readonly unverifiedRequirements: readonly string[];
|
|
4248
|
+
}
|
|
4249
|
+
interface FindingVerificationResult {
|
|
4250
|
+
readonly findings: readonly {
|
|
4251
|
+
readonly findingId: string;
|
|
4252
|
+
readonly disposition: 'confirmed' | 'refuted' | 'unresolved';
|
|
4253
|
+
readonly evidence: string;
|
|
4254
|
+
readonly effectiveSeverity?: ReviewSeverity;
|
|
4255
|
+
readonly severityReason?: string;
|
|
4256
|
+
}[];
|
|
4257
|
+
}
|
|
4258
|
+
interface VerifiedScopedReviewResult {
|
|
4259
|
+
readonly specVerdict: SpecVerdict;
|
|
4260
|
+
readonly qualityVerdict: QualityVerdict;
|
|
4261
|
+
readonly unverifiedRequirements: readonly string[];
|
|
4262
|
+
readonly actionable: readonly {
|
|
4263
|
+
readonly findingId: string;
|
|
4264
|
+
readonly disposition: 'confirmed' | 'unresolved';
|
|
4265
|
+
readonly severity: ReviewSeverity;
|
|
4266
|
+
readonly location: string;
|
|
4267
|
+
readonly claim: string;
|
|
4268
|
+
readonly evidence: readonly string[];
|
|
4269
|
+
readonly verificationEvidence: string;
|
|
4270
|
+
readonly suggestedFixes: readonly string[];
|
|
4271
|
+
readonly severityReason?: string;
|
|
4272
|
+
}[];
|
|
4273
|
+
readonly audit: FindingVerificationResult;
|
|
4274
|
+
readonly unqualifiedApprovalAllowed: boolean;
|
|
4275
|
+
}
|
|
4276
|
+
declare const SCOPED_REVIEW_OUTPUT_SCHEMA: {
|
|
4277
|
+
readonly type: "object";
|
|
4278
|
+
readonly additionalProperties: false;
|
|
4279
|
+
readonly required: readonly ["specVerdict", "qualityVerdict", "findings", "unverifiedRequirements"];
|
|
4280
|
+
readonly properties: {
|
|
4281
|
+
readonly specVerdict: {
|
|
4282
|
+
readonly enum: readonly ["compliant", "issues", "not-verifiable"];
|
|
4283
|
+
};
|
|
4284
|
+
readonly qualityVerdict: {
|
|
4285
|
+
readonly enum: readonly ["approved", "needs-fixes"];
|
|
4286
|
+
};
|
|
4287
|
+
readonly findings: {
|
|
4288
|
+
readonly type: "array";
|
|
4289
|
+
readonly items: {
|
|
4290
|
+
readonly type: "object";
|
|
4291
|
+
readonly additionalProperties: false;
|
|
4292
|
+
readonly required: readonly ["severity", "location", "claim", "evidence"];
|
|
4293
|
+
readonly properties: {
|
|
4294
|
+
readonly severity: {
|
|
4295
|
+
readonly enum: readonly ["critical", "high", "medium", "low"];
|
|
4296
|
+
};
|
|
4297
|
+
readonly location: {
|
|
4298
|
+
readonly type: "string";
|
|
4299
|
+
};
|
|
4300
|
+
readonly claim: {
|
|
4301
|
+
readonly type: "string";
|
|
4302
|
+
};
|
|
4303
|
+
readonly evidence: {
|
|
4304
|
+
readonly type: "string";
|
|
4305
|
+
};
|
|
4306
|
+
readonly suggestedFix: {
|
|
4307
|
+
readonly type: "string";
|
|
4308
|
+
};
|
|
4309
|
+
};
|
|
4310
|
+
};
|
|
4311
|
+
};
|
|
4312
|
+
readonly unverifiedRequirements: {
|
|
4313
|
+
readonly type: "array";
|
|
4314
|
+
readonly items: {
|
|
4315
|
+
readonly type: "string";
|
|
4316
|
+
};
|
|
4317
|
+
};
|
|
4318
|
+
};
|
|
4319
|
+
};
|
|
4320
|
+
declare const FINDING_VERIFICATION_OUTPUT_SCHEMA: {
|
|
4321
|
+
readonly type: "object";
|
|
4322
|
+
readonly additionalProperties: false;
|
|
4323
|
+
readonly required: readonly ["findings"];
|
|
4324
|
+
readonly properties: {
|
|
4325
|
+
readonly findings: {
|
|
4326
|
+
readonly type: "array";
|
|
4327
|
+
readonly items: {
|
|
4328
|
+
readonly type: "object";
|
|
4329
|
+
readonly additionalProperties: false;
|
|
4330
|
+
readonly required: readonly ["findingId", "disposition", "evidence"];
|
|
4331
|
+
readonly properties: {
|
|
4332
|
+
readonly findingId: {
|
|
4333
|
+
readonly type: "string";
|
|
4334
|
+
};
|
|
4335
|
+
readonly disposition: {
|
|
4336
|
+
readonly enum: readonly ["confirmed", "refuted", "unresolved"];
|
|
4337
|
+
};
|
|
4338
|
+
readonly evidence: {
|
|
4339
|
+
readonly type: "string";
|
|
4340
|
+
};
|
|
4341
|
+
readonly effectiveSeverity: {
|
|
4342
|
+
readonly enum: readonly ["critical", "high", "medium", "low"];
|
|
4343
|
+
};
|
|
4344
|
+
readonly severityReason: {
|
|
4345
|
+
readonly type: "string";
|
|
4346
|
+
};
|
|
4347
|
+
};
|
|
4348
|
+
};
|
|
4349
|
+
};
|
|
4350
|
+
};
|
|
4351
|
+
};
|
|
4352
|
+
declare function normalizeScopedReviewResult(packetHash: string, requirementsPresent: boolean, result: RawScopedReviewResult): ScopedReviewResult;
|
|
4353
|
+
declare function mergeScopedReviewResults(results: readonly ScopedReviewResult[]): MergedScopedReviewResult;
|
|
4354
|
+
declare function applyFindingVerification(review: MergedScopedReviewResult, verification: FindingVerificationResult): VerifiedScopedReviewResult;
|
|
4355
|
+
|
|
4356
|
+
interface ReviewPacketBudget {
|
|
4357
|
+
readonly maxBytes: number;
|
|
4358
|
+
readonly maxLines: number;
|
|
4359
|
+
readonly maxLineChars: number;
|
|
4360
|
+
}
|
|
4361
|
+
interface ReviewPacketChunk {
|
|
4362
|
+
readonly path: string;
|
|
4363
|
+
readonly contentHash: string;
|
|
4364
|
+
}
|
|
4365
|
+
interface ReviewPacketMetadata {
|
|
4366
|
+
readonly packetPath: string;
|
|
4367
|
+
readonly contentHash: string;
|
|
4368
|
+
readonly rangeId: string;
|
|
4369
|
+
readonly partitionKey: string;
|
|
4370
|
+
readonly label: string;
|
|
4371
|
+
readonly baseRef?: string;
|
|
4372
|
+
readonly headRef?: string;
|
|
4373
|
+
readonly scopePaths: readonly string[];
|
|
4374
|
+
readonly riskFlags: readonly 'routing-high'[];
|
|
4375
|
+
readonly budget: ReviewPacketBudget;
|
|
4376
|
+
readonly evidenceChunks: readonly ReviewPacketChunk[];
|
|
4377
|
+
readonly requirementsPresent: boolean;
|
|
4378
|
+
readonly testEvidencePresent: boolean;
|
|
4379
|
+
}
|
|
4380
|
+
interface ReviewPacketInput {
|
|
4381
|
+
readonly cwd: string;
|
|
4382
|
+
readonly sessionId: string;
|
|
4383
|
+
readonly label: string;
|
|
4384
|
+
/** Exact captured diff bytes. The builder never rereads Git. */
|
|
4385
|
+
readonly diff: string;
|
|
4386
|
+
readonly scope?: 'staged' | 'unstaged' | 'all' | 'compare' | 'commit';
|
|
4387
|
+
readonly baseRef?: string;
|
|
4388
|
+
readonly headRef?: string;
|
|
4389
|
+
readonly customPrompt?: string;
|
|
4390
|
+
readonly requirements?: readonly string[];
|
|
4391
|
+
readonly testEvidence?: readonly string[];
|
|
4392
|
+
/** Must come from KodaXTaskRoutingDecision; no local semantic inference occurs. */
|
|
4393
|
+
readonly routingRisk?: 'low' | 'medium' | 'high';
|
|
4394
|
+
/** Test seam only; production snapshots the existing Read-tool caps. */
|
|
4395
|
+
readonly budget?: ReviewPacketBudget;
|
|
4396
|
+
}
|
|
4397
|
+
declare function writeReviewPackets(input: ReviewPacketInput): Promise<readonly ReviewPacketMetadata[]>;
|
|
4398
|
+
|
|
4399
|
+
interface ScopedReviewWorkflowArgs {
|
|
4400
|
+
readonly packets: readonly ReviewPacketMetadata[];
|
|
4401
|
+
readonly lean?: boolean;
|
|
4402
|
+
readonly reviewFocus?: string;
|
|
4403
|
+
}
|
|
4404
|
+
interface ScopedReviewWorkflowResult {
|
|
4405
|
+
readonly summary: string;
|
|
4406
|
+
readonly packetResults: readonly {
|
|
4407
|
+
readonly contentHash: string;
|
|
4408
|
+
readonly result: VerifiedScopedReviewResult;
|
|
4409
|
+
}[];
|
|
4410
|
+
}
|
|
4411
|
+
declare function buildScopedReviewPrimaryPrompt(packet: ReviewPacketMetadata, extraPrimary: boolean, args: ScopedReviewWorkflowArgs): string;
|
|
4412
|
+
declare function buildScopedReviewVerificationPrompt(packet: ReviewPacketMetadata, merged: ReturnType<typeof mergeScopedReviewResults>): string;
|
|
4413
|
+
declare function buildScopedReviewFinalPrompt(packetResults: readonly ScopedReviewWorkflowResult['packetResults'][number][]): string;
|
|
4414
|
+
declare const scopedReview: WorkflowModule<ScopedReviewWorkflowArgs, ScopedReviewWorkflowResult>;
|
|
4415
|
+
|
|
5133
4416
|
/**
|
|
5134
4417
|
* FEATURE_217 / FEATURE_246 — built-in workflow registry.
|
|
5135
4418
|
*
|
|
@@ -5752,5 +5035,39 @@ interface AuthorWorkflowViaWorkerHandle {
|
|
|
5752
5035
|
*/
|
|
5753
5036
|
declare function authorWorkflowViaWorker(input: AuthorWorkflowViaWorkerInput): AuthorWorkflowViaWorkerHandle;
|
|
5754
5037
|
|
|
5755
|
-
|
|
5756
|
-
|
|
5038
|
+
interface WorkflowPacketReadCost {
|
|
5039
|
+
readonly contentHash: string;
|
|
5040
|
+
readonly reason?: string;
|
|
5041
|
+
}
|
|
5042
|
+
interface WorkflowCostReport {
|
|
5043
|
+
readonly totalModelTokens: number;
|
|
5044
|
+
readonly inputTokens: number;
|
|
5045
|
+
readonly cacheReadTokens: number;
|
|
5046
|
+
readonly outputTokens: number;
|
|
5047
|
+
readonly digestTokens: number;
|
|
5048
|
+
readonly agentStarts: number;
|
|
5049
|
+
readonly childTurns: number;
|
|
5050
|
+
readonly agentStartsByRoleTier: Readonly<Record<string, number>>;
|
|
5051
|
+
readonly primaryReviewStarts: number;
|
|
5052
|
+
readonly duplicatePrimaryPacketReads: number;
|
|
5053
|
+
readonly verificationPacketReads: readonly WorkflowPacketReadCost[];
|
|
5054
|
+
readonly synthesisPacketReads: readonly WorkflowPacketReadCost[];
|
|
5055
|
+
readonly reviewWaves: number;
|
|
5056
|
+
readonly fixWaves: number;
|
|
5057
|
+
readonly rereviewWaves: number;
|
|
5058
|
+
readonly qualityGateOutcomes: readonly {
|
|
5059
|
+
readonly contentHash: string;
|
|
5060
|
+
readonly actionableFindings: number;
|
|
5061
|
+
readonly unresolvedFindings: number;
|
|
5062
|
+
readonly unqualifiedApprovalAllowed: boolean;
|
|
5063
|
+
}[];
|
|
5064
|
+
readonly tokenCoverage: {
|
|
5065
|
+
readonly ok: boolean;
|
|
5066
|
+
readonly missingTaskIds: readonly string[];
|
|
5067
|
+
};
|
|
5068
|
+
readonly excludedExternalTaskIds: readonly string[];
|
|
5069
|
+
}
|
|
5070
|
+
declare function buildWorkflowCostReport(events: readonly WorkflowEvent[]): WorkflowCostReport;
|
|
5071
|
+
|
|
5072
|
+
export { Agent, AgentMessage, AutoRules, BLOCKER_REQUIRED_CONSECUTIVE_TURNS, BUILTIN_WORKFLOWS, BoundExtensionRuntimeController, CANCELLED_TOOL_RESULT_MESSAGE, CANCELLED_TOOL_RESULT_PREFIX, CODING_AGENT_MARKER, CODING_INVARIANTS, CODING_SUMMARY_PROMPT, CODING_UPDATE_SUMMARY_PROMPT, Capabilities, CapabilityProvider, CapabilityResult, KodaXClient as Client, CombinedExtensionRuntime, ConstructionArtifact, ConstructionPolicy, DEFAULT_CODING_AGENT_NAME, DEFAULT_DANGEROUS_PATTERNS, DEFAULT_RESILIENCE_CONFIG, DEFAULT_SAFE_PATTERNS, DEFAULT_SELF_MODIFY_BUDGET, DEFAULT_WINDOW_MS as DEFAULT_SPECULATIVE_WINDOW_MS, DEFAULT_TOOL_OUTPUT_MAX_BYTES, DEFAULT_TOOL_OUTPUT_MAX_LINES, DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS, EMIT_VERDICT_TOOL_NAME, ErrorCategory, ExtensionCommandDefinition, ExtensionContributionSource, ExtensionEventMap, ExtensionFailureStage, ExtensionHookMap, ExtensionLoadSource, ExtensionRuntimeContract, ExtensionRuntimeDiagnostics, FINDING_VERIFICATION_OUTPUT_SCHEMA, FailureStage, GENERATOR_AGENT_NAME, GoalCompleteResult, Guardrail, KODAX_TOOLS, KODAX_UNDERLYING_CAPABILITY_TOPICS, KodaXAgentScope, KodaXBaseProvider, KodaXChildContextBundle, KodaXClient, KodaXContentBlock, KodaXContextOptions, KodaXEvents, KodaXExecutionMode, KodaXExtensionRuntime, KodaXInputArtifact, KodaXManualTopic, KodaXManualTopicId, KodaXMessage, KodaXOptions, KodaXProviderCapabilityProfile, KodaXProviderPolicyHints, KodaXReasoningCapability, KodaXReasoningMode, KodaXRepoIntelligenceCapability, KodaXRepoIntelligenceMode, KodaXRepoIntelligenceResolvedMode, KodaXRepoIntelligenceTrace, KodaXRepoRoutingSignals, KodaXResult, KodaXRetrievalItem, KodaXRetrievalResult, KodaXRetrievalToolName, KodaXSessionControl, KodaXSessionError, KodaXSessionMutators, KodaXTaskRoutingDecision, KodaXTaskType, KodaXTerminalError, KodaXThinkingDepth, KodaXTimeoutConfig, KodaXTokenUsage, KodaXToolDefinition, KodaXToolError, KodaXToolExecutionContext, KodaXToolUseBlock, KodaXWireReasoningEffort, LocalToolDefinition, MANUAL_REGISTRY, MANUAL_TOPIC_IDS, McpCapabilityProvider, McpProviderOptions, McpReverseCapabilities, McpRoot, McpServersConfig, PLANNER_AGENT_NAME, PROMPT_SECTION_REGISTRY, PROTOCOL_EMITTER_TOOLS, ProviderExecutionState, ProviderRecoveryCoordinator, ProviderResilienceConfig, ProviderResiliencePolicy, READ_DEFAULT_LIMIT, READ_MAX_LINE_CHARS, READ_PREFLIGHT_SIZE_BYTES, REPO_EXPLORER_AGENT_NAME, REPO_EXPLORER_TOOL_NAMES, RecoveryDecision, RecoveryResult, RegisteredToolDefinition, ResilienceClassification, ResolveKodaXManualInput, ResolveKodaXManualOptions, ResolveKodaXManualResult, RuntimeContextBudgetSnapshot, RuntimeContextPressure, RuntimeDefaultsSnapshot, SCOPED_REVIEW_OUTPUT_SCHEMA, SCOUT_AGENT_NAME, SCOUT_THEN_AUTHOR_PROMPT_LINES, SELF_KNOWLEDGE_ROUTING_RULE, SYSTEM_PROMPT, SYSTEM_WORKFLOW_LIMITS, ScriptSource, SessionErrorMetadata, SignalCollector, StableBoundaryTracker, StagedHandle, TASK_ENGINE_ROLE_AGENTS, TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME, TRACING_ENV, TestResult, ToolCallSignal, ToolHandler, ToolRegistrationOptions, WORKER_AGENT_NAME, WORKFLOW_GENERATION_SYSTEM_PROMPT, WorkflowEventCorrelation, WorkflowHostPolicy, _resetRuntimeForTesting, activate, analyzeChangedScope, appendAuditEntry, applyAccountingDelta, applyFindingVerification, applyToolResultGuardrail, authorWorkflowViaWorker, bashSignalCollector, bootstrapTracing, boundedRevise, budgetCeiling, buildApprovalSummary, buildBlockedGoal, buildCapabilityContextSections, buildClassifierPrompt, buildCompleteGoal, buildCreatedGoal, buildFallbackRoutingDecision, buildLlmReviewPrompt, buildManualToolDescription, buildMcpReverseCapabilities, buildPausedGoal, buildPromptMessageContent, buildPromptSnapshot, buildProviderCapabilitySnapshot, buildProviderPolicyHintsForDecision, buildProviderPolicyPromptNotes, buildRepoIntelligenceContext, buildRepoIntelligenceIndex, buildRepoOverview, buildResumedGoal, buildScopedReviewFinalPrompt, buildScopedReviewPrimaryPrompt, buildScopedReviewVerificationPrompt, buildScoutThenAuthorPrompt, buildSelfKnowledgeRoutingRule, buildSystemPrompt, buildSystemPromptSnapshot, buildToolResultBudget, buildToolResultBudgetFromUsage, buildToolSearchIndex, buildWorkflowCostReport, buildWorkflowGenerationSkillContext, buildWorkflowGenerationUserPrompt, checkAbsoluteDeny, checkIncompleteToolCalls, checkPromiseSignal, clampToolResultPolicyToBudget, clampWorkflowLimits, classify, classifyBashCommand, classifyError, classifyFileCategory, classifyResilienceError, combineExtensionRuntimes, computeInputSignature, configureRuntime, convertCapabilityReadResult, convertProviderSearchResults, createBashClassifierConfig, createBuiltinToolDefinition, createCodingWorkflowBackend, createCtxProxy, createDefaultCodingAgent, createDenialTracker, createExtensionRuntime, createKodaXTaskRunner, createPromptSection, createReasoningPlan, createRunGraphWriter, createSessionControl, createToolResultTruncationGuardrail, createWorkflowLifecycleController, createWorkflowPatternTemplateModule, createWorkflowRunManager, dedupeExtensionPathsByEntrypoint, deleteSavedWorkflow, disableSelfModify, discoverDefaultExtensions, discoverExtensionsInDirectory, discoverExtensionsInDirectoryDetailed, discoverMarkdownAgents, discoverSavedWorkflows, emitVerdict, emitWorkflowAgentDigest, ensureBuiltinRepoExplorerAgent, evaluateProviderPolicy, excludeExtensionPathsByEntrypoint, executeTool, extractComparableUserMessageText, extractHtmlTitle, extractPromptComparableText, fileSignalCollector, finalizeRetrievalResult, findByVersion, formatParallelDispatchResult, formatSize, generateWorkflow, generateWorkflowFromOptions, getActiveExtensionRuntime, getAllRegisteredTools, getBuiltinRegisteredToolDefinition, getBuiltinToolDefinition, getBuiltinWorkflow, getDefaultExtensionDirectory, getDefaultWorkflowRunManager, getDenialContext, getImpactEstimate, getModuleContext, getProcessContext, getRegisteredToolDefinition, getRepoIntelligenceIndex, getRepoOverview, getRepoRoutingSignals, getRequiredToolParams, getSymbolContext, getTool, getToolDefinition, getToolRegistrations, getToolResultPolicy, getWorkflowPatternTemplate, goalTokenDelta, inferTaskType, inspectEditFailure, inspectRepoIntelligenceRuntime, isDeniedRecently, isParallelDispatchDirective, isSessionRecoveryCandidateError, isSupportedExtensionModulePath, isToolFileMutation, isToolMutation, isToolNetworkRead, isToolPlanModeAllowed, isValidTokenBudget, languageIdForPath, listAll, list as listArtifacts, listBuiltinToolDefinitions, listBuiltinWorkflows, listCodingDispatchableAgents, listConstructed, listToolDefinitions, listTools, listWorkflowPatternTemplates, loadAgentsFromMarkdown, loadGeneratedWorkflowFromRun, loadHandler, loadMarkdownAgentScope, loadSavedWorkflow, loadSavedWorkflowCapsule, mcpRootsFromWorkspace, mergeScopedReviewResults, normalizeScopedReviewResult, normalizeWorkflowModule, orderPromptSections, parallelInvestigation, parseClassifierOutput, parseEditToolError, parseLlmReviewVerdict, parseModelSpec, parseToolSearchQuery, parseWorkflowGeneration, persistToolOutput, preflightWorkflowCapsule, prewarmRepoIntelligenceCaches, readArtifact, readAuditEntries, readBudget, readDisableState, readWindowFromEnv as readSpeculativeWindowFromEnv, reasoningModeToDepth, reconstructMessagesWithToolGuard, recordBlockerAttempt, recordDenial, registerCodingInvariants, registerConfiguredMcpCapabilityProvider, registerOfficialSandboxExtension, registerTool, rehydrateActiveArtifacts, remaining as remainingSelfModifyBudget, renameSavedWorkflow, renderChangedScope, renderImpactEstimate, renderModuleContext, renderProcessContext, renderPromptSections, renderRepoOverview, renderRetrievalResult, renderSymbolContext, replaceSavedWorkflow, report as reportLspDiagnostics, resetBlockerCounter, resetBudget, resolveClassifierModel, resolveCodingDispatchableAgent, resolveExtensionEntrypoint, resolveKodaXManual, resolveReasoningMode, resolveRepoIntelligenceMode, resolveRepoIntelligenceRuntimeConfig, resolveResilienceConfig, resolveToolCapability, resolveWorkflowGenerationTimeoutMs, resolveWorkflowIdentity, revoke, rollbackSelfModify, runAstRules, runKodaX, runLlmReview, runManagedTask, runOrchestration, runWorkflowFromOptions, runWorkflowModule, safeWorkflowArtifactName, saveGeneratedWorkflow, saveGeneratedWorkflowFromRun, scopedReview, searchToolIndex, setActiveExtensionRuntime, shouldFlipBudgetLimited, speculativeRace, stage, startKodaX, startManagedWorkflow, stripAssistantText, stripHtmlToText, test as testArtifact, toolAskUserQuestion, toolBash, toolChangedDiff, toolChangedScope, toolCodeSearch, toolEdit, toolGlob, toolGrep, toolImpactEstimate, toolInsertAfterAnchor, toolModuleContext, toolPermission, toolProcessContext, toolRead, toolRepoOverview, toolSemanticLookup, toolSymbolContext, toolUndo, toolWebFetch, toolWebSearch, toolWrite, truncateHead, truncateLine, truncateTail, turnWallTimeDelta, validateGeneratedWorkflowSource, validateSubtaskIndependence, validateToolSchemaForProvider, verifyGoalCompletion, withManualToolBranding, workerAgent, writeReviewPackets };
|
|
5073
|
+
export type { AbsoluteDenyMatch, AbsoluteDenyMiss, AbsoluteDenyResult, AstCheckResult, AstRuleId, AstRuleViolation, AuditEntry, AuditEventKind, AuthorWorkflowViaWorkerHandle, AuthorWorkflowViaWorkerInput, BashClassificationResult, BashClassifierConfig, BashRiskLevel, BlockerAttemptResult, BootstrapTracingOptions, BudgetState, BuildClassifierPromptInput, BuildPromptInput, ChangedFileEntry, ChangedFileStatus, ChangedScopeAreaSummary, ChangedScopeReport, ClassifierDecision, ClassifierPrompt, ClassifyDecision, ClassifyOptions, CodingDispatchableAgentRoute, CodingWorkflowBackendDeps, CreateCtxProxyOptions, CreateKodaXTaskRunnerOptions, CreateWorkflowLifecycleControllerOptions, DeleteSavedWorkflowInput, DeleteWorkflowRunOptions, DenialRecord, DenialTracker, DisableState, DiscoverMarkdownAgentsResult, DiscoveredMarkdownAgent, EditRecoveryDiagnostic, EditToolErrorCode, ErrorClassification, ExtensionDiscoveryResult, ExtensionDiscoverySkipReason, FindingVerificationResult, GenerateWorkflowFromOptionsInput, GenerateWorkflowInput, GeneratedWorkflow, GoalCompletionVerifier, ImpactEstimateResult, InvestigationFinding, KodaXAgentWorkerSpec, KodaXPromptSection, KodaXPromptSectionDefinition, KodaXPromptSectionSlot, KodaXPromptSectionStability, KodaXPromptSnapshot, KodaXPromptSnapshotMetadata, KodaXProviderCapabilitySnapshot, KodaXProviderPolicyDecision, KodaXProviderPolicyIssue, KodaXProviderPolicyIssueSeverity, KodaXProviderSourceKind, LanguageCapabilityTier, LlmReviewClient, LlmReviewResult, LlmReviewVerdict, LoadAgentsFromMarkdownOptions, LoadAgentsFromMarkdownResult, LoadGeneratedWorkflowFromRunInput, LoadHandlerOptions, LoadHandlerScope, LoadMarkdownAgentScopeOptions, LoadMarkdownAgentScopeResult, LoadedGeneratedWorkflowFromRun, LoadedMarkdownAgent, ManagedWorkflowRun, ManagedWorkflowSnapshot, ManagedWorkflowSource, MarkdownAgentLoadWarning, MarkdownAgentToolFilter, MarkdownLoadFailure, McpReverseWorkspace, MergedScopedReviewResult, ModuleCapsule, ModuleContextResult, OfficialSandboxMode, OfficialSandboxOptions, OrchestrationArtifact, OrchestrationCompletedTask, OrchestrationRunEvents, OrchestrationRunOptions, OrchestrationRunResult, OrchestrationTaskBudget, OrchestrationTaskContext, OrchestrationTaskExecution, OrchestrationTaskStatus, OrchestrationTraceEvent, OrchestrationWorkerResult, OrchestrationWorkerRunner, OrchestrationWorkerSpec, ParallelDispatchDirective, ParallelDispatchResult, ParallelInvestigationArgs, ParallelInvestigationResult, ParallelSubtask, ParsedModelSpec, ProcessCapsule, ProcessContextResult, ProcessStep, ProtocolEmitterMetadata, QualityVerdict, RawScopedReviewResult, RenameSavedWorkflowInput, ReplaceSavedWorkflowInput, ReplaceSavedWorkflowResult, RepoAreaKind, RepoAreaOverview, RepoIntelligenceIndex, RepoIntelligenceRuntimeInspection, RepoLanguageId, RepoLanguageSupport, RepoOverview, RepoSymbolKind, RepoSymbolRecord, RepoSymbolReference, ResolveClassifierModelOptions, ResolveSource, ResolvedClassifierModel, ReviewPacketBudget, ReviewPacketChunk, ReviewPacketInput, ReviewPacketMetadata, ReviewSeverity, RollbackResult, RunGraphWriter, RunGraphWriterDeps, RunJsonInput, RunWorkflowFromOptionsInput, RunWorkflowModuleOptions, RunWorkflowModuleOutcome, RunningSession, SaveGeneratedWorkflowFromRunInput, SaveGeneratedWorkflowInput, SavedGeneratedWorkflowFile, SavedWorkflowDirs, SavedWorkflowExecution, SavedWorkflowRef, SavedWorkflowSource, SchemaProvider, SchemaValidationResult, ScopedReviewResult, ScopedReviewWorkflowArgs, ScopedReviewWorkflowResult, SelfModifyAskUser, SelfModifyAskUserInput, SelfModifyDiffSeverity, SelfModifyDiffSummary, SkippedExtensionDiscoveryEntry, SpecVerdict, SpeculativeResult, StartManagedWorkflowInput, StartManagedWorkflowResult, StripOptions, SymbolContextResult, TestArtifactOptions, TierZeroPatternId, ToolResultBudget, ToolResultBudgetReason, ToolResultBudgetUsageInput, ToolSearchIndex, ToolSearchIndexEntry, ToolSearchIndexOptions, ToolSearchQueryParts, ToolSearchResult, VerifiedScopedReviewResult, VerifyGoalCompletionOptions, WorkflowCapsulePreflightEnvironment, WorkflowCapsulePreflightInput, WorkflowCapsulePreflightIssue, WorkflowCapsulePreflightResult, WorkflowChildOptions, WorkflowCostReport, WorkflowGenerationResult, WorkflowGenerationTextFn, WorkflowGenerationTextRequest, WorkflowIdentityResolution, WorkflowIdentityResolverInput, WorkflowLifecycleController, WorkflowPacketReadCost, WorkflowPatternTemplate, WorkflowRunListOptions, WorkflowRunManager, WorkflowRunProcessMetadata, WorkflowRunRetentionOptions, WorkflowRunRetentionResult, WorkflowScriptSnapshotInput, WorkflowScriptSnapshotRef };
|