@theokit/agents 4.7.0 → 4.9.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as Guardrail, L as LoopStrategy, R as ReflectionStrategy, C as CompiledAgentOptions, M as MainLoopMeta, a as CompiledTool, b as ReasoningEffort, c as RoundStreamFactory, S as StreamEvent, D as DelegationResult, d as ContextWindowOptions, e as SkillsOptions, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions, f as AgentManifestEntry } from './bridge-entry-Ddu3Ug_3.js';
2
- export { g as AGENT_BRAND, h as AfterToolCallContext, i as AgentBuilder, j as AgentDefinition, k as AgentDefinitionError, l as AgentExecutionContext, m as AgentManifest, n as AgentManifestSource, o as AgentManifestTool, p as AgentOptions, q as AgentRoute, r as AgentRouteContext, s as AgentRunInfo, t as AgentStreamEvent, u as AgentTurnMetadata, v as AgentsPluginOptions, w as ApiErrorContext, x as ApiErrorDecision, y as ApiErrorPolicy, z as ApprovalRequiredEvent, B as ArtifactChunkEvent, E as ArtifactStartEvent, F as BackgroundDelegation, I as BeforeToolCallContext, J as BudgetExceededError, K as BudgetOptions, N as CheckpointSavedEvent, O as CompiledContextWindow, P as ContextualTool, Q as CostBudgetExceededError, U as DEFAULT_MAX_ITERATIONS, V as DefineAgentConfig, W as DelegateFn, X as DelegateOptions, Y as DelegationError, Z as DoneEvent, _ as ErrorEvent, $ as FileEditEvent, a0 as GuardrailAction, a1 as GuardrailPhase, a2 as GuardrailResult, a3 as GuardrailViolationError, a4 as HitlDecision, a5 as InferAgentInput, a6 as InferAgentToolNames, a7 as IterationEvent, a8 as LLMCallContext, a9 as LoopFinishReason, aa as LoopOutcome, ab as LoopStrategyConfig, ac as MainLoopOptions, ad as McpApprovalSpec, ae as McpRegistryConfig, af as McpRequestContext, ag as McpSelection, ah as PartialToolCallEvent, ai as PolicyHandler, aj as ProcessInputContext, ak as ReflectionContext, al as ReflectionResult, am as ReflectionStrategyConfig, an as RunStartedEvent, ao as ScoreVerdict, ap as ScoredDelegation, aq as Scorer, ar as SdkAgentHandle, as as SdkMessage, at as Segment, au as SkillsRequestContext, av as SkillsSelection, aw as StateUpdateEvent, ax as TextDeltaEvent, ay as ThinkingEvent, az as TimeoutAction, aA as ToolCallEvent, aB as ToolCallVeto, aC as ToolHooks, aD as ToolHooksPlugin, aE as ToolResultEvent, aF as ToolWalkResult, aG as ToolboxOptions, aH as ToolboxWalkResult, aI as agentsPlugin, aJ as buildModelSelection, aK as compileAgentDefinition, aL as compileAgentModule, aM as compileContextWindow, aN as compileProjectContext, aO as compileSkills, aP as compileTools, aQ as createAgentExecutionContext, aR as createApiErrorHandler, aS as createSdkAgentStream, aT as createThinkTagExtractor, aU as createToolHooksPlugin, aV as delegate, aW as delegateBackground, aX as delegateWithScoring, aY as extractThinkTagStream, aZ as generateAgentManifest, a_ as generateAgentRoutes, a$ as isAgentContext, b0 as isAgentDefinition, b1 as isApprovalRequired, b2 as isDone, b3 as isError, b4 as isPartialToolCall, b5 as isTextDelta, b6 as isToolCall, b7 as isToolResult, b8 as ladderReflectionStrategy, b9 as loopStrategyConfigSchema, ba as mcpRegistry, bb as mcpToolApprovals, bc as noopReflectionStrategy, bd as presentUIMessageStream, be as projectContextMetadataOnlyKnobs, bf as reflectionStrategyConfigSchema, bg as resolveEnabledSkills, bh as resolveLoopStrategy, bi as resolveMcpServers, bj as runWithApiErrorHandling, bk as streamAgentResponse, bl as streamAgentUIMessages, bm as toAgentFactory, bn as translateSdkEvent } from './bridge-entry-Ddu3Ug_3.js';
1
+ import { G as Guardrail, L as LoopStrategy, R as ReflectionStrategy, C as CompiledAgentOptions, M as MainLoopMeta, a as CompiledTool, b as ReasoningEffort, c as RoundStreamFactory, S as StreamEvent, D as DelegationResult, d as ContextWindowOptions, e as SkillsOptions, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions, f as AgentManifestEntry } from './bridge-entry-BmPk3TPf.js';
2
+ export { g as AGENT_BRAND, h as AfterToolCallContext, i as AgentBuilder, j as AgentDefinition, k as AgentDefinitionError, l as AgentExecutionContext, m as AgentManifest, n as AgentManifestSource, o as AgentManifestTool, p as AgentOptions, q as AgentRoute, r as AgentRouteContext, s as AgentRunInfo, t as AgentStreamEvent, u as AgentTurnMetadata, v as AgentsPluginOptions, w as ApiErrorContext, x as ApiErrorDecision, y as ApiErrorPolicy, z as ApprovalRequiredEvent, B as ArtifactChunkEvent, E as ArtifactStartEvent, F as BackgroundDelegation, I as BeforeToolCallContext, J as BudgetExceededError, K as BudgetOptions, N as CheckpointSavedEvent, O as CompiledContextWindow, P as ContextualTool, Q as CostBudgetExceededError, U as DEFAULT_MAX_ITERATIONS, V as DefineAgentConfig, W as DelegateFn, X as DelegateOptions, Y as DelegationError, Z as DoneEvent, _ as ErrorEvent, $ as FileEditEvent, a0 as GuardrailAction, a1 as GuardrailPhase, a2 as GuardrailResult, a3 as GuardrailViolationError, a4 as HitlDecision, a5 as InferAgentInput, a6 as InferAgentToolNames, a7 as IterationEvent, a8 as LLMCallContext, a9 as LoopFinishReason, aa as LoopOutcome, ab as LoopStrategyConfig, ac as MainLoopOptions, ad as McpApprovalSpec, ae as McpRegistryConfig, af as McpRequestContext, ag as McpSelection, ah as PartialToolCallEvent, ai as PolicyHandler, aj as ProcessInputContext, ak as ReflectionContext, al as ReflectionResult, am as ReflectionStrategyConfig, an as RunStartedEvent, ao as ScoreVerdict, ap as ScoredDelegation, aq as Scorer, ar as SdkAgentHandle, as as SdkMessage, at as Segment, au as SkillsRequestContext, av as SkillsSelection, aw as StateUpdateEvent, ax as TextDeltaEvent, ay as ThinkingEvent, az as TimeoutAction, aA as ToolCallEvent, aB as ToolCallVeto, aC as ToolHooks, aD as ToolHooksPlugin, aE as ToolResultEvent, aF as ToolWalkResult, aG as ToolboxOptions, aH as ToolboxWalkResult, aI as agentsPlugin, aJ as buildModelSelection, aK as compileAgentDefinition, aL as compileAgentModule, aM as compileContextWindow, aN as compileProjectContext, aO as compileSkills, aP as compileTools, aQ as createAgentExecutionContext, aR as createApiErrorHandler, aS as createSdkAgentStream, aT as createThinkTagExtractor, aU as createToolHooksPlugin, aV as delegate, aW as delegateBackground, aX as delegateWithScoring, aY as extractThinkTagStream, aZ as generateAgentManifest, a_ as generateAgentRoutes, a$ as isAgentContext, b0 as isAgentDefinition, b1 as isApprovalRequired, b2 as isDone, b3 as isError, b4 as isPartialToolCall, b5 as isTextDelta, b6 as isToolCall, b7 as isToolResult, b8 as ladderReflectionStrategy, b9 as loopStrategyConfigSchema, ba as mcpRegistry, bb as mcpToolApprovals, bc as noopReflectionStrategy, bd as presentUIMessageStream, be as projectContextMetadataOnlyKnobs, bf as reflectionStrategyConfigSchema, bg as resolveEnabledSkills, bh as resolveLoopStrategy, bi as resolveMcpServers, bj as runWithApiErrorHandling, bk as streamAgentResponse, bl as streamAgentUIMessages, bm as toAgentFactory, bn as translateSdkEvent } from './bridge-entry-BmPk3TPf.js';
3
3
  export { ConfigurationError } from '@theokit/sdk/errors';
4
4
  import { PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition, BudgetTracker, CustomTool, GoalLoopAgent, GoalOptions, runGoalLoop, GoalEvent, GoalResult, InlineSkill } from '@theokit/sdk';
5
5
  export { Agent, CustomTool, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, Provider, SDKAgent, SessionRecord, Squad, Tool } from '@theokit/sdk';
@@ -182,10 +182,24 @@ declare const tokenBudgetCompactionStrategy: TranscriptCompactionStrategy;
182
182
  * referencia: knowledge-base/references/spring-ai DefaultChatClientBuilder.java (build() returns standalone).
183
183
  */
184
184
 
185
+ /**
186
+ * Resolve a credencial no início do stream, em vez de exigir o valor pronto antes da chamada.
187
+ *
188
+ * M74 — o ponto de injeção da credencial JÁ era por run; o que travava era o tipo. Com `string`, quem
189
+ * chama precisa ter o valor em mãos antes, então o *momento* é por run mas o *valor* é congelado
190
+ * antes — e um bearer OAuth com validade curta atravessa a run inteira sem ser reconsultado. Foi a
191
+ * causa estrutural de um turno silencioso em produção.
192
+ */
193
+ type CredentialResolver = () => string | Promise<string>;
185
194
  /** Options for {@link AgentRunner.run}. */
186
195
  interface AgentRunnerRunOptions {
187
- /** LLM API key. */
188
- readonly apiKey: string;
196
+ /**
197
+ * LLM API key, ou um resolvedor chamado quando o stream começa.
198
+ *
199
+ * `string` continua válido e é o caminho de quem tem chave de API — ela não expira, e exigir um
200
+ * resolvedor ali seria cerimônia sem ganho. O resolvedor existe para credencial que EXPIRA.
201
+ */
202
+ readonly apiKey: string | CredentialResolver;
189
203
  /** Session id override (default: a fresh isolated id). */
190
204
  readonly sessionId?: string;
191
205
  /** Cumulative USD budget across rounds. */
package/dist/index.js CHANGED
@@ -71,7 +71,7 @@ import {
71
71
  toolRuntimeName,
72
72
  translateSdkEvent,
73
73
  unicodeNormalizer
74
- } from "./chunk-LIRSFEEJ.js";
74
+ } from "./chunk-ZQKR6XQS.js";
75
75
  import {
76
76
  __name
77
77
  } from "./chunk-7QVYU63E.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/agents",
3
- "version": "4.7.0",
3
+ "version": "4.9.0",
4
4
  "description": "AI agents as first-class citizens of the TheoKit pipeline. The fluent agent()/tool() builders compile to SDK Agent.create() (M31 builder-only authoring API).",
5
5
  "type": "module",
6
6
  "sideEffects": false,