@theokit/sdk 4.6.0 → 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.cjs CHANGED
@@ -6127,7 +6127,9 @@ function serializeAgents(agents2) {
6127
6127
  out[name] = {
6128
6128
  description: def.description,
6129
6129
  prompt: def.prompt,
6130
- ...def.model !== void 0 ? { model: def.model } : {}
6130
+ ...def.model !== void 0 ? { model: def.model } : {},
6131
+ ...def.tools !== void 0 ? { tools: def.tools } : {},
6132
+ ...def.sandbox !== void 0 ? { sandbox: def.sandbox } : {}
6131
6133
  };
6132
6134
  }
6133
6135
  return out;
@@ -9335,9 +9337,9 @@ function rejectMcp(fields, filename) {
9335
9337
  function resolveModel(fields, filename) {
9336
9338
  const modelId = asString(fields.model);
9337
9339
  const effort = asString(fields.reasoning_effort);
9338
- if (effort !== void 0 && modelId === void 0) {
9340
+ if (effort !== void 0 && (modelId === void 0 || modelId === "inherit")) {
9339
9341
  throw new exports.ConfigurationError(
9340
- `Subagent ${filename}: reasoning_effort requires a model (effort is a model parameter)`,
9342
+ `Subagent ${filename}: reasoning_effort requires a concrete model (effort is a model parameter; an absent model or "inherit" cannot carry it)`,
9341
9343
  { code: "subagent_reasoning_effort_without_model" }
9342
9344
  );
9343
9345
  }
@@ -9356,7 +9358,9 @@ function resolveSandbox(fields, filename) {
9356
9358
  return fields.sandbox;
9357
9359
  }
9358
9360
  function asString(v) {
9359
- return typeof v === "string" ? v : void 0;
9361
+ if (typeof v !== "string") return void 0;
9362
+ const m = /^(["'])(.*)\1$/.exec(v);
9363
+ return m ? m[2] : v;
9360
9364
  }
9361
9365
  function toStringList(v) {
9362
9366
  if (Array.isArray(v)) return v.map((t) => t.trim()).filter((t) => t.length > 0);
@@ -16464,10 +16468,11 @@ ${lines.join("\n")}
16464
16468
  }
16465
16469
  function buildChildCreateOptions(spec, inherited) {
16466
16470
  const model = spec.model !== void 0 ? typeof spec.model === "string" ? { id: spec.model } : spec.model : inherited?.model;
16471
+ const sandbox = spec.sandbox ?? inherited?.sandbox;
16467
16472
  return {
16468
16473
  ...inherited?.apiKey !== void 0 ? { apiKey: inherited.apiKey } : {},
16469
16474
  ...model !== void 0 ? { model } : {},
16470
- ...spec.sandbox === true ? { local: { sandboxOptions: { enabled: true } } } : {},
16475
+ ...sandbox !== void 0 ? { local: { sandboxOptions: { enabled: sandbox } } } : {},
16471
16476
  ...inherited?.plugins !== void 0 ? { plugins: inherited.plugins } : {},
16472
16477
  systemPrompt: spec.instructions,
16473
16478
  tools: spec.tools ?? []
@@ -16643,10 +16648,12 @@ function declarativeSubagentTools(agents2, parentTools) {
16643
16648
  }
16644
16649
  function bindParentCredentials(tools, agentOptions) {
16645
16650
  const parentPlugins = Array.isArray(agentOptions.plugins) ? agentOptions.plugins : void 0;
16651
+ const parentSandbox = agentOptions.local?.sandboxOptions?.enabled;
16646
16652
  const credentials = {
16647
16653
  ...agentOptions.apiKey !== void 0 ? { apiKey: agentOptions.apiKey } : {},
16648
16654
  ...typeof agentOptions.model === "object" ? { model: agentOptions.model } : {},
16649
- ...parentPlugins !== void 0 ? { plugins: parentPlugins } : {}
16655
+ ...parentPlugins !== void 0 ? { plugins: parentPlugins } : {},
16656
+ ...parentSandbox !== void 0 ? { sandbox: parentSandbox } : {}
16650
16657
  };
16651
16658
  for (const tool of tools) inheritSubAgentCredentials(tool, credentials);
16652
16659
  }