@theokit/sdk 2.11.1 → 2.11.3

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/cron.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import './run-D22b53SU.cjs';
2
- export { K as Cron } from './cron-BNI8pyn_.cjs';
1
+ import './run-TMdc7gmo.cjs';
2
+ export { K as Cron } from './cron-DOw-Hqol.cjs';
package/dist/cron.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import './run-D22b53SU.js';
2
- export { K as Cron } from './cron-CZlMLA1K.js';
1
+ import './run-TMdc7gmo.js';
2
+ export { K as Cron } from './cron-BRfFPEKY.js';
package/dist/cron.js CHANGED
@@ -8549,6 +8549,9 @@ async function streamLlmTurn(inputs, ctx) {
8549
8549
  const effort = reasoningEffortFromParams(inputs.model.params);
8550
8550
  return effort !== void 0 ? { reasoning: { effort } } : {};
8551
8551
  })(),
8552
+ // Step-cap force-close: forward the per-run tool gate (`"none"` on a ceiling round forces a
8553
+ // text close even though tools are advertised). Absent ⇒ provider default (auto).
8554
+ ...inputs.toolChoice !== void 0 ? { toolChoice: inputs.toolChoice } : {},
8552
8555
  messages: ctx.messages,
8553
8556
  tools: ctx.tools.map(toLlmTool)
8554
8557
  },
@@ -11020,6 +11023,16 @@ var OpenAIClient = class {
11020
11023
  } catch {
11021
11024
  continue;
11022
11025
  }
11026
+ if (chunk.error !== void 0 && chunk.error !== null) {
11027
+ const status = typeof chunk.error.code === "number" ? chunk.error.code : 502;
11028
+ throw mapOpenAICompatibleError({
11029
+ providerId,
11030
+ status,
11031
+ body: chunk,
11032
+ headers: response.headers,
11033
+ endpoint: "/v1/chat/completions"
11034
+ });
11035
+ }
11023
11036
  const events = accumulator.consume(chunk);
11024
11037
  for (const event of events) yield event;
11025
11038
  }
@@ -11123,6 +11136,14 @@ function applyReasoningRequest(body, effort, providerName) {
11123
11136
  }
11124
11137
  body.reasoning = { effort };
11125
11138
  }
11139
+ function applyToolsRequest(body, request) {
11140
+ if (request.tools === void 0 || request.tools.length === 0) return;
11141
+ body.tools = request.tools.map((tool) => ({
11142
+ type: "function",
11143
+ function: { name: tool.name, description: tool.description, parameters: tool.inputSchema }
11144
+ }));
11145
+ if (request.toolChoice !== void 0) body.tool_choice = request.toolChoice;
11146
+ }
11126
11147
  function buildOpenAIBody(request, providerName) {
11127
11148
  const messages = [];
11128
11149
  const systemText = openAISystemText(request.system);
@@ -11144,12 +11165,7 @@ function buildOpenAIBody(request, providerName) {
11144
11165
  if (request.temperature !== void 0) body.temperature = request.temperature;
11145
11166
  if (request.reasoning?.effort !== void 0)
11146
11167
  applyReasoningRequest(body, request.reasoning.effort, providerName);
11147
- if (request.tools !== void 0 && request.tools.length > 0) {
11148
- body.tools = request.tools.map((tool) => ({
11149
- type: "function",
11150
- function: { name: tool.name, description: tool.description, parameters: tool.inputSchema }
11151
- }));
11152
- }
11168
+ applyToolsRequest(body, request);
11153
11169
  const responseFormat = encodeOpenAIResponseFormat(request.responseFormat);
11154
11170
  if (responseFormat !== void 0) body.response_format = responseFormat;
11155
11171
  return body;
@@ -11992,6 +12008,7 @@ function buildLoopInputs(options, runId, userText) {
11992
12008
  ...options.systemPrompt !== void 0 ? { systemPrompt: options.systemPrompt } : {},
11993
12009
  ...options.onStep !== void 0 ? { onStep: options.onStep } : {},
11994
12010
  ...options.onDelta !== void 0 ? { onDelta: options.onDelta } : {},
12011
+ ...options.sendOptions.toolChoice !== void 0 ? { toolChoice: options.sendOptions.toolChoice } : {},
11995
12012
  ...options.priorMessages !== void 0 ? { priorMessages: options.priorMessages } : {},
11996
12013
  ...options.memoryTools !== void 0 && options.memoryTools.length > 0 ? { memoryTools: options.memoryTools } : {},
11997
12014
  ...buildCustomToolsInput(