@theokit/agents 0.39.0 → 0.42.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.
- package/dist/{bridge-entry-CAY5JP9z.d.ts → bridge-entry-CE3ie8rG.d.ts} +35 -23
- package/dist/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/{chunk-JID4DOB3.js → chunk-OFPS2N3U.js} +36 -29
- package/dist/chunk-OFPS2N3U.js.map +1 -0
- package/dist/decorators.d.ts +1 -18
- package/dist/decorators.js +0 -22
- package/dist/decorators.js.map +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-JID4DOB3.js.map +0 -1
|
@@ -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 { InlineSkill, SystemPromptResolver,
|
|
3
|
+
import { InlineSkill, SystemPromptResolver, SettingSource, 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';
|
|
@@ -191,13 +191,11 @@ interface CompiledAgentOptions {
|
|
|
191
191
|
/** Static prompt OR a per-request {@link SystemPromptResolver} (V4-L.1, Axis-B). */
|
|
192
192
|
systemPrompt?: string | SystemPromptResolver;
|
|
193
193
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* wins over this; absent ⇒ the SDK default store is chosen lazily. Distinct from `@Checkpoint`,
|
|
198
|
-
* which only toggles filesystem-vs-memory for the built-in default.
|
|
194
|
+
* theokit-file-based-config — opt-in `.theokit/` file-based config roots (`"project"`/`"user"`/…).
|
|
195
|
+
* Projected into `Agent.create({ local: { settingSources } })` by `assembleM8CreateOptions`
|
|
196
|
+
* (merged with `cwd`, decoupled from inline skills). Absent ⇒ inline (code) config only.
|
|
199
197
|
*/
|
|
200
|
-
|
|
198
|
+
settingSources?: readonly SettingSource[];
|
|
201
199
|
tools: CompiledTool[];
|
|
202
200
|
agents: Record<string, CompiledSubAgent>;
|
|
203
201
|
memory?: MemoryOptions;
|
|
@@ -563,11 +561,13 @@ interface RuntimeOverrides {
|
|
|
563
561
|
/** Per-run SDK budget tracker (inner tool-loop cap; distinct from the loop's USD `budget`). */
|
|
564
562
|
budgetTracker?: BudgetTracker;
|
|
565
563
|
/**
|
|
566
|
-
*
|
|
567
|
-
* (
|
|
568
|
-
*
|
|
564
|
+
* SDK 4.0 (SE40) — root of the native Claude-shaped `.jsonl` session transcript the SDK writes
|
|
565
|
+
* automatically (`<baseDir>/projects/<encoded-cwd>/<agentId>.jsonl`). The framework threads the
|
|
566
|
+
* app's project root here (see `mount-agent`) so sessions persist per-app; unset ⇒ SDK default
|
|
567
|
+
* (`~/.theokit`). Replaces the removed pluggable `conversationStorage` — persistence is now the
|
|
568
|
+
* SDK's native transcript, not a swappable adapter.
|
|
569
569
|
*/
|
|
570
|
-
|
|
570
|
+
baseDir?: string;
|
|
571
571
|
/**
|
|
572
572
|
* V4-Q: pre-built SDK `CustomTool[]` forwarded RAW to `Agent.create.tools` (appended after the
|
|
573
573
|
* compiled tools), bypassing `defineTool` (which requires a Zod schema). Lets an app whose tools
|
|
@@ -736,12 +736,14 @@ interface DefineAgentConfig<TInput extends z.ZodType = z.ZodType> {
|
|
|
736
736
|
*/
|
|
737
737
|
skills?: SkillsSelection;
|
|
738
738
|
/**
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* `
|
|
742
|
-
*
|
|
739
|
+
* theokit-file-based-config — opt into `.theokit/` file-based config (skills, subagents, hooks,
|
|
740
|
+
* MCP, context, cron). The SDK discovers config from these roots under the app's `cwd`:
|
|
741
|
+
* `"project"` = `<cwd>/.theokit/`, `"user"` = `~/.theokit/`. Absent ⇒ inline (code) config only.
|
|
742
|
+
* SECURITY: enabling `"project"` enables shell-executing hooks from `.theokit/hooks.json` — this
|
|
743
|
+
* is opt-in because `.theokit/` is the app's own repo (informed consent). The SDK owns discovery
|
|
744
|
+
* + execution (G2 / ADR-0040); theokit only wires this into `Agent.create({ local.settingSources })`.
|
|
743
745
|
*/
|
|
744
|
-
|
|
746
|
+
settingSources?: readonly SettingSource[];
|
|
745
747
|
}
|
|
746
748
|
/**
|
|
747
749
|
* A branded agent definition — the value {@link defineAgent} returns.
|
|
@@ -873,10 +875,12 @@ interface AgentBuilder<TInput extends z.ZodType | UnsetMarker = UnsetMarker, TMo
|
|
|
873
875
|
*/
|
|
874
876
|
skills(selection: SkillsSelection): AgentBuilder<TInput, TModel, TContext, TTools>;
|
|
875
877
|
/**
|
|
876
|
-
*
|
|
877
|
-
*
|
|
878
|
+
* theokit-file-based-config — opt into `.theokit/` file-based config (skills, subagents, hooks,
|
|
879
|
+
* MCP, context, cron), discovered by the SDK from the app root (`"project"` = `<cwd>/.theokit/`,
|
|
880
|
+
* `"user"` = `~/.theokit/`). Unset ⇒ inline (code) config only. SECURITY: `"project"` enables
|
|
881
|
+
* shell-executing hooks from `.theokit/hooks.json` — opt-in because `.theokit/` is your own repo.
|
|
878
882
|
*/
|
|
879
|
-
|
|
883
|
+
settingSources(sources: readonly SettingSource[]): AgentBuilder<TInput, TModel, TContext, TTools>;
|
|
880
884
|
/**
|
|
881
885
|
* Apply a reusable partial chain (Spring-Boot-style composition). `preset` receives the current
|
|
882
886
|
* builder and returns an advanced one; its accumulated type-state flows through.
|
|
@@ -974,8 +978,18 @@ interface StreamAgentOptions {
|
|
|
974
978
|
sessionId: string;
|
|
975
979
|
/** Enable human-in-the-loop tool approval (M4). Absent ⇒ the M2 non-HITL path, byte-unchanged. */
|
|
976
980
|
hitl?: StreamHitlOptions;
|
|
977
|
-
/**
|
|
978
|
-
|
|
981
|
+
/**
|
|
982
|
+
* theokit-file-based-config (EC-1) — the app root `cwd` the SDK resolves `.theokit/` against when
|
|
983
|
+
* `settingSources` is active. The framework boundary (`mountAgent`) threads its resolved
|
|
984
|
+
* `projectRoot` here so discovery points at the app root, NOT `process.cwd()`. Absent ⇒ no `local.cwd`.
|
|
985
|
+
*/
|
|
986
|
+
cwd?: RuntimeOverrides['cwd'];
|
|
987
|
+
/**
|
|
988
|
+
* SDK 4.0 (SE40) — root of the native `.jsonl` session transcript. The framework boundary
|
|
989
|
+
* (`mountAgent`) threads the resolved app root here so sessions persist per-app; absent ⇒ the SDK
|
|
990
|
+
* default (`~/.theokit`).
|
|
991
|
+
*/
|
|
992
|
+
baseDir?: RuntimeOverrides['baseDir'];
|
|
979
993
|
/**
|
|
980
994
|
* The request's abort signal (M4). On client disconnect, the HITL merge queue is closed so the
|
|
981
995
|
* detached SDK pump stops buffering (bounded memory) and the client stream terminates at once.
|
|
@@ -1242,8 +1256,6 @@ interface DelegateOptions {
|
|
|
1242
1256
|
agents?: Record<string, AgentDefinition$1>;
|
|
1243
1257
|
/** Per-run SDK budget tracker (inner tool-loop cap). */
|
|
1244
1258
|
budgetTracker?: BudgetTracker;
|
|
1245
|
-
/** Per-run conversation store (cross-round history). */
|
|
1246
|
-
conversationStorage?: ConversationStorageAdapter;
|
|
1247
1259
|
/** Per-run pre-built SDK tools forwarded raw (V4-Q). */
|
|
1248
1260
|
sdkTools?: readonly CustomTool[];
|
|
1249
1261
|
/** Per-round transient retry (V4-P). */
|
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-
|
|
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-CE3ie8rG.js';
|
|
2
2
|
import '@theokit/http';
|
|
3
3
|
import './types-DVA4LQsA.js';
|
|
4
4
|
import '@theokit/sdk';
|
package/dist/bridge.js
CHANGED
|
@@ -820,12 +820,15 @@ function assembleM8CreateOptions(compiled) {
|
|
|
820
820
|
const base = compiled.systemPrompt;
|
|
821
821
|
if (compiled.skills) {
|
|
822
822
|
options.skills = compiled.skills;
|
|
823
|
+
applied.push("skills");
|
|
824
|
+
}
|
|
825
|
+
const settingSources = resolveSettingSources(compiled);
|
|
826
|
+
if (settingSources) {
|
|
823
827
|
options.local = {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
]
|
|
828
|
+
...options.local,
|
|
829
|
+
settingSources
|
|
827
830
|
};
|
|
828
|
-
applied.push("
|
|
831
|
+
applied.push("settingSources");
|
|
829
832
|
}
|
|
830
833
|
if (compiled.context) {
|
|
831
834
|
options.context = compiled.context;
|
|
@@ -847,6 +850,17 @@ function assembleM8CreateOptions(compiled) {
|
|
|
847
850
|
};
|
|
848
851
|
}
|
|
849
852
|
__name(assembleM8CreateOptions, "assembleM8CreateOptions");
|
|
853
|
+
function resolveSettingSources(compiled) {
|
|
854
|
+
const explicit = compiled.settingSources;
|
|
855
|
+
if (explicit && explicit.length > 0) return [
|
|
856
|
+
...explicit
|
|
857
|
+
];
|
|
858
|
+
if (compiled.skills) return [
|
|
859
|
+
"project"
|
|
860
|
+
];
|
|
861
|
+
return void 0;
|
|
862
|
+
}
|
|
863
|
+
__name(resolveSettingSources, "resolveSettingSources");
|
|
850
864
|
function realUsageDone(result, t0) {
|
|
851
865
|
const u = result.usage;
|
|
852
866
|
const inputTokens = u?.inputTokens ?? 0;
|
|
@@ -994,15 +1008,12 @@ __name(buildExtraCreateOptions, "buildExtraCreateOptions");
|
|
|
994
1008
|
async function loadSdkRuntime() {
|
|
995
1009
|
try {
|
|
996
1010
|
const sdk = await import("@theokit/sdk");
|
|
997
|
-
const InMemory = sdk.InMemoryConversationStorage;
|
|
998
1011
|
const skillReadTool = "SkillReadTool" in sdk ? sdk.SkillReadTool : void 0;
|
|
999
1012
|
return {
|
|
1000
1013
|
Agent: sdk.Agent,
|
|
1001
1014
|
// `.bind` keeps the static factory callable when detached from `sdk.Tool` (it takes no `this`,
|
|
1002
1015
|
// but binding is explicit + satisfies unbound-method rather than relying on that).
|
|
1003
1016
|
defineTool: sdk.Tool.create.bind(sdk.Tool),
|
|
1004
|
-
InMemoryConversationStorage: InMemory,
|
|
1005
|
-
FileSystemConversationStorage: "FileSystemConversationStorage" in sdk ? sdk.FileSystemConversationStorage : InMemory,
|
|
1006
1017
|
...skillReadTool ? {
|
|
1007
1018
|
defineSkillReadTool: /* @__PURE__ */ __name((skills) => skillReadTool.create(skills), "defineSkillReadTool")
|
|
1008
1019
|
} : {}
|
|
@@ -1013,10 +1024,6 @@ async function loadSdkRuntime() {
|
|
|
1013
1024
|
}
|
|
1014
1025
|
}
|
|
1015
1026
|
__name(loadSdkRuntime, "loadSdkRuntime");
|
|
1016
|
-
function newConversationStorage(compiled, InMemory, FileSystem) {
|
|
1017
|
-
return compiled.checkpoint?.storage === "filesystem" ? new FileSystem() : new InMemory();
|
|
1018
|
-
}
|
|
1019
|
-
__name(newConversationStorage, "newConversationStorage");
|
|
1020
1027
|
function createAsyncQueue() {
|
|
1021
1028
|
const items = [];
|
|
1022
1029
|
let wake = null;
|
|
@@ -1186,7 +1193,6 @@ function createSdkAgentStream(compiled, compiledTools, apiKey, overrides = {}) {
|
|
|
1186
1193
|
const reasoningEffort = overrides.reasoningEffort ?? compiled.reasoningEffort;
|
|
1187
1194
|
const { parseThinkTags, stripToolDialect } = resolveTextTransformFlags(compiled, overrides);
|
|
1188
1195
|
const runContext = overrides.runContext ?? compiled.runContext;
|
|
1189
|
-
let storage = overrides.conversationStorage ?? compiled.conversationStorage;
|
|
1190
1196
|
return (message, sessionId, factoryOpts) => ({
|
|
1191
1197
|
async *[Symbol.asyncIterator]() {
|
|
1192
1198
|
const runId = `run-${Date.now()}`;
|
|
@@ -1201,7 +1207,6 @@ function createSdkAgentStream(compiled, compiledTools, apiKey, overrides = {}) {
|
|
|
1201
1207
|
};
|
|
1202
1208
|
return;
|
|
1203
1209
|
}
|
|
1204
|
-
const { InMemoryConversationStorage, FileSystemConversationStorage } = rt;
|
|
1205
1210
|
const sdkTools = buildSdkTools(compiledTools, rt.defineTool, overrides.sdkTools, runContext);
|
|
1206
1211
|
const inlineSkills = compiled.skills?.inline;
|
|
1207
1212
|
if (inlineSkills !== void 0 && inlineSkills.length > 0 && rt.defineSkillReadTool !== void 0 && !compiledTools.some((t) => t.name === "skill_read")) {
|
|
@@ -1219,9 +1224,8 @@ function createSdkAgentStream(compiled, compiledTools, apiKey, overrides = {}) {
|
|
|
1219
1224
|
source: runContextSource,
|
|
1220
1225
|
keys: runContext !== void 0 ? Object.keys(runContext) : []
|
|
1221
1226
|
});
|
|
1222
|
-
storage ??= newConversationStorage(compiled, InMemoryConversationStorage, FileSystemConversationStorage);
|
|
1223
1227
|
try {
|
|
1224
|
-
yield* streamSdkAgent(rt, compiled, sdkTools,
|
|
1228
|
+
yield* streamSdkAgent(rt, compiled, sdkTools, {
|
|
1225
1229
|
apiKey,
|
|
1226
1230
|
model,
|
|
1227
1231
|
reasoningEffort,
|
|
@@ -1246,7 +1250,7 @@ function createSdkAgentStream(compiled, compiledTools, apiKey, overrides = {}) {
|
|
|
1246
1250
|
});
|
|
1247
1251
|
}
|
|
1248
1252
|
__name(createSdkAgentStream, "createSdkAgentStream");
|
|
1249
|
-
async function* streamSdkAgent(rt, compiled, sdkTools,
|
|
1253
|
+
async function* streamSdkAgent(rt, compiled, sdkTools, opts) {
|
|
1250
1254
|
const { Agent } = rt;
|
|
1251
1255
|
const { apiKey, model, reasoningEffort, overrides, parseThinkTags, stripToolDialect, sessionId, message, factoryOpts, runId, t0 } = opts;
|
|
1252
1256
|
const { options: m8, applied } = assembleM8CreateOptions(compiled);
|
|
@@ -1254,6 +1258,10 @@ async function* streamSdkAgent(rt, compiled, sdkTools, storage, opts) {
|
|
|
1254
1258
|
...m8.local,
|
|
1255
1259
|
cwd: overrides.cwd
|
|
1256
1260
|
};
|
|
1261
|
+
if (overrides.baseDir !== void 0) m8.local = {
|
|
1262
|
+
...m8.local,
|
|
1263
|
+
baseDir: overrides.baseDir
|
|
1264
|
+
};
|
|
1257
1265
|
const extra = buildExtraCreateOptions(overrides, compiled);
|
|
1258
1266
|
if (applied.length > 0) {
|
|
1259
1267
|
debugLog("[THEO_AGENT_M8_RUNTIME_APPLIED]", {
|
|
@@ -1267,8 +1275,7 @@ async function* streamSdkAgent(rt, compiled, sdkTools, storage, opts) {
|
|
|
1267
1275
|
model: buildModelSelection(model, reasoningEffort),
|
|
1268
1276
|
tools: sdkTools,
|
|
1269
1277
|
...m8,
|
|
1270
|
-
...extra
|
|
1271
|
-
conversationStorage: storage
|
|
1278
|
+
...extra
|
|
1272
1279
|
});
|
|
1273
1280
|
try {
|
|
1274
1281
|
const queue = createAsyncQueue();
|
|
@@ -1502,10 +1509,10 @@ function compileAgentDefinition(def) {
|
|
|
1502
1509
|
} : {},
|
|
1503
1510
|
// M13 — skills: a static list → SDK skills.enabled; a resolver → carried for the request path.
|
|
1504
1511
|
...compileSkillsSelection(def.skills),
|
|
1505
|
-
//
|
|
1506
|
-
// `Agent.
|
|
1507
|
-
...def.
|
|
1508
|
-
|
|
1512
|
+
// theokit-file-based-config — the declared `.theokit/` sources flow to the run path, which
|
|
1513
|
+
// projects them into `Agent.create({ local.settingSources })`; absent ⇒ inline config only.
|
|
1514
|
+
...def.settingSources !== void 0 ? {
|
|
1515
|
+
settingSources: def.settingSources
|
|
1509
1516
|
} : {}
|
|
1510
1517
|
};
|
|
1511
1518
|
}
|
|
@@ -1607,10 +1614,10 @@ function makeBuilder(config) {
|
|
|
1607
1614
|
...config,
|
|
1608
1615
|
skills: selection
|
|
1609
1616
|
}), "skills"),
|
|
1610
|
-
|
|
1617
|
+
settingSources: /* @__PURE__ */ __name((sources) => makeBuilder({
|
|
1611
1618
|
...config,
|
|
1612
|
-
|
|
1613
|
-
}), "
|
|
1619
|
+
settingSources: sources
|
|
1620
|
+
}), "settingSources"),
|
|
1614
1621
|
use: /* @__PURE__ */ __name((preset) => preset(runtime), "use"),
|
|
1615
1622
|
build: /* @__PURE__ */ __name(() => defineAgent(config), "build")
|
|
1616
1623
|
};
|
|
@@ -1762,7 +1769,8 @@ __name(appendCheckpointSaved, "appendCheckpointSaved");
|
|
|
1762
1769
|
function streamAgentUIMessages(compiled, apiKey, input) {
|
|
1763
1770
|
const textId = crypto.randomUUID();
|
|
1764
1771
|
const overrides = {};
|
|
1765
|
-
if (input.
|
|
1772
|
+
if (input.cwd !== void 0) overrides.cwd = input.cwd;
|
|
1773
|
+
if (input.baseDir !== void 0) overrides.baseDir = input.baseDir;
|
|
1766
1774
|
let source;
|
|
1767
1775
|
if (!input.hitl || input.hitl.gated.size === 0) {
|
|
1768
1776
|
const events2 = createSdkAgentStream(compiled, compiled.tools, apiKey, overrides)(input.message, input.sessionId);
|
|
@@ -2447,11 +2455,11 @@ var AgentRunner = class {
|
|
|
2447
2455
|
stripToolDialect: opts.stripToolDialect,
|
|
2448
2456
|
recoverLeakedToolCalls: opts.recoverLeakedToolCalls,
|
|
2449
2457
|
cwd: opts.cwd,
|
|
2458
|
+
baseDir: opts.baseDir,
|
|
2450
2459
|
plugins: opts.plugins,
|
|
2451
2460
|
providers: opts.providers,
|
|
2452
2461
|
agents: opts.agents,
|
|
2453
2462
|
budgetTracker: opts.budgetTracker,
|
|
2454
|
-
conversationStorage: opts.conversationStorage,
|
|
2455
2463
|
sdkTools: opts.sdkTools
|
|
2456
2464
|
});
|
|
2457
2465
|
const sessionId = opts.sessionId ?? `runner-${crypto.randomUUID()}`;
|
|
@@ -2569,7 +2577,6 @@ async function delegate(SubAgentClass, message, opts = {}) {
|
|
|
2569
2577
|
providers: opts.providers,
|
|
2570
2578
|
agents: opts.agents,
|
|
2571
2579
|
budgetTracker: opts.budgetTracker,
|
|
2572
|
-
conversationStorage: opts.conversationStorage,
|
|
2573
2580
|
sdkTools: opts.sdkTools
|
|
2574
2581
|
});
|
|
2575
2582
|
const sessionId = opts.sessionId ?? `sub-${crypto.randomUUID()}`;
|
|
@@ -2986,4 +2993,4 @@ export {
|
|
|
2986
2993
|
generateAgentManifest,
|
|
2987
2994
|
agentsPlugin
|
|
2988
2995
|
};
|
|
2989
|
-
//# sourceMappingURL=chunk-
|
|
2996
|
+
//# sourceMappingURL=chunk-OFPS2N3U.js.map
|