@theokit/sdk 4.5.1 → 4.6.1

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
@@ -6124,7 +6124,9 @@ function serializeAgents(agents2) {
6124
6124
  out[name] = {
6125
6125
  description: def.description,
6126
6126
  prompt: def.prompt,
6127
- ...def.model !== void 0 ? { model: def.model } : {}
6127
+ ...def.model !== void 0 ? { model: def.model } : {},
6128
+ ...def.tools !== void 0 ? { tools: def.tools } : {},
6129
+ ...def.sandbox !== void 0 ? { sandbox: def.sandbox } : {}
6128
6130
  };
6129
6131
  }
6130
6132
  return out;
@@ -9284,22 +9286,86 @@ async function readProjectSubagents(cwd) {
9284
9286
  }
9285
9287
  return subagents;
9286
9288
  }
9289
+ var ACCEPTED_FIELDS = /* @__PURE__ */ new Set([
9290
+ "name",
9291
+ "description",
9292
+ "model",
9293
+ "tools",
9294
+ "reasoning_effort",
9295
+ "mcp",
9296
+ "sandbox"
9297
+ ]);
9287
9298
  function parseSubagentMarkdown(raw, filename) {
9288
9299
  const { frontmatter, body } = splitFrontmatter(raw, filename);
9289
9300
  const fields = parseFrontmatterFields(frontmatter);
9290
- const baseName = filename.replace(/\.md$/, "");
9291
- const name = fields.name ?? baseName;
9301
+ rejectUnknownFields(fields, filename);
9302
+ rejectMcp(fields, filename);
9292
9303
  const definition = {
9293
- description: fields.description ?? "",
9304
+ description: asString(fields.description) ?? "",
9294
9305
  prompt: body
9295
9306
  };
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;
9307
+ const model = resolveModel(fields, filename);
9308
+ if (model !== void 0) definition.model = model;
9309
+ const tools = toStringList(fields.tools);
9310
+ if (tools.length > 0) definition.tools = tools;
9311
+ const sandbox = resolveSandbox(fields, filename);
9312
+ if (sandbox !== void 0) definition.sandbox = sandbox;
9313
+ const name = asString(fields.name) ?? filename.replace(/\.md$/, "");
9301
9314
  return { name, definition };
9302
9315
  }
9316
+ function rejectUnknownFields(fields, filename) {
9317
+ for (const key2 of Object.keys(fields)) {
9318
+ if (!ACCEPTED_FIELDS.has(key2)) {
9319
+ throw new ConfigurationError(
9320
+ `Subagent ${filename}: unknown frontmatter field "${key2}" (accepted: ${[...ACCEPTED_FIELDS].join(", ")})`,
9321
+ { code: "subagent_unknown_field" }
9322
+ );
9323
+ }
9324
+ }
9325
+ }
9326
+ function rejectMcp(fields, filename) {
9327
+ if (fields.mcp !== void 0) {
9328
+ throw new ConfigurationError(
9329
+ `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`,
9330
+ { code: "subagent_mcp_unsupported_local" }
9331
+ );
9332
+ }
9333
+ }
9334
+ function resolveModel(fields, filename) {
9335
+ const modelId = asString(fields.model);
9336
+ const effort = asString(fields.reasoning_effort);
9337
+ if (effort !== void 0 && (modelId === void 0 || modelId === "inherit")) {
9338
+ throw new ConfigurationError(
9339
+ `Subagent ${filename}: reasoning_effort requires a concrete model (effort is a model parameter; an absent model or "inherit" cannot carry it)`,
9340
+ { code: "subagent_reasoning_effort_without_model" }
9341
+ );
9342
+ }
9343
+ if (modelId === void 0) return void 0;
9344
+ if (modelId === "inherit") return "inherit";
9345
+ return effort !== void 0 ? { id: modelId, params: [{ id: "thinking", value: effort }] } : { id: modelId };
9346
+ }
9347
+ function resolveSandbox(fields, filename) {
9348
+ if (fields.sandbox === void 0) return void 0;
9349
+ if (typeof fields.sandbox !== "boolean") {
9350
+ throw new ConfigurationError(
9351
+ `Subagent ${filename}: sandbox must be a boolean (got "${String(fields.sandbox)}"); granular sandbox modes are not supported by the runtime`,
9352
+ { code: "subagent_sandbox_not_boolean" }
9353
+ );
9354
+ }
9355
+ return fields.sandbox;
9356
+ }
9357
+ function asString(v) {
9358
+ if (typeof v !== "string") return void 0;
9359
+ const m = /^(["'])(.*)\1$/.exec(v);
9360
+ return m ? m[2] : v;
9361
+ }
9362
+ function toStringList(v) {
9363
+ if (Array.isArray(v)) return v.map((t) => t.trim()).filter((t) => t.length > 0);
9364
+ if (typeof v === "string") {
9365
+ return v.split(/[\s,]+/).map((t) => t.trim()).filter((t) => t.length > 0);
9366
+ }
9367
+ return [];
9368
+ }
9303
9369
  function splitFrontmatter(raw, filename) {
9304
9370
  const match = /^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/.exec(raw);
9305
9371
  if (match === null) {
@@ -9310,12 +9376,7 @@ function splitFrontmatter(raw, filename) {
9310
9376
  return { frontmatter: match[1] ?? "", body: (match[2] ?? "").trim() };
9311
9377
  }
9312
9378
  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;
9379
+ return parseSimpleYaml(frontmatter);
9319
9380
  }
9320
9381
 
9321
9382
  // src/define-tool.ts
@@ -9514,12 +9575,12 @@ init_path_guard();
9514
9575
 
9515
9576
  // src/internal/runtime/skills/skill-frontmatter.ts
9516
9577
  init_errors();
9517
- function asString(v) {
9578
+ function asString2(v) {
9518
9579
  return typeof v === "string" ? v : void 0;
9519
9580
  }
9520
9581
  function toStringFields(raw) {
9521
9582
  const out = {};
9522
- for (const [k, v] of Object.entries(raw)) out[k] = asString(v);
9583
+ for (const [k, v] of Object.entries(raw)) out[k] = asString2(v);
9523
9584
  return out;
9524
9585
  }
9525
9586
  function parseSkillFrontmatter(raw, fallbackName) {
@@ -16403,10 +16464,12 @@ ${lines.join("\n")}
16403
16464
  </subagent-tool-results>`;
16404
16465
  }
16405
16466
  function buildChildCreateOptions(spec, inherited) {
16406
- const model = spec.model ? { id: spec.model } : inherited?.model;
16467
+ const model = spec.model !== void 0 ? typeof spec.model === "string" ? { id: spec.model } : spec.model : inherited?.model;
16468
+ const sandbox = spec.sandbox ?? inherited?.sandbox;
16407
16469
  return {
16408
16470
  ...inherited?.apiKey !== void 0 ? { apiKey: inherited.apiKey } : {},
16409
16471
  ...model !== void 0 ? { model } : {},
16472
+ ...sandbox !== void 0 ? { local: { sandboxOptions: { enabled: sandbox } } } : {},
16410
16473
  ...inherited?.plugins !== void 0 ? { plugins: inherited.plugins } : {},
16411
16474
  systemPrompt: spec.instructions,
16412
16475
  tools: spec.tools ?? []
@@ -16515,7 +16578,10 @@ function subAgentToolsFromDefinitions(agents2, parentTools) {
16515
16578
  name,
16516
16579
  description: def.description,
16517
16580
  instructions: def.prompt,
16518
- ...def.model !== void 0 && def.model !== "inherit" ? { model: def.model.id } : {},
16581
+ // Carry the FULL ModelSelection (id + reasoning params), not just the id, so
16582
+ // per-subagent reasoning effort survives to buildChildCreateOptions.
16583
+ ...def.model !== void 0 && def.model !== "inherit" ? { model: def.model } : {},
16584
+ ...def.sandbox !== void 0 ? { sandbox: def.sandbox } : {},
16519
16585
  tools: [...childTools]
16520
16586
  });
16521
16587
  });
@@ -16579,10 +16645,12 @@ function declarativeSubagentTools(agents2, parentTools) {
16579
16645
  }
16580
16646
  function bindParentCredentials(tools, agentOptions) {
16581
16647
  const parentPlugins = Array.isArray(agentOptions.plugins) ? agentOptions.plugins : void 0;
16648
+ const parentSandbox = agentOptions.local?.sandboxOptions?.enabled;
16582
16649
  const credentials = {
16583
16650
  ...agentOptions.apiKey !== void 0 ? { apiKey: agentOptions.apiKey } : {},
16584
16651
  ...typeof agentOptions.model === "object" ? { model: agentOptions.model } : {},
16585
- ...parentPlugins !== void 0 ? { plugins: parentPlugins } : {}
16652
+ ...parentPlugins !== void 0 ? { plugins: parentPlugins } : {},
16653
+ ...parentSandbox !== void 0 ? { sandbox: parentSandbox } : {}
16586
16654
  };
16587
16655
  for (const tool of tools) inheritSubAgentCredentials(tool, credentials);
16588
16656
  }