@theokit/sdk 4.5.0 → 4.6.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/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-gE8612p9.cjs';
2
2
  export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-gE8612p9.cjs';
3
- import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-CWQPZTwX.cjs';
4
- export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD as TelemetrySettings } from './cron-CWQPZTwX.cjs';
3
+ import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-26WH1n7o.cjs';
4
+ export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD as TelemetrySettings } from './cron-26WH1n7o.cjs';
5
5
  import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-DFM1H2jW.cjs';
6
6
  export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-DFM1H2jW.cjs';
7
7
  import * as zod from 'zod';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { T as TheokitAgentError, B as BudgetOptions, a as BudgetHandle, b as BudgetSnapshot, E as ErrorMetadata } from './errors-CG2RpeW-.js';
2
2
  export { A as AgentDisposedError, c as AgentRunError, d as AgentRunErrorCode, e as AuthenticationError, f as BudgetExceedEvent, g as BudgetExceededError, h as BudgetLimit, i as BudgetMode, j as BudgetScope, k as BudgetThresholdEvent, l as BudgetWindow, C as ConfigurationError, m as ErrorCode, I as IntegrationNotConnectedError, n as InvalidTaskIdError, M as MemoryAdapterError, o as MemoryAdapterErrorCode, N as NetworkError, R as RateLimitError, p as TaskNotFoundError, U as UnknownAgentError, q as UnsupportedBudgetOperationError, r as UnsupportedRunOperationError, s as UnsupportedTaskOperationError, t as isTransientError } from './errors-CG2RpeW-.js';
3
- import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-DVM9f1I_.js';
4
- export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD as TelemetrySettings } from './cron-DVM9f1I_.js';
3
+ import { A as AgentOptions, L as LocalOptions, P as ProviderRoutingSettings, S as SystemPromptResolver, C as CloudOptions, M as MemorySettings, a as AgentDefinition, b as ContextSettings, c as PluginsSettings, d as SkillsSettings, e as SDKAgent, f as ListAgentsOptions, g as ListResult, h as SDKAgentInfo, G as GetAgentOptions, i as ListRunsOptions, j as GetRunOptions, k as AgentOperationOptions, l as Plugin$1, m as ProviderProfile, I as InlineSkill, B as BudgetTracker, n as MemoryProvider, o as MemoryId, p as PreToolCallDecision, q as StepResult, r as SDKProvider } from './cron-D_0p_gXd.js';
4
+ export { s as ActiveMemoryPassArgs, t as ActiveMemoryPassResult, u as AgentMemory, v as BudgetCheck, w as BudgetTotal, x as BudgetUsageEvent, y as CloudEnv, z as CloudRepo, D as ContextBudget, E as ContextManagerKind, F as ContextSnapshot, H as ContextSource, J as ContextSourceStatus, K as CreateSkillSpec, N as Cron, O as CronCreateOptions, Q as CronGetOptions, R as CronJob, T as CronJobStatus, U as CronListOptions, V as CronOperationOptions, W as CronRunOptions, X as CronRuntime, Y as CronSchedulerStatus, Z as CronStartOptions, _ as GoalEvent, $ as GoalOptions, a0 as GoalResult, a1 as HookName, a2 as InvalidateCacheOptions, a3 as MemoryAdapter, a4 as MemoryAdapterCapabilities, a5 as MemoryContext, a6 as MemoryFact, a7 as MemoryProviderHandle, a8 as MemoryProviderInitOptions, a9 as MemoryRevision, aa as MemoryToolSchema, ab as MemoryTurnMessage, ac as PersonalityPreset, ad as PluginContext, ae as PostAssistantReplyContext, af as PreToolCallContext, ag as PreUserSendContext, ah as PreUserSendResult, ai as ProviderCapability, aj as ProviderRoute, ak as RecordSessionSummaryArgs, al as ResolvedProviderRoute, am as RunUntilIterator, an as SDKAgentPlugins, ao as SDKAgentSkillDetail, ap as SDKAgentSkills, aq as SDKArtifact, ar as SDKContextManager, as as SDKPluginMetadata, at as SDKProvidersManager, au as SessionRecord, av as SessionStore, aw as SettingSource, ax as Skill, ay as SkillsResolver, az as SkillsResolverContext, aA as SystemPromptContext, aB as SystemPromptMemoryFact, aC as SystemPromptSkillRef, aD as TelemetrySettings } from './cron-D_0p_gXd.js';
5
5
  import { R as RunResult, M as ModelSelection, C as CustomTool, a as McpServerConfig, b as Run, P as Processor, T as ToolResultContentBlock, c as PermissionMode, d as PermissionEngine, e as RunEventSink, S as SDKMessage } from './run-DFM1H2jW.js';
6
6
  export { A as AgentConversationTurn, f as AssistantMessage, g as CompletionCheck, h as CompletionCheckResult, i as ConversationStep, j as ConversationTurn, k as CostBreakdown, l as CostSource, m as CostStatus, D as DoomLoopThresholds, G as GenerateOptions, n as GenerateRunResult, I as ImageBlock, o as InputProcessorContext, p as InteractionUpdate, q as McpAuthConfig, r as McpHttpServerConfig, s as McpOAuthConfig, t as McpStdioServerConfig, u as MessageOrigin, v as ModelParameterValue, O as OutputProcessorContext, w as PartialToolCallUpdate, x as PermissionAction, y as PermissionEngineOptions, z as PermissionRule, B as ProcessorControls, E as ProcessorTripwire, F as ProcessorViolation, H as RunCompactBoundaryEvent, J as RunCompletionCheckEvent, K as RunErrorDetail, L as RunEvent, N as RunGitInfo, Q as RunOperation, U as RunPermissionDeniedEvent, V as RunRateLimitEvent, W as RunStatus, X as RunTaskCompletedEvent, Y as RunTaskStartedEvent, Z as RunTaskUpdatedEvent, _ as RunToCompletionOptions, $ as RunToCompletionResult, a0 as RunToolProgressEvent, a1 as RunTripwireEvent, a2 as SDKAssistantMessage, a3 as SDKImage, a4 as SDKImageDimension, a5 as SDKObjectDelta, a6 as SDKRequestMessage, a7 as SDKStatusMessage, a8 as SDKSystemMessage, a9 as SDKTaskMessage, aa as SDKThinkingMessage, ab as SDKToolUseMessage, ac as SDKUserMessage, ad as SDKUserMessageEvent, ae as SendOptions, af as ShellCommand, ag as ShellConversationTurn, ah as ShellOutput, ai as ShellOutputDeltaUpdate, aj as StepCompletedUpdate, ak as StepStartedUpdate, al as StreamToCompletionResult, am as SummaryCompletedUpdate, an as SummaryStartedUpdate, ao as SummaryUpdate, ap as TextBlock, aq as TextDeltaUpdate, ar as ThinkingCompletedUpdate, as as ThinkingDeltaUpdate, at as ThinkingMessage, au as TokenDeltaUpdate, av as TokenUsage, aw as ToolCall, ax as ToolCallCompletedUpdate, ay as ToolCallStartedUpdate, az as ToolContextMessage, aA as ToolResult, aB as ToolResultGuardOptions, aC as ToolUseBlock, aD as TurnEndedUpdate, aE as UserMessage, aF as UserMessageAppendedUpdate, aG as applyMode, aH as emitRunEvent } from './run-DFM1H2jW.js';
7
7
  import * as zod from 'zod';
package/dist/index.js CHANGED
@@ -9284,22 +9284,84 @@ async function readProjectSubagents(cwd) {
9284
9284
  }
9285
9285
  return subagents;
9286
9286
  }
9287
+ var ACCEPTED_FIELDS = /* @__PURE__ */ new Set([
9288
+ "name",
9289
+ "description",
9290
+ "model",
9291
+ "tools",
9292
+ "reasoning_effort",
9293
+ "mcp",
9294
+ "sandbox"
9295
+ ]);
9287
9296
  function parseSubagentMarkdown(raw, filename) {
9288
9297
  const { frontmatter, body } = splitFrontmatter(raw, filename);
9289
9298
  const fields = parseFrontmatterFields(frontmatter);
9290
- const baseName = filename.replace(/\.md$/, "");
9291
- const name = fields.name ?? baseName;
9299
+ rejectUnknownFields(fields, filename);
9300
+ rejectMcp(fields, filename);
9292
9301
  const definition = {
9293
- description: fields.description ?? "",
9302
+ description: asString(fields.description) ?? "",
9294
9303
  prompt: body
9295
9304
  };
9296
- if (fields.model !== void 0) {
9297
- definition.model = fields.model === "inherit" ? "inherit" : { id: fields.model };
9298
- }
9299
- const tools = fields.tools?.split(/[\s,]+/).map((t) => t.trim()).filter((t) => t.length > 0);
9300
- if (tools !== void 0 && tools.length > 0) definition.tools = tools;
9305
+ const model = resolveModel(fields, filename);
9306
+ if (model !== void 0) definition.model = model;
9307
+ const tools = toStringList(fields.tools);
9308
+ if (tools.length > 0) definition.tools = tools;
9309
+ const sandbox = resolveSandbox(fields, filename);
9310
+ if (sandbox !== void 0) definition.sandbox = sandbox;
9311
+ const name = asString(fields.name) ?? filename.replace(/\.md$/, "");
9301
9312
  return { name, definition };
9302
9313
  }
9314
+ function rejectUnknownFields(fields, filename) {
9315
+ for (const key2 of Object.keys(fields)) {
9316
+ if (!ACCEPTED_FIELDS.has(key2)) {
9317
+ throw new ConfigurationError(
9318
+ `Subagent ${filename}: unknown frontmatter field "${key2}" (accepted: ${[...ACCEPTED_FIELDS].join(", ")})`,
9319
+ { code: "subagent_unknown_field" }
9320
+ );
9321
+ }
9322
+ }
9323
+ }
9324
+ function rejectMcp(fields, filename) {
9325
+ if (fields.mcp !== void 0) {
9326
+ throw new ConfigurationError(
9327
+ `Subagent ${filename}: per-subagent "mcp" is not yet supported on the local delegation path; declare MCP servers in .theokit/mcp.json (or the parent) instead`,
9328
+ { code: "subagent_mcp_unsupported_local" }
9329
+ );
9330
+ }
9331
+ }
9332
+ function resolveModel(fields, filename) {
9333
+ const modelId = asString(fields.model);
9334
+ const effort = asString(fields.reasoning_effort);
9335
+ if (effort !== void 0 && modelId === void 0) {
9336
+ throw new ConfigurationError(
9337
+ `Subagent ${filename}: reasoning_effort requires a model (effort is a model parameter)`,
9338
+ { code: "subagent_reasoning_effort_without_model" }
9339
+ );
9340
+ }
9341
+ if (modelId === void 0) return void 0;
9342
+ if (modelId === "inherit") return "inherit";
9343
+ return effort !== void 0 ? { id: modelId, params: [{ id: "thinking", value: effort }] } : { id: modelId };
9344
+ }
9345
+ function resolveSandbox(fields, filename) {
9346
+ if (fields.sandbox === void 0) return void 0;
9347
+ if (typeof fields.sandbox !== "boolean") {
9348
+ throw new ConfigurationError(
9349
+ `Subagent ${filename}: sandbox must be a boolean (got "${String(fields.sandbox)}"); granular sandbox modes are not supported by the runtime`,
9350
+ { code: "subagent_sandbox_not_boolean" }
9351
+ );
9352
+ }
9353
+ return fields.sandbox;
9354
+ }
9355
+ function asString(v) {
9356
+ return typeof v === "string" ? v : void 0;
9357
+ }
9358
+ function toStringList(v) {
9359
+ if (Array.isArray(v)) return v.map((t) => t.trim()).filter((t) => t.length > 0);
9360
+ if (typeof v === "string") {
9361
+ return v.split(/[\s,]+/).map((t) => t.trim()).filter((t) => t.length > 0);
9362
+ }
9363
+ return [];
9364
+ }
9303
9365
  function splitFrontmatter(raw, filename) {
9304
9366
  const match = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/.exec(raw);
9305
9367
  if (match === null) {
@@ -9310,12 +9372,7 @@ function splitFrontmatter(raw, filename) {
9310
9372
  return { frontmatter: match[1] ?? "", body: (match[2] ?? "").trim() };
9311
9373
  }
9312
9374
  function parseFrontmatterFields(frontmatter) {
9313
- const raw = parseSimpleYaml(frontmatter);
9314
- const out = {};
9315
- for (const [k, v] of Object.entries(raw)) {
9316
- out[k] = typeof v === "string" ? v : void 0;
9317
- }
9318
- return out;
9375
+ return parseSimpleYaml(frontmatter);
9319
9376
  }
9320
9377
 
9321
9378
  // src/define-tool.ts
@@ -9514,12 +9571,12 @@ init_path_guard();
9514
9571
 
9515
9572
  // src/internal/runtime/skills/skill-frontmatter.ts
9516
9573
  init_errors();
9517
- function asString(v) {
9574
+ function asString2(v) {
9518
9575
  return typeof v === "string" ? v : void 0;
9519
9576
  }
9520
9577
  function toStringFields(raw) {
9521
9578
  const out = {};
9522
- for (const [k, v] of Object.entries(raw)) out[k] = asString(v);
9579
+ for (const [k, v] of Object.entries(raw)) out[k] = asString2(v);
9523
9580
  return out;
9524
9581
  }
9525
9582
  function parseSkillFrontmatter(raw, fallbackName) {
@@ -16403,10 +16460,11 @@ ${lines.join("\n")}
16403
16460
  </subagent-tool-results>`;
16404
16461
  }
16405
16462
  function buildChildCreateOptions(spec, inherited) {
16406
- const model = spec.model ? { id: spec.model } : inherited?.model;
16463
+ const model = spec.model !== void 0 ? typeof spec.model === "string" ? { id: spec.model } : spec.model : inherited?.model;
16407
16464
  return {
16408
16465
  ...inherited?.apiKey !== void 0 ? { apiKey: inherited.apiKey } : {},
16409
16466
  ...model !== void 0 ? { model } : {},
16467
+ ...spec.sandbox === true ? { local: { sandboxOptions: { enabled: true } } } : {},
16410
16468
  ...inherited?.plugins !== void 0 ? { plugins: inherited.plugins } : {},
16411
16469
  systemPrompt: spec.instructions,
16412
16470
  tools: spec.tools ?? []
@@ -16515,7 +16573,10 @@ function subAgentToolsFromDefinitions(agents2, parentTools) {
16515
16573
  name,
16516
16574
  description: def.description,
16517
16575
  instructions: def.prompt,
16518
- ...def.model !== void 0 && def.model !== "inherit" ? { model: def.model.id } : {},
16576
+ // Carry the FULL ModelSelection (id + reasoning params), not just the id, so
16577
+ // per-subagent reasoning effort survives to buildChildCreateOptions.
16578
+ ...def.model !== void 0 && def.model !== "inherit" ? { model: def.model } : {},
16579
+ ...def.sandbox !== void 0 ? { sandbox: def.sandbox } : {},
16519
16580
  tools: [...childTools]
16520
16581
  });
16521
16582
  });