@theokit/agents 0.38.0 → 0.39.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.
@@ -861,7 +861,16 @@ interface AgentBuilder<TInput extends z.ZodType | UnsetMarker = UnsetMarker, TMo
861
861
  approval(toolName: TTools extends never ? string : TTools, options: HumanInTheLoopOptions): AgentBuilder<TInput, TModel, TContext, TTools>;
862
862
  /** M14 — set the full approvals map (replaces any previously added). */
863
863
  approvals(map: Record<string, HumanInTheLoopOptions>): AgentBuilder<TInput, TModel, TContext, TTools>;
864
- /** M13 — select skills: a static list OR a per-request resolver `(ctx) => string[]`. */
864
+ /**
865
+ * M13 — the skills the agent can consult mid-turn: a static list OR a per-request
866
+ * resolver `(ctx) => string[]`. Each entry is a `createSkill(...)` object OR a
867
+ * filesystem skill NAME (a string) — mix freely.
868
+ *
869
+ * Progressive disclosure (cheap by default): every turn the SDK lists each skill's
870
+ * name + description in a `<skills>` block (so the model KNOWS the skill exists) AND
871
+ * auto-provisions a `skill_read` tool the model calls to load the full body ON DEMAND
872
+ * (so a long procedure only enters the prompt when it is actually needed).
873
+ */
865
874
  skills(selection: SkillsSelection): AgentBuilder<TInput, TModel, TContext, TTools>;
866
875
  /**
867
876
  * Set the agent's conversation memory — the `ConversationStorageAdapter` the SDK persists turns to.
package/dist/bridge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { c as AGENT_BRAND, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinition, g as AgentDefinitionError, h as AgentExecutionContext, i as AgentManifest, A as AgentManifestEntry, j as AgentManifestTool, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentStreamEvent, o as AgentWalkResult, p as AgentWarningCode, q as AgentsPluginOptions, r as ApiErrorContext, s as ApiErrorDecision, t as ApiErrorPolicy, u as ApprovalRequiredEvent, v as ArtifactChunkEvent, w as ArtifactStartEvent, B as BackgroundDelegation, x as BeforeToolCallContext, y as BudgetExceededError, z as CheckpointSavedEvent, C as CompiledAgentOptions, E as CompiledContextWindow, a as CompiledTool, F as ContextualTool, H as DefineAgentConfig, I as DelegateFn, J as DelegateOptions, K as DelegationError, D as DelegationResult, M as DoneEvent, N as ErrorEvent, O as FileEditEvent, Q as InferAgentInput, T as InferAgentToolNames, U as IterationEvent, V as LLMCallContext, Z as McpApprovalSpec, _ as McpRegistryConfig, $ as McpRequestContext, a0 as McpSelection, a1 as PartialToolCallEvent, a2 as ProcessInputContext, a6 as RunStartedEvent, a7 as ScoreVerdict, a8 as ScoredDelegation, a9 as Scorer, aa as SdkMessage, ab as Segment, ae as StateUpdateEvent, S as StreamEvent, af as TextDeltaEvent, ag as ThinkingEvent, ah as ToolCallEvent, ai as ToolCallVeto, aj as ToolHooks, ak as ToolHooksPlugin, al as ToolResultEvent, am as ToolWalkResult, an as ToolboxWalkResult, ao as agent, ap as agentsPlugin, aq as buildModelSelection, ar as compileAgent, as as compileAgentDefinition, at as compileAgentModule, au as compileContextWindow, av as compileProjectContext, aw as compileSkills, ax as compileTools, ay as contextualTool, az as createAgentExecutionContext, aA as createApiErrorHandler, aB as createSdkAgentStream, aC as createThinkTagExtractor, aD as createToolHooksPlugin, aE as delegate, aF as delegateBackground, aG as delegateWithScoring, aH as extractThinkTagStream, aI as generateAgentManifest, aJ as generateAgentRoutes, aK as isAgentContext, aL as isAgentDefinition, aM as isApprovalRequired, aN as isDone, aO as isError, aP as isPartialToolCall, aQ as isTextDelta, aR as isToolCall, aS as isToolResult, aV as mcpRegistry, aW as mcpToolApprovals, aY as projectContextMetadataOnlyKnobs, b0 as resolveMcpServers, b1 as runWithApiErrorHandling, b2 as streamAgentResponse, b3 as streamAgentUIMessages, b4 as translateSdkEvent, b5 as translateToUIMessageStream, b6 as validateUniqueRoutes, b7 as walkAgentMetadata } from './bridge-entry-C20NAna5.js';
1
+ export { c as AGENT_BRAND, d as AfterToolCallContext, e as AgentBuilder, f as AgentDefinition, g as AgentDefinitionError, h as AgentExecutionContext, i as AgentManifest, A as AgentManifestEntry, j as AgentManifestTool, k as AgentRoute, l as AgentRouteContext, m as AgentRunInfo, n as AgentStreamEvent, o as AgentWalkResult, p as AgentWarningCode, q as AgentsPluginOptions, r as ApiErrorContext, s as ApiErrorDecision, t as ApiErrorPolicy, u as ApprovalRequiredEvent, v as ArtifactChunkEvent, w as ArtifactStartEvent, B as BackgroundDelegation, x as BeforeToolCallContext, y as BudgetExceededError, z as CheckpointSavedEvent, C as CompiledAgentOptions, E as CompiledContextWindow, a as CompiledTool, F as ContextualTool, H as DefineAgentConfig, I as DelegateFn, J as DelegateOptions, K as DelegationError, D as DelegationResult, M as DoneEvent, N as ErrorEvent, O as FileEditEvent, Q as InferAgentInput, T as InferAgentToolNames, U as IterationEvent, V as LLMCallContext, Z as McpApprovalSpec, _ as McpRegistryConfig, $ as McpRequestContext, a0 as McpSelection, a1 as PartialToolCallEvent, a2 as ProcessInputContext, a6 as RunStartedEvent, a7 as ScoreVerdict, a8 as ScoredDelegation, a9 as Scorer, aa as SdkMessage, ab as Segment, ae as StateUpdateEvent, S as StreamEvent, af as TextDeltaEvent, ag as ThinkingEvent, ah as ToolCallEvent, ai as ToolCallVeto, aj as ToolHooks, ak as ToolHooksPlugin, al as ToolResultEvent, am as ToolWalkResult, an as ToolboxWalkResult, ao as agent, ap as agentsPlugin, aq as buildModelSelection, ar as compileAgent, as as compileAgentDefinition, at as compileAgentModule, au as compileContextWindow, av as compileProjectContext, aw as compileSkills, ax as compileTools, ay as contextualTool, az as createAgentExecutionContext, aA as createApiErrorHandler, aB as createSdkAgentStream, aC as createThinkTagExtractor, aD as createToolHooksPlugin, aE as delegate, aF as delegateBackground, aG as delegateWithScoring, aH as extractThinkTagStream, aI as generateAgentManifest, aJ as generateAgentRoutes, aK as isAgentContext, aL as isAgentDefinition, aM as isApprovalRequired, aN as isDone, aO as isError, aP as isPartialToolCall, aQ as isTextDelta, aR as isToolCall, aS as isToolResult, aV as mcpRegistry, aW as mcpToolApprovals, aY as projectContextMetadataOnlyKnobs, b0 as resolveMcpServers, b1 as runWithApiErrorHandling, b2 as streamAgentResponse, b3 as streamAgentUIMessages, b4 as translateSdkEvent, b5 as translateToUIMessageStream, b6 as validateUniqueRoutes, b7 as walkAgentMetadata } from './bridge-entry-CAY5JP9z.js';
2
2
  import '@theokit/http';
3
3
  import './types-DVA4LQsA.js';
4
4
  import '@theokit/sdk';
package/dist/bridge.js CHANGED
@@ -46,8 +46,8 @@ import {
46
46
  translateToUIMessageStream,
47
47
  validateUniqueRoutes,
48
48
  walkAgentMetadata
49
- } from "./chunk-YRVPQ6QC.js";
50
- import "./chunk-B24BAVE6.js";
49
+ } from "./chunk-JID4DOB3.js";
50
+ import "./chunk-NERDIS45.js";
51
51
  import "./chunk-7QVYU63E.js";
52
52
  export {
53
53
  AGENT_BRAND,
@@ -22,7 +22,7 @@ import {
22
22
  getProjectContextConfig,
23
23
  getSkillsConfig,
24
24
  getSubAgents
25
- } from "./chunk-B24BAVE6.js";
25
+ } from "./chunk-NERDIS45.js";
26
26
  import {
27
27
  __name
28
28
  } from "./chunk-7QVYU63E.js";
@@ -995,13 +995,16 @@ async function loadSdkRuntime() {
995
995
  try {
996
996
  const sdk = await import("@theokit/sdk");
997
997
  const InMemory = sdk.InMemoryConversationStorage;
998
+ const skillReadTool = "SkillReadTool" in sdk ? sdk.SkillReadTool : void 0;
998
999
  return {
999
1000
  Agent: sdk.Agent,
1000
- defineTool: sdk.defineTool,
1001
+ // `.bind` keeps the static factory callable when detached from `sdk.Tool` (it takes no `this`,
1002
+ // but binding is explicit + satisfies unbound-method rather than relying on that).
1003
+ defineTool: sdk.Tool.create.bind(sdk.Tool),
1001
1004
  InMemoryConversationStorage: InMemory,
1002
1005
  FileSystemConversationStorage: "FileSystemConversationStorage" in sdk ? sdk.FileSystemConversationStorage : InMemory,
1003
- ..."defineSkillReadTool" in sdk ? {
1004
- defineSkillReadTool: sdk.defineSkillReadTool
1006
+ ...skillReadTool ? {
1007
+ defineSkillReadTool: /* @__PURE__ */ __name((skills) => skillReadTool.create(skills), "defineSkillReadTool")
1005
1008
  } : {}
1006
1009
  };
1007
1010
  } catch (err) {
@@ -1149,7 +1152,7 @@ function hasZodInputSchema(schema) {
1149
1152
  __name(hasZodInputSchema, "hasZodInputSchema");
1150
1153
  function withRunContext(handler, runContext) {
1151
1154
  return (input, ctx) => handler(input, {
1152
- signal: ctx?.signal,
1155
+ ...ctx,
1153
1156
  context: runContext
1154
1157
  });
1155
1158
  }
@@ -2258,8 +2261,8 @@ async function startRound(factory, prompt, sessionId, signal, retry) {
2258
2261
  }
2259
2262
  }, "open");
2260
2263
  if (!retry) return open();
2261
- const { withRetry } = await import("@theokit/sdk/retry");
2262
- return withRetry(open, {
2264
+ const { Retry } = await import("@theokit/sdk/retry");
2265
+ return Retry.create(open, {
2263
2266
  ...retry,
2264
2267
  signal: retry.signal ?? signal
2265
2268
  });
@@ -2983,4 +2986,4 @@ export {
2983
2986
  generateAgentManifest,
2984
2987
  agentsPlugin
2985
2988
  };
2986
- //# sourceMappingURL=chunk-YRVPQ6QC.js.map
2989
+ //# sourceMappingURL=chunk-JID4DOB3.js.map