@theokit/agents 4.23.1 → 4.25.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.
@@ -0,0 +1,227 @@
1
+ import { ChatTransport, UIMessage, UIMessageChunk } from 'ai';
2
+
3
+ /**
4
+ * M41 (ADR-0050 D2) — a HITL approval decision sent to settle a paused gated-tool call. Mirrors the
5
+ * `POST /api/agents/<name>/approve/<id>` wire body (`approve-agent.ts` `parseApprovalBody`). Defined
6
+ * on the client side (not imported from `server/`) as the client's view of the boundary contract.
7
+ */
8
+ interface ApprovalDecision {
9
+ /** Whether the paused gated tool may proceed. */
10
+ approved: boolean;
11
+ /** Optional reason surfaced to the model on denial. */
12
+ reason?: string;
13
+ /** Optional small structured note (edited args, a reviewer comment) — capped server-side at 16 KiB. */
14
+ payload?: unknown;
15
+ }
16
+ /**
17
+ * M43 (ADR-0052) — per-request context attached uniformly across every transport.
18
+ *
19
+ * `headers` is the serializable, HTTP-native half (an auth token → request headers on `HttpTransport`);
20
+ * `metadata` is the structured, same-process half forwarded to the in-process runner
21
+ * (`InProcessTransport`) / the Tauri `invoke` (`ChannelTransport`). Threaded through the seam's existing
22
+ * `ChatRequestOptions` — NOT a new channel. The turn input stays the request `body`.
23
+ */
24
+ interface RequestContext {
25
+ /** Per-request headers (e.g. auth). HTTP-native; mapped to request headers by `HttpTransport`. */
26
+ headers?: Record<string, string>;
27
+ /** Structured per-request context (tenant, provider, …) forwarded to in-process / channel runners. */
28
+ metadata?: unknown;
29
+ }
30
+ /**
31
+ * M41 (ADR-0050 D1/D2) — the client transport seam.
32
+ *
33
+ * It IS `ai`'s `ChatTransport<UIMessage>` (the adopted SOTA interface — we do NOT invent a parallel
34
+ * one) plus ONE optional method, `approve`, for TheoKit's OUT-OF-BAND HITL (the server pauses the run;
35
+ * the client settles it via a separate call). `ai`'s `ChatTransport` has no `approve` because its HITL
36
+ * is in-band (a re-sent message part); ours is out-of-band, and the settle route differs per transport
37
+ * (HTTP `POST /approve/<id>` vs an inline callback), so it belongs on the transport. `approve` is
38
+ * optional — agents without gated tools never settle an approval.
39
+ *
40
+ * `HttpTransport` (web) and `InProcessTransport` (TUI/desktop) implement this; `useAgent` drives it.
41
+ */
42
+ type AgentTransport = ChatTransport<UIMessage> & {
43
+ approve?(approvalId: string, decision: ApprovalDecision): Promise<void>;
44
+ };
45
+
46
+ /** An inline approval request handed to the transport's resolver (structural — no server import). */
47
+ interface InProcessApprovalRequestLike {
48
+ approvalId: string;
49
+ toolName: string;
50
+ opts: unknown;
51
+ }
52
+ /** Resolve one gated-tool approval inline (mirrors the SDK's `boolean | HitlDecision` return). */
53
+ type InProcessAwaitApproval = (req: InProcessApprovalRequestLike) => Promise<boolean | ApprovalDecision>;
54
+ /** The input the injected runner receives (structurally compatible with `StreamAgentTurnInProcessInput`). */
55
+ interface InProcessRunInput {
56
+ message: string;
57
+ sessionId?: string;
58
+ signal?: AbortSignal;
59
+ awaitApproval?: InProcessAwaitApproval;
60
+ /** M43 — per-request context (from `sendMessages`'s `metadata`) — tenant / provider / auth for the runner. */
61
+ context?: unknown;
62
+ }
63
+ /**
64
+ * The in-process turn runner. The consumer binds `streamAgentTurnInProcess(mod, apiKey, …)`:
65
+ * `new InProcessTransport({ run: (input) => streamAgentTurnInProcess(mod, apiKey, input) })`.
66
+ * Injecting it keeps this client module decoupled from `server/` and makes the transport testable.
67
+ */
68
+ type InProcessRunner = (input: InProcessRunInput) => AsyncGenerator<UIMessageChunk>;
69
+ interface InProcessTransportOptions {
70
+ run: InProcessRunner;
71
+ }
72
+ /**
73
+ * M41 (ADR-0050 D4) — `ChatTransport` over the in-process seam (`streamAgentTurnInProcess`), for the
74
+ * terminal/desktop surfaces that run client + server in ONE process (no HTTP loopback).
75
+ *
76
+ * - `sendMessages`: bridge the injected runner's `AsyncGenerator<UIMessageChunk>` into a
77
+ * `ReadableStream<UIMessageChunk>` (honoring `abortSignal`, which the runner forwards to the SDK).
78
+ * - `reconnectToStream`: always `null` — a single process has no dropped server-side stream to resume
79
+ * (mirrors `ai`'s `DirectChatTransport`).
80
+ * - `approve`: resolve the pending inline approval by id (the run parks on `awaitApproval`). An unknown
81
+ * id rejects (fail-fast, Rule 8 — never a silent resolve).
82
+ *
83
+ * Error asymmetry vs `HttpTransport` (by design, matching the `ChatTransport` contract): a runner that
84
+ * throws SYNCHRONOUSLY surfaces the error when the stream is READ (via `controller.error`), not from the
85
+ * `sendMessages` promise — whereas `HttpTransport` throws from `sendMessages` on a non-2xx response.
86
+ */
87
+ declare class InProcessTransport implements AgentTransport {
88
+ #private;
89
+ constructor(options: InProcessTransportOptions);
90
+ sendMessages(options: Parameters<ChatTransport<UIMessage>['sendMessages']>[0]): Promise<ReadableStream<UIMessageChunk>>;
91
+ reconnectToStream(): Promise<ReadableStream<UIMessageChunk> | null>;
92
+ approve(approvalId: string, decision: ApprovalDecision): Promise<void>;
93
+ }
94
+
95
+ /** Handlers the transport hands to the injected push source for one turn. */
96
+ interface ChannelTurnHandlers {
97
+ /** One pushed JSONL line (a serialized `UIMessageChunk`). */
98
+ onLine: (line: string) => void;
99
+ /** The turn ended — no more lines. */
100
+ onClose: () => void;
101
+ /** The push source failed. */
102
+ onError?: (err: unknown) => void;
103
+ }
104
+ /**
105
+ * The injected push source — a Tauri `Channel`/`invoke` bridge, kept STRUCTURAL so core adds no
106
+ * `@tauri-apps/*` dependency and the transport is testable with a fake (ADR-0051 D2). The Tauri app
107
+ * wires it: `new Channel()`, `channel.onmessage = onLine`, `invoke('run_agent', { message, channel })`,
108
+ * returning a teardown that aborts the sidecar turn.
109
+ */
110
+ interface ChannelPushSource {
111
+ /**
112
+ * Start a turn; deliver each JSONL `UIMessageChunk` line to `onLine`, then `onClose`. Return a teardown.
113
+ * `turn.context` (M43) is the per-request context (from the seam's `metadata`) — the Tauri `invoke`
114
+ * forwards it to the sidecar. When no context is set it is present as `context: undefined` (the key is
115
+ * NOT absent) — a sidecar that checks `'context' in turn` should treat `undefined` as "no context".
116
+ */
117
+ start(turn: {
118
+ message: string;
119
+ context?: unknown;
120
+ }, handlers: ChannelTurnHandlers): () => void;
121
+ /** Optional HITL settle (another Tauri `invoke`). */
122
+ settle?(approvalId: string, decision: ApprovalDecision): Promise<void>;
123
+ }
124
+ interface ChannelTransportOptions {
125
+ source: ChannelPushSource;
126
+ }
127
+ /**
128
+ * M42 (ADR-0051) — `ChatTransport` over a Tauri-`Channel`-shaped push source, for the desktop webview.
129
+ *
130
+ * - `sendMessages`: start the turn via the injected source and bridge its pushed JSONL frames into a
131
+ * `ReadableStream<UIMessageChunk>` (built in `start` — a Channel is push, so the stream's queue buffers
132
+ * frames; ADR-0051 D3). A malformed JSONL line is SKIPPED, never fatal (ADR-0051 D4, Rule 8). `abortSignal`
133
+ * tears down the source and closes the stream.
134
+ * - `reconnectToStream`: always `null` — the M36 sidecar runs the turn directly (no durable server stream);
135
+ * this is the honest parity for a single-process push surface (ADR-0051 D5; mirrors `InProcessTransport`).
136
+ * - `approve`: routes to the injected `settle` (another Tauri `invoke`); absent `settle` → a typed error.
137
+ *
138
+ * The push source is INJECTED — core stays Tauri-agnostic and this transport is unit-tested with a fake.
139
+ */
140
+ declare class ChannelTransport implements AgentTransport {
141
+ #private;
142
+ constructor(options: ChannelTransportOptions);
143
+ sendMessages(options: Parameters<ChatTransport<UIMessage>['sendMessages']>[0]): Promise<ReadableStream<UIMessageChunk>>;
144
+ reconnectToStream(): Promise<ReadableStream<UIMessageChunk> | null>;
145
+ approve(approvalId: string, decision: ApprovalDecision): Promise<void>;
146
+ }
147
+
148
+ type UseAgentStatus = 'idle' | 'streaming' | 'done' | 'error';
149
+ /** The observable state the store exposes (stable reference between emits — `useSyncExternalStore` contract). */
150
+ interface AgentClientState {
151
+ /** The CURRENT turn's assistant messages (per-turn; reset each `send`). Back-compat — unchanged since M41. */
152
+ messages: UIMessage[];
153
+ /**
154
+ * M46 — the full conversation: committed turns + the current turn's user message + in-flight assistant.
155
+ * Accumulated across sends (never reset except by `reset()`), with stable ids committed exactly once.
156
+ * Render this instead of hand-rolling a transcript from `messages`.
157
+ */
158
+ thread: UIMessage[];
159
+ status: UseAgentStatus;
160
+ error: Error | undefined;
161
+ }
162
+ /**
163
+ * M41 (ADR-0050 D6) — the framework-agnostic agent client store.
164
+ *
165
+ * Holds `messages`/`status`/`error`, drives an {@link AgentTransport}, and notifies subscribers on
166
+ * change. It is the SINGLE consolidation point: web (`HttpTransport`) and terminal/desktop
167
+ * (`InProcessTransport`) run the SAME store. `useAgent` is a thin React binding over it via
168
+ * `useSyncExternalStore`; a standalone (no-React) client (M44) can subscribe directly. Being
169
+ * framework-agnostic, it is unit-tested without a DOM.
170
+ */
171
+ declare class AgentClient<TInput = unknown> {
172
+ #private;
173
+ constructor(transport: AgentTransport, contextResolver?: () => RequestContext | undefined);
174
+ /** Subscribe to state changes; returns an unsubscribe fn. */
175
+ subscribe: (listener: () => void) => (() => void);
176
+ /** The current immutable snapshot (stable reference until the next emit). */
177
+ getSnapshot: () => AgentClientState;
178
+ /** Send a typed input; opens a fresh stream (replaces prior messages). */
179
+ send: (input: TInput) => void;
180
+ /** Resume an interrupted stream via the transport's `reconnectToStream` (no-op when unavailable). */
181
+ reconnect: () => void;
182
+ /** Abort an in-flight stream (not an error — leaves messages as-is). */
183
+ abort: () => void;
184
+ /** Clear messages + error, back to idle. */
185
+ reset: () => void;
186
+ /** Settle a paused HITL approval via the transport's HITL path (HTTP POST or inline callback). */
187
+ approve: (approvalId: string, decision: ApprovalDecision) => Promise<void>;
188
+ }
189
+
190
+ /**
191
+ * M47 (ADR-M47-2) — a typed, client-safe handle for an exposed agent.
192
+ *
193
+ * It carries ONLY the HTTP `path` at runtime plus phantom `input`/`toolNames` types (never populated) — so
194
+ * `useAgent(chat)` / `createAgentClient(chat…)` bind with NO magic string (the path is generated from the
195
+ * `@Expose` exposure, not hand-typed) and NO duplicated input type (the input type flows through the phantom
196
+ * generic, inferred from the agent's `.input()`). This mirrors tRPC/Hono's type-only handle: the client
197
+ * pulls the agent's TYPE via `import type`, never its server runtime. The generated `@theo/agents` module
198
+ * emits one `export const <name> = agentHandle('/api/agents/<name>')` per agent, typed with the phantoms.
199
+ */
200
+ interface AgentHandle<TInput = unknown, TToolNames extends string = string> {
201
+ /** The agent's HTTP endpoint path (e.g. `/api/agents/chat`). The only serializable/runtime-bearing field. */
202
+ readonly path: string;
203
+ /**
204
+ * M47 — bind this agent in-process (TUI / single-process): wraps the app's runner in an
205
+ * {@link InProcessTransport}. `useAgent(chat.inProcess(run))` drives the SAME agent without HTTP.
206
+ */
207
+ inProcess(run: InProcessRunner): InProcessTransport;
208
+ /**
209
+ * M47 — bind this agent over a push channel (Tauri desktop webview): wraps the source in a
210
+ * {@link ChannelTransport}. `createAgentClient(chat.channel(source))` drives the SAME agent.
211
+ */
212
+ channel(source: ChannelPushSource): ChannelTransport;
213
+ /** Phantom — the agent's `input` type, carried for `useAgent(handle).send` inference. Never populated. */
214
+ readonly __input?: TInput;
215
+ /** Phantom — the agent's tool-name union, carried end-to-end. Never populated. */
216
+ readonly __toolNames?: TToolNames;
217
+ }
218
+ /**
219
+ * Build an {@link AgentHandle} from an agent's HTTP path. Types are supplied by the caller/codegen. The
220
+ * `inProcess`/`channel` binders are methods (dropped by `JSON.stringify`, so the `{ path }` core stays
221
+ * serializable + client-safe) that produce the M41 transports for the non-web surfaces.
222
+ */
223
+ declare function agentHandle<TInput = unknown, TToolNames extends string = string>(path: string): AgentHandle<TInput, TToolNames>;
224
+ /** Narrow an unknown binding to an {@link AgentHandle} (has a string `path`, is not a transport). */
225
+ declare function isAgentHandle(value: unknown): value is AgentHandle;
226
+
227
+ export { type ApprovalDecision as A, type ChannelPushSource as C, type InProcessApprovalRequestLike as I, type RequestContext as R, type UseAgentStatus as U, type AgentHandle as a, type AgentTransport as b, AgentClient as c, type AgentClientState as d, ChannelTransport as e, type ChannelTransportOptions as f, type ChannelTurnHandlers as g, type InProcessAwaitApproval as h, type InProcessRunInput as i, type InProcessRunner as j, InProcessTransport as k, type InProcessTransportOptions as l, agentHandle as m, isAgentHandle as n };
@@ -2109,4 +2109,4 @@ declare function agentsPlugin(opts: AgentsPluginOptions): {
2109
2109
  register(app: PluginApp): void;
2110
2110
  };
2111
2111
 
2112
- export { type FileEditEvent as $, type ApprovalOptions as A, type ArtifactChunkEvent as B, type CompiledAgentOptions as C, type DelegationResult as D, type ArtifactStartEvent as E, type BackgroundDelegation as F, type Guardrail as G, type HumanInTheLoopOptions as H, type BeforeToolCallContext as I, BudgetExceededError as J, type BudgetOptions as K, type LoopStrategy as L, type MainLoopMeta as M, type CheckpointSavedEvent as N, type CompiledContextWindow as O, ContextualTool as P, CostBudgetExceededError as Q, type ReflectionStrategy as R, type StreamEvent as S, type ToolOptions as T, DEFAULT_MAX_ITERATIONS as U, type DefineAgentConfig as V, type DelegateFn as W, type DelegateOptions as X, DelegationError as Y, type DoneEvent as Z, type ErrorEvent as _, type CompiledTool as a, generateAgentRoutes as a$, type GuardrailAction as a0, type GuardrailPhase as a1, type GuardrailResult as a2, GuardrailViolationError as a3, type HitlDecision as a4, type HookHandlers as a5, type InferAgentInput as a6, type InferAgentToolNames as a7, type IterationEvent as a8, type LLMCallContext as a9, type TimeoutAction as aA, type ToolCallEvent as aB, type ToolCallVeto as aC, type ToolHooks as aD, type ToolHooksPlugin as aE, type ToolResultEvent as aF, type ToolWalkResult as aG, type ToolboxOptions as aH, type ToolboxWalkResult as aI, agentsPlugin as aJ, buildModelSelection as aK, compileAgentDefinition as aL, compileAgentModule as aM, compileContextWindow as aN, compileProjectContext as aO, compileSkills as aP, compileTools as aQ, createAgentExecutionContext as aR, createApiErrorHandler as aS, createSdkAgentStream as aT, createThinkTagExtractor as aU, createToolHooksPlugin as aV, delegate as aW, delegateBackground as aX, delegateWithScoring as aY, extractThinkTagStream as aZ, generateAgentManifest as a_, type LoopFinishReason as aa, type LoopOutcome as ab, type LoopStrategyConfig as ac, type MainLoopOptions as ad, type McpApprovalSpec as ae, type McpRegistryConfig as af, type McpRequestContext as ag, type McpSelection as ah, type PartialToolCallEvent as ai, type PolicyHandler as aj, type ProcessInputContext as ak, type ReflectionContext as al, type ReflectionResult as am, type ReflectionStrategyConfig as an, type RunStartedEvent as ao, type ScoreVerdict as ap, type ScoredDelegation as aq, type Scorer as ar, type SdkAgentHandle as as, type SdkMessage as at, type Segment as au, type SkillsRequestContext as av, type SkillsSelection as aw, type StateUpdateEvent as ax, type TextDeltaEvent as ay, type ThinkingEvent as az, type ReasoningEffort as b, isAgentContext as b0, isAgentDefinition as b1, isApprovalRequired as b2, isDone as b3, isError as b4, isPartialToolCall as b5, isTextDelta as b6, isToolCall as b7, isToolResult as b8, ladderReflectionStrategy as b9, loopStrategyConfigSchema as ba, mcpRegistry as bb, mcpToolApprovals as bc, noopReflectionStrategy as bd, presentUIMessageStream as be, projectContextMetadataOnlyKnobs as bf, reflectionStrategyConfigSchema as bg, resolveEnabledSkills as bh, resolveLoopStrategy as bi, resolveMcpServers as bj, runWithApiErrorHandling as bk, streamAgentResponse as bl, streamAgentUIMessages as bm, toAgentFactory as bn, translateSdkEvent as bo, type RoundStreamFactory as c, type ContextWindowOptions as d, type SkillsOptions as e, type AgentManifestEntry as f, AGENT_BRAND as g, type AfterToolCallContext as h, AgentBuilder as i, type AgentDefinition as j, AgentDefinitionError as k, type AgentExecutionContext as l, type AgentManifest as m, type AgentManifestSource as n, type AgentManifestTool as o, type AgentOptions as p, type AgentRoute as q, type AgentRouteContext as r, type AgentRunInfo as s, type AgentStreamEvent as t, type AgentTurnMetadata as u, type AgentsPluginOptions as v, type ApiErrorContext as w, type ApiErrorDecision as x, type ApiErrorPolicy as y, type ApprovalRequiredEvent as z };
2112
+ export { type DoneEvent as $, type ApprovalOptions as A, type ApiErrorPolicy as B, type CompiledAgentOptions as C, type DelegationResult as D, type ApprovalRequiredEvent as E, type ArtifactChunkEvent as F, type Guardrail as G, type HumanInTheLoopOptions as H, type ArtifactStartEvent as I, type BackgroundDelegation as J, type BeforeToolCallContext as K, type LoopStrategy as L, type MainLoopMeta as M, BudgetExceededError as N, type BudgetOptions as O, type CheckpointSavedEvent as P, type CompiledContextWindow as Q, type ReflectionStrategy as R, type StreamEvent as S, type ToolOptions as T, ContextualTool as U, CostBudgetExceededError as V, DEFAULT_MAX_ITERATIONS as W, type DefineAgentConfig as X, type DelegateFn as Y, type DelegateOptions as Z, DelegationError as _, type CompiledTool as a, generateAgentManifest as a$, type ErrorEvent as a0, type FileEditEvent as a1, type GuardrailAction as a2, type GuardrailPhase as a3, type GuardrailResult as a4, GuardrailViolationError as a5, type HookHandlers as a6, type InferAgentInput as a7, type InferAgentToolNames as a8, type IterationEvent as a9, type ThinkingEvent as aA, type TimeoutAction as aB, type ToolCallEvent as aC, type ToolCallVeto as aD, type ToolHooks as aE, type ToolHooksPlugin as aF, type ToolResultEvent as aG, type ToolWalkResult as aH, type ToolboxOptions as aI, type ToolboxWalkResult as aJ, agentsPlugin as aK, buildModelSelection as aL, compileAgentDefinition as aM, compileAgentModule as aN, compileContextWindow as aO, compileProjectContext as aP, compileSkills as aQ, compileTools as aR, createAgentExecutionContext as aS, createApiErrorHandler as aT, createSdkAgentStream as aU, createThinkTagExtractor as aV, createToolHooksPlugin as aW, delegate as aX, delegateBackground as aY, delegateWithScoring as aZ, extractThinkTagStream as a_, type LLMCallContext as aa, type LoopFinishReason as ab, type LoopOutcome as ac, type LoopStrategyConfig as ad, type MainLoopOptions as ae, type McpApprovalSpec as af, type McpRegistryConfig as ag, type McpRequestContext as ah, type McpSelection as ai, type PartialToolCallEvent as aj, type PolicyHandler as ak, type ProcessInputContext as al, type ReflectionContext as am, type ReflectionResult as an, type ReflectionStrategyConfig as ao, type RunStartedEvent as ap, type ScoreVerdict as aq, type ScoredDelegation as ar, type Scorer as as, type SdkAgentHandle as at, type SdkMessage as au, type Segment as av, type SkillsRequestContext as aw, type SkillsSelection as ax, type StateUpdateEvent as ay, type TextDeltaEvent as az, type ReasoningEffort as b, generateAgentRoutes as b0, isAgentContext as b1, isAgentDefinition as b2, isApprovalRequired as b3, isDone as b4, isError as b5, isPartialToolCall as b6, isTextDelta as b7, isToolCall as b8, isToolResult as b9, ladderReflectionStrategy as ba, loopStrategyConfigSchema as bb, mcpRegistry as bc, mcpToolApprovals as bd, noopReflectionStrategy as be, presentUIMessageStream as bf, projectContextMetadataOnlyKnobs as bg, reflectionStrategyConfigSchema as bh, resolveEnabledSkills as bi, resolveLoopStrategy as bj, resolveMcpServers as bk, runWithApiErrorHandling as bl, streamAgentResponse as bm, toAgentFactory as bn, translateSdkEvent as bo, type RoundStreamFactory as c, type ContextWindowOptions as d, type SkillsOptions as e, type AgentManifestEntry as f, type HitlDecision as g, AGENT_BRAND as h, type AfterToolCallContext as i, AgentBuilder as j, type AgentDefinition as k, AgentDefinitionError as l, type AgentExecutionContext as m, type AgentManifest as n, type AgentManifestSource as o, type AgentManifestTool as p, type AgentOptions as q, type AgentRoute as r, streamAgentUIMessages as s, type AgentRouteContext as t, type AgentRunInfo as u, type AgentStreamEvent as v, type AgentTurnMetadata as w, type AgentsPluginOptions as x, type ApiErrorContext as y, type ApiErrorDecision as z };
package/dist/bridge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { g as AGENT_BRAND, h as AfterToolCallContext, i as AgentBuilder, j as AgentDefinition, k as AgentDefinitionError, l as AgentExecutionContext, m as AgentManifest, f as AgentManifestEntry, n as AgentManifestSource, o as AgentManifestTool, 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, N as CheckpointSavedEvent, C as CompiledAgentOptions, O as CompiledContextWindow, a as CompiledTool, P as ContextualTool, V as DefineAgentConfig, W as DelegateFn, X as DelegateOptions, Y as DelegationError, D as DelegationResult, Z as DoneEvent, _ as ErrorEvent, $ as FileEditEvent, a6 as InferAgentInput, a7 as InferAgentToolNames, a8 as IterationEvent, a9 as LLMCallContext, ae as McpApprovalSpec, af as McpRegistryConfig, ag as McpRequestContext, ah as McpSelection, ai as PartialToolCallEvent, ak as ProcessInputContext, ao as RunStartedEvent, ap as ScoreVerdict, aq as ScoredDelegation, ar as Scorer, as as SdkAgentHandle, at as SdkMessage, au as Segment, ax as StateUpdateEvent, S as StreamEvent, ay as TextDeltaEvent, az as ThinkingEvent, aB as ToolCallEvent, aC as ToolCallVeto, aD as ToolHooks, aE as ToolHooksPlugin, aF as ToolResultEvent, aG as ToolWalkResult, aI as ToolboxWalkResult, aJ as agentsPlugin, aK as buildModelSelection, aL as compileAgentDefinition, aM as compileAgentModule, aN as compileContextWindow, aO as compileProjectContext, aP as compileSkills, aQ as compileTools, aR as createAgentExecutionContext, aS as createApiErrorHandler, aT as createSdkAgentStream, aU as createThinkTagExtractor, aV as createToolHooksPlugin, aW as delegate, aX as delegateBackground, aY as delegateWithScoring, aZ as extractThinkTagStream, a_ as generateAgentManifest, a$ as generateAgentRoutes, b0 as isAgentContext, b1 as isAgentDefinition, b2 as isApprovalRequired, b3 as isDone, b4 as isError, b5 as isPartialToolCall, b6 as isTextDelta, b7 as isToolCall, b8 as isToolResult, bb as mcpRegistry, bc as mcpToolApprovals, be as presentUIMessageStream, bf as projectContextMetadataOnlyKnobs, bj as resolveMcpServers, bk as runWithApiErrorHandling, bl as streamAgentResponse, bm as streamAgentUIMessages, bn as toAgentFactory, bo as translateSdkEvent } from './bridge-entry-_RN_53jC.js';
1
+ export { h as AGENT_BRAND, i as AfterToolCallContext, j as AgentBuilder, k as AgentDefinition, l as AgentDefinitionError, m as AgentExecutionContext, n as AgentManifest, f as AgentManifestEntry, o as AgentManifestSource, p as AgentManifestTool, r as AgentRoute, t as AgentRouteContext, u as AgentRunInfo, v as AgentStreamEvent, w as AgentTurnMetadata, x as AgentsPluginOptions, y as ApiErrorContext, z as ApiErrorDecision, B as ApiErrorPolicy, E as ApprovalRequiredEvent, F as ArtifactChunkEvent, I as ArtifactStartEvent, J as BackgroundDelegation, K as BeforeToolCallContext, N as BudgetExceededError, P as CheckpointSavedEvent, C as CompiledAgentOptions, Q as CompiledContextWindow, a as CompiledTool, U as ContextualTool, X as DefineAgentConfig, Y as DelegateFn, Z as DelegateOptions, _ as DelegationError, D as DelegationResult, $ as DoneEvent, a0 as ErrorEvent, a1 as FileEditEvent, a7 as InferAgentInput, a8 as InferAgentToolNames, a9 as IterationEvent, aa as LLMCallContext, af as McpApprovalSpec, ag as McpRegistryConfig, ah as McpRequestContext, ai as McpSelection, aj as PartialToolCallEvent, al as ProcessInputContext, ap as RunStartedEvent, aq as ScoreVerdict, ar as ScoredDelegation, as as Scorer, at as SdkAgentHandle, au as SdkMessage, av as Segment, ay as StateUpdateEvent, S as StreamEvent, az as TextDeltaEvent, aA as ThinkingEvent, aC as ToolCallEvent, aD as ToolCallVeto, aE as ToolHooks, aF as ToolHooksPlugin, aG as ToolResultEvent, aH as ToolWalkResult, aJ as ToolboxWalkResult, aK as agentsPlugin, aL as buildModelSelection, aM as compileAgentDefinition, aN as compileAgentModule, aO as compileContextWindow, aP as compileProjectContext, aQ as compileSkills, aR as compileTools, aS as createAgentExecutionContext, aT as createApiErrorHandler, aU as createSdkAgentStream, aV as createThinkTagExtractor, aW as createToolHooksPlugin, aX as delegate, aY as delegateBackground, aZ as delegateWithScoring, a_ as extractThinkTagStream, a$ as generateAgentManifest, b0 as generateAgentRoutes, b1 as isAgentContext, b2 as isAgentDefinition, b3 as isApprovalRequired, b4 as isDone, b5 as isError, b6 as isPartialToolCall, b7 as isTextDelta, b8 as isToolCall, b9 as isToolResult, bc as mcpRegistry, bd as mcpToolApprovals, bf as presentUIMessageStream, bg as projectContextMetadataOnlyKnobs, bk as resolveMcpServers, bl as runWithApiErrorHandling, bm as streamAgentResponse, s as streamAgentUIMessages, bn as toAgentFactory, bo as translateSdkEvent } from './bridge-entry-Cq1aVJ_c.js';
2
2
  import '@theokit/http';
3
3
  import '@theokit/sdk';
4
4
  import 'zod';
package/dist/bridge.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  streamAgentUIMessages,
44
44
  toAgentFactory,
45
45
  translateSdkEvent
46
- } from "./chunk-SDJLIKOH.js";
46
+ } from "./chunk-2L5DI75P.js";
47
47
  import "./chunk-7QVYU63E.js";
48
48
  export {
49
49
  AGENT_BRAND,
@@ -3508,4 +3508,4 @@ export {
3508
3508
  generateAgentManifest,
3509
3509
  agentsPlugin
3510
3510
  };
3511
- //# sourceMappingURL=chunk-SDJLIKOH.js.map
3511
+ //# sourceMappingURL=chunk-2L5DI75P.js.map