@kodax-ai/kodax 0.7.62 → 0.7.63

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +2 -2
  3. package/README_CN.md +2 -2
  4. package/dist/chunks/{agent-4ZMCIEGD.js → agent-SL444XLN.js} +1 -1
  5. package/dist/chunks/argument-completer-EN63ZVJK.js +2 -0
  6. package/dist/chunks/{chunk-AY3BLB4Q.js → chunk-4MIHVNB7.js} +94 -94
  7. package/dist/chunks/{chunk-6HTR3GHZ.js → chunk-7MPU7TP6.js} +202 -202
  8. package/dist/chunks/{chunk-JILSZHCQ.js → chunk-HP4FXMEM.js} +2 -2
  9. package/dist/chunks/{chunk-OGRJQGKO.js → chunk-KCFVGXVK.js} +1 -1
  10. package/dist/chunks/{chunk-3KD26NCI.js → chunk-KHICMJIR.js} +166 -166
  11. package/dist/chunks/{chunk-HO6P6CPU.js → chunk-L3MF5V64.js} +1 -1
  12. package/dist/chunks/{chunk-WFE6FBQ2.js → chunk-LGR7ACBQ.js} +8 -8
  13. package/dist/chunks/{chunk-S4ISEA6F.js → chunk-RR7W7UF6.js} +146 -146
  14. package/dist/chunks/{chunk-E2Q4RIOD.js → chunk-UGTK2JIJ.js} +59 -59
  15. package/dist/chunks/{chunk-2F4R7WM7.js → chunk-VSWROENP.js} +1 -1
  16. package/dist/chunks/{compaction-config-SP3REMFR.js → compaction-config-4VIONMFB.js} +1 -1
  17. package/dist/chunks/{construction-bootstrap-4ZNFZFX2.js → construction-bootstrap-EFZBONTK.js} +1 -1
  18. package/dist/chunks/dist-EDF2YUF6.js +2 -0
  19. package/dist/chunks/host-J4HPDLFC.js +2 -0
  20. package/dist/chunks/{run-manager-UXIPDVVF.js → run-manager-ZVSW2OWM.js} +1 -1
  21. package/dist/chunks/{utils-XKWEVPE3.js → utils-5HDLYTZJ.js} +1 -1
  22. package/dist/index.d.ts +8 -8
  23. package/dist/index.js +2 -2
  24. package/dist/kodax_cli.js +860 -860
  25. package/dist/sdk-agent.d.ts +6 -6
  26. package/dist/sdk-agent.js +1 -1
  27. package/dist/sdk-coding.d.ts +585 -624
  28. package/dist/sdk-coding.js +1 -1
  29. package/dist/sdk-mcp.js +1 -1
  30. package/dist/sdk-repl.d.ts +9 -9
  31. package/dist/sdk-repl.js +2 -2
  32. package/dist/sdk-session.d.ts +4 -4
  33. package/dist/sdk-session.js +1 -1
  34. package/dist/sdk-skills.js +1 -1
  35. package/dist/types-chunks/{bash-prefix-extractor.d-Do_TCAmA.d.ts → bash-prefix-extractor.d-CZW9fRoa.d.ts} +126 -3
  36. package/dist/types-chunks/{guardrail.d-DRp0Lqvx.d.ts → guardrail.d-MR6LwMB2.d.ts} +2 -2
  37. package/dist/types-chunks/{process.d-DXkRD7hj.d.ts → process.d-CY2g03Mb.d.ts} +11 -4
  38. package/dist/types-chunks/{run-manager.d-CYY3pZeJ.d.ts → run-manager.d-CYTnWhZY.d.ts} +6 -17
  39. package/dist/types-chunks/{sdk-session-BGGOC0cT.d.ts → sdk-session-RBSBBKol.d.ts} +8 -6
  40. package/dist/types-chunks/{storage.d-C3umBC4g.d.ts → storage.d-C6kkAEch.d.ts} +2 -2
  41. package/dist/types-chunks/{types.d-DFf4Sfys.d.ts → types.d-1CnTg7Sd.d.ts} +1 -1
  42. package/dist/types-chunks/{utils.d-ChOEH3NF.d.ts → utils.d-C14jZ9ZM.d.ts} +4 -4
  43. package/package.json +1 -1
  44. package/dist/chunks/argument-completer-5PWSKFKI.js +0 -2
  45. package/dist/chunks/dist-IKWRJW6J.js +0 -2
  46. package/dist/chunks/host-XL5CH7QP.js +0 -2
@@ -1,173 +1,460 @@
1
- import { a0 as KodaXToolDefinition, a2 as KodaXToolResultContentItem, a8 as KodaXWireReasoningEffort, j as KodaXMessage, a5 as KodaXToolUseBlock, c as KodaXContentBlock, o as KodaXProviderCapabilityProfile, A as KodaXReasoningCapability, E as KodaXReasoningMode, U as KodaXTaskType, e as KodaXExecutionMode, T as KodaXTaskRoutingDecision, Z as KodaXThinkingDepth, $ as KodaXTokenUsage } from './types-chunks/types.d-Bp4Lm1jv.js';
1
+ import { a8 as KodaXWireReasoningEffort, a0 as KodaXToolDefinition, a2 as KodaXToolResultContentItem, j as KodaXMessage, a5 as KodaXToolUseBlock, c as KodaXContentBlock, o as KodaXProviderCapabilityProfile, A as KodaXReasoningCapability, E as KodaXReasoningMode, U as KodaXTaskType, e as KodaXExecutionMode, T as KodaXTaskRoutingDecision, 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
7
  import { C as CapabilityKind, a as CapabilityProvider, b as CapabilityResult } from './types-chunks/capability.d-3C62G8Eq.js';
8
- import { ap as KodaXToolExecutionContext, aW as ToolSideEffect, U as KodaXRepoIntelligenceCapability, X as KodaXRepoIntelligenceTrace, V as KodaXRepoIntelligenceMode, W as KodaXRepoIntelligenceResolvedMode, Z as KodaXRepoRoutingSignals, Q as KodaXOptions, u as KodaXContextOptions, T as KodaXProviderPolicyHints, aH as ProviderResilienceConfig, aI as ProviderResiliencePolicy, F as FailureStage, aN as ResilienceClassification, aF as ProviderExecutionState, aK as RecoveryDecision, aM as RecoveryResult, _ as KodaXResult, a2 as KodaXSessionControl, a3 as KodaXSessionMutators, A as KodaXManagedProtocolPayload, E as ExtensionRuntimeContract, aS as RuntimeDefaultsSnapshot, c as BoundExtensionRuntimeController, x as KodaXEvents, g as GoalCompleteResult, aP as ResolveKodaXManualInput, aQ as ResolveKodaXManualOptions, aR as ResolveKodaXManualResult, N as KodaXManualTopicId, M as KodaXManualTopic, d as ChildSnapshotEvent, r as KodaXChildContextBundle, s as KodaXChildExecutionResult, aX as WorkflowHostPolicy, an as KodaXTimeoutConfig } from './types-chunks/bash-prefix-extractor.d-Do_TCAmA.js';
9
- export { B as BASH_POLICY_SPEC, a as BashPrefixExtractor, b as BashPrefixResult, C as CapabilityRuntimeContract, e as CreateBashPrefixExtractorOptions, D as DiagnosticsRequest, f as ExtractCommandPrefixOptions, G as GoalBlockedResult, h as GoalCreateInput, i as GoalLifecycleContext, j as GoalRuntimeBinding, k as GoalRuntimeBindingDeps, l as GoalToolsContext, K as KodaXActivityEventMeta, m as KodaXAgentMode, n as KodaXAgentProfile, o as KodaXBudgetDisclosureZone, p as KodaXBudgetExtensionRequest, q as KodaXChildAgentResult, t as KodaXCompactionOverride, v as KodaXContextTokenSnapshot, w as KodaXEffectiveTaskConfig, y as KodaXLiveEventMeta, z as KodaXManagedBudgetSnapshot, H as KodaXManagedTask, I as KodaXManagedTaskRuntimeState, J as KodaXManagedTaskStatusEvent, L as KodaXManualSource, O as KodaXManualTopicInput, P as KodaXMemoryStrategy, R as KodaXOrchestrationVerdict, S as KodaXParentReductionContract, Y as KodaXRepoIntelligenceTraceEvent, $ as KodaXRoleRoundSummary, a0 as KodaXRuntimeVerificationContract, a1 as KodaXSelfManualConfig, a4 as KodaXSessionOptions, a5 as KodaXSidecarMessageEvent, a6 as KodaXSkillDynamicContextPolicy, a7 as KodaXSkillInvocationContext, a8 as KodaXSkillMap, a9 as KodaXSkillProjectionConfidence, aa as KodaXTaskCapabilityHint, ab as KodaXTaskContract, ac as KodaXTaskEvidenceArtifact, ad as KodaXTaskEvidenceBundle, ae as KodaXTaskEvidenceEntry, af as KodaXTaskRole, ag as KodaXTaskRoleAssignment, ah as KodaXTaskStatus, ai as KodaXTaskSurface, aj as KodaXTaskToolPolicy, ak as KodaXTaskVerificationContract, al as KodaXTaskVerificationCriterion, am as KodaXTaskWorkItem, ao as KodaXToolEventMeta, aq as KodaXToolVisibilityMeta, ar as KodaXToolVisibilityPolicy, as as KodaXTurnCompletedEvent, at as KodaXTurnDeliveryKind, au as KodaXTurnFailedEvent, av as KodaXTurnStartedEvent, aw as KodaXVerificationScorecard, ax as KodaXVerificationScorecardCriterion, ay as KodaXWorkflowAgentDigestEvent, az as KodaXWorkflowEventMeta, aA as KodaXWorkflowTimeoutConfig, aB as LSP_SERVERS, aC as LspServerInfo, aD as LspService, aE as LspServiceConfig, aG as ProviderRecoveryEvent, aJ as RecoveryAction, aL as RecoveryLadderStep, aO as ResilienceErrorClass, aT as TodoItem, aU as TodoList, aV as TodoStatus, aY as WorkflowInvocationAction, aZ as WorkflowInvocationPolicyDecision, a_ as WorkflowInvocationPolicyInput, a$ as WorkflowInvocationSource, b0 as WorkflowRunProgressView, b1 as WorkflowStartOutcome, b2 as WorkflowToolHost, b3 as WorkflowToolHostInlineInput, b4 as WorkflowToolHostResult, b5 as WorkflowToolHostStartResult, b6 as buildGoalRuntimeBinding, b7 as createBashPrefixExtractor, b8 as decideWorkflowInvocation, b9 as extractCommandPrefix, ba as getDefaultLspService, bb as makeDisabledGoalToolsContext, bc as providerResilienceConfigFromTimeouts, bd as shutdownDefaultLspService, be as withGoalBeforeNextTurn, bf as withGoalStopHook, bg as workflowStartOutcomeConsumesTurn } from './types-chunks/bash-prefix-extractor.d-Do_TCAmA.js';
8
+ import { aq as KodaXToolExecutionContext, aX as ToolSideEffect, o as KodaXAgentScope, V as KodaXRepoIntelligenceCapability, Y as KodaXRepoIntelligenceTrace, W as KodaXRepoIntelligenceMode, X as KodaXRepoIntelligenceResolvedMode, _ as KodaXRepoRoutingSignals, R as KodaXOptions, v as KodaXContextOptions, U as KodaXProviderPolicyHints, aI as ProviderResilienceConfig, aJ as ProviderResiliencePolicy, F as FailureStage, aO as ResilienceClassification, aG as ProviderExecutionState, aL as RecoveryDecision, aN as RecoveryResult, $ as KodaXResult, a3 as KodaXSessionControl, a4 as KodaXSessionMutators, H as KodaXManagedProtocolPayload, E as ExtensionRuntimeContract, aT as RuntimeDefaultsSnapshot, c as BoundExtensionRuntimeController, y as KodaXEvents, g as GoalCompleteResult, aQ as ResolveKodaXManualInput, aR as ResolveKodaXManualOptions, aS as ResolveKodaXManualResult, O as KodaXManualTopicId, N as KodaXManualTopic, d as ChildSnapshotEvent, s as KodaXChildContextBundle, t as KodaXChildExecutionResult, aY as WorkflowHostPolicy, ao as KodaXTimeoutConfig } from './types-chunks/bash-prefix-extractor.d-CZW9fRoa.js';
9
+ export { B as BASH_POLICY_SPEC, a as BashPrefixExtractor, b as BashPrefixResult, C as CapabilityRuntimeContract, e as CreateBashPrefixExtractorOptions, D as DiagnosticsRequest, f as ExtractCommandPrefixOptions, G as GoalBlockedResult, h as GoalCreateInput, i as GoalLifecycleContext, j as GoalRuntimeBinding, k as GoalRuntimeBindingDeps, l as GoalToolsContext, K as KodaXActivityEventMeta, m as KodaXAgentMode, n as KodaXAgentProfile, p as KodaXBudgetDisclosureZone, q as KodaXBudgetExtensionRequest, r as KodaXChildAgentResult, u as KodaXCompactionOverride, w as KodaXContextTokenSnapshot, x as KodaXEffectiveTaskConfig, z as KodaXLiveEventMeta, A as KodaXManagedBudgetSnapshot, I as KodaXManagedTask, J as KodaXManagedTaskRuntimeState, L as KodaXManagedTaskStatusEvent, M as KodaXManualSource, P as KodaXManualTopicInput, Q as KodaXMemoryStrategy, S as KodaXOrchestrationVerdict, T as KodaXParentReductionContract, Z as KodaXRepoIntelligenceTraceEvent, a0 as KodaXRoleRoundSummary, a1 as KodaXRuntimeVerificationContract, a2 as KodaXSelfManualConfig, a5 as KodaXSessionOptions, a6 as KodaXSidecarMessageEvent, a7 as KodaXSkillDynamicContextPolicy, a8 as KodaXSkillInvocationContext, a9 as KodaXSkillMap, aa as KodaXSkillProjectionConfidence, ab as KodaXTaskCapabilityHint, ac as KodaXTaskContract, ad as KodaXTaskEvidenceArtifact, ae as KodaXTaskEvidenceBundle, af as KodaXTaskEvidenceEntry, ag as KodaXTaskRole, ah as KodaXTaskRoleAssignment, ai as KodaXTaskStatus, aj as KodaXTaskSurface, ak as KodaXTaskToolPolicy, al as KodaXTaskVerificationContract, am as KodaXTaskVerificationCriterion, an as KodaXTaskWorkItem, ap as KodaXToolEventMeta, ar as KodaXToolVisibilityMeta, as as KodaXToolVisibilityPolicy, at as KodaXTurnCompletedEvent, au as KodaXTurnDeliveryKind, av as KodaXTurnFailedEvent, aw as KodaXTurnStartedEvent, ax as KodaXVerificationScorecard, ay as KodaXVerificationScorecardCriterion, az as KodaXWorkflowAgentDigestEvent, aA as KodaXWorkflowEventMeta, aB as KodaXWorkflowTimeoutConfig, aC as LSP_SERVERS, aD as LspServerInfo, aE as LspService, aF as LspServiceConfig, aH as ProviderRecoveryEvent, aK as RecoveryAction, aM as RecoveryLadderStep, aP as ResilienceErrorClass, aU as TodoItem, aV as TodoList, aW as TodoStatus, aZ as WorkflowInvocationAction, a_ as WorkflowInvocationPolicyDecision, a$ as WorkflowInvocationPolicyInput, b0 as WorkflowInvocationSource, b1 as WorkflowRunProgressView, b2 as WorkflowStartOutcome, b3 as WorkflowToolHost, b4 as WorkflowToolHostInlineInput, b5 as WorkflowToolHostResult, b6 as WorkflowToolHostStartResult, b7 as buildGoalRuntimeBinding, b8 as createBashPrefixExtractor, b9 as decideWorkflowInvocation, ba as drainPendingSwaps, bb as extractCommandPrefix, bc as getDefaultLspService, bd as hasPendingSwap, be as makeDisabledGoalToolsContext, bf as providerResilienceConfigFromTimeouts, bg as resolveConstructedAgent, bh as shutdownDefaultLspService, bi as withGoalBeforeNextTurn, bj as withGoalStopHook, bk as workflowStartOutcomeConsumesTurn } from './types-chunks/bash-prefix-extractor.d-CZW9fRoa.js';
10
10
  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 { h as AgentMessage, f as Agent, bo as RunnerLlmReturn, a4 as KodaXJsonValue, U as KodaXExtensionSessionRecord, W as KodaXExtensionStore, a2 as KodaXInputArtifact, bw as SessionErrorMetadata, ba as QualityInvariant, bS as ToolCapability, bk as RunnableTool, bp as RunnerToolCall, _ as KodaXGoalState, c4 as WorkflowEventCorrelation, J as Guardrail, cD as WorkflowTaskSummaryEventUpdate, bZ as WorkflowAgentBackend, cc as WorkflowModule, cs as WorkflowProcessTrackerOptions, c3 as WorkflowEvent, c1 as WorkflowArtifactRef, ca as WorkflowMeta, cu as WorkflowRunState, b$ as WorkflowApproval, cg as WorkflowProcessEvent, c0 as WorkflowApprovalSummary, c8 as WorkflowLimits, cm as WorkflowProcessSnapshot } from './types-chunks/process.d-DXkRD7hj.js';
12
- export { j as AgentReasoningProfile, l as AgentTool, m as AskUserAnswer, n as AskUserCustomInputAnswer, o as AskUserMultiOptions, p as AskUserQuestionItem, q as AskUserQuestionOptions, r as AskUserSelectionAnswer, s as CompactionAnchor, v as CompactionResult, x as CompactionUpdate, L as Handoff, N as InMemorySessionOptions, S as KodaXCompactMemoryProgress, T as KodaXCompactMemorySeed, V as KodaXExtensionSessionState, Y as KodaXFileInputArtifact, a0 as KodaXImageInputArtifact, a1 as KodaXImageMediaType, a3 as KodaXInputArtifactSource, a6 as KodaXSessionArtifactLedgerEntry, a7 as KodaXSessionBranchSummaryEntry, a9 as KodaXSessionCompactionEntry, aa as KodaXSessionData, ab as KodaXSessionEntry, ac as KodaXSessionEntryBase, ae as KodaXSessionLabelEntry, af as KodaXSessionLineage, ag as KodaXSessionMessageEntry, ah as KodaXSessionMeta, ai as KodaXSessionNavigationOptions, aj as KodaXSessionRuntimeInfo, ak as KodaXSessionScope, al as KodaXSessionStorage, am as KodaXSessionTreeNode, an as KodaXSessionUiHistoryItem, ao as KodaXSessionUiHistoryItemType, ap as KodaXSessionUiTextHistoryItem, aq as KodaXSessionUiTextHistoryItemType, ar as KodaXSessionUiToolCall, as as KodaXSessionUiToolCallStatus, at as KodaXSessionUiToolGroupHistoryItem, au as KodaXSessionWorkspaceKind, av as KodaXVideoInputArtifact, aw as KodaXVideoMediaType, b5 as MessageEntry, b8 as PresetDispatcher, bd as ReasoningDepth, bh as RunEvent, bi as RunOptions, bj as RunResult, bl as Runner, bt as Session, bv as SessionEntry, bx as SessionExtension, by as SessionForkOptions, cQ as createAgent, cR as createHandoff, cS as createInMemorySession, d8 as registerPresetDispatcher } from './types-chunks/process.d-DXkRD7hj.js';
13
- import { y as MessageQueue, X as WorkflowScriptManifest, F as WorkflowCapsule, I as WorkflowCapsuleIntent, H as WorkflowCapsuleInputs, N as WorkflowCapsuleRequirements, J as WorkflowCapsuleProvenance, w as ManagedWorkflowSnapshot$1, V as WorkflowRunManager$1, R as WorkflowQualityLintFinding, O as WorkflowPatternId } from './types-chunks/run-manager.d-CYY3pZeJ.js';
14
- 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, x as ManagedWorkflowStatus, P as PROMISE_PATTERN, Y as appendSessionLineageLabel, $ as applySessionCompaction, a0 as archiveOldIslands, a2 as buildSessionTree, a4 as cleanupIncompleteToolCalls, a5 as countActiveLineageMessages, a6 as countTokens, a7 as createSessionLineage, ab as estimateTokens, ac as extractArtifactLedger, ae as extractTitleFromMessages, af as findPreviousUserEntryId, ag as forkSessionLineage, ah as generateSessionId, ai as getAgentConfigHome, aj as getAgentConfigPath, ak as getAppDataDir, an as getSessionLineagePath, ao as getSessionMessagesFromLineage, aq as mergeArtifactLedger, as as resolveSessionLineageTarget, at as rewindSessionLineage, au as setAgentConfigHome, av as setSessionLineageActiveEntry, aw as validateAndFixToolHistory } from './types-chunks/run-manager.d-CYY3pZeJ.js';
11
+ import { h as AgentMessage, f as Agent, bp as RunnerLlmReturn, a4 as KodaXJsonValue, U as KodaXExtensionSessionRecord, W as KodaXExtensionStore, a2 as KodaXInputArtifact, bx as SessionErrorMetadata, bb as QualityInvariant, bT as ToolCapability, bl as RunnableTool, bq as RunnerToolCall, _ as KodaXGoalState, c5 as WorkflowEventCorrelation, J as Guardrail, cE as WorkflowTaskSummaryEventUpdate, b_ as WorkflowAgentBackend, cd as WorkflowModule, ct as WorkflowProcessTrackerOptions, c4 as WorkflowEvent, c2 as WorkflowArtifactRef, cb as WorkflowMeta, cv as WorkflowRunState, c0 as WorkflowApproval, ch as WorkflowProcessEvent, c1 as WorkflowApprovalSummary, c9 as WorkflowLimits, cn as WorkflowProcessSnapshot } from './types-chunks/process.d-CY2g03Mb.js';
12
+ export { j as AgentReasoningProfile, l as AgentTool, m as AskUserAnswer, n as AskUserCustomInputAnswer, o as AskUserMultiOptions, p as AskUserQuestionItem, q as AskUserQuestionOptions, r as AskUserSelectionAnswer, s as CompactionAnchor, v as CompactionResult, x as CompactionUpdate, L as Handoff, N as InMemorySessionOptions, S as KodaXCompactMemoryProgress, T as KodaXCompactMemorySeed, V as KodaXExtensionSessionState, Y as KodaXFileInputArtifact, a0 as KodaXImageInputArtifact, a1 as KodaXImageMediaType, a3 as KodaXInputArtifactSource, a6 as KodaXSessionArtifactLedgerEntry, a7 as KodaXSessionBranchSummaryEntry, a9 as KodaXSessionCompactionEntry, aa as KodaXSessionData, ab as KodaXSessionEntry, ac as KodaXSessionEntryBase, ae as KodaXSessionLabelEntry, af as KodaXSessionLineage, ag as KodaXSessionMessageEntry, ah as KodaXSessionMeta, ai as KodaXSessionNavigationOptions, ak as KodaXSessionRuntimeInfo, al as KodaXSessionScope, am as KodaXSessionStorage, an as KodaXSessionTreeNode, ao as KodaXSessionUiHistoryItem, ap as KodaXSessionUiHistoryItemType, aq as KodaXSessionUiTextHistoryItem, ar as KodaXSessionUiTextHistoryItemType, as as KodaXSessionUiToolCall, at as KodaXSessionUiToolCallStatus, au as KodaXSessionUiToolGroupHistoryItem, av as KodaXSessionWorkspaceKind, aw as KodaXVideoInputArtifact, ax as KodaXVideoMediaType, b6 as MessageEntry, b9 as PresetDispatcher, be as ReasoningDepth, bi as RunEvent, bj as RunOptions, bk as RunResult, bm as Runner, bu as Session, bw as SessionEntry, by as SessionExtension, bz as SessionForkOptions, cR as createAgent, cS as createHandoff, cT as createInMemorySession, d9 as registerPresetDispatcher } from './types-chunks/process.d-CY2g03Mb.js';
13
+ import { y as MessageQueue, X as WorkflowScriptManifest, F as WorkflowCapsule, I as WorkflowCapsuleIntent, H as WorkflowCapsuleInputs, N as WorkflowCapsuleRequirements, J as WorkflowCapsuleProvenance, w as ManagedWorkflowSnapshot$1, V as WorkflowRunManager$1, R as WorkflowQualityLintFinding, O as WorkflowPatternId } from './types-chunks/run-manager.d-CYTnWhZY.js';
14
+ 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, x as ManagedWorkflowStatus, P as PROMISE_PATTERN, Y as appendSessionLineageLabel, $ as applySessionCompaction, a0 as archiveOldIslands, a2 as buildSessionTree, a4 as cleanupIncompleteToolCalls, a5 as countActiveLineageMessages, a6 as countTokens, a7 as createSessionLineage, ab as estimateTokens, ac as extractArtifactLedger, ae as extractTitleFromMessages, af as findPreviousUserEntryId, ag as forkSessionLineage, ah as generateSessionId, ai as getAgentConfigHome, aj as getAgentConfigPath, ak as getAppDataDir, an as getSessionLineagePath, ao as getSessionMessagesFromLineage, aq as mergeArtifactLedger, as as resolveSessionLineageTarget, at as rewindSessionLineage, au as setAgentConfigHome, av as setSessionLineageActiveEntry, aw as validateAndFixToolHistory } from './types-chunks/run-manager.d-CYTnWhZY.js';
15
15
  import { b as McpServersConfig } from './types-chunks/config.d-CJy1WENT.js';
16
16
  export { M as McpConnectMode, a as McpServerConfig, c as McpTransportKind } from './types-chunks/config.d-CJy1WENT.js';
17
17
  import { k as McpProviderOptions, c as McpCapabilityProvider, l as McpReverseCapabilities, m as McpRoot } from './types-chunks/manager.d-DBD7SOTT.js';
18
18
  export { A as AuthorizationServerMetadata, D as DiscoveredOAuthEndpoints, M as McpAuthRequiredError, a as McpCapabilityDescriptor, b as McpCapabilityKind, d as McpCapabilityRisk, e as McpCatalogItem, f as McpElicitRequest, g as McpElicitResult, h as McpExpiredSessionError, i as McpIcon, j as McpManager, n as McpSamplingRequest, o as McpSamplingResult, p as McpServerCatalog, q as McpServerCatalogSnapshot, r as McpServerLogs, s as McpServerRuntime, t as McpServerRuntimeDiagnostics, u as McpServerStatus, v as McpServerToolList, w as McpToolTaskSupport, x as McpTransport, y as McpTransportEvents, O as OAuthClientInfo, z as OAuthLoginConsent, P as PerformOAuthLoginOptions, B as ProtectedResourceMetadata, W as WwwAuthenticateChallenge, C as buildInitializeCapabilities, E as createMcpCapabilityId, F as createMcpManager, G as createMcpTransport, H as defaultMcpCacheDir, I as discoverAuthorizationServerMetadata, J as discoverOAuthEndpoints, K as discoverProtectedResourceMetadata, L as extractInsufficientScope, N as extractResourceMetadataUrl, Q as getMcpCachePaths, R as loadValidToken, S as normalizeMcpCapabilityId, T as parseMcpCapabilityId, U as performOAuthLogin, V as registerOAuthClient, X as searchMcpCatalog } from './types-chunks/manager.d-DBD7SOTT.js';
19
- import { h as AutoRules, T as ToolCallSignal, S as SignalCollector } from './types-chunks/guardrail.d-DRp0Lqvx.js';
20
- 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-DRp0Lqvx.js';
21
- import { g as ToolGuardrail } from './types-chunks/types.d-DFf4Sfys.js';
19
+ import { h as AutoRules, T as ToolCallSignal, S as SignalCollector } from './types-chunks/guardrail.d-MR6LwMB2.js';
20
+ 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-MR6LwMB2.js';
21
+ import { g as ToolGuardrail } from './types-chunks/types.d-1CnTg7Sd.js';
22
22
  import { Diagnostic } from 'vscode-languageserver-protocol';
23
23
  import '@anthropic-ai/sdk';
24
24
  import 'openai';
25
25
  import './types-chunks/types.d-vJExiRje.js';
26
26
 
27
27
  /**
28
- * KodaX Core Errors
28
+ * KodaX Constructed-World types (FEATURE_087, v0.7.28).
29
29
  *
30
- * 错误类型体系 - 提供结构化的错误处理
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.
31
38
  */
32
- /** 基础 KodaX 错误类 */
33
- declare class KodaXError extends Error {
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';
34
51
  readonly code: string;
35
- constructor(message: string, code?: string);
36
- }
37
- /** 工具执行错误 */
38
- declare class KodaXToolError extends KodaXError {
39
- readonly toolName: string;
40
- readonly toolId?: string | undefined;
41
- constructor(message: string, toolName: string, toolId?: string | undefined);
42
52
  }
43
- /** 会话错误 */
44
- declare class KodaXSessionError extends KodaXError {
45
- readonly sessionId?: string | undefined;
46
- constructor(message: string, sessionId?: string | undefined);
47
- }
48
- /** 终端不支持错误 */
49
- declare class KodaXTerminalError extends KodaXError {
50
- /** 建议的替代命令 */
51
- readonly suggestions: string[];
52
- constructor(message: string, suggestions?: string[]);
53
- }
54
-
55
53
  /**
56
- * KodaX Error Classification
54
+ * Capability declaration.
57
55
  *
58
- * 错误分类系统 - 决定适当的恢复策略
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.
59
65
  */
60
- declare enum ErrorCategory {
61
- TRANSIENT = 0,// 临时错误,可重试(速率限制、超时、网络错误)
62
- PERMANENT = 1,// 永久错误,不可重试(认证失败、无效请求)
63
- TOOL_CALL_ID = 2,// 特定的 tool_call_id 不匹配错误
64
- USER_ABORT = 3
66
+ interface Capabilities {
67
+ readonly tools: readonly string[];
65
68
  }
66
- interface ErrorClassification {
67
- category: ErrorCategory;
68
- retryable: boolean;
69
- maxRetries: number;
70
- retryDelay: number;
71
- shouldCleanup: boolean;
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;
72
83
  }
73
84
  /**
74
- * 分类错误以确定适当的恢复策略
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.
75
88
  */
76
- declare function classifyError(error: Error): ErrorClassification;
77
-
89
+ declare const DEFAULT_HANDLER_TIMEOUT_MS = 30000;
78
90
  /**
79
- * KodaX Core Constants
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).
80
94
  */
81
-
82
- /** Prefix used to detect user-cancelled tool results in the agent loop. */
83
- declare const CANCELLED_TOOL_RESULT_PREFIX = "[Cancelled]";
84
- /** Standard cancellation message returned when a tool is cancelled by the user. */
85
- declare const CANCELLED_TOOL_RESULT_MESSAGE = "[Cancelled] Operation cancelled by user";
86
-
95
+ type ArtifactStatus = 'staged' | 'active' | 'revoked';
87
96
  /**
88
- * KodaX Tool Types
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
89
106
  */
90
-
107
+ interface ToolRef {
108
+ readonly ref: string;
109
+ }
91
110
  /**
92
- * Progress yield from a streaming (async generator) tool.
93
- * Each yield appears as a real-time status update in the REPL transcript.
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.
94
115
  */
95
- interface ToolProgress {
96
- readonly stage: string;
97
- readonly message: string;
116
+ interface GuardrailRef {
117
+ readonly kind: 'input' | 'output' | 'tool';
118
+ readonly ref: string;
98
119
  }
99
120
  /**
100
- * Final result a tool may return. Either a plain string (the default for
101
- * text-only tools) OR a typed-array form for multimodal returns (e.g.
102
- * `read` on an image path returns `[{type:'text',...}, {type:'image',...}]`).
103
- * Providers serialize each shape to their wire format; OpenAI-compat
104
- * gateways downgrade image items to a placeholder rather than rejecting.
105
- *
106
- * The array form mirrors claudecode's FileReadTool image return — Claude
107
- * Code packs image data into `tool_result` content so the model can
108
- * re-fetch images via the tool path. See
109
- * `c:/Works/claudecode/src/tools/FileReadTool/FileReadTool.ts:866-891`.
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.
110
125
  */
111
- type ToolResult = string | readonly KodaXToolResultContentItem[];
112
- /** Standard tool handler — returns a final result (text or multimodal). */
113
- type ToolHandlerSync = (input: Record<string, unknown>, context: KodaXToolExecutionContext) => Promise<ToolResult>;
114
- /** Streaming tool handler — yields progress updates, returns final result. */
115
- type ToolHandlerStreaming = (input: Record<string, unknown>, context: KodaXToolExecutionContext) => AsyncGenerator<ToolProgress, ToolResult, void>;
116
- /** Union of both handler types. Existing tools use ToolHandlerSync; new long-running tools may use ToolHandlerStreaming. */
117
- type ToolHandler = ToolHandlerSync | ToolHandlerStreaming;
118
-
126
+ interface AgentHandoffRef {
127
+ readonly target: {
128
+ readonly ref: string;
129
+ };
130
+ readonly kind: 'continuation' | 'as-tool';
131
+ readonly description?: string;
132
+ }
119
133
  /**
120
- * FEATURE_149 (v0.7.38) interrupt-on-submit policy for in-flight tools.
121
- *
122
- * Controls whether submitting a new prompt while THIS tool is mid-execution
123
- * triggers a fast-abort of the current agent round (so the new prompt starts
124
- * immediately) or queues the prompt to run after the tool resolves.
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:
125
147
  *
126
- * - `'cancel'` long-running tools whose work the user is likely to want
127
- * to abandon when they redirect (e.g., `bash` running a 30s script,
128
- * `dispatch_child_task` synchronously awaiting a child, sleep-style
129
- * tools). InkREPL submit handler aborts the round immediately.
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)
130
151
  *
131
- * - `'wait'` (default) atomic / fast tools (read, grep, glob, write,
132
- * edit, …) where waiting for completion is cheaper than aborting and
133
- * redoing.
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'`).
134
165
  *
135
- * Mirrors Claude Code `interruptBehavior` (`utils/handlePromptSubmit.ts`).
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).
136
171
  */
137
- type ToolInterruptBehavior = 'cancel' | 'wait';
138
- interface LocalToolDefinition extends KodaXToolDefinition {
139
- handler: ToolHandler;
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;
140
181
  /**
141
- * v0.7.42Required declarative side-effect class. See
142
- * {@link ToolSideEffect} for category definitions and rationale. Plan
143
- * mode and SDK embedders' permission brokers consume this; failure to
144
- * declare is a TypeScript error (by design — `sideEffect` is required,
145
- * not optional, to prevent silent drift when new tools are added).
182
+ * FEATURE_191one-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.
146
190
  */
147
- sideEffect: ToolSideEffect;
191
+ readonly description?: string;
148
192
  /**
149
- * v0.7.42 — Optional plan-mode override.
150
- *
151
- * - `undefined` (default): plan-mode permits only `sideEffect ===
152
- * 'readonly'` tools.
153
- * - `true`: explicitly permitted in plan mode even when sideEffect is
154
- * not `'readonly'`. Reserve for tools whose effect is itself part of
155
- * the planning loop (`exit_plan_mode`, `task_stop`, `todo_update`,
156
- * `todo_create`, `ask_user_question`).
157
- * - `false`: explicitly blocked in plan mode even when sideEffect is
158
- * `'readonly'`. Rare — useful for read-only tools whose output would
159
- * leak content the planner should not see.
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.
160
196
  */
161
- planModeAllowed?: boolean;
197
+ readonly outputSchema?: Record<string, unknown>;
162
198
  /**
163
- * FEATURE_149 (v0.7.38) submit-time interrupt policy. See
164
- * {@link ToolInterruptBehavior}. Default `'wait'` when undefined.
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).
165
202
  */
166
- interruptBehavior?: ToolInterruptBehavior;
203
+ readonly testCases?: readonly AgentTestCase[];
167
204
  /**
168
- * Progressive disclosure when `true`, the tool's full description is
169
- * replaced with `searchHint` (a one-line summary) in the LLM-visible
170
- * tool schema until the per-session unlock Set marks the tool name as
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
+ }
313
+
314
+ /**
315
+ * KodaX Core Errors
316
+ *
317
+ * 错误类型体系 - 提供结构化的错误处理
318
+ */
319
+ /** 基础 KodaX 错误类 */
320
+ declare class KodaXError extends Error {
321
+ readonly code: string;
322
+ constructor(message: string, code?: string);
323
+ }
324
+ /** 工具执行错误 */
325
+ declare class KodaXToolError extends KodaXError {
326
+ readonly toolName: string;
327
+ readonly toolId?: string | undefined;
328
+ constructor(message: string, toolName: string, toolId?: string | undefined);
329
+ }
330
+ /** 会话错误 */
331
+ declare class KodaXSessionError extends KodaXError {
332
+ readonly sessionId?: string | undefined;
333
+ constructor(message: string, sessionId?: string | undefined);
334
+ }
335
+ /** 终端不支持错误 */
336
+ declare class KodaXTerminalError extends KodaXError {
337
+ /** 建议的替代命令 */
338
+ readonly suggestions: string[];
339
+ constructor(message: string, suggestions?: string[]);
340
+ }
341
+
342
+ /**
343
+ * KodaX Error Classification
344
+ *
345
+ * 错误分类系统 - 决定适当的恢复策略
346
+ */
347
+ declare enum ErrorCategory {
348
+ TRANSIENT = 0,// 临时错误,可重试(速率限制、超时、网络错误)
349
+ PERMANENT = 1,// 永久错误,不可重试(认证失败、无效请求)
350
+ TOOL_CALL_ID = 2,// 特定的 tool_call_id 不匹配错误
351
+ USER_ABORT = 3
352
+ }
353
+ interface ErrorClassification {
354
+ category: ErrorCategory;
355
+ retryable: boolean;
356
+ maxRetries: number;
357
+ retryDelay: number;
358
+ shouldCleanup: boolean;
359
+ }
360
+ /**
361
+ * 分类错误以确定适当的恢复策略
362
+ */
363
+ declare function classifyError(error: Error): ErrorClassification;
364
+
365
+ /**
366
+ * KodaX Core Constants
367
+ */
368
+
369
+ /** Prefix used to detect user-cancelled tool results in the agent loop. */
370
+ declare const CANCELLED_TOOL_RESULT_PREFIX = "[Cancelled]";
371
+ /** Standard cancellation message returned when a tool is cancelled by the user. */
372
+ declare const CANCELLED_TOOL_RESULT_MESSAGE = "[Cancelled] Operation cancelled by user";
373
+
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
171
458
  * unlocked. Unlocking happens via the `tool_search` tool: the LLM
172
459
  * invokes `tool_search` with a query that selects this tool, and the
173
460
  * full description + JSON schema are returned in the tool_result text.
@@ -279,454 +566,167 @@ interface KodaXRetrievalResult {
279
566
  trust: KodaXRetrievalTrust;
280
567
  freshness: KodaXRetrievalFreshness;
281
568
  provider?: string;
282
- summary: string;
283
- content?: string;
284
- items: KodaXRetrievalItem[];
285
- artifacts?: KodaXRetrievalArtifact[];
286
- metadata?: Record<string, unknown>;
287
- }
288
-
289
- declare const KODAX_TOOLS: KodaXToolDefinition[];
290
- declare function registerTool(definition: LocalToolDefinition, options?: ToolRegistrationOptions): () => void;
291
- declare function getTool(name: string): ToolHandler | undefined;
292
- declare function getToolDefinition(name: string): KodaXToolDefinition | undefined;
293
- declare function getRegisteredToolDefinition(name: string): RegisteredToolDefinition | undefined;
294
- declare function getToolRegistrations(name: string): RegisteredToolDefinition[];
295
- declare function getBuiltinToolDefinition(name: string): KodaXToolDefinition | undefined;
296
- declare function getBuiltinRegisteredToolDefinition(name: string): RegisteredToolDefinition | undefined;
297
- declare function createBuiltinToolDefinition(name: string): LocalToolDefinition | undefined;
298
- declare function listBuiltinToolDefinitions(): RegisteredToolDefinition[];
299
- /**
300
- * v0.7.42 — snapshot of every currently-active tool registration.
301
- *
302
- * Returns the most-recent registration for each tool name (mirroring
303
- * {@link getRegisteredToolDefinition}'s single-name semantics across the
304
- * full registry). Use this to drive metadata-based filters such as:
305
- *
306
- * - SDK embedder permission brokers building a blocklist by side-effect class:
307
- * `getAllRegisteredTools().filter(t => t.sideEffect !== 'readonly')`
308
- * - UI that displays available tools grouped by category.
309
- * - Plan-mode gates that compute their own blocklist from metadata
310
- * instead of hardcoded `Set<string>` of names.
311
- *
312
- * The returned array is a fresh copy per call (safe to mutate without
313
- * affecting the registry). Order is registration order (sorted by name
314
- * within each registration to keep the snapshot deterministic).
315
- */
316
- declare function getAllRegisteredTools(): RegisteredToolDefinition[];
317
- /**
318
- * v0.7.42 — plan-mode permit check driven by tool metadata.
319
- *
320
- * - `sideEffect === 'readonly'` ⇒ permitted (unless explicitly
321
- * `planModeAllowed: false`).
322
- * - `planModeAllowed: true` ⇒ permitted (overrides non-readonly).
323
- * - any other sideEffect ⇒ blocked.
324
- *
325
- * Returns `false` for unknown tool names (fail-closed). Use this in
326
- * preference to hardcoded `Set<string>` of tool names — adding a new
327
- * `'mutates-fs'` builtin will flow through automatically.
328
- */
329
- declare function isToolPlanModeAllowed(name: string): boolean;
330
- /**
331
- * v0.7.42 — does this tool mutate the filesystem?
332
- *
333
- * Wraps `sideEffect === 'mutates-fs'`. Used by the REPL permission
334
- * pipeline's gitRoot guard and Space's permission broker. Replaces the
335
- * previous practice of hardcoding `Set(["write", "edit"])`-style lookups
336
- * scattered across 5+ callsites.
337
- */
338
- declare function isToolFileMutation(name: string): boolean;
339
- /**
340
- * FEATURE_247 — does this tool perform a read-only network request
341
- * (`sideEffect === 'reads-network'`)?
342
- *
343
- * Lets an SDK embedder's permission broker (e.g. KodaX-Space Partner) allow
344
- * web research / MCP reads (`web_search`, `mcp_read_resource`, `mcp_get_prompt`)
345
- * while still blocking mutating network calls (`web_fetch`, `mcp_call` →
346
- * `mutates-network`). Fail-closed: unknown names return `false`.
347
- *
348
- * Note: `isToolMutation` intentionally still returns `true` for a
349
- * `reads-network` tool (only `readonly` is treated as non-mutating there), so
350
- * existing mutation-gate behavior is unchanged — use THIS predicate, or the
351
- * `sideEffect` value directly, to select the read-network class.
352
- */
353
- declare function isToolNetworkRead(name: string): boolean;
354
- /**
355
- * v0.7.42 — does this tool mutate anything (FS, shell, network, state)?
356
- *
357
- * True for every `sideEffect` except `'readonly'`. Fail-closed (unknown
358
- * names return `true` — assumed mutating until proven otherwise).
359
- */
360
- declare function isToolMutation(name: string): boolean;
361
- declare function getRequiredToolParams(name: string): string[];
362
- declare function listTools(): string[];
363
- declare function listToolDefinitions(): KodaXToolDefinition[];
364
- declare function executeTool(name: string, input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
365
-
366
- declare function toolRead(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string | readonly KodaXToolResultContentItem[]>;
367
-
368
- declare function toolWrite(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
369
-
370
- type EditToolErrorCode = 'EDIT_NOT_FOUND' | 'EDIT_AMBIGUOUS' | 'EDIT_TOO_LARGE';
371
- interface EditRecoveryDiagnostic {
372
- code: EditToolErrorCode;
373
- filePath: string;
374
- candidates: Array<{
375
- startLine: number;
376
- endLine: number;
377
- preview: string;
378
- excerpt: string;
379
- }>;
380
- }
381
- declare function toolEdit(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
382
- declare function parseEditToolError(result: string): EditToolErrorCode | undefined;
383
- declare function inspectEditFailure(pathValue: string, oldString: string, ctx: KodaXToolExecutionContext, windowLines: number): Promise<EditRecoveryDiagnostic>;
384
-
385
- declare function toolInsertAfterAnchor(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
386
-
387
- declare function toolBash(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
388
-
389
- /**
390
- * KodaX Glob Tool
391
- *
392
- * 文件搜索工具
393
- */
394
-
395
- declare function toolGlob(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
396
-
397
- declare function toolGrep(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
398
-
399
- /**
400
- * KodaX Undo Tool
401
- *
402
- * 撤销工具 - 恢复最后一次文件修改
403
- */
404
-
405
- declare function toolUndo(_input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
406
-
407
- /**
408
- * KodaX AskUserQuestion Tool
409
- *
410
- * Lets the LLM ask the user interactive questions. Supports single-select,
411
- * multi-select, free-text input, and multi-question modes.
412
- */
413
-
414
- /**
415
- * Ask user a question with multiple interaction modes.
416
- *
417
- * This tool requires context.askUser (select), context.askUserMulti
418
- * (multi-question), or context.askUserInput (input) from the host.
419
- */
420
- declare function toolAskUserQuestion(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
421
-
422
- declare function toolRepoOverview(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
423
-
424
- declare function toolChangedScope(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
425
-
426
- declare function toolChangedDiff(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
427
-
428
- declare function toolModuleContext(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
429
-
430
- declare function toolSymbolContext(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
431
-
432
- declare function toolProcessContext(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
433
-
434
- declare function toolImpactEstimate(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
435
-
436
- declare function toolWebSearch(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
437
-
438
- declare function toolWebFetch(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
439
-
440
- declare function toolCodeSearch(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
441
-
442
- declare function toolSemanticLookup(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
443
-
444
- /**
445
- * KodaX Constructed-World types (FEATURE_087, v0.7.28).
446
- *
447
- * Runtime-generated capabilities (tools / agents / skills / ...) live in
448
- * `.kodax/constructed/` and are loaded into the same registries as builtin
449
- * primitives. v0.7.28 only ships tool generation (FEATURE_088); other kinds
450
- * land in FEATURE_089 / FEATURE_090.
451
- *
452
- * Cross-references:
453
- * - DD §14 — lifecycle, security model, registry merge semantics.
454
- * - docs/features/v0.7.28.md — capability schema, generation flow.
455
- */
456
-
457
- /**
458
- * Handler script source. v0.7.28 limits language to `'javascript'` so that
459
- * `loadHandler()` can `await import()` the file directly without an
460
- * intermediate TS → JS compile step (no esbuild / tsx dependency).
461
- *
462
- * TypeScript handlers are explicitly out of scope; Coding Agent generates
463
- * JS strings on the wire.
464
- */
465
- interface ScriptSource {
466
- readonly kind: 'script';
467
- readonly language: 'javascript';
468
- readonly code: string;
469
- }
470
- /**
471
- * Capability declaration.
472
- *
473
- * v0.7.28 ships the single-dimension form: a whitelist of builtin tool
474
- * names that the handler may invoke through `ctx.tools.<name>(...)`.
475
- * All I/O — fs / net / env — must flow through builtin tools (`read` /
476
- * `write` / `bash` / etc.); handlers do not receive direct `ctx.fs` /
477
- * `ctx.net` / `ctx.env` entry points.
478
- *
479
- * Forward-compatible evolution: if the future demands path/domain-level
480
- * constraints, this can grow to `(string | { name; constraints })[]`
481
- * without breaking existing manifests.
482
- */
483
- interface Capabilities {
484
- readonly tools: readonly string[];
485
- }
486
- /**
487
- * Tool-kind artifact body (the `content` of `ConstructionArtifact` when
488
- * `kind === 'tool'`).
489
- */
490
- interface ToolContent {
491
- readonly description: string;
492
- readonly inputSchema: Record<string, unknown>;
493
- readonly capabilities: Capabilities;
494
- readonly handler: ScriptSource;
495
- /**
496
- * Per-tool timeout override. Defaults to {@link DEFAULT_HANDLER_TIMEOUT_MS}
497
- * when omitted. Bounded by AbortController in `loadHandler()`.
498
- */
499
- readonly timeoutMs?: number;
500
- }
501
- /**
502
- * Default handler timeout. Picked to match the historical ceiling on
503
- * builtin streaming tools (30s); revisit if a constructed tool demands
504
- * longer-running computation.
505
- */
506
- declare const DEFAULT_HANDLER_TIMEOUT_MS = 30000;
507
- /**
508
- * Lifecycle state on disk. Drives both the startup glob filter and the
509
- * `revoke()` semantics. See DD §14.1 — file system is the single source
510
- * of truth; no separate `_manifest.json` index file (C4 decision).
511
- */
512
- type ArtifactStatus = 'staged' | 'active' | 'revoked';
513
- /**
514
- * Reference to a tool by stable id. v0.7.31 (FEATURE_089) introduces
515
- * Agent manifests that bundle tool refs rather than inline tool bodies;
516
- * the resolver expands these refs to concrete `KodaXToolDefinition`
517
- * instances at activate time.
518
- *
519
- * `ref` shape:
520
- * - `builtin:<name>` — a tool from the static registry
521
- * (e.g. `builtin:read`, `builtin:bash`)
522
- * - `constructed:<name>@<ver>` — a previously-activated constructed tool
523
- */
524
- interface ToolRef {
525
- readonly ref: string;
526
- }
527
- /**
528
- * Reference to a Guardrail by stable id. The Layer A `Guardrail`
529
- * declaration is name-only (no runtime hooks); resolvers map known
530
- * names to constructed `ToolGuardrail` / `InputGuardrail` /
531
- * `OutputGuardrail` instances at activation time.
532
- */
533
- interface GuardrailRef {
534
- readonly kind: 'input' | 'output' | 'tool';
535
- readonly ref: string;
536
- }
537
- /**
538
- * Reference to a handoff target by stable id (another constructed agent
539
- * or a builtin role). The resolver expands `target.ref` to the actual
540
- * `Agent` declaration at admission time so the handoff DAG check
541
- * (`handoffLegality` invariant) sees the full graph.
542
- */
543
- interface AgentHandoffRef {
544
- readonly target: {
545
- readonly ref: string;
546
- };
547
- readonly kind: 'continuation' | 'as-tool';
548
- readonly description?: string;
549
- }
550
- /**
551
- * Reasoning profile declaration mirroring the Layer A
552
- * `AgentReasoningProfile`. Kept structurally identical so the resolver
553
- * passes the value through without re-shaping.
554
- */
555
- interface AgentReasoningRef {
556
- readonly default: 'quick' | 'balanced' | 'deep';
557
- readonly max?: 'quick' | 'balanced' | 'deep';
558
- readonly escalateOnRevise?: boolean;
559
- }
560
- /**
561
- * Sandbox test case. Used by `sandbox_test_agent` to verify a
562
- * constructed agent before it can activate. Each case feeds `input`
563
- * to a sandbox Runner instance and grades the agent's final output:
564
- *
565
- * - `expectMatch` — final text must match this regex (string form)
566
- * - `expectNotMatch` — final text must NOT match this regex
567
- * - `expectFinalText` — exact substring match (case-sensitive)
568
- *
569
- * At least one of the three expect-fields must be present; the cases
570
- * are graded by `runSandboxAgentTest()` (FEATURE_089 Phase 3.5).
571
- */
572
- interface AgentTestCase {
573
- readonly id: string;
574
- readonly input: string;
575
- readonly expectMatch?: string;
576
- readonly expectNotMatch?: string;
577
- readonly expectFinalText?: string;
578
- }
579
- /**
580
- * Agent-kind artifact body (the `content` of `ConstructionArtifact`
581
- * when `kind === 'agent'`).
582
- *
583
- * FEATURE_089 (v0.7.31): all fields except `instructions` are optional;
584
- * a minimal "echo agent" can be expressed as `{ instructions: '...' }`.
585
- * Tool / handoff / guardrail refs are resolved at admission time
586
- * (Runner.admit's 5-step audit expands them and feeds the resolved
587
- * Agent through the invariant chain).
588
- */
589
- interface AgentContent {
590
- readonly instructions: string;
591
- readonly tools?: readonly ToolRef[];
592
- readonly handoffs?: readonly AgentHandoffRef[];
593
- readonly reasoning?: AgentReasoningRef;
594
- readonly guardrails?: readonly GuardrailRef[];
595
- readonly model?: string;
596
- readonly provider?: string;
597
- readonly effort?: KodaXWireReasoningEffort;
598
- /**
599
- * FEATURE_191 — one-sentence human-readable summary surfaced in the
600
- * Worker system prompt's `=== Available specialist agents ===`
601
- * block (FEATURE_191 A.3) and in `/agents list` UIs. Frontmatter
602
- * `description` field of `~/.kodax/agents/<name>.md` and the
603
- * `name`-paired argument of `KodaXExtensionAPI.registerAgent`
604
- * funnel into this field. Optional for backward compatibility with
605
- * FEATURE_089 minimal-agent shape (`{ instructions: '...' }`);
606
- * the SP block renders `(no description)` when absent.
607
- */
608
- readonly description?: string;
609
- /**
610
- * Optional structured-output schema mirroring `Agent.outputSchema`.
611
- * Pure pass-through to the runtime — admission does not validate
612
- * shape semantics here, only well-formed JSON.
613
- */
614
- readonly outputSchema?: Record<string, unknown>;
615
- /**
616
- * Optional sandbox test cases. When present, `sandbox_test_agent`
617
- * runs them; when absent, the test step performs only the static
618
- * checks (manifest schema + admission audit).
619
- */
620
- readonly testCases?: readonly AgentTestCase[];
621
- /**
622
- * Maximum total budget (iteration count) the agent may consume.
623
- * Plumbed onto the resolved `AgentManifest.maxBudget` and clamped by
624
- * `budgetCeiling` invariant during admission.
625
- */
626
- readonly maxBudget?: number;
627
- /**
628
- * Voluntary additional invariants the LLM declares this agent
629
- * commits to. Plumbed onto `AgentManifest.declaredInvariants`;
630
- * unioned on top of the required set during admission.
631
- */
632
- readonly declaredInvariants?: readonly string[];
569
+ summary: string;
570
+ content?: string;
571
+ items: KodaXRetrievalItem[];
572
+ artifacts?: KodaXRetrievalArtifact[];
573
+ metadata?: Record<string, unknown>;
633
574
  }
575
+
576
+ declare const KODAX_TOOLS: KodaXToolDefinition[];
577
+ declare function registerTool(definition: LocalToolDefinition, options?: ToolRegistrationOptions): () => void;
578
+ declare function getTool(name: string): ToolHandler | undefined;
579
+ declare function getToolDefinition(name: string): KodaXToolDefinition | undefined;
580
+ declare function getRegisteredToolDefinition(name: string): RegisteredToolDefinition | undefined;
581
+ declare function getToolRegistrations(name: string): RegisteredToolDefinition[];
582
+ declare function getBuiltinToolDefinition(name: string): KodaXToolDefinition | undefined;
583
+ declare function getBuiltinRegisteredToolDefinition(name: string): RegisteredToolDefinition | undefined;
584
+ declare function createBuiltinToolDefinition(name: string): LocalToolDefinition | undefined;
585
+ declare function listBuiltinToolDefinitions(): RegisteredToolDefinition[];
634
586
  /**
635
- * Persisted artifact shape (one JSON file per name/version under
636
- * `.kodax/constructed/<kind>s/<name>/<version>.json`).
587
+ * v0.7.42 snapshot of every currently-active tool registration.
637
588
  *
638
- * Discriminated union over `kind`:
639
- * - `kind: 'tool'` — v0.7.28 (FEATURE_088) tool generation
640
- * - `kind: 'agent'` v0.7.31 (FEATURE_089) agent generation; passes
641
- * through `Runner.admit()` at activation time
589
+ * Returns the most-recent registration for each tool name (mirroring
590
+ * {@link getRegisteredToolDefinition}'s single-name semantics across the
591
+ * full registry). Use this to drive metadata-based filters such as:
642
592
  *
643
- * Lifecycle fields (status / timestamps / contentHash / sourceAgent /
644
- * signedBy) are common to all kinds.
593
+ * - SDK embedder permission brokers building a blocklist by side-effect class:
594
+ * `getAllRegisteredTools().filter(t => t.sideEffect !== 'readonly')`
595
+ * - UI that displays available tools grouped by category.
596
+ * - Plan-mode gates that compute their own blocklist from metadata
597
+ * instead of hardcoded `Set<string>` of names.
598
+ *
599
+ * The returned array is a fresh copy per call (safe to mutate without
600
+ * affecting the registry). Order is registration order (sorted by name
601
+ * within each registration to keep the snapshot deterministic).
645
602
  */
646
- type ConstructionArtifact = ToolArtifact | AgentArtifact;
647
- interface ConstructionArtifactBase {
648
- readonly name: string;
649
- readonly version: string;
650
- status: ArtifactStatus;
651
- readonly signedBy?: string;
652
- readonly createdAt: number;
653
- readonly sourceAgent?: string;
654
- testedAt?: number;
655
- activatedAt?: number;
656
- revokedAt?: number;
657
- /**
658
- * SHA-256 of `JSON.stringify(content)` captured at activate time.
659
- * `rehydrateActiveArtifacts()` recomputes and compares — a mismatch
660
- * indicates the manifest was edited between activation and the next
661
- * boot (naive cross-session tampering, e.g. an LLM rewriting the .json
662
- * via the Write tool without recomputing the hash). Mismatched
663
- * artifacts are skipped at rehydrate with a stderr warning. This is
664
- * NOT a defense against a coordinated attacker who recomputes the
665
- * hash; the threat model is single-user CLI integrity, not multi-user
666
- * supply chain.
667
- */
668
- contentHash?: string;
669
- }
670
- interface ToolArtifact extends ConstructionArtifactBase {
671
- readonly kind: 'tool';
672
- readonly content: ToolContent;
673
- }
674
- interface AgentArtifact extends ConstructionArtifactBase {
675
- readonly kind: 'agent';
676
- readonly content: AgentContent;
677
- }
603
+ declare function getAllRegisteredTools(): RegisteredToolDefinition[];
678
604
  /**
679
- * Returned by {@link ConstructionRuntime.stage}; opaque handle that
680
- * downstream `test()` / `activate()` calls bind to.
605
+ * v0.7.42 plan-mode permit check driven by tool metadata.
606
+ *
607
+ * - `sideEffect === 'readonly'` ⇒ permitted (unless explicitly
608
+ * `planModeAllowed: false`).
609
+ * - `planModeAllowed: true` ⇒ permitted (overrides non-readonly).
610
+ * - any other sideEffect ⇒ blocked.
611
+ *
612
+ * Returns `false` for unknown tool names (fail-closed). Use this in
613
+ * preference to hardcoded `Set<string>` of tool names — adding a new
614
+ * `'mutates-fs'` builtin will flow through automatically.
681
615
  */
682
- interface StagedHandle {
683
- readonly artifact: ConstructionArtifact;
684
- readonly stagedAt: number;
685
- }
616
+ declare function isToolPlanModeAllowed(name: string): boolean;
686
617
  /**
687
- * Outcome of {@link ConstructionRuntime.test}. `ok=false` blocks
688
- * activation; `warnings` surface but do not block.
618
+ * v0.7.42 does this tool mutate the filesystem?
619
+ *
620
+ * Wraps `sideEffect === 'mutates-fs'`. Used by the REPL permission
621
+ * pipeline's gitRoot guard and Space's permission broker. Replaces the
622
+ * previous practice of hardcoding `Set(["write", "edit"])`-style lookups
623
+ * scattered across 5+ callsites.
689
624
  */
690
- interface TestResult {
691
- readonly ok: boolean;
692
- readonly errors?: readonly string[];
693
- readonly warnings?: readonly string[];
694
- }
625
+ declare function isToolFileMutation(name: string): boolean;
695
626
  /**
696
- * Policy gate invoked once per `activate()` before the artifact is
697
- * registered. Default rejects implicit auto-approval; the REPL surface
698
- * binds a dialog-based policy in `packages/repl/src/common/construction-
699
- * bootstrap.ts` so user approval flows through the live askUser channel.
627
+ * FEATURE_247does this tool perform a read-only network request
628
+ * (`sideEffect === 'reads-network'`)?
700
629
  *
701
- * Modeled as a function type rather than an interface (D3 decision):
702
- * keeps the contract surface tiny, no class boilerplate.
630
+ * Lets an SDK embedder's permission broker (e.g. KodaX-Space Partner) allow
631
+ * web research / MCP reads (`web_search`, `mcp_read_resource`, `mcp_get_prompt`)
632
+ * while still blocking mutating network calls (`web_fetch`, `mcp_call` →
633
+ * `mutates-network`). Fail-closed: unknown names return `false`.
703
634
  *
704
- * No declarative `kodax.config.ts` override hatch is provided see the
705
- * "Deferred Design Decisions" section in `features/v0.7.28.md` for why
706
- * a `risk_mode` enum (when truly needed) is preferred over user-authored
707
- * policy functions.
635
+ * Note: `isToolMutation` intentionally still returns `true` for a
636
+ * `reads-network` tool (only `readonly` is treated as non-mutating there), so
637
+ * existing mutation-gate behavior is unchanged use THIS predicate, or the
638
+ * `sideEffect` value directly, to select the read-network class.
708
639
  */
709
- type ConstructionPolicy = (artifact: ConstructionArtifact) => Promise<ConstructionPolicyVerdict>;
710
- type ConstructionPolicyVerdict = 'approve' | 'reject' | 'ask-user';
711
- /** Default policy: always ask the user; no implicit approvals. */
712
- declare const defaultPolicy: ConstructionPolicy;
640
+ declare function isToolNetworkRead(name: string): boolean;
713
641
  /**
714
- * Thrown by `CtxProxy` when handler attempts to access a tool not declared
715
- * in `capabilities.tools`. Caught in tracer; surfaces as a tool error.
642
+ * v0.7.42 does this tool mutate anything (FS, shell, network, state)?
643
+ *
644
+ * True for every `sideEffect` except `'readonly'`. Fail-closed (unknown
645
+ * names return `true` — assumed mutating until proven otherwise).
716
646
  */
717
- declare class CapabilityDeniedError extends Error {
718
- readonly toolName: string;
719
- readonly declaredTools: readonly string[];
720
- constructor(toolName: string, declaredTools: readonly string[]);
647
+ declare function isToolMutation(name: string): boolean;
648
+ declare function getRequiredToolParams(name: string): string[];
649
+ declare function listTools(): string[];
650
+ declare function listToolDefinitions(): KodaXToolDefinition[];
651
+ declare function executeTool(name: string, input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
652
+
653
+ declare function toolRead(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string | readonly KodaXToolResultContentItem[]>;
654
+
655
+ declare function toolWrite(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
656
+
657
+ type EditToolErrorCode = 'EDIT_NOT_FOUND' | 'EDIT_AMBIGUOUS' | 'EDIT_TOO_LARGE';
658
+ interface EditRecoveryDiagnostic {
659
+ code: EditToolErrorCode;
660
+ filePath: string;
661
+ candidates: Array<{
662
+ startLine: number;
663
+ endLine: number;
664
+ preview: string;
665
+ excerpt: string;
666
+ }>;
721
667
  }
668
+ declare function toolEdit(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
669
+ declare function parseEditToolError(result: string): EditToolErrorCode | undefined;
670
+ declare function inspectEditFailure(pathValue: string, oldString: string, ctx: KodaXToolExecutionContext, windowLines: number): Promise<EditRecoveryDiagnostic>;
671
+
672
+ declare function toolInsertAfterAnchor(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
673
+
674
+ declare function toolBash(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
675
+
722
676
  /**
723
- * Thrown when a manifest cannot be parsed / is missing required fields.
724
- * Surfaces during stage() / startup glob; tracer records details.
677
+ * KodaX Glob Tool
678
+ *
679
+ * 文件搜索工具
680
+ */
681
+
682
+ declare function toolGlob(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
683
+
684
+ declare function toolGrep(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
685
+
686
+ /**
687
+ * KodaX Undo Tool
688
+ *
689
+ * 撤销工具 - 恢复最后一次文件修改
690
+ */
691
+
692
+ declare function toolUndo(_input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
693
+
694
+ /**
695
+ * KodaX AskUserQuestion Tool
696
+ *
697
+ * Lets the LLM ask the user interactive questions. Supports single-select,
698
+ * multi-select, free-text input, and multi-question modes.
725
699
  */
726
- declare class ConstructionManifestError extends Error {
727
- readonly path?: string;
728
- constructor(message: string, path?: string);
729
- }
700
+
701
+ /**
702
+ * Ask user a question with multiple interaction modes.
703
+ *
704
+ * This tool requires context.askUser (select), context.askUserMulti
705
+ * (multi-question), or context.askUserInput (input) from the host.
706
+ */
707
+ declare function toolAskUserQuestion(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
708
+
709
+ declare function toolRepoOverview(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
710
+
711
+ declare function toolChangedScope(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
712
+
713
+ declare function toolChangedDiff(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
714
+
715
+ declare function toolModuleContext(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
716
+
717
+ declare function toolSymbolContext(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
718
+
719
+ declare function toolProcessContext(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
720
+
721
+ declare function toolImpactEstimate(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
722
+
723
+ declare function toolWebSearch(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
724
+
725
+ declare function toolWebFetch(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
726
+
727
+ declare function toolCodeSearch(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
728
+
729
+ declare function toolSemanticLookup(input: Record<string, unknown>, ctx: KodaXToolExecutionContext): Promise<string>;
730
730
 
731
731
  /**
732
732
  * FEATURE_089 Phase 3.5 — Sandbox Agent Test Runner.
@@ -1157,77 +1157,6 @@ declare function findByVersion(name: string, version: string): RegisteredToolDef
1157
1157
  */
1158
1158
  declare function listAll(): RegisteredToolDefinition[];
1159
1159
 
1160
- /**
1161
- * FEATURE_089 (v0.7.31) Phase 3.4 — Constructed Agent Resolver.
1162
- *
1163
- * Module-singleton registry mapping `name` → runnable `Agent` for
1164
- * agents that have passed admission and been activated through
1165
- * `ConstructionRuntime.activate()`. Mirrors the way TOOL_REGISTRY
1166
- * holds activated constructed tools, but for agents.
1167
- *
1168
- * Why a separate registry (not in TOOL_REGISTRY):
1169
- *
1170
- * - Tools and Agents are different runtime types. A `KodaXToolDefinition`
1171
- * has `input_schema` + `handler`; an `Agent` has `instructions` +
1172
- * `tools` + `handoffs` + `reasoning`. Conflating them would force
1173
- * consumers to discriminate on every lookup.
1174
- * - Resolution semantics differ: a tool lookup returns the executable
1175
- * handler; an agent lookup returns the declarative spec (Runner.run
1176
- * drives the loop separately).
1177
- *
1178
- * Resolution surface:
1179
- *
1180
- * - `resolveConstructedAgent(name)` — name → Agent | undefined
1181
- * - `listConstructedAgents()` — snapshot of activated agents
1182
- * - `registerConstructedAgent(artifact)` → unregister fn (called by
1183
- * runtime on activate, captured in the runtime's `_activated` map)
1184
- * - `_resetAgentResolverForTesting()` — test isolation
1185
- *
1186
- * Tool / handoff ref resolution:
1187
- * - Tool refs are resolved against TOOL_REGISTRY at activation time —
1188
- * a snapshot. If a referenced tool is later revoked, the agent
1189
- * keeps its stale ref; Phase 3.5 sandbox testing catches this.
1190
- * - Handoff target refs lift to stub Agent objects (`name` only) when
1191
- * the target hasn't been activated yet. Transitive admission ran
1192
- * at test time so the graph is known to be acyclic; runtime
1193
- * traversal just walks the names.
1194
- *
1195
- * Non-goal: full referential consistency between tools / agents /
1196
- * handoffs. The threat model is single-user CLI integrity (DD §14.5);
1197
- * stale refs are an LLM-authoring footgun, not a security bypass.
1198
- */
1199
-
1200
- /**
1201
- * Look up an activated constructed agent by name. Returns the
1202
- * resolved `Agent` (with tools / handoffs lifted from refs). Returns
1203
- * `undefined` when no agent at that name has been activated.
1204
- */
1205
- declare function resolveConstructedAgent(name: string): Agent | undefined;
1206
- /**
1207
- * FEATURE_090 — `true` iff a self-modify activation has been staged
1208
- * for `name` but has not yet been drained into the active registry.
1209
- * Surfaces for tooling that wants to display "next run will use
1210
- * version X" hints, and as a sanity-check assertion in tests.
1211
- */
1212
- declare function hasPendingSwap(name: string): boolean;
1213
- /**
1214
- * FEATURE_090 — promote every pending self-modify entry into
1215
- * `AGENT_REGISTRY`, replacing the prior active version. Returns the
1216
- * names that were drained so the caller can surface a hint
1217
- * ("alpha is now running version 1.1.0").
1218
- *
1219
- * Idempotent: calling on an empty pending map is a no-op. Atomic at
1220
- * the JS event-loop level (a single synchronous pass); drain cannot
1221
- * partially complete.
1222
- *
1223
- * Integration contract: the REPL surface calls this immediately after
1224
- * any top-level `Runner.run` returns. KodaX is single-process and
1225
- * single-user, so "the run that triggered the change" and "all
1226
- * in-flight runs" are the same set — no concurrent-run coordination
1227
- * needed.
1228
- */
1229
- declare function drainPendingSwaps(): readonly string[];
1230
-
1231
1160
  /**
1232
1161
  * FEATURE_191 (v0.7.43) — markdown-defined agent loader.
1233
1162
  *
@@ -1262,6 +1191,7 @@ declare function drainPendingSwaps(): readonly string[];
1262
1191
  * decision. Ignoring them silently keeps user `.md` files
1263
1192
  * forward-compatible across future feature versions.
1264
1193
  */
1194
+
1265
1195
  /**
1266
1196
  * Per-file failure record returned to the boot caller. Mirrors
1267
1197
  * claudecode's `getAgentDefinitionsWithOverrides.failedFiles` shape so
@@ -1291,6 +1221,36 @@ interface LoadAgentsFromMarkdownOptions {
1291
1221
  */
1292
1222
  readonly configHome?: string;
1293
1223
  }
1224
+ interface LoadMarkdownAgentScopeOptions extends LoadAgentsFromMarkdownOptions {
1225
+ /** Stable host-chosen id for diagnostics. Defaults to the resolved project cwd. */
1226
+ readonly id?: string;
1227
+ }
1228
+ interface MarkdownAgentToolFilter {
1229
+ readonly name: string;
1230
+ readonly reason: 'not-registered' | 'admission-clamped';
1231
+ }
1232
+ interface MarkdownAgentLoadWarning {
1233
+ readonly path: string;
1234
+ readonly agentName?: string;
1235
+ readonly reason: string;
1236
+ }
1237
+ interface LoadedMarkdownAgent {
1238
+ readonly name: string;
1239
+ readonly description: string;
1240
+ readonly source: 'markdown:user' | 'markdown:project';
1241
+ readonly path: string;
1242
+ readonly requestedTools?: readonly string[];
1243
+ readonly effectiveTools?: readonly string[];
1244
+ readonly filteredTools: readonly MarkdownAgentToolFilter[];
1245
+ readonly admissionWarnings: readonly string[];
1246
+ }
1247
+ interface LoadMarkdownAgentScopeResult {
1248
+ readonly scope: KodaXAgentScope;
1249
+ readonly loaded: readonly LoadedMarkdownAgent[];
1250
+ readonly failed: readonly MarkdownLoadFailure[];
1251
+ readonly warnings: readonly MarkdownAgentLoadWarning[];
1252
+ dispose(): Promise<void>;
1253
+ }
1294
1254
  /**
1295
1255
  * FEATURE_197 (v0.7.43) — discovered markdown agent metadata.
1296
1256
  *
@@ -1341,6 +1301,7 @@ interface DiscoverMarkdownAgentsResult {
1341
1301
  * not break boot.
1342
1302
  */
1343
1303
  declare function loadAgentsFromMarkdown(opts?: LoadAgentsFromMarkdownOptions): Promise<LoadAgentsFromMarkdownResult>;
1304
+ declare function loadMarkdownAgentScope(opts?: LoadMarkdownAgentScopeOptions): Promise<LoadMarkdownAgentScopeResult>;
1344
1305
  /**
1345
1306
  * FEATURE_197 (v0.7.43) — read-only counterpart to
1346
1307
  * `loadAgentsFromMarkdown`. Scans the same two-tier path (user dir
@@ -5791,5 +5752,5 @@ interface AuthorWorkflowViaWorkerHandle {
5791
5752
  */
5792
5753
  declare function authorWorkflowViaWorker(input: AuthorWorkflowViaWorkerInput): AuthorWorkflowViaWorkerHandle;
5793
5754
 
5794
- 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, CapabilityDeniedError, CapabilityKind, CapabilityProvider, CapabilityResult, KodaXClient as Client, CombinedExtensionRuntime, ConstructionManifestError, DEFAULT_CODING_AGENT_NAME, DEFAULT_DANGEROUS_PATTERNS, DEFAULT_HANDLER_TIMEOUT_MS, 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, ExtensionRuntimeContract, FailureStage, GENERATOR_AGENT_NAME, GoalCompleteResult, Guardrail, KODAX_TOOLS, KODAX_UNDERLYING_CAPABILITY_TOPICS, KodaXBaseProvider, KodaXChildContextBundle, KodaXClient, KodaXContentBlock, KodaXContextOptions, KodaXEvents, KodaXExecutionMode, KodaXExtensionRuntime, KodaXExtensionSessionRecord, KodaXInputArtifact, KodaXJsonValue, KodaXManualTopic, KodaXManualTopicId, KodaXMessage, KodaXOptions, KodaXProviderCapabilityProfile, KodaXProviderPolicyHints, KodaXReasoningCapability, KodaXReasoningMode, KodaXRepoIntelligenceCapability, KodaXRepoIntelligenceMode, KodaXRepoIntelligenceResolvedMode, KodaXRepoIntelligenceTrace, KodaXRepoRoutingSignals, KodaXResult, KodaXSessionControl, KodaXSessionError, KodaXSessionMutators, KodaXTaskRoutingDecision, KodaXTaskType, KodaXTerminalError, KodaXThinkingDepth, KodaXTimeoutConfig, KodaXTokenUsage, KodaXToolDefinition, KodaXToolError, KodaXToolExecutionContext, KodaXToolUseBlock, KodaXWireReasoningEffort, 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, ResilienceClassification, ResolveKodaXManualInput, ResolveKodaXManualOptions, ResolveKodaXManualResult, RuntimeDefaultsSnapshot, SCOUT_AGENT_NAME, SCOUT_THEN_AUTHOR_PROMPT_LINES, SELF_KNOWLEDGE_ROUTING_RULE, SYSTEM_PROMPT, SYSTEM_WORKFLOW_LIMITS, SessionErrorMetadata, SignalCollector, StableBoundaryTracker, TASK_ENGINE_ROLE_AGENTS, TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME, TRACING_ENV, ToolCallSignal, ToolSideEffect, WORKER_AGENT_NAME, WORKFLOW_GENERATION_SYSTEM_PROMPT, WorkflowEventCorrelation, WorkflowHostPolicy, _resetRuntimeForTesting, activate, analyzeChangedScope, appendAuditEntry, applyAccountingDelta, 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, buildScoutThenAuthorPrompt, buildSelfKnowledgeRoutingRule, buildSystemPrompt, buildSystemPromptSnapshot, buildWorkflowGenerationSkillContext, buildWorkflowGenerationUserPrompt, checkAbsoluteDeny, checkIncompleteToolCalls, checkPromiseSignal, clampWorkflowLimits, classify, classifyBashCommand, classifyError, classifyResilienceError, combineExtensionRuntimes, computeInputSignature, configureRuntime, convertCapabilityReadResult, convertProviderSearchResults, createBashClassifierConfig, createBuiltinToolDefinition, createCodingWorkflowBackend, createCtxProxy, createDefaultCodingAgent, createDenialTracker, createExtensionRuntime, createKodaXTaskRunner, createPromptSection, createReasoningPlan, createRunGraphWriter, createSessionControl, createToolResultTruncationGuardrail, createWorkflowLifecycleController, createWorkflowPatternTemplateModule, createWorkflowRunManager, dedupeExtensionPathsByEntrypoint, defaultPolicy, deleteSavedWorkflow, disableSelfModify, discoverDefaultExtensions, discoverExtensionsInDirectory, discoverExtensionsInDirectoryDetailed, discoverMarkdownAgents, discoverSavedWorkflows, drainPendingSwaps, emitVerdict, emitWorkflowAgentDigest, ensureBuiltinRepoExplorerAgent, evaluateProviderPolicy, excludeExtensionPathsByEntrypoint, exec, 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, hasPendingSwap, inferTaskType, inspectEditFailure, inspectRepoIntelligenceRuntime, isDeniedRecently, isParallelDispatchDirective, isSessionRecoveryCandidateError, isSupportedExtensionModulePath, isToolFileMutation, isToolMutation, isToolNetworkRead, isToolPlanModeAllowed, isValidTokenBudget, languageIdForPath, listAll, list as listArtifacts, listBuiltinToolDefinitions, listBuiltinWorkflows, listConstructed, listToolDefinitions, listTools, listWorkflowPatternTemplates, loadAgentsFromMarkdown, loadGeneratedWorkflowFromRun, loadHandler, loadSavedWorkflow, loadSavedWorkflowCapsule, mcpRootsFromWorkspace, normalizeWorkflowModule, orderPromptSections, parallelInvestigation, parseClassifierOutput, parseEditToolError, parseLlmReviewVerdict, parseModelSpec, 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, resolveConstructedAgent, resolveExtensionEntrypoint, resolveKodaXManual, resolveReasoningMode, resolveRepoIntelligenceMode, resolveRepoIntelligenceRuntimeConfig, resolveResilienceConfig, resolveToolCapability, resolveWorkflowGenerationTimeoutMs, resolveWorkflowIdentity, revoke, rollbackSelfModify, runAstRules, runKodaX, runLlmReview, runManagedTask, runOrchestration, runWorkflowFromOptions, runWorkflowModule, safeWorkflowArtifactName, saveGeneratedWorkflow, saveGeneratedWorkflowFromRun, 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, webhook, withManualToolBranding, workerAgent };
5795
- export type { AbsoluteDenyMatch, AbsoluteDenyMiss, AbsoluteDenyResult, AgentArtifact, ArtifactStatus, AstCheckResult, AstRuleId, AstRuleViolation, AuditEntry, AuditEventKind, AuthorWorkflowViaWorkerHandle, AuthorWorkflowViaWorkerInput, BashClassificationResult, BashClassifierConfig, BashRiskLevel, BlockerAttemptResult, BootstrapTracingOptions, BudgetState, BuildClassifierPromptInput, BuildPromptInput, Capabilities, ChangedFileEntry, ChangedFileStatus, ChangedScopeAreaSummary, ChangedScopeReport, ClassifierDecision, ClassifierPrompt, ClassifyDecision, ClassifyOptions, CodingWorkflowBackendDeps, ConstructionArtifact, ConstructionPolicy, ConstructionPolicyVerdict, CreateCtxProxyOptions, CreateKodaXTaskRunnerOptions, CreateWorkflowLifecycleControllerOptions, DeleteSavedWorkflowInput, DeleteWorkflowRunOptions, DenialRecord, DenialTracker, DisableState, DiscoverMarkdownAgentsResult, DiscoveredMarkdownAgent, EditRecoveryDiagnostic, EditToolErrorCode, ErrorClassification, ExecOptions, ExecResult, ExtensionCommandContext, ExtensionCommandDefinition, ExtensionCommandInvocation, ExtensionCommandResult, ExtensionContributionSource, ExtensionDiscoveryResult, ExtensionDiscoverySkipReason, ExtensionEventMap, ExtensionFailureDiagnostic, ExtensionFailureStage, ExtensionHookMap, ExtensionLoadSource, ExtensionLogger, ExtensionRuntimeController, ExtensionRuntimeDiagnostics, ExtensionToolBeforeHookContext, GenerateWorkflowFromOptionsInput, GenerateWorkflowInput, GeneratedWorkflow, GoalCompletionVerifier, ImpactEstimateResult, InvestigationFinding, KodaXAgentWorkerSpec, KodaXExtensionAPI, KodaXExtensionActivationResult, KodaXExtensionModule, KodaXPromptSection, KodaXPromptSectionDefinition, KodaXPromptSectionSlot, KodaXPromptSectionStability, KodaXPromptSnapshot, KodaXPromptSnapshotMetadata, KodaXProviderCapabilitySnapshot, KodaXProviderPolicyDecision, KodaXProviderPolicyIssue, KodaXProviderPolicyIssueSeverity, KodaXProviderSourceKind, KodaXRetrievalArtifact, KodaXRetrievalFreshness, KodaXRetrievalItem, KodaXRetrievalResult, KodaXRetrievalScope, KodaXRetrievalToolName, KodaXRetrievalTrust, LanguageCapabilityTier, LlmReviewClient, LlmReviewResult, LlmReviewVerdict, LoadAgentsFromMarkdownOptions, LoadAgentsFromMarkdownResult, LoadGeneratedWorkflowFromRunInput, LoadHandlerOptions, LoadHandlerScope, LoadedExtensionDiagnostic, LoadedGeneratedWorkflowFromRun, LocalToolDefinition, ManagedWorkflowRun, ManagedWorkflowSnapshot, ManagedWorkflowSource, MarkdownLoadFailure, McpReverseWorkspace, ModelProviderRegistration, 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, RegisteredCapabilityProviderDiagnostic, RegisteredCommandDiagnostic, RegisteredHookDiagnostic, RegisteredToolDefinition, RegisteredToolDiagnostic, RenameSavedWorkflowInput, ReplaceSavedWorkflowInput, ReplaceSavedWorkflowResult, RepoAreaKind, RepoAreaOverview, RepoIntelligenceIndex, RepoIntelligenceRuntimeInspection, RepoLanguageId, RepoLanguageSupport, RepoOverview, RepoSymbolKind, RepoSymbolRecord, RepoSymbolReference, ResolveClassifierModelOptions, ResolveSource, ResolvedClassifierModel, RollbackResult, RunGraphWriter, RunGraphWriterDeps, RunJsonInput, RunWorkflowFromOptionsInput, RunWorkflowModuleOptions, RunWorkflowModuleOutcome, RunningSession, SaveGeneratedWorkflowFromRunInput, SaveGeneratedWorkflowInput, SavedGeneratedWorkflowFile, SavedWorkflowDirs, SavedWorkflowExecution, SavedWorkflowRef, SavedWorkflowSource, SchemaProvider, SchemaValidationResult, ScriptSource, SelfModifyAskUser, SelfModifyAskUserInput, SelfModifyDiffSeverity, SelfModifyDiffSummary, SkippedExtensionDiscoveryEntry, SpeculativeResult, StagedHandle, StartManagedWorkflowInput, StartManagedWorkflowResult, StripOptions, SymbolContextResult, TestArtifactOptions, TestResult, TierZeroPatternId, ToolContent, ToolDefinitionSource, ToolHandler, ToolRegistrationOptions, ToolRegistry, VerifyGoalCompletionOptions, WebhookOptions, WebhookResult, WorkflowCapsulePreflightEnvironment, WorkflowCapsulePreflightInput, WorkflowCapsulePreflightIssue, WorkflowCapsulePreflightResult, WorkflowChildOptions, WorkflowGenerationResult, WorkflowGenerationTextFn, WorkflowGenerationTextRequest, WorkflowIdentityResolution, WorkflowIdentityResolverInput, WorkflowLifecycleController, WorkflowPatternTemplate, WorkflowRunListOptions, WorkflowRunManager, WorkflowRunProcessMetadata, WorkflowRunRetentionOptions, WorkflowRunRetentionResult, WorkflowScriptSnapshotInput, WorkflowScriptSnapshotRef };
5755
+ 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, CapabilityDeniedError, CapabilityKind, CapabilityProvider, CapabilityResult, KodaXClient as Client, CombinedExtensionRuntime, ConstructionManifestError, DEFAULT_CODING_AGENT_NAME, DEFAULT_DANGEROUS_PATTERNS, DEFAULT_HANDLER_TIMEOUT_MS, 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, ExtensionRuntimeContract, FailureStage, GENERATOR_AGENT_NAME, GoalCompleteResult, Guardrail, KODAX_TOOLS, KODAX_UNDERLYING_CAPABILITY_TOPICS, KodaXAgentScope, KodaXBaseProvider, KodaXChildContextBundle, KodaXClient, KodaXContentBlock, KodaXContextOptions, KodaXEvents, KodaXExecutionMode, KodaXExtensionRuntime, KodaXExtensionSessionRecord, KodaXInputArtifact, KodaXJsonValue, KodaXManualTopic, KodaXManualTopicId, KodaXMessage, KodaXOptions, KodaXProviderCapabilityProfile, KodaXProviderPolicyHints, KodaXReasoningCapability, KodaXReasoningMode, KodaXRepoIntelligenceCapability, KodaXRepoIntelligenceMode, KodaXRepoIntelligenceResolvedMode, KodaXRepoIntelligenceTrace, KodaXRepoRoutingSignals, KodaXResult, KodaXSessionControl, KodaXSessionError, KodaXSessionMutators, KodaXTaskRoutingDecision, KodaXTaskType, KodaXTerminalError, KodaXThinkingDepth, KodaXTimeoutConfig, KodaXTokenUsage, KodaXToolDefinition, KodaXToolError, KodaXToolExecutionContext, KodaXToolUseBlock, KodaXWireReasoningEffort, 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, ResilienceClassification, ResolveKodaXManualInput, ResolveKodaXManualOptions, ResolveKodaXManualResult, RuntimeDefaultsSnapshot, SCOUT_AGENT_NAME, SCOUT_THEN_AUTHOR_PROMPT_LINES, SELF_KNOWLEDGE_ROUTING_RULE, SYSTEM_PROMPT, SYSTEM_WORKFLOW_LIMITS, SessionErrorMetadata, SignalCollector, StableBoundaryTracker, TASK_ENGINE_ROLE_AGENTS, TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME, TRACING_ENV, ToolCallSignal, ToolSideEffect, WORKER_AGENT_NAME, WORKFLOW_GENERATION_SYSTEM_PROMPT, WorkflowEventCorrelation, WorkflowHostPolicy, _resetRuntimeForTesting, activate, analyzeChangedScope, appendAuditEntry, applyAccountingDelta, 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, buildScoutThenAuthorPrompt, buildSelfKnowledgeRoutingRule, buildSystemPrompt, buildSystemPromptSnapshot, buildWorkflowGenerationSkillContext, buildWorkflowGenerationUserPrompt, checkAbsoluteDeny, checkIncompleteToolCalls, checkPromiseSignal, clampWorkflowLimits, classify, classifyBashCommand, classifyError, classifyResilienceError, combineExtensionRuntimes, computeInputSignature, configureRuntime, convertCapabilityReadResult, convertProviderSearchResults, createBashClassifierConfig, createBuiltinToolDefinition, createCodingWorkflowBackend, createCtxProxy, createDefaultCodingAgent, createDenialTracker, createExtensionRuntime, createKodaXTaskRunner, createPromptSection, createReasoningPlan, createRunGraphWriter, createSessionControl, createToolResultTruncationGuardrail, createWorkflowLifecycleController, createWorkflowPatternTemplateModule, createWorkflowRunManager, dedupeExtensionPathsByEntrypoint, defaultPolicy, deleteSavedWorkflow, disableSelfModify, discoverDefaultExtensions, discoverExtensionsInDirectory, discoverExtensionsInDirectoryDetailed, discoverMarkdownAgents, discoverSavedWorkflows, emitVerdict, emitWorkflowAgentDigest, ensureBuiltinRepoExplorerAgent, evaluateProviderPolicy, excludeExtensionPathsByEntrypoint, exec, 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, listConstructed, listToolDefinitions, listTools, listWorkflowPatternTemplates, loadAgentsFromMarkdown, loadGeneratedWorkflowFromRun, loadHandler, loadMarkdownAgentScope, loadSavedWorkflow, loadSavedWorkflowCapsule, mcpRootsFromWorkspace, normalizeWorkflowModule, orderPromptSections, parallelInvestigation, parseClassifierOutput, parseEditToolError, parseLlmReviewVerdict, parseModelSpec, 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, resolveExtensionEntrypoint, resolveKodaXManual, resolveReasoningMode, resolveRepoIntelligenceMode, resolveRepoIntelligenceRuntimeConfig, resolveResilienceConfig, resolveToolCapability, resolveWorkflowGenerationTimeoutMs, resolveWorkflowIdentity, revoke, rollbackSelfModify, runAstRules, runKodaX, runLlmReview, runManagedTask, runOrchestration, runWorkflowFromOptions, runWorkflowModule, safeWorkflowArtifactName, saveGeneratedWorkflow, saveGeneratedWorkflowFromRun, 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, webhook, withManualToolBranding, workerAgent };
5756
+ export type { AbsoluteDenyMatch, AbsoluteDenyMiss, AbsoluteDenyResult, AgentArtifact, ArtifactStatus, AstCheckResult, AstRuleId, AstRuleViolation, AuditEntry, AuditEventKind, AuthorWorkflowViaWorkerHandle, AuthorWorkflowViaWorkerInput, BashClassificationResult, BashClassifierConfig, BashRiskLevel, BlockerAttemptResult, BootstrapTracingOptions, BudgetState, BuildClassifierPromptInput, BuildPromptInput, Capabilities, ChangedFileEntry, ChangedFileStatus, ChangedScopeAreaSummary, ChangedScopeReport, ClassifierDecision, ClassifierPrompt, ClassifyDecision, ClassifyOptions, CodingWorkflowBackendDeps, ConstructionArtifact, ConstructionPolicy, ConstructionPolicyVerdict, CreateCtxProxyOptions, CreateKodaXTaskRunnerOptions, CreateWorkflowLifecycleControllerOptions, DeleteSavedWorkflowInput, DeleteWorkflowRunOptions, DenialRecord, DenialTracker, DisableState, DiscoverMarkdownAgentsResult, DiscoveredMarkdownAgent, EditRecoveryDiagnostic, EditToolErrorCode, ErrorClassification, ExecOptions, ExecResult, ExtensionCommandContext, ExtensionCommandDefinition, ExtensionCommandInvocation, ExtensionCommandResult, ExtensionContributionSource, ExtensionDiscoveryResult, ExtensionDiscoverySkipReason, ExtensionEventMap, ExtensionFailureDiagnostic, ExtensionFailureStage, ExtensionHookMap, ExtensionLoadSource, ExtensionLogger, ExtensionRuntimeController, ExtensionRuntimeDiagnostics, ExtensionToolBeforeHookContext, GenerateWorkflowFromOptionsInput, GenerateWorkflowInput, GeneratedWorkflow, GoalCompletionVerifier, ImpactEstimateResult, InvestigationFinding, KodaXAgentWorkerSpec, KodaXExtensionAPI, KodaXExtensionActivationResult, KodaXExtensionModule, KodaXPromptSection, KodaXPromptSectionDefinition, KodaXPromptSectionSlot, KodaXPromptSectionStability, KodaXPromptSnapshot, KodaXPromptSnapshotMetadata, KodaXProviderCapabilitySnapshot, KodaXProviderPolicyDecision, KodaXProviderPolicyIssue, KodaXProviderPolicyIssueSeverity, KodaXProviderSourceKind, KodaXRetrievalArtifact, KodaXRetrievalFreshness, KodaXRetrievalItem, KodaXRetrievalResult, KodaXRetrievalScope, KodaXRetrievalToolName, KodaXRetrievalTrust, LanguageCapabilityTier, LlmReviewClient, LlmReviewResult, LlmReviewVerdict, LoadAgentsFromMarkdownOptions, LoadAgentsFromMarkdownResult, LoadGeneratedWorkflowFromRunInput, LoadHandlerOptions, LoadHandlerScope, LoadMarkdownAgentScopeOptions, LoadMarkdownAgentScopeResult, LoadedExtensionDiagnostic, LoadedGeneratedWorkflowFromRun, LoadedMarkdownAgent, LocalToolDefinition, ManagedWorkflowRun, ManagedWorkflowSnapshot, ManagedWorkflowSource, MarkdownAgentLoadWarning, MarkdownAgentToolFilter, MarkdownLoadFailure, McpReverseWorkspace, ModelProviderRegistration, 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, RegisteredCapabilityProviderDiagnostic, RegisteredCommandDiagnostic, RegisteredHookDiagnostic, RegisteredToolDefinition, RegisteredToolDiagnostic, RenameSavedWorkflowInput, ReplaceSavedWorkflowInput, ReplaceSavedWorkflowResult, RepoAreaKind, RepoAreaOverview, RepoIntelligenceIndex, RepoIntelligenceRuntimeInspection, RepoLanguageId, RepoLanguageSupport, RepoOverview, RepoSymbolKind, RepoSymbolRecord, RepoSymbolReference, ResolveClassifierModelOptions, ResolveSource, ResolvedClassifierModel, RollbackResult, RunGraphWriter, RunGraphWriterDeps, RunJsonInput, RunWorkflowFromOptionsInput, RunWorkflowModuleOptions, RunWorkflowModuleOutcome, RunningSession, SaveGeneratedWorkflowFromRunInput, SaveGeneratedWorkflowInput, SavedGeneratedWorkflowFile, SavedWorkflowDirs, SavedWorkflowExecution, SavedWorkflowRef, SavedWorkflowSource, SchemaProvider, SchemaValidationResult, ScriptSource, SelfModifyAskUser, SelfModifyAskUserInput, SelfModifyDiffSeverity, SelfModifyDiffSummary, SkippedExtensionDiscoveryEntry, SpeculativeResult, StagedHandle, StartManagedWorkflowInput, StartManagedWorkflowResult, StripOptions, SymbolContextResult, TestArtifactOptions, TestResult, TierZeroPatternId, ToolContent, ToolDefinitionSource, ToolHandler, ToolRegistrationOptions, ToolRegistry, VerifyGoalCompletionOptions, WebhookOptions, WebhookResult, WorkflowCapsulePreflightEnvironment, WorkflowCapsulePreflightInput, WorkflowCapsulePreflightIssue, WorkflowCapsulePreflightResult, WorkflowChildOptions, WorkflowGenerationResult, WorkflowGenerationTextFn, WorkflowGenerationTextRequest, WorkflowIdentityResolution, WorkflowIdentityResolverInput, WorkflowLifecycleController, WorkflowPatternTemplate, WorkflowRunListOptions, WorkflowRunManager, WorkflowRunProcessMetadata, WorkflowRunRetentionOptions, WorkflowRunRetentionResult, WorkflowScriptSnapshotInput, WorkflowScriptSnapshotRef };