@theokit/sdk 4.26.0 → 4.28.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.
Files changed (47) hide show
  1. package/dist/{judge-call-QG4WZ7F3.cjs → chunk-4GTXATWK.cjs} +2 -3
  2. package/dist/chunk-4GTXATWK.cjs.map +1 -0
  3. package/dist/{judge-call-CEQ3FYYD.js → chunk-CR3DGWUQ.js} +2 -3
  4. package/dist/chunk-CR3DGWUQ.js.map +1 -0
  5. package/dist/{chunk-R43CNCES.cjs → chunk-I53QDJVI.cjs} +5 -5
  6. package/dist/{chunk-R43CNCES.cjs.map → chunk-I53QDJVI.cjs.map} +1 -1
  7. package/dist/{chunk-KDNBTPY2.js → chunk-PF5Y5BHG.js} +3 -3
  8. package/dist/{chunk-KDNBTPY2.js.map → chunk-PF5Y5BHG.js.map} +1 -1
  9. package/dist/{chunk-ZUBIEQJF.cjs → chunk-PN53WGEI.cjs} +7 -7
  10. package/dist/{chunk-ZUBIEQJF.cjs.map → chunk-PN53WGEI.cjs.map} +1 -1
  11. package/dist/{chunk-PSJN532Q.js → chunk-XW6RXVGB.js} +5 -5
  12. package/dist/{chunk-PSJN532Q.js.map → chunk-XW6RXVGB.js.map} +1 -1
  13. package/dist/{cron-DivRaEmN.d.ts → cron-BN6JJlDw.d.ts} +41 -1
  14. package/dist/{cron-D0JKR-yX.d.cts → cron-CoQREV_k.d.cts} +41 -1
  15. package/dist/cron.cjs +3 -3
  16. package/dist/cron.d.cts +1 -1
  17. package/dist/cron.d.ts +1 -1
  18. package/dist/cron.js +2 -2
  19. package/dist/eval.cjs +2 -2
  20. package/dist/eval.js +1 -1
  21. package/dist/index.cjs +27 -22
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +16 -17
  24. package/dist/index.d.ts +16 -17
  25. package/dist/index.js +6 -5
  26. package/dist/index.js.map +1 -1
  27. package/dist/internal/runtime/lifecycle/run-until.d.ts +1 -2
  28. package/dist/internal/runtime/lifecycle/wrap-completion-check-run.d.ts +1 -1
  29. package/dist/judge-call-2FULQ6KL.cjs +22 -0
  30. package/dist/judge-call-2FULQ6KL.cjs.map +1 -0
  31. package/dist/judge-call-D7R3ZTZS.js +5 -0
  32. package/dist/judge-call-D7R3ZTZS.js.map +1 -0
  33. package/dist/{run-until-XLHEHRQM.js → run-until-YZ2ODWOF.js} +3 -2
  34. package/dist/run-until-YZ2ODWOF.js.map +1 -0
  35. package/dist/{run-until-PNO3QQLI.cjs → run-until-ZZ2JLPJM.cjs} +3 -2
  36. package/dist/run-until-ZZ2JLPJM.cjs.map +1 -0
  37. package/dist/server/auth/index.d.cts +207 -11
  38. package/dist/server/auth/index.d.ts +207 -11
  39. package/dist/server/errors-envelope.d.cts +12 -6
  40. package/dist/server/errors-envelope.d.ts +12 -6
  41. package/dist/types/goal-events.d.ts +40 -0
  42. package/package.json +1 -1
  43. package/dist/internal/judge/types.d.ts +0 -17
  44. package/dist/judge-call-CEQ3FYYD.js.map +0 -1
  45. package/dist/judge-call-QG4WZ7F3.cjs.map +0 -1
  46. package/dist/run-until-PNO3QQLI.cjs.map +0 -1
  47. package/dist/run-until-XLHEHRQM.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-BdL-buYn.cjs';
2
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-BdL-buYn.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, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as StepResult, u as SDKProvider } from './cron-D0JKR-yX.cjs';
4
- export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as BudgetCheck, z as BudgetTotal, D as BudgetUsageEvent, E as CloudEnv, F as CloudRepo, H as ContextBudget, J as ContextManagerKind, K as ContextSnapshot, N as ContextSource, O as ContextSourceStatus, Q as CreateSkillSpec, R as Cron, T as CronCreateOptions, U as CronGetOptions, V as CronJob, W as CronJobStatus, X as CronListOptions, Y as CronOperationOptions, Z as CronRunOptions, _ as CronRuntime, $ as CronSchedulerStatus, a0 as CronStartOptions, 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 ProviderTransform, al as ProviderTransformContext, am as RecordSessionSummaryArgs, an as ResolvedProviderRoute, ao as RunUntilIterator, ap as SDKAgentPlugins, aq as SDKAgentSkillDetail, ar as SDKAgentSkills, as as SDKArtifact, at as SDKContextManager, au as SDKPluginMetadata, av as SDKProvidersManager, aw as SessionRecord, ax as SessionStore, ay as SettingSource, az as Skill, aA as SkillsResolver, aB as SkillsResolverContext, aC as SystemPromptContext, aD as SystemPromptMemoryFact, aE as SystemPromptSkillRef, aF as TelemetrySettings } from './cron-D0JKR-yX.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, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as StepResult, u as SDKProvider } from './cron-CoQREV_k.cjs';
4
+ export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as BudgetCheck, z as BudgetTotal, D as BudgetUsageEvent, E as CloudEnv, F as CloudRepo, H as ContextBudget, K as ContextManagerKind, N as ContextSnapshot, O as ContextSource, Q as ContextSourceStatus, R as CreateSkillSpec, T as Cron, U as CronCreateOptions, V as CronGetOptions, W as CronJob, X as CronJobStatus, Y as CronListOptions, Z as CronOperationOptions, _ as CronRunOptions, $ as CronRuntime, a0 as CronSchedulerStatus, a1 as CronStartOptions, a2 as HookName, a3 as InvalidateCacheOptions, a4 as MemoryAdapter, a5 as MemoryAdapterCapabilities, a6 as MemoryContext, a7 as MemoryFact, a8 as MemoryProviderHandle, a9 as MemoryProviderInitOptions, aa as MemoryRevision, ab as MemoryToolSchema, ac as MemoryTurnMessage, ad as PersonalityPreset, ae as PluginContext, af as PostAssistantReplyContext, ag as PreToolCallContext, ah as PreUserSendContext, ai as PreUserSendResult, aj as ProviderCapability, ak as ProviderRoute, al as ProviderTransform, am as ProviderTransformContext, an as RecordSessionSummaryArgs, ao as ResolvedProviderRoute, ap as RunUntilIterator, aq as SDKAgentPlugins, ar as SDKAgentSkillDetail, as as SDKAgentSkills, at as SDKArtifact, au as SDKContextManager, av as SDKPluginMetadata, aw as SDKProvidersManager, ax as SessionRecord, ay as SessionStore, az as SettingSource, aA as Skill, aB as SkillsResolver, aC as SkillsResolverContext, aD as SystemPromptContext, aE as SystemPromptMemoryFact, aF as SystemPromptSkillRef, aG as TelemetrySettings, aH as Verdict } from './cron-CoQREV_k.cjs';
5
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-OJbGyweZ.cjs';
6
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-OJbGyweZ.cjs';
7
7
  import * as zod from 'zod';
@@ -1189,23 +1189,22 @@ interface JudgeOptions {
1189
1189
  /** Override env. Default `process.env.OPENROUTER_API_KEY` (EC-A). */
1190
1190
  apiKey?: string;
1191
1191
  }
1192
-
1193
1192
  /**
1194
- * Public types for the judge subsystem (T2.1, ADR D120).
1193
+ * M80 a credencial ou o modelo do judge não servem: 401/404.
1195
1194
  *
1196
- * @internal
1195
+ * Falha RÁPIDA por design. `rules/error-handling.md § 2` separa recuperável de irrecuperável, e um
1196
+ * modelo inexistente não passa a existir no retry — dobrar isso em `{parseFailed: true}` fazia o loop
1197
+ * tentar três vezes e reportar "failed" por limite de falhas consecutivas, escondendo que a causa era
1198
+ * credencial. Falha lenta e opaca trocada por rápida e clara.
1199
+ *
1200
+ * Falha de PARSE e erro de rede continuam dobrados: são recuperáveis, e o loop já decide por falhas
1201
+ * consecutivas.
1197
1202
  */
1198
- /** Outcome of {@link parseVerdict} / {@link judgeCallImpl}. */
1199
- interface JudgeResult {
1200
- verdict: Verdict;
1201
- reason: string;
1202
- /**
1203
- * `true` when the underlying text did not start with one of the three
1204
- * canonical prefixes. The verdict is set to `"continue"` (fail-safe,
1205
- * ADR D121) to avoid stopping prematurely; callers track consecutive
1206
- * failures and bail via `maxConsecutiveJudgeFailures`.
1207
- */
1208
- parseFailed: boolean;
1203
+ declare class JudgeCredentialError extends TheokitAgentError {
1204
+ readonly httpStatus: number;
1205
+ readonly judgeModel: string;
1206
+ readonly name = "JudgeCredentialError";
1207
+ constructor(httpStatus: number, judgeModel: string, cause: unknown);
1209
1208
  }
1210
1209
 
1211
1210
  /**
@@ -2310,4 +2309,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2310
2309
  model?: string;
2311
2310
  }): ShareGptTrajectory | null;
2312
2311
 
2313
- export { Agent, AgentBuilder, AgentDefinition, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, withCwdMutex };
2312
+ export { Agent, AgentBuilder, AgentDefinition, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, withCwdMutex };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-DHZtSNnj.js';
2
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-DHZtSNnj.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, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as StepResult, u as SDKProvider } from './cron-DivRaEmN.js';
4
- export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as BudgetCheck, z as BudgetTotal, D as BudgetUsageEvent, E as CloudEnv, F as CloudRepo, H as ContextBudget, J as ContextManagerKind, K as ContextSnapshot, N as ContextSource, O as ContextSourceStatus, Q as CreateSkillSpec, R as Cron, T as CronCreateOptions, U as CronGetOptions, V as CronJob, W as CronJobStatus, X as CronListOptions, Y as CronOperationOptions, Z as CronRunOptions, _ as CronRuntime, $ as CronSchedulerStatus, a0 as CronStartOptions, 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 ProviderTransform, al as ProviderTransformContext, am as RecordSessionSummaryArgs, an as ResolvedProviderRoute, ao as RunUntilIterator, ap as SDKAgentPlugins, aq as SDKAgentSkillDetail, ar as SDKAgentSkills, as as SDKArtifact, at as SDKContextManager, au as SDKPluginMetadata, av as SDKProvidersManager, aw as SessionRecord, ax as SessionStore, ay as SettingSource, az as Skill, aA as SkillsResolver, aB as SkillsResolverContext, aC as SystemPromptContext, aD as SystemPromptMemoryFact, aE as SystemPromptSkillRef, aF as TelemetrySettings } from './cron-DivRaEmN.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, J as JudgeResult, n as GoalOptions, o as GoalEvent, p as GoalResult, B as BudgetTracker, q as MemoryProvider, r as MemoryId, s as PreToolCallDecision, t as StepResult, u as SDKProvider } from './cron-BN6JJlDw.js';
4
+ export { v as ActiveMemoryPassArgs, w as ActiveMemoryPassResult, x as AgentMemory, y as BudgetCheck, z as BudgetTotal, D as BudgetUsageEvent, E as CloudEnv, F as CloudRepo, H as ContextBudget, K as ContextManagerKind, N as ContextSnapshot, O as ContextSource, Q as ContextSourceStatus, R as CreateSkillSpec, T as Cron, U as CronCreateOptions, V as CronGetOptions, W as CronJob, X as CronJobStatus, Y as CronListOptions, Z as CronOperationOptions, _ as CronRunOptions, $ as CronRuntime, a0 as CronSchedulerStatus, a1 as CronStartOptions, a2 as HookName, a3 as InvalidateCacheOptions, a4 as MemoryAdapter, a5 as MemoryAdapterCapabilities, a6 as MemoryContext, a7 as MemoryFact, a8 as MemoryProviderHandle, a9 as MemoryProviderInitOptions, aa as MemoryRevision, ab as MemoryToolSchema, ac as MemoryTurnMessage, ad as PersonalityPreset, ae as PluginContext, af as PostAssistantReplyContext, ag as PreToolCallContext, ah as PreUserSendContext, ai as PreUserSendResult, aj as ProviderCapability, ak as ProviderRoute, al as ProviderTransform, am as ProviderTransformContext, an as RecordSessionSummaryArgs, ao as ResolvedProviderRoute, ap as RunUntilIterator, aq as SDKAgentPlugins, ar as SDKAgentSkillDetail, as as SDKAgentSkills, at as SDKArtifact, au as SDKContextManager, av as SDKPluginMetadata, aw as SDKProvidersManager, ax as SessionRecord, ay as SessionStore, az as SettingSource, aA as Skill, aB as SkillsResolver, aC as SkillsResolverContext, aD as SystemPromptContext, aE as SystemPromptMemoryFact, aF as SystemPromptSkillRef, aG as TelemetrySettings, aH as Verdict } from './cron-BN6JJlDw.js';
5
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-OJbGyweZ.js';
6
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-OJbGyweZ.js';
7
7
  import * as zod from 'zod';
@@ -1189,23 +1189,22 @@ interface JudgeOptions {
1189
1189
  /** Override env. Default `process.env.OPENROUTER_API_KEY` (EC-A). */
1190
1190
  apiKey?: string;
1191
1191
  }
1192
-
1193
1192
  /**
1194
- * Public types for the judge subsystem (T2.1, ADR D120).
1193
+ * M80 a credencial ou o modelo do judge não servem: 401/404.
1195
1194
  *
1196
- * @internal
1195
+ * Falha RÁPIDA por design. `rules/error-handling.md § 2` separa recuperável de irrecuperável, e um
1196
+ * modelo inexistente não passa a existir no retry — dobrar isso em `{parseFailed: true}` fazia o loop
1197
+ * tentar três vezes e reportar "failed" por limite de falhas consecutivas, escondendo que a causa era
1198
+ * credencial. Falha lenta e opaca trocada por rápida e clara.
1199
+ *
1200
+ * Falha de PARSE e erro de rede continuam dobrados: são recuperáveis, e o loop já decide por falhas
1201
+ * consecutivas.
1197
1202
  */
1198
- /** Outcome of {@link parseVerdict} / {@link judgeCallImpl}. */
1199
- interface JudgeResult {
1200
- verdict: Verdict;
1201
- reason: string;
1202
- /**
1203
- * `true` when the underlying text did not start with one of the three
1204
- * canonical prefixes. The verdict is set to `"continue"` (fail-safe,
1205
- * ADR D121) to avoid stopping prematurely; callers track consecutive
1206
- * failures and bail via `maxConsecutiveJudgeFailures`.
1207
- */
1208
- parseFailed: boolean;
1203
+ declare class JudgeCredentialError extends TheokitAgentError {
1204
+ readonly httpStatus: number;
1205
+ readonly judgeModel: string;
1206
+ readonly name = "JudgeCredentialError";
1207
+ constructor(httpStatus: number, judgeModel: string, cause: unknown);
1209
1208
  }
1210
1209
 
1211
1210
  /**
@@ -2310,4 +2309,4 @@ declare function toShareGptTrajectory(result: BatchResult, options?: {
2310
2309
  model?: string;
2311
2310
  }): ShareGptTrajectory | null;
2312
2311
 
2313
- export { Agent, AgentBuilder, AgentDefinition, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, withCwdMutex };
2312
+ export { Agent, AgentBuilder, AgentDefinition, AgentFactory, AgentOperationOptions, AgentOptions, type AgentPromptResult, type AgentRegistryOptions, type BatchItem, type BatchOptions, type BatchProgress, type BatchResult, Budget, BudgetHandle, BudgetOptions, BudgetSnapshot, BudgetTracker, CloudOptions, ContextSettings, type CounterBudgetTrackerOptions, CustomTool, type DeepPartial, type DefineProviderOptions, type DefineToolSpec, type DreamingSweepOptions, type DreamingSweepResult, ErrorMetadata, EventBus, type EvictReason, GOAL_CONTINUATION_MARKER, GenerateObjectError, type GenerateObjectOptions, type GenerateObjectResult, GetAgentOptions, GetRunOptions, GoalEvent, type GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JobQueue, type JobQueueOptions, JudgeCredentialError, JudgeResult, ListAgentsOptions, ListResult, ListRunsOptions, LiveAgentRegistry, LocalOptions, McpServerConfig, Memory, MemoryId, MemoryProvider, MemorySettings, type MigrateOptions, type MigrateResult, type ModelListItem, type ModelParameterDefinition, ModelSelection, type ModelVariant, NoopMemoryProvider, type NormalizedJsonSchema, PermissionEngine, type PermissionGate, type PermissionGateContext, type PermissionGateDecision, PermissionMode, PermissionPlugin, type PermissionPluginOptions, Plugin, PluginsSettings, PreToolCallDecision, Processor, Provider, ProviderProfile, ProviderRoutingSettings, Run, RunEventSink, RunResult, SDKAgent, SDKAgentInfo, SDKMessage, type SDKModel, SDKProvider, type SDKRepository, type SDKUser, Security, type SessionScope, type ShareGptMessage, type ShareGptTrajectory, SkillReadTool, SkillsSettings, Squad, type SquadOptions, type SquadRun, StreamObjectError, type StreamObjectEvent, type StreamObjectOptions, SystemPromptResolver, TASK_RESERVED_PREFIXES, Task, type TaskCancelResult, type TaskConfigureOptions, type TaskEvent, type TaskFilter, type TaskHandle, type TaskKind, type TaskState, type TaskStoreOptions, type TaskSubmitOptions, type TaskWorkContext, type TaskWorkFn, Theokit, TheokitAgentError, type TheokitRequestOptions, TokenLimiter, type TokenLimiterOptions, Tool, ToolError, ToolResultContentBlock, UnicodeNormalizer, type UnicodeNormalizerOptions, UsageAccumulator, chargeAndCheckThresholds, computeCost, createCounterBudgetTracker, estimateTokens, extractRawId, getPricingEntry, inferApiMode, isValidTaskId, migrateSqliteToLance, mkMemoryId, normalizeSchema, normalizeUsage, preflightCheck, runGoalLoop, scopedConversationId, sessionScopePrefix, toShareGptTrajectory, withCwdMutex };
package/dist/index.js CHANGED
@@ -1,13 +1,14 @@
1
1
  export { StreamObjectError } from './chunk-S5RCBTSF.js';
2
2
  export { GOAL_CONTINUATION_MARKER } from './chunk-2ONFGMBV.js';
3
+ export { JudgeCredentialError } from './chunk-CR3DGWUQ.js';
3
4
  export { GenerateObjectError } from './chunk-TQKCU7CL.js';
4
5
  import './chunk-GJAGKFTR.js';
5
6
  import { Workflow, agentStep } from './chunk-BFWPZMG7.js';
6
7
  import './chunk-UVNG67DG.js';
7
8
  import './chunk-CAH3G4IS.js';
8
- export { Cron } from './chunk-KDNBTPY2.js';
9
- import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, shouldUseFixtureMode, isFixtureApiKey, httpRequest, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-PSJN532Q.js';
10
- export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-PSJN532Q.js';
9
+ export { Cron } from './chunk-PF5Y5BHG.js';
10
+ import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, shouldUseFixtureMode, isFixtureApiKey, httpRequest, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-XW6RXVGB.js';
11
+ export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-XW6RXVGB.js';
11
12
  import { configure, submit, list, get, cancel, subscribe } from './chunk-HRA3CPGG.js';
12
13
  export { emitRunEvent } from './chunk-HRA3CPGG.js';
13
14
  import './chunk-SQLZ7ONU.js';
@@ -694,9 +695,9 @@ var EventBus = class {
694
695
  // src/goal-loop.ts
695
696
  function runGoalLoop(agent, goal, options, depsOverride) {
696
697
  async function* wrap() {
697
- const { runUntilImpl } = await import('./run-until-XLHEHRQM.js');
698
+ const { runUntilImpl } = await import('./run-until-YZ2ODWOF.js');
698
699
  const deps = depsOverride ?? await (async () => {
699
- const { judgeCallImpl } = await import('./judge-call-CEQ3FYYD.js');
700
+ const { judgeCallImpl } = await import('./judge-call-D7R3ZTZS.js');
700
701
  const { getAgentFacade } = await import('./agent-factory-registry-ZVTABLEY.js');
701
702
  const create = getAgentFacade().create;
702
703
  return {