@theokit/agents 0.30.0 → 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.
- package/dist/{bridge-entry-DVhOQc_f.d.ts → bridge-entry-DzSZRp22.d.ts} +6 -2
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/{chunk-AUOCWGPS.js → chunk-QJKU2YMC.js} +17 -4
- package/dist/chunk-QJKU2YMC.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AUOCWGPS.js.map +0 -1
|
@@ -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
|
-
/**
|
|
630
|
-
|
|
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-
|
|
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
|
@@ -1120,14 +1120,18 @@ function applyTextTransforms(events, opts) {
|
|
|
1120
1120
|
return out;
|
|
1121
1121
|
}
|
|
1122
1122
|
__name(applyTextTransforms, "applyTextTransforms");
|
|
1123
|
+
function hasZodInputSchema(schema) {
|
|
1124
|
+
return typeof schema?.parse === "function";
|
|
1125
|
+
}
|
|
1126
|
+
__name(hasZodInputSchema, "hasZodInputSchema");
|
|
1123
1127
|
function buildSdkTools(compiledTools, defineTool, extraSdkTools = []) {
|
|
1124
1128
|
return [
|
|
1125
|
-
...compiledTools.map((t) => defineTool({
|
|
1129
|
+
...compiledTools.map((t) => hasZodInputSchema(t.inputSchema) ? defineTool({
|
|
1126
1130
|
name: t.name,
|
|
1127
1131
|
description: t.description,
|
|
1128
1132
|
inputSchema: t.inputSchema,
|
|
1129
1133
|
handler: t.handler
|
|
1130
|
-
})),
|
|
1134
|
+
}) : t),
|
|
1131
1135
|
...extraSdkTools
|
|
1132
1136
|
];
|
|
1133
1137
|
}
|
|
@@ -1385,12 +1389,21 @@ function isAgentDefinition(value) {
|
|
|
1385
1389
|
return typeof value === "object" && value !== null && value[AGENT_BRAND] === true;
|
|
1386
1390
|
}
|
|
1387
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");
|
|
1388
1401
|
function compileAgentDefinition(def) {
|
|
1389
1402
|
return {
|
|
1390
1403
|
model: def.model,
|
|
1391
1404
|
reasoningEffort: def.reasoningEffort,
|
|
1392
1405
|
systemPrompt: def.system,
|
|
1393
|
-
tools: def.tools ?? [],
|
|
1406
|
+
tools: (def.tools ?? []).map(toCompiledTool),
|
|
1394
1407
|
agents: {},
|
|
1395
1408
|
stream: true
|
|
1396
1409
|
};
|
|
@@ -2312,4 +2325,4 @@ export {
|
|
|
2312
2325
|
generateAgentManifest,
|
|
2313
2326
|
agentsPlugin
|
|
2314
2327
|
};
|
|
2315
|
-
//# sourceMappingURL=chunk-
|
|
2328
|
+
//# sourceMappingURL=chunk-QJKU2YMC.js.map
|