@theokit/sdk 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/a2a/index.cjs +152 -35
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +152 -35
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-C2jWAvlQ.d.cts → cron-4u1UdmgC.d.cts} +1 -1
- package/dist/{cron-BLRe166v.d.ts → cron-DuhVPer6.d.ts} +1 -1
- package/dist/cron.cjs +152 -35
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +152 -35
- package/dist/cron.js.map +1 -1
- package/dist/{errors-D_Bfo30u.d.ts → errors-_fPS0X80.d.ts} +1 -1
- package/dist/{errors-DZpCGlYv.d.cts → errors-jxK4yfp5.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +152 -35
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +152 -35
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +152 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +152 -35
- package/dist/index.js.map +1 -1
- package/dist/internal/runtime/context/context-discovery.d.ts +1 -1
- package/dist/internal/runtime/context/context-glob.d.ts +1 -0
- package/dist/internal/runtime/context/context-manager.d.ts +18 -1
- package/dist/internal/runtime/context/context-mdc-parser.d.ts +7 -6
- package/dist/internal/runtime/context/context-rules-frontmatter.d.ts +30 -0
- package/dist/internal/runtime/context/context-yaml-lite.d.ts +26 -0
- package/dist/project.cjs.map +1 -1
- package/dist/project.js.map +1 -1
- package/dist/{run-CLXKMRgq.d.cts → run-CrHz9BAP.d.cts} +9 -0
- package/dist/{run-CLXKMRgq.d.ts → run-CrHz9BAP.d.ts} +9 -0
- package/dist/types/run.d.ts +9 -0
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-
|
|
2
|
-
export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-
|
|
3
|
-
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as ProviderProfile, m as Plugin, I as InlineSkill, n as ConversationStorageAdapter, o as StoredMessage, p as SessionMeta, q as SessionMetaPatch, O as ObjectiveRecord, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as StepResult, v as SDKProvider } from './cron-
|
|
4
|
-
export { w as ActiveMemoryPassArgs, x as ActiveMemoryPassResult, y as AgentGoalConfig, z as AgentMemory, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, J as CloudRepo, K as ContextBudget, N as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as Cron, W as CronCreateOptions, X as CronGetOptions, Y as CronJob, Z as CronJobStatus, _ as CronListOptions, $ as CronOperationOptions, a0 as CronRunOptions, a1 as CronRuntime, a2 as CronSchedulerStatus, a3 as CronStartOptions, a4 as DurableGoalOptions, a5 as GoalEvent, a6 as GoalOptions, a7 as GoalResult, a8 as HookName, a9 as InvalidateCacheOptions, aa as MemoryAdapter, ab as MemoryAdapterCapabilities, ac as MemoryContext, ad as MemoryFact, ae as MemoryProviderHandle, af as MemoryProviderInitOptions, ag as MemoryRevision, ah as MemoryToolSchema, ai as MemoryTurnMessage, aj as ObjectiveStatus, ak as PersonalityPreset, al as PluginContext, am as PostAssistantReplyContext, an as PreToolCallContext, ao as PreUserSendContext, ap as PreUserSendResult, aq as ProviderCapability, ar as ProviderRoute, as as RecordSessionSummaryArgs, at as ResolvedProviderRoute, au as RunUntilIterator, av as SDKAgentPlugins, aw as SDKAgentSkillDetail, ax as SDKAgentSkills, ay as SDKArtifact, az as SDKContextManager, aA as SDKPluginMetadata, aB as SDKProvidersManager, aC as SettingSource, aD as Skill, aE as SkillsResolver, aF as SkillsResolverContext, aG as SystemPromptContext, aH as SystemPromptMemoryFact, aI as SystemPromptSkillRef, aJ as TelemetrySettings } from './cron-
|
|
5
|
-
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, S as SDKMessage } from './run-
|
|
6
|
-
export { A as AgentConversationTurn, c as AssistantMessage, d as CompletionCheck, e as CompletionCheckResult, f as ConversationStep, g as ConversationTurn, h as CostBreakdown, i as CostSource, j as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, k as GenerateRunResult, I as ImageBlock, l as InputProcessorContext, m as InteractionUpdate, n as McpAuthConfig, o as McpHttpServerConfig, p as McpOAuthConfig, q as McpStdioServerConfig, r as MessageOrigin, s as ModelParameterValue, O as OutputProcessorContext, t as PartialToolCallUpdate, u as ProcessorControls, v as ProcessorTripwire, w as ProcessorViolation, x as RunCompactBoundaryEvent, y as RunCompletionCheckEvent, z as RunErrorDetail, B as RunEvent, E as RunEventSink, F as RunGitInfo, H as RunOperation, J as RunPermissionDeniedEvent, K as RunRateLimitEvent, L as RunStatus, N as RunTaskCompletedEvent, Q as RunTaskStartedEvent, U as RunTaskUpdatedEvent, V as RunToCompletionOptions, W as RunToCompletionResult, X as RunToolProgressEvent, Y as RunTripwireEvent, Z as SDKAssistantMessage, _ as SDKImage, $ as SDKImageDimension, a0 as SDKObjectDelta, a1 as SDKRequestMessage, a2 as SDKStatusMessage, a3 as SDKSystemMessage, a4 as SDKTaskMessage, a5 as SDKThinkingMessage, a6 as SDKToolUseMessage, a7 as SDKUserMessage, a8 as SDKUserMessageEvent, a9 as SendOptions, aa as ShellCommand, ab as ShellConversationTurn, ac as ShellOutput, ad as ShellOutputDeltaUpdate, ae as StepCompletedUpdate, af as StepStartedUpdate, ag as StreamToCompletionResult, ah as SummaryCompletedUpdate, ai as SummaryStartedUpdate, aj as SummaryUpdate, ak as TextBlock, al as TextDeltaUpdate, am as ThinkingCompletedUpdate, an as ThinkingDeltaUpdate, ao as ThinkingMessage, ap as TokenDeltaUpdate, aq as TokenUsage, ar as ToolCall, as as ToolCallCompletedUpdate, at as ToolCallStartedUpdate, au as ToolContextMessage, av as ToolResult, aw as ToolResultGuardOptions, ax as ToolUseBlock, ay as TurnEndedUpdate, az as UserMessage, aA as UserMessageAppendedUpdate, aB as emitRunEvent } from './run-
|
|
1
|
+
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-jxK4yfp5.cjs';
|
|
2
|
+
export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-jxK4yfp5.cjs';
|
|
3
|
+
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as ProviderProfile, m as Plugin, I as InlineSkill, n as ConversationStorageAdapter, o as StoredMessage, p as SessionMeta, q as SessionMetaPatch, O as ObjectiveRecord, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as StepResult, v as SDKProvider } from './cron-4u1UdmgC.cjs';
|
|
4
|
+
export { w as ActiveMemoryPassArgs, x as ActiveMemoryPassResult, y as AgentGoalConfig, z as AgentMemory, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, J as CloudRepo, K as ContextBudget, N as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as Cron, W as CronCreateOptions, X as CronGetOptions, Y as CronJob, Z as CronJobStatus, _ as CronListOptions, $ as CronOperationOptions, a0 as CronRunOptions, a1 as CronRuntime, a2 as CronSchedulerStatus, a3 as CronStartOptions, a4 as DurableGoalOptions, a5 as GoalEvent, a6 as GoalOptions, a7 as GoalResult, a8 as HookName, a9 as InvalidateCacheOptions, aa as MemoryAdapter, ab as MemoryAdapterCapabilities, ac as MemoryContext, ad as MemoryFact, ae as MemoryProviderHandle, af as MemoryProviderInitOptions, ag as MemoryRevision, ah as MemoryToolSchema, ai as MemoryTurnMessage, aj as ObjectiveStatus, ak as PersonalityPreset, al as PluginContext, am as PostAssistantReplyContext, an as PreToolCallContext, ao as PreUserSendContext, ap as PreUserSendResult, aq as ProviderCapability, ar as ProviderRoute, as as RecordSessionSummaryArgs, at as ResolvedProviderRoute, au as RunUntilIterator, av as SDKAgentPlugins, aw as SDKAgentSkillDetail, ax as SDKAgentSkills, ay as SDKArtifact, az as SDKContextManager, aA as SDKPluginMetadata, aB as SDKProvidersManager, aC as SettingSource, aD as Skill, aE as SkillsResolver, aF as SkillsResolverContext, aG as SystemPromptContext, aH as SystemPromptMemoryFact, aI as SystemPromptSkillRef, aJ as TelemetrySettings } from './cron-4u1UdmgC.cjs';
|
|
5
|
+
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, S as SDKMessage } from './run-CrHz9BAP.cjs';
|
|
6
|
+
export { A as AgentConversationTurn, c as AssistantMessage, d as CompletionCheck, e as CompletionCheckResult, f as ConversationStep, g as ConversationTurn, h as CostBreakdown, i as CostSource, j as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, k as GenerateRunResult, I as ImageBlock, l as InputProcessorContext, m as InteractionUpdate, n as McpAuthConfig, o as McpHttpServerConfig, p as McpOAuthConfig, q as McpStdioServerConfig, r as MessageOrigin, s as ModelParameterValue, O as OutputProcessorContext, t as PartialToolCallUpdate, u as ProcessorControls, v as ProcessorTripwire, w as ProcessorViolation, x as RunCompactBoundaryEvent, y as RunCompletionCheckEvent, z as RunErrorDetail, B as RunEvent, E as RunEventSink, F as RunGitInfo, H as RunOperation, J as RunPermissionDeniedEvent, K as RunRateLimitEvent, L as RunStatus, N as RunTaskCompletedEvent, Q as RunTaskStartedEvent, U as RunTaskUpdatedEvent, V as RunToCompletionOptions, W as RunToCompletionResult, X as RunToolProgressEvent, Y as RunTripwireEvent, Z as SDKAssistantMessage, _ as SDKImage, $ as SDKImageDimension, a0 as SDKObjectDelta, a1 as SDKRequestMessage, a2 as SDKStatusMessage, a3 as SDKSystemMessage, a4 as SDKTaskMessage, a5 as SDKThinkingMessage, a6 as SDKToolUseMessage, a7 as SDKUserMessage, a8 as SDKUserMessageEvent, a9 as SendOptions, aa as ShellCommand, ab as ShellConversationTurn, ac as ShellOutput, ad as ShellOutputDeltaUpdate, ae as StepCompletedUpdate, af as StepStartedUpdate, ag as StreamToCompletionResult, ah as SummaryCompletedUpdate, ai as SummaryStartedUpdate, aj as SummaryUpdate, ak as TextBlock, al as TextDeltaUpdate, am as ThinkingCompletedUpdate, an as ThinkingDeltaUpdate, ao as ThinkingMessage, ap as TokenDeltaUpdate, aq as TokenUsage, ar as ToolCall, as as ToolCallCompletedUpdate, at as ToolCallStartedUpdate, au as ToolContextMessage, av as ToolResult, aw as ToolResultGuardOptions, ax as ToolUseBlock, ay as TurnEndedUpdate, az as UserMessage, aA as UserMessageAppendedUpdate, aB as emitRunEvent } from './run-CrHz9BAP.cjs';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-
|
|
2
|
-
export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-
|
|
3
|
-
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as ProviderProfile, m as Plugin, I as InlineSkill, n as ConversationStorageAdapter, o as StoredMessage, p as SessionMeta, q as SessionMetaPatch, O as ObjectiveRecord, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as StepResult, v as SDKProvider } from './cron-
|
|
4
|
-
export { w as ActiveMemoryPassArgs, x as ActiveMemoryPassResult, y as AgentGoalConfig, z as AgentMemory, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, J as CloudRepo, K as ContextBudget, N as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as Cron, W as CronCreateOptions, X as CronGetOptions, Y as CronJob, Z as CronJobStatus, _ as CronListOptions, $ as CronOperationOptions, a0 as CronRunOptions, a1 as CronRuntime, a2 as CronSchedulerStatus, a3 as CronStartOptions, a4 as DurableGoalOptions, a5 as GoalEvent, a6 as GoalOptions, a7 as GoalResult, a8 as HookName, a9 as InvalidateCacheOptions, aa as MemoryAdapter, ab as MemoryAdapterCapabilities, ac as MemoryContext, ad as MemoryFact, ae as MemoryProviderHandle, af as MemoryProviderInitOptions, ag as MemoryRevision, ah as MemoryToolSchema, ai as MemoryTurnMessage, aj as ObjectiveStatus, ak as PersonalityPreset, al as PluginContext, am as PostAssistantReplyContext, an as PreToolCallContext, ao as PreUserSendContext, ap as PreUserSendResult, aq as ProviderCapability, ar as ProviderRoute, as as RecordSessionSummaryArgs, at as ResolvedProviderRoute, au as RunUntilIterator, av as SDKAgentPlugins, aw as SDKAgentSkillDetail, ax as SDKAgentSkills, ay as SDKArtifact, az as SDKContextManager, aA as SDKPluginMetadata, aB as SDKProvidersManager, aC as SettingSource, aD as Skill, aE as SkillsResolver, aF as SkillsResolverContext, aG as SystemPromptContext, aH as SystemPromptMemoryFact, aI as SystemPromptSkillRef, aJ as TelemetrySettings } from './cron-
|
|
5
|
-
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, S as SDKMessage } from './run-
|
|
6
|
-
export { A as AgentConversationTurn, c as AssistantMessage, d as CompletionCheck, e as CompletionCheckResult, f as ConversationStep, g as ConversationTurn, h as CostBreakdown, i as CostSource, j as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, k as GenerateRunResult, I as ImageBlock, l as InputProcessorContext, m as InteractionUpdate, n as McpAuthConfig, o as McpHttpServerConfig, p as McpOAuthConfig, q as McpStdioServerConfig, r as MessageOrigin, s as ModelParameterValue, O as OutputProcessorContext, t as PartialToolCallUpdate, u as ProcessorControls, v as ProcessorTripwire, w as ProcessorViolation, x as RunCompactBoundaryEvent, y as RunCompletionCheckEvent, z as RunErrorDetail, B as RunEvent, E as RunEventSink, F as RunGitInfo, H as RunOperation, J as RunPermissionDeniedEvent, K as RunRateLimitEvent, L as RunStatus, N as RunTaskCompletedEvent, Q as RunTaskStartedEvent, U as RunTaskUpdatedEvent, V as RunToCompletionOptions, W as RunToCompletionResult, X as RunToolProgressEvent, Y as RunTripwireEvent, Z as SDKAssistantMessage, _ as SDKImage, $ as SDKImageDimension, a0 as SDKObjectDelta, a1 as SDKRequestMessage, a2 as SDKStatusMessage, a3 as SDKSystemMessage, a4 as SDKTaskMessage, a5 as SDKThinkingMessage, a6 as SDKToolUseMessage, a7 as SDKUserMessage, a8 as SDKUserMessageEvent, a9 as SendOptions, aa as ShellCommand, ab as ShellConversationTurn, ac as ShellOutput, ad as ShellOutputDeltaUpdate, ae as StepCompletedUpdate, af as StepStartedUpdate, ag as StreamToCompletionResult, ah as SummaryCompletedUpdate, ai as SummaryStartedUpdate, aj as SummaryUpdate, ak as TextBlock, al as TextDeltaUpdate, am as ThinkingCompletedUpdate, an as ThinkingDeltaUpdate, ao as ThinkingMessage, ap as TokenDeltaUpdate, aq as TokenUsage, ar as ToolCall, as as ToolCallCompletedUpdate, at as ToolCallStartedUpdate, au as ToolContextMessage, av as ToolResult, aw as ToolResultGuardOptions, ax as ToolUseBlock, ay as TurnEndedUpdate, az as UserMessage, aA as UserMessageAppendedUpdate, aB as emitRunEvent } from './run-
|
|
1
|
+
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-_fPS0X80.js';
|
|
2
|
+
export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-_fPS0X80.js';
|
|
3
|
+
import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as ProviderProfile, m as Plugin, I as InlineSkill, n as ConversationStorageAdapter, o as StoredMessage, p as SessionMeta, q as SessionMetaPatch, O as ObjectiveRecord, B as BudgetTracker, r as MemoryProvider, s as MemoryId, t as PreToolCallDecision, u as StepResult, v as SDKProvider } from './cron-DuhVPer6.js';
|
|
4
|
+
export { w as ActiveMemoryPassArgs, x as ActiveMemoryPassResult, y as AgentGoalConfig, z as AgentMemory, D as BudgetCheck, E as BudgetTotal, F as BudgetUsageEvent, H as CloudEnv, J as CloudRepo, K as ContextBudget, N as ContextManagerKind, Q as ContextSnapshot, R as ContextSource, T as ContextSourceStatus, U as CreateSkillSpec, V as Cron, W as CronCreateOptions, X as CronGetOptions, Y as CronJob, Z as CronJobStatus, _ as CronListOptions, $ as CronOperationOptions, a0 as CronRunOptions, a1 as CronRuntime, a2 as CronSchedulerStatus, a3 as CronStartOptions, a4 as DurableGoalOptions, a5 as GoalEvent, a6 as GoalOptions, a7 as GoalResult, a8 as HookName, a9 as InvalidateCacheOptions, aa as MemoryAdapter, ab as MemoryAdapterCapabilities, ac as MemoryContext, ad as MemoryFact, ae as MemoryProviderHandle, af as MemoryProviderInitOptions, ag as MemoryRevision, ah as MemoryToolSchema, ai as MemoryTurnMessage, aj as ObjectiveStatus, ak as PersonalityPreset, al as PluginContext, am as PostAssistantReplyContext, an as PreToolCallContext, ao as PreUserSendContext, ap as PreUserSendResult, aq as ProviderCapability, ar as ProviderRoute, as as RecordSessionSummaryArgs, at as ResolvedProviderRoute, au as RunUntilIterator, av as SDKAgentPlugins, aw as SDKAgentSkillDetail, ax as SDKAgentSkills, ay as SDKArtifact, az as SDKContextManager, aA as SDKPluginMetadata, aB as SDKProvidersManager, aC as SettingSource, aD as Skill, aE as SkillsResolver, aF as SkillsResolverContext, aG as SystemPromptContext, aH as SystemPromptMemoryFact, aI as SystemPromptSkillRef, aJ as TelemetrySettings } from './cron-DuhVPer6.js';
|
|
5
|
+
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, S as SDKMessage } from './run-CrHz9BAP.js';
|
|
6
|
+
export { A as AgentConversationTurn, c as AssistantMessage, d as CompletionCheck, e as CompletionCheckResult, f as ConversationStep, g as ConversationTurn, h as CostBreakdown, i as CostSource, j as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, k as GenerateRunResult, I as ImageBlock, l as InputProcessorContext, m as InteractionUpdate, n as McpAuthConfig, o as McpHttpServerConfig, p as McpOAuthConfig, q as McpStdioServerConfig, r as MessageOrigin, s as ModelParameterValue, O as OutputProcessorContext, t as PartialToolCallUpdate, u as ProcessorControls, v as ProcessorTripwire, w as ProcessorViolation, x as RunCompactBoundaryEvent, y as RunCompletionCheckEvent, z as RunErrorDetail, B as RunEvent, E as RunEventSink, F as RunGitInfo, H as RunOperation, J as RunPermissionDeniedEvent, K as RunRateLimitEvent, L as RunStatus, N as RunTaskCompletedEvent, Q as RunTaskStartedEvent, U as RunTaskUpdatedEvent, V as RunToCompletionOptions, W as RunToCompletionResult, X as RunToolProgressEvent, Y as RunTripwireEvent, Z as SDKAssistantMessage, _ as SDKImage, $ as SDKImageDimension, a0 as SDKObjectDelta, a1 as SDKRequestMessage, a2 as SDKStatusMessage, a3 as SDKSystemMessage, a4 as SDKTaskMessage, a5 as SDKThinkingMessage, a6 as SDKToolUseMessage, a7 as SDKUserMessage, a8 as SDKUserMessageEvent, a9 as SendOptions, aa as ShellCommand, ab as ShellConversationTurn, ac as ShellOutput, ad as ShellOutputDeltaUpdate, ae as StepCompletedUpdate, af as StepStartedUpdate, ag as StreamToCompletionResult, ah as SummaryCompletedUpdate, ai as SummaryStartedUpdate, aj as SummaryUpdate, ak as TextBlock, al as TextDeltaUpdate, am as ThinkingCompletedUpdate, an as ThinkingDeltaUpdate, ao as ThinkingMessage, ap as TokenDeltaUpdate, aq as TokenUsage, ar as ToolCall, as as ToolCallCompletedUpdate, at as ToolCallStartedUpdate, au as ToolContextMessage, av as ToolResult, aw as ToolResultGuardOptions, ax as ToolUseBlock, ay as TurnEndedUpdate, az as UserMessage, aA as UserMessageAppendedUpdate, aB as emitRunEvent } from './run-CrHz9BAP.js';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
|
package/dist/index.js
CHANGED
|
@@ -973,10 +973,10 @@ function buildToolPrompt(prompt) {
|
|
|
973
973
|
Respond by calling the \`output\` tool with the structured answer that matches the schema.`;
|
|
974
974
|
}
|
|
975
975
|
function setupStructuredOutput(schema, maxRetries) {
|
|
976
|
-
const
|
|
976
|
+
const z11 = requireZod();
|
|
977
977
|
const jsonSchema = toJsonSchema(schema, { unrepresentable: "any" });
|
|
978
978
|
return {
|
|
979
|
-
z:
|
|
979
|
+
z: z11,
|
|
980
980
|
jsonSchema,
|
|
981
981
|
maxRetries: maxRetries ?? 1,
|
|
982
982
|
initialUsage: { inputTokens: 0, outputTokens: 0 }
|
|
@@ -6052,7 +6052,7 @@ async function buildSystemPromptContext(inputs, userText, memoryFacts, manager =
|
|
|
6052
6052
|
memory: memoryFacts.map((fact) => ({ text: fact.text }))
|
|
6053
6053
|
};
|
|
6054
6054
|
}
|
|
6055
|
-
async function buildAssemblyContext(inputs, userText, baseSystemPrompt, memoryFacts, activeMemorySummary) {
|
|
6055
|
+
async function buildAssemblyContext(inputs, userText, baseSystemPrompt, memoryFacts, activeMemorySummary, contextPaths) {
|
|
6056
6056
|
const resolved = await resolveSendSkills(inputs, userText, memoryFacts);
|
|
6057
6057
|
const baseCtx = await buildSystemPromptContext(inputs, userText, memoryFacts, resolved.manager);
|
|
6058
6058
|
const assemblyCtx = {
|
|
@@ -6065,19 +6065,21 @@ async function buildAssemblyContext(inputs, userText, baseSystemPrompt, memoryFa
|
|
|
6065
6065
|
assemblyCtx.activeMemorySummary = activeMemorySummary;
|
|
6066
6066
|
}
|
|
6067
6067
|
if (inputs.context !== void 0) {
|
|
6068
|
+
await inputs.context.applyScope(contextPaths);
|
|
6068
6069
|
const internal = inputs.context.internalAssemblySnapshot();
|
|
6069
6070
|
assemblyCtx.contextSnapshot = { sources: internal.sources };
|
|
6070
6071
|
if (internal.maxTokens !== void 0) assemblyCtx.contextMaxTokens = internal.maxTokens;
|
|
6071
6072
|
}
|
|
6072
6073
|
return assemblyCtx;
|
|
6073
6074
|
}
|
|
6074
|
-
async function assembleSystemPromptForSend(inputs, userText, baseSystemPrompt, memoryFacts, activeMemorySummary) {
|
|
6075
|
+
async function assembleSystemPromptForSend(inputs, userText, baseSystemPrompt, memoryFacts, activeMemorySummary, contextPaths) {
|
|
6075
6076
|
const ctx = await buildAssemblyContext(
|
|
6076
6077
|
inputs,
|
|
6077
6078
|
userText,
|
|
6078
6079
|
baseSystemPrompt,
|
|
6079
6080
|
memoryFacts,
|
|
6080
|
-
activeMemorySummary
|
|
6081
|
+
activeMemorySummary,
|
|
6082
|
+
contextPaths
|
|
6081
6083
|
);
|
|
6082
6084
|
return inputs.systemPromptPipeline.assemble(ctx);
|
|
6083
6085
|
}
|
|
@@ -6784,6 +6786,14 @@ var init_context_discovery = __esm({
|
|
|
6784
6786
|
followImports: false,
|
|
6785
6787
|
priority: 40
|
|
6786
6788
|
},
|
|
6789
|
+
{
|
|
6790
|
+
id: "theokit-rules",
|
|
6791
|
+
pattern: ".theokit/rules/*.md",
|
|
6792
|
+
scope: "globbed",
|
|
6793
|
+
parser: "rules-frontmatter",
|
|
6794
|
+
followImports: false,
|
|
6795
|
+
priority: 45
|
|
6796
|
+
},
|
|
6787
6797
|
{
|
|
6788
6798
|
id: "theokit-context",
|
|
6789
6799
|
pattern: ".theokit/context/*.md",
|
|
@@ -6867,32 +6877,27 @@ var init_context_import_resolver = __esm({
|
|
|
6867
6877
|
MAX_HOPS = 5;
|
|
6868
6878
|
}
|
|
6869
6879
|
});
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
}
|
|
6875
|
-
const yamlBody = m[1] ?? "";
|
|
6876
|
-
const body = m[2] ?? "";
|
|
6877
|
-
try {
|
|
6878
|
-
const parsed = parseSimpleYaml2(yamlBody);
|
|
6879
|
-
const validated = McdFrontmatterSchema.safeParse(parsed);
|
|
6880
|
-
if (!validated.success) return void 0;
|
|
6881
|
-
return { frontmatter: validated.data, body };
|
|
6882
|
-
} catch {
|
|
6883
|
-
return void 0;
|
|
6884
|
-
}
|
|
6880
|
+
|
|
6881
|
+
// src/internal/runtime/context/context-glob.ts
|
|
6882
|
+
function globToRegex(glob) {
|
|
6883
|
+
const compiled = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*\//g, "::GLOBSTAR_SLASH::").replace(/\*\*/g, "::GLOBSTAR::").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]").replace(/::GLOBSTAR_SLASH::/g, "(?:.*/)?").replace(/::GLOBSTAR::/g, ".*");
|
|
6884
|
+
return new RegExp(`^${compiled}$`);
|
|
6885
6885
|
}
|
|
6886
|
-
function
|
|
6887
|
-
if (
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
const globRes = fm.globs.map(globToRegex);
|
|
6891
|
-
return touchedFiles.some((file) => globRes.some((re) => re.test(file)));
|
|
6886
|
+
function anyGlobMatches(patterns, paths) {
|
|
6887
|
+
if (patterns.length === 0 || paths.length === 0) return false;
|
|
6888
|
+
const res = patterns.map(globToRegex);
|
|
6889
|
+
return paths.some((p) => res.some((re) => re.test(p)));
|
|
6892
6890
|
}
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6891
|
+
var init_context_glob = __esm({
|
|
6892
|
+
"src/internal/runtime/context/context-glob.ts"() {
|
|
6893
|
+
}
|
|
6894
|
+
});
|
|
6895
|
+
|
|
6896
|
+
// src/internal/runtime/context/context-yaml-lite.ts
|
|
6897
|
+
function splitFrontmatter3(content) {
|
|
6898
|
+
const m = FRONTMATTER_RE.exec(content);
|
|
6899
|
+
if (m === null) return { yaml: void 0, body: content };
|
|
6900
|
+
return { yaml: m[1] ?? "", body: m[2] ?? "" };
|
|
6896
6901
|
}
|
|
6897
6902
|
function parseSimpleYaml2(yaml) {
|
|
6898
6903
|
const out = {};
|
|
@@ -6939,15 +6944,76 @@ function parseScalar(s) {
|
|
|
6939
6944
|
if (/^-?\d+$/.test(s)) return parseInt(s, 10);
|
|
6940
6945
|
return s.replace(/^["']|["']$/g, "");
|
|
6941
6946
|
}
|
|
6942
|
-
var
|
|
6947
|
+
var FRONTMATTER_RE;
|
|
6948
|
+
var init_context_yaml_lite = __esm({
|
|
6949
|
+
"src/internal/runtime/context/context-yaml-lite.ts"() {
|
|
6950
|
+
FRONTMATTER_RE = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/;
|
|
6951
|
+
}
|
|
6952
|
+
});
|
|
6953
|
+
function parseMdc(content) {
|
|
6954
|
+
const { yaml, body } = splitFrontmatter3(content);
|
|
6955
|
+
if (yaml === void 0) {
|
|
6956
|
+
return { frontmatter: { alwaysApply: true }, body: content };
|
|
6957
|
+
}
|
|
6958
|
+
try {
|
|
6959
|
+
const parsed = parseSimpleYaml2(yaml);
|
|
6960
|
+
const validated = McdFrontmatterSchema.safeParse(parsed);
|
|
6961
|
+
if (!validated.success) return void 0;
|
|
6962
|
+
return { frontmatter: validated.data, body };
|
|
6963
|
+
} catch {
|
|
6964
|
+
return void 0;
|
|
6965
|
+
}
|
|
6966
|
+
}
|
|
6967
|
+
function shouldActivate(fm, touchedFiles) {
|
|
6968
|
+
if (fm.alwaysApply === true) return true;
|
|
6969
|
+
if (fm.globs === void 0 || fm.globs.length === 0) return false;
|
|
6970
|
+
return anyGlobMatches(fm.globs, touchedFiles);
|
|
6971
|
+
}
|
|
6972
|
+
var McdFrontmatterSchema;
|
|
6943
6973
|
var init_context_mdc_parser = __esm({
|
|
6944
6974
|
"src/internal/runtime/context/context-mdc-parser.ts"() {
|
|
6975
|
+
init_context_glob();
|
|
6976
|
+
init_context_yaml_lite();
|
|
6945
6977
|
McdFrontmatterSchema = z.object({
|
|
6946
6978
|
description: z.string().optional(),
|
|
6947
6979
|
globs: z.array(z.string()).optional(),
|
|
6948
6980
|
alwaysApply: z.boolean().optional()
|
|
6949
6981
|
});
|
|
6950
|
-
|
|
6982
|
+
}
|
|
6983
|
+
});
|
|
6984
|
+
function parseRules(content) {
|
|
6985
|
+
const { yaml, body } = splitFrontmatter3(content);
|
|
6986
|
+
if (yaml === void 0) {
|
|
6987
|
+
return { frontmatter: { alwaysApply: true }, body: content };
|
|
6988
|
+
}
|
|
6989
|
+
try {
|
|
6990
|
+
const parsed = parseSimpleYaml2(yaml);
|
|
6991
|
+
const validated = RulesFrontmatterSchema.safeParse(parsed);
|
|
6992
|
+
if (!validated.success) return void 0;
|
|
6993
|
+
return { frontmatter: validated.data, body };
|
|
6994
|
+
} catch {
|
|
6995
|
+
return void 0;
|
|
6996
|
+
}
|
|
6997
|
+
}
|
|
6998
|
+
function shouldActivateRule(fm, inScopePaths) {
|
|
6999
|
+
if (fm.enabled === false) return false;
|
|
7000
|
+
if (fm.alwaysApply === true) return true;
|
|
7001
|
+
const patterns = [...fm.paths ?? [], ...fm.globs ?? []];
|
|
7002
|
+
if (patterns.length === 0) return false;
|
|
7003
|
+
return anyGlobMatches(patterns, inScopePaths);
|
|
7004
|
+
}
|
|
7005
|
+
var RulesFrontmatterSchema;
|
|
7006
|
+
var init_context_rules_frontmatter = __esm({
|
|
7007
|
+
"src/internal/runtime/context/context-rules-frontmatter.ts"() {
|
|
7008
|
+
init_context_glob();
|
|
7009
|
+
init_context_yaml_lite();
|
|
7010
|
+
RulesFrontmatterSchema = z.object({
|
|
7011
|
+
description: z.string().optional(),
|
|
7012
|
+
paths: z.array(z.string()).optional(),
|
|
7013
|
+
globs: z.array(z.string()).optional(),
|
|
7014
|
+
alwaysApply: z.boolean().optional(),
|
|
7015
|
+
enabled: z.boolean().optional()
|
|
7016
|
+
});
|
|
6951
7017
|
}
|
|
6952
7018
|
});
|
|
6953
7019
|
async function runDiscovery(opts) {
|
|
@@ -6983,6 +7049,9 @@ async function loadOneSource(spec, path, opts, gitRoot) {
|
|
|
6983
7049
|
if (spec.parser === "mdc") {
|
|
6984
7050
|
return loadMdcSource(spec, path, id, opts);
|
|
6985
7051
|
}
|
|
7052
|
+
if (spec.parser === "rules-frontmatter") {
|
|
7053
|
+
return loadRulesSource(spec, path, id, opts);
|
|
7054
|
+
}
|
|
6986
7055
|
if (spec.parser === "frontmatter-zod") {
|
|
6987
7056
|
return void 0;
|
|
6988
7057
|
}
|
|
@@ -7006,6 +7075,24 @@ async function loadMdcSource(spec, path, id, opts) {
|
|
|
7006
7075
|
truncated: false
|
|
7007
7076
|
};
|
|
7008
7077
|
}
|
|
7078
|
+
async function loadRulesSource(spec, path, id, opts) {
|
|
7079
|
+
let raw;
|
|
7080
|
+
try {
|
|
7081
|
+
raw = await readFile(path, "utf8");
|
|
7082
|
+
} catch {
|
|
7083
|
+
return void 0;
|
|
7084
|
+
}
|
|
7085
|
+
const parsed = parseRules(raw);
|
|
7086
|
+
if (parsed === void 0) return void 0;
|
|
7087
|
+
if (!shouldActivateRule(parsed.frontmatter, opts.touchedFiles ?? [])) return void 0;
|
|
7088
|
+
return {
|
|
7089
|
+
id,
|
|
7090
|
+
source: path,
|
|
7091
|
+
content: parsed.body,
|
|
7092
|
+
priority: spec.priority,
|
|
7093
|
+
truncated: false
|
|
7094
|
+
};
|
|
7095
|
+
}
|
|
7009
7096
|
async function loadPlainMarkdownSource(spec, path, id, opts) {
|
|
7010
7097
|
const loaded = await loadPlainMarkdown(path, { maxBytesPerFile: opts.maxBytesPerFile });
|
|
7011
7098
|
if (loaded === void 0) return void 0;
|
|
@@ -7031,6 +7118,7 @@ var init_context_discovery_runner = __esm({
|
|
|
7031
7118
|
init_context_import_resolver();
|
|
7032
7119
|
init_context_loaders();
|
|
7033
7120
|
init_context_mdc_parser();
|
|
7121
|
+
init_context_rules_frontmatter();
|
|
7034
7122
|
}
|
|
7035
7123
|
});
|
|
7036
7124
|
var ContextSourceFrontmatterSchema;
|
|
@@ -7166,6 +7254,10 @@ function matchesGlob(pattern, path) {
|
|
|
7166
7254
|
function tokenizeContent(content) {
|
|
7167
7255
|
return content.split(/\s+/).filter((token) => token.length > 0);
|
|
7168
7256
|
}
|
|
7257
|
+
function sameScope(a, b) {
|
|
7258
|
+
if (a.length !== b.length) return false;
|
|
7259
|
+
return a.every((v, i) => v === b[i]);
|
|
7260
|
+
}
|
|
7169
7261
|
var FileContextManager;
|
|
7170
7262
|
var init_context_manager = __esm({
|
|
7171
7263
|
"src/internal/runtime/context/context-manager.ts"() {
|
|
@@ -7186,6 +7278,13 @@ var init_context_manager = __esm({
|
|
|
7186
7278
|
settings;
|
|
7187
7279
|
settingSourcesIncludeProject;
|
|
7188
7280
|
state;
|
|
7281
|
+
/**
|
|
7282
|
+
* The in-scope file set used by the most recent `refresh`. Tracked so
|
|
7283
|
+
* `applyScope` only touches state when the scope actually changes — a
|
|
7284
|
+
* caller that never scopes (the common case) keeps the create-time
|
|
7285
|
+
* snapshot untouched, at zero per-send cost.
|
|
7286
|
+
*/
|
|
7287
|
+
lastScope = [];
|
|
7189
7288
|
async initialize() {
|
|
7190
7289
|
if (!this.settingSourcesIncludeProject && this.settings.manager !== "file") {
|
|
7191
7290
|
this.state = { config: { sources: [] }, loadedSources: [] };
|
|
@@ -7193,14 +7292,31 @@ var init_context_manager = __esm({
|
|
|
7193
7292
|
}
|
|
7194
7293
|
await this.refresh();
|
|
7195
7294
|
}
|
|
7196
|
-
|
|
7295
|
+
/**
|
|
7296
|
+
* Re-run discovery for a specific per-send in-scope file set (T3). Path-scoped
|
|
7297
|
+
* rules (`.theokit/rules/*.md`, `.cursor/rules/*.mdc` globs) activate iff a
|
|
7298
|
+
* pattern matches one of `contextPaths`. Idempotent: unchanged scope is a
|
|
7299
|
+
* no-op, and `undefined` scope while never previously scoped never touches
|
|
7300
|
+
* state (preserves the create-time snapshot for non-users).
|
|
7301
|
+
*/
|
|
7302
|
+
async applyScope(contextPaths) {
|
|
7303
|
+
const scope = contextPaths ?? [];
|
|
7304
|
+
if (scope.length === 0 && this.lastScope.length === 0) return;
|
|
7305
|
+
if (sameScope(scope, this.lastScope)) return;
|
|
7306
|
+
await this.refresh({ touchedFiles: scope });
|
|
7307
|
+
}
|
|
7308
|
+
async refresh(opts) {
|
|
7309
|
+
const touchedFiles = opts?.touchedFiles ?? [];
|
|
7310
|
+
this.lastScope = [...touchedFiles];
|
|
7197
7311
|
const config = await loadContextConfig(this.cwd);
|
|
7198
7312
|
const legacy = await loadSources(config, this.cwd);
|
|
7199
7313
|
const maxBytesPerFile = this.settings.maxBytesPerFile ?? DEFAULT_MAX_BYTES_PER_FILE;
|
|
7200
7314
|
const maxBytesTotal = this.settings.maxBytesTotal ?? DEFAULT_MAX_BYTES_TOTAL;
|
|
7201
7315
|
const discovered = await runDiscovery({
|
|
7202
7316
|
cwd: this.cwd,
|
|
7203
|
-
maxBytesPerFile
|
|
7317
|
+
maxBytesPerFile,
|
|
7318
|
+
touchedFiles
|
|
7319
|
+
});
|
|
7204
7320
|
const legacyAsAggregator = legacy.map((src) => ({
|
|
7205
7321
|
id: src.name,
|
|
7206
7322
|
source: src.path,
|
|
@@ -17153,7 +17269,8 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
17153
17269
|
userText,
|
|
17154
17270
|
baseSystemPrompt,
|
|
17155
17271
|
memoryFacts,
|
|
17156
|
-
activeMemorySummary
|
|
17272
|
+
activeMemorySummary,
|
|
17273
|
+
options.contextPaths
|
|
17157
17274
|
);
|
|
17158
17275
|
const projectedSystemPrompt = await projectCurrentObjective(
|
|
17159
17276
|
inputs.storageHandle,
|
|
@@ -18226,7 +18343,7 @@ var init_local_agent = __esm({
|
|
|
18226
18343
|
runPreHook: (ut) => this.runPreHook(ut),
|
|
18227
18344
|
// biome-ignore format: G8 budget — callbacks wire to private methods.
|
|
18228
18345
|
resolveSystemPromptForSend: (ut, o, mf) => this.resolveSystemPrompt(ut, o, mf),
|
|
18229
|
-
assembleSystemPromptForSend: (ut, bp, mf, ams) => assembleSystemPromptForSend(this.assemblyInputs(), ut, bp, mf, ams),
|
|
18346
|
+
assembleSystemPromptForSend: (ut, bp, mf, ams, cp) => assembleSystemPromptForSend(this.assemblyInputs(), ut, bp, mf, ams, cp),
|
|
18230
18347
|
dispatchRun: (msg, o, sp, mf, pm, mt, mp) => this.dispatchRun(msg, o, sp, mf, pm, mt, mp)
|
|
18231
18348
|
},
|
|
18232
18349
|
message,
|