@theokit/agents 0.30.1 → 0.30.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.
@@ -626,8 +626,12 @@ interface DefineAgentConfig<TInput extends z.ZodType = z.ZodType> {
626
626
  system?: string;
627
627
  /** Extended-thinking effort (mirrors `@Agent({ reasoningEffort })`). */
628
628
  reasoningEffort?: ReasoningEffort;
629
- /** Pre-built tools (SDK-ready `CompiledTool` shape). */
630
- tools?: CompiledTool[];
629
+ /**
630
+ * Pre-built tools. Accepts the `@theokit/sdk` `CustomTool` that `defineAgentTool`
631
+ * (theokit/server) and every `@theokit/sdk-tools` factory return (issue #81) — they are
632
+ * normalized to the internal {@link CompiledTool} shape at compile time.
633
+ */
634
+ tools?: readonly CustomTool[];
631
635
  }
632
636
  /** A branded agent definition — the value {@link defineAgent} returns. */
633
637
  type AgentDefinition<TInput extends z.ZodType = z.ZodType> = DefineAgentConfig<TInput> & {
package/dist/bridge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AGENT_BRAND, b as AgentDefinition, c as AgentDefinitionError, d as AgentExecutionContext, e as AgentManifest, f as AgentManifestEntry, g as AgentManifestTool, h as AgentRoute, i as AgentRouteContext, j as AgentRunInfo, k as AgentStreamEvent, l as AgentWalkResult, m as AgentWarningCode, n as AgentsPluginOptions, o as ApprovalRequiredEvent, p as ArtifactChunkEvent, q as ArtifactStartEvent, B as BudgetExceededError, r as CheckpointSavedEvent, C as CompiledAgentOptions, s as CompiledContextWindow, a as CompiledTool, u as DefineAgentConfig, v as DelegateOptions, w as DelegationError, D as DelegationResult, x as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as InferAgentInput, y as IterationEvent, P as PartialToolCallEvent, N as RunStartedEvent, O as SdkMessage, Q as Segment, T as StateUpdateEvent, S as StreamEvent, U as TextDeltaEvent, V as ThinkingEvent, W as ToolCallEvent, X as ToolResultEvent, Y as ToolWalkResult, Z as ToolboxWalkResult, _ as agentsPlugin, $ as buildModelSelection, a0 as compileAgent, a1 as compileAgentDefinition, a2 as compileAgentModule, a3 as compileContextWindow, a4 as compileProjectContext, a5 as compileSkills, a6 as compileTools, a7 as createAgentExecutionContext, a8 as createSdkAgentStream, a9 as createThinkTagExtractor, aa as defineAgent, ab as delegate, ac as extractThinkTagStream, ad as generateAgentManifest, ae as generateAgentRoutes, af as isAgentContext, ag as isAgentDefinition, ah as isApprovalRequired, ai as isDone, aj as isError, ak as isPartialToolCall, al as isTextDelta, am as isToolCall, an as isToolResult, ar as projectContextMetadataOnlyKnobs, au as streamAgentResponse, av as streamAgentUIMessages, aw as translateSdkEvent, ax as translateToUIMessageStream, ay as validateUniqueRoutes, az as walkAgentMetadata } from './bridge-entry-DVhOQc_f.js';
1
+ export { A as AGENT_BRAND, b as AgentDefinition, c as AgentDefinitionError, d as AgentExecutionContext, e as AgentManifest, f as AgentManifestEntry, g as AgentManifestTool, h as AgentRoute, i as AgentRouteContext, j as AgentRunInfo, k as AgentStreamEvent, l as AgentWalkResult, m as AgentWarningCode, n as AgentsPluginOptions, o as ApprovalRequiredEvent, p as ArtifactChunkEvent, q as ArtifactStartEvent, B as BudgetExceededError, r as CheckpointSavedEvent, C as CompiledAgentOptions, s as CompiledContextWindow, a as CompiledTool, u as DefineAgentConfig, v as DelegateOptions, w as DelegationError, D as DelegationResult, x as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as InferAgentInput, y as IterationEvent, P as PartialToolCallEvent, N as RunStartedEvent, O as SdkMessage, Q as Segment, T as StateUpdateEvent, S as StreamEvent, U as TextDeltaEvent, V as ThinkingEvent, W as ToolCallEvent, X as ToolResultEvent, Y as ToolWalkResult, Z as ToolboxWalkResult, _ as agentsPlugin, $ as buildModelSelection, a0 as compileAgent, a1 as compileAgentDefinition, a2 as compileAgentModule, a3 as compileContextWindow, a4 as compileProjectContext, a5 as compileSkills, a6 as compileTools, a7 as createAgentExecutionContext, a8 as createSdkAgentStream, a9 as createThinkTagExtractor, aa as defineAgent, ab as delegate, ac as extractThinkTagStream, ad as generateAgentManifest, ae as generateAgentRoutes, af as isAgentContext, ag as isAgentDefinition, ah as isApprovalRequired, ai as isDone, aj as isError, ak as isPartialToolCall, al as isTextDelta, am as isToolCall, an as isToolResult, ar as projectContextMetadataOnlyKnobs, au as streamAgentResponse, av as streamAgentUIMessages, aw as translateSdkEvent, ax as translateToUIMessageStream, ay as validateUniqueRoutes, az as walkAgentMetadata } from './bridge-entry-DzSZRp22.js';
2
2
  import '@theokit/http';
3
3
  import './skills-Dx_KJ6Eg.js';
4
4
  import '@theokit/sdk';
package/dist/bridge.js CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  translateToUIMessageStream,
38
38
  validateUniqueRoutes,
39
39
  walkAgentMetadata
40
- } from "./chunk-XCQNYAVU.js";
40
+ } from "./chunk-QJKU2YMC.js";
41
41
  import "./chunk-FI6ZG2YP.js";
42
42
  import "./chunk-7QVYU63E.js";
43
43
  export {
@@ -1389,12 +1389,21 @@ function isAgentDefinition(value) {
1389
1389
  return typeof value === "object" && value !== null && value[AGENT_BRAND] === true;
1390
1390
  }
1391
1391
  __name(isAgentDefinition, "isAgentDefinition");
1392
+ function toCompiledTool(tool) {
1393
+ return {
1394
+ name: tool.name,
1395
+ description: tool.description,
1396
+ inputSchema: tool.inputSchema,
1397
+ handler: /* @__PURE__ */ __name((input) => tool.handler(input), "handler")
1398
+ };
1399
+ }
1400
+ __name(toCompiledTool, "toCompiledTool");
1392
1401
  function compileAgentDefinition(def) {
1393
1402
  return {
1394
1403
  model: def.model,
1395
1404
  reasoningEffort: def.reasoningEffort,
1396
1405
  systemPrompt: def.system,
1397
- tools: def.tools ?? [],
1406
+ tools: (def.tools ?? []).map(toCompiledTool),
1398
1407
  agents: {},
1399
1408
  stream: true
1400
1409
  };
@@ -2316,4 +2325,4 @@ export {
2316
2325
  generateAgentManifest,
2317
2326
  agentsPlugin
2318
2327
  };
2319
- //# sourceMappingURL=chunk-XCQNYAVU.js.map
2328
+ //# sourceMappingURL=chunk-QJKU2YMC.js.map