@theokit/sdk 4.2.1 → 4.2.2
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 +97 -86
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/subagent.d.cts +2 -2
- package/dist/a2a/subagent.d.ts +2 -2
- package/dist/{cron-Y_aM4m4-.d.cts → cron-DxBlp3i4.d.ts} +2 -2
- package/dist/{cron-pjzn3jxf.d.ts → cron-afuxJHol.d.cts} +2 -2
- 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.map +1 -1
- package/dist/{errors-B4QB3-Wu.d.ts → errors-DzCWdfkp.d.ts} +1 -1
- package/dist/{errors-B03TBTc_.d.cts → errors-VY7_0ki7.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js.map +1 -1
- package/dist/filesystem/index.cjs.map +1 -1
- package/dist/filesystem/index.js.map +1 -1
- package/dist/filesystem/local-filesystem.d.cts +1 -1
- package/dist/filesystem/local-filesystem.d.ts +1 -1
- package/dist/filesystem/types.d.cts +1 -1
- package/dist/filesystem/types.d.ts +1 -1
- package/dist/index.cjs +1 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +1 -9
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-loop/doom-loop-tracker.d.ts +1 -1
- package/dist/internal/budget/usage-accumulator.d.ts +1 -1
- package/dist/internal/llm/model-identifier.d.ts +1 -1
- package/dist/internal/llm/ollama-native.d.ts +2 -2
- package/dist/internal/llm/openai.d.ts +1 -1
- package/dist/internal/llm/router.d.ts +3 -4
- package/dist/internal/memory/adapters/ollama-embedding.d.ts +1 -1
- package/dist/internal/memory/embedding-adapter.d.ts +3 -3
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/providers/builtin/vertex.d.ts +1 -1
- package/dist/internal/resilience/circuit-breaker.d.ts +1 -1
- package/dist/internal/runtime/concurrency/abort-utils.d.ts +1 -1
- package/dist/internal/runtime/registry/run-registry.d.ts +0 -1
- package/dist/internal/runtime/skills/skill-frontmatter.d.ts +0 -1
- package/dist/internal/task/registry.d.ts +0 -3
- package/dist/internal/telemetry/span-names.d.ts +0 -1
- package/dist/internal/workflow/telemetry.d.ts +0 -2
- package/dist/models.cjs.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/permission-engine.d.ts +3 -3
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js.map +1 -1
- package/dist/project.cjs.map +1 -1
- package/dist/project.js.map +1 -1
- package/dist/{run-CqihtbtU.d.cts → run-CsIsK9Gx.d.cts} +7 -7
- package/dist/{run-CqihtbtU.d.ts → run-CsIsK9Gx.d.ts} +7 -7
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.js.map +1 -1
- package/dist/subscription/index.cjs.map +1 -1
- package/dist/subscription/index.js.map +1 -1
- package/dist/subscription/internal/sse-encoder.d.cts +1 -1
- package/dist/subscription/internal/sse-encoder.d.ts +1 -1
- package/dist/subscription/internal/sse-parser.d.cts +1 -1
- package/dist/subscription/internal/sse-parser.d.ts +1 -1
- package/dist/task-store.cjs.map +1 -1
- package/dist/task-store.js.map +1 -1
- package/dist/types/agent.d.ts +1 -1
- package/dist/types/processors.d.ts +1 -1
- package/dist/types/run.d.ts +2 -2
- package/dist/types/usage.d.ts +1 -1
- package/dist/workflow.cjs +1 -9
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.js +1 -9
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
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 Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-
|
|
4
|
-
export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD 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, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-
|
|
6
|
-
export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-
|
|
1
|
+
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-VY7_0ki7.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-VY7_0ki7.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 Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-afuxJHol.cjs';
|
|
4
|
+
export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD as TelemetrySettings } from './cron-afuxJHol.cjs';
|
|
5
|
+
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-CsIsK9Gx.cjs';
|
|
6
|
+
export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-CsIsK9Gx.cjs';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
|
|
@@ -671,7 +671,7 @@ declare function chargeAndCheckThresholds(name: string, actualUsd: number): Prom
|
|
|
671
671
|
/**
|
|
672
672
|
* normalizeUsage — convert provider-shaped raw `usage` object to
|
|
673
673
|
* canonical `TokenUsage`. Ports Hermes Agent's `normalize_usage`
|
|
674
|
-
* (referencia/
|
|
674
|
+
* (referencia/peer-agent/agent/usage_pricing.py:672-742).
|
|
675
675
|
*
|
|
676
676
|
* Handles 3 API shapes:
|
|
677
677
|
* - Anthropic Messages: 4 explicit buckets (input/output/cache_read/cache_creation).
|
|
@@ -679,8 +679,8 @@ declare function chargeAndCheckThresholds(name: string, actualUsd: number): Prom
|
|
|
679
679
|
* - OpenAI Responses (Codex): input_tokens INCLUDES cache; same subtraction.
|
|
680
680
|
*
|
|
681
681
|
* Edge cases:
|
|
682
|
-
* -
|
|
683
|
-
*
|
|
682
|
+
* - a peer#10266 — OpenAI-compat proxies (OpenRouter, a peer vendor AI Gateway,
|
|
683
|
+
* a peer) routing Claude expose Anthropic-style top-level fields
|
|
684
684
|
* (cache_read_input_tokens / cache_creation_input_tokens). Both
|
|
685
685
|
* locations are checked with top-level fallback.
|
|
686
686
|
* - Null/undefined fields → 0 via `int()` coerce.
|
|
@@ -734,7 +734,7 @@ declare function getPricingEntry(opts: {
|
|
|
734
734
|
|
|
735
735
|
/**
|
|
736
736
|
* UsageAccumulator — aggregate multi-step `LlmFinish` token counts
|
|
737
|
-
* into a canonical `TokenUsage` (ADR D376, mirror
|
|
737
|
+
* into a canonical `TokenUsage` (ADR D376, mirror a peer SDK
|
|
738
738
|
* `Usage.add`).
|
|
739
739
|
*
|
|
740
740
|
* Each `add(step)` merges in a per-step finish; `toTokenUsage()`
|
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 Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-
|
|
4
|
-
export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD 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, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-
|
|
6
|
-
export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-
|
|
1
|
+
import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DzCWdfkp.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-DzCWdfkp.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 Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-DxBlp3i4.js';
|
|
4
|
+
export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD as TelemetrySettings } from './cron-DxBlp3i4.js';
|
|
5
|
+
import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-CsIsK9Gx.js';
|
|
6
|
+
export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-CsIsK9Gx.js';
|
|
7
7
|
import * as zod from 'zod';
|
|
8
8
|
import { ZodType, z } from 'zod';
|
|
9
9
|
|
|
@@ -671,7 +671,7 @@ declare function chargeAndCheckThresholds(name: string, actualUsd: number): Prom
|
|
|
671
671
|
/**
|
|
672
672
|
* normalizeUsage — convert provider-shaped raw `usage` object to
|
|
673
673
|
* canonical `TokenUsage`. Ports Hermes Agent's `normalize_usage`
|
|
674
|
-
* (referencia/
|
|
674
|
+
* (referencia/peer-agent/agent/usage_pricing.py:672-742).
|
|
675
675
|
*
|
|
676
676
|
* Handles 3 API shapes:
|
|
677
677
|
* - Anthropic Messages: 4 explicit buckets (input/output/cache_read/cache_creation).
|
|
@@ -679,8 +679,8 @@ declare function chargeAndCheckThresholds(name: string, actualUsd: number): Prom
|
|
|
679
679
|
* - OpenAI Responses (Codex): input_tokens INCLUDES cache; same subtraction.
|
|
680
680
|
*
|
|
681
681
|
* Edge cases:
|
|
682
|
-
* -
|
|
683
|
-
*
|
|
682
|
+
* - a peer#10266 — OpenAI-compat proxies (OpenRouter, a peer vendor AI Gateway,
|
|
683
|
+
* a peer) routing Claude expose Anthropic-style top-level fields
|
|
684
684
|
* (cache_read_input_tokens / cache_creation_input_tokens). Both
|
|
685
685
|
* locations are checked with top-level fallback.
|
|
686
686
|
* - Null/undefined fields → 0 via `int()` coerce.
|
|
@@ -734,7 +734,7 @@ declare function getPricingEntry(opts: {
|
|
|
734
734
|
|
|
735
735
|
/**
|
|
736
736
|
* UsageAccumulator — aggregate multi-step `LlmFinish` token counts
|
|
737
|
-
* into a canonical `TokenUsage` (ADR D376, mirror
|
|
737
|
+
* into a canonical `TokenUsage` (ADR D376, mirror a peer SDK
|
|
738
738
|
* `Usage.add`).
|
|
739
739
|
*
|
|
740
740
|
* Each `add(step)` merges in a per-step finish; `toTokenUsage()`
|
package/dist/index.js
CHANGED
|
@@ -3560,12 +3560,10 @@ var init_telemetry = __esm({
|
|
|
3560
3560
|
// src/internal/task/registry.ts
|
|
3561
3561
|
var registry_exports = {};
|
|
3562
3562
|
__export(registry_exports, {
|
|
3563
|
-
__getCancelRequestedForTests: () => __getCancelRequestedForTests,
|
|
3564
3563
|
__getSubscribersCountForTests: () => __getSubscribersCountForTests,
|
|
3565
3564
|
__resetTaskRegistryForTests: () => __resetTaskRegistryForTests,
|
|
3566
3565
|
cancel: () => cancel,
|
|
3567
3566
|
configure: () => configure,
|
|
3568
|
-
evictNow: () => evictNow,
|
|
3569
3567
|
get: () => get,
|
|
3570
3568
|
list: () => list,
|
|
3571
3569
|
submit: () => submit,
|
|
@@ -3590,9 +3588,6 @@ function __resetTaskRegistryForTests() {
|
|
|
3590
3588
|
function __getSubscribersCountForTests(taskId) {
|
|
3591
3589
|
return state.subscribers.get(taskId)?.size ?? 0;
|
|
3592
3590
|
}
|
|
3593
|
-
function __getCancelRequestedForTests(_taskId) {
|
|
3594
|
-
return void 0;
|
|
3595
|
-
}
|
|
3596
3591
|
function configure(opts) {
|
|
3597
3592
|
if (state.firstSubmitSeen) {
|
|
3598
3593
|
process.stderr.write(
|
|
@@ -3854,9 +3849,6 @@ async function cancelInternal(id, currentState, reason) {
|
|
|
3854
3849
|
if (aborter !== void 0) aborter.abort(reason ?? "cancelled");
|
|
3855
3850
|
return { cancelled: true, alreadyTerminal: false };
|
|
3856
3851
|
}
|
|
3857
|
-
async function evictNow(now = Date.now()) {
|
|
3858
|
-
return state.store.evictTerminalOlderThan(now - state.retentionMs);
|
|
3859
|
-
}
|
|
3860
3852
|
var DEFAULT_CONCURRENCY, DEFAULT_RETENTION_MS, EVICTION_INTERVAL_MS, RING_CAP, reentryAls, state, subscribe;
|
|
3861
3853
|
var init_registry = __esm({
|
|
3862
3854
|
"src/internal/task/registry.ts"() {
|
|
@@ -21700,7 +21692,7 @@ var WorkflowBuilder = class {
|
|
|
21700
21692
|
get __steps() {
|
|
21701
21693
|
return this._steps;
|
|
21702
21694
|
}
|
|
21703
|
-
// biome-ignore lint/suspicious/noThenProperty: D233 locks the
|
|
21695
|
+
// biome-ignore lint/suspicious/noThenProperty: D233 locks the a peer framework-style `.then(step)` builder DSL. The method is fluent, never awaited.
|
|
21704
21696
|
then(step) {
|
|
21705
21697
|
this.assertNotCommitted();
|
|
21706
21698
|
validateStepId(step.id);
|