@theokit/agents 0.36.0 → 0.37.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.
@@ -1,6 +1,6 @@
1
1
  import { ExecutionContext } from '@theokit/http';
2
2
  import { A as AgentOptions, g as ToolOptions, M as MainLoopMeta, a as ApprovalOptions, B as BudgetOptions, H as HumanInTheLoopOptions, t as GatewayOptions, z as MemoryOptions, O as SkillsOptions, r as ContextWindowOptions, K as ProjectContextOptions, x as McpServersMap, G as Guardrail, o as CompactionDecoratorConfig, j as CheckpointOptions, R as ReasoningEffort } from './types-DVA4LQsA.js';
3
- import { SystemPromptResolver, ConversationStorageAdapter, SkillsSettings, ContextSettings, PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition as AgentDefinition$1, BudgetTracker, CustomTool, ModelSelection } from '@theokit/sdk';
3
+ import { InlineSkill, SystemPromptResolver, ConversationStorageAdapter, SkillsSettings, ContextSettings, PluginsSettings, Plugin, ProviderRoutingSettings, AgentDefinition as AgentDefinition$1, BudgetTracker, CustomTool, ModelSelection } from '@theokit/sdk';
4
4
  import { UIMessageChunk } from 'ai';
5
5
  import { z } from 'zod';
6
6
  import { RetryOptions } from '@theokit/sdk/retry';
@@ -112,17 +112,23 @@ declare function validateUniqueRoutes(results: AgentWalkResult[]): void;
112
112
  * different users. A selection is either a static list or a function of the request context (the M7
113
113
  * run-context). Discovery + injection stay in the SDK; this only CHOOSES the enabled set per call.
114
114
  */
115
+
115
116
  /** The request context handed to a skills resolver (the M7 run-context — opaque per-request data). */
116
117
  type SkillsRequestContext = Record<string, unknown>;
117
118
  /**
118
- * How the enabled skill set is chosen:
119
- * - `string[]` a static list (same shape `skills.enabled` accepts today).
120
- * - a function — resolved per request from the {@link SkillsRequestContext} (sync or async).
119
+ * How the skill set is chosen:
120
+ * - a static array of `string` (filesystem skill NAMES `skills.enabled`) and/or `InlineSkill`
121
+ * objects from `createSkill` (code-defined skills `skills.inline`, injected into the `<skills>`
122
+ * block). A mixed list is split at compile time.
123
+ * - a function — resolved per request from the {@link SkillsRequestContext} (sync or async). The
124
+ * resolver returns filesystem skill NAMES (inline skills are static — declared on the agent).
121
125
  */
122
- type SkillsSelection = readonly string[] | ((ctx: SkillsRequestContext) => readonly string[] | Promise<readonly string[]>);
126
+ type SkillsSelection = readonly (string | InlineSkill)[] | ((ctx: SkillsRequestContext) => readonly string[] | Promise<readonly string[]>);
123
127
  /**
124
128
  * Resolve the enabled skill names for a request. Returns `undefined` when no selection is given (the
125
- * SDK then enables every discovered skill). Fails fast if a resolver returns a non-array.
129
+ * SDK then enables every discovered skill). Fails fast if a resolver returns a non-array. The static
130
+ * array is compiled ahead of time (see `compileSkillsSelection`), so this is exercised for the
131
+ * resolver form; a static array is defensively narrowed to its string (name) members.
126
132
  */
127
133
  declare function resolveEnabledSkills(selection: SkillsSelection | undefined, ctx: SkillsRequestContext): Promise<string[] | undefined>;
128
134
 
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-DYXCEzdJ.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-C20NAna5.js';
2
2
  import '@theokit/http';
3
3
  import './types-DVA4LQsA.js';
4
4
  import '@theokit/sdk';
package/dist/bridge.js CHANGED
@@ -46,7 +46,7 @@ import {
46
46
  translateToUIMessageStream,
47
47
  validateUniqueRoutes,
48
48
  walkAgentMetadata
49
- } from "./chunk-RJTRE6BD.js";
49
+ } from "./chunk-AG4WA4I4.js";
50
50
  import "./chunk-B24BAVE6.js";
51
51
  import "./chunk-7QVYU63E.js";
52
52
  export {
@@ -1505,12 +1505,19 @@ function compileSkillsSelection(skills) {
1505
1505
  if (typeof skills === "function") return {
1506
1506
  skillsResolver: skills
1507
1507
  };
1508
+ const enabled = [];
1509
+ const inline = [];
1510
+ for (const entry of skills) {
1511
+ if (typeof entry === "string") enabled.push(entry);
1512
+ else inline.push(entry);
1513
+ }
1508
1514
  return {
1509
1515
  skills: {
1510
- enabled: [
1511
- ...skills
1512
- ],
1513
- autoInject: true
1516
+ enabled,
1517
+ autoInject: true,
1518
+ ...inline.length > 0 ? {
1519
+ inline
1520
+ } : {}
1514
1521
  }
1515
1522
  };
1516
1523
  }
@@ -2969,4 +2976,4 @@ export {
2969
2976
  generateAgentManifest,
2970
2977
  agentsPlugin
2971
2978
  };
2972
- //# sourceMappingURL=chunk-RJTRE6BD.js.map
2979
+ //# sourceMappingURL=chunk-AG4WA4I4.js.map