@theokit/sdk 2.23.0 → 2.24.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/CHANGELOG.md +28 -0
- package/dist/a2a/index.cjs +3 -1
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +3 -1
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-Bpt_1khA.d.cts → cron-Bd2oRD7A.d.cts} +1 -1
- package/dist/{cron-7CruUd_0.d.ts → cron-vjod0qVQ.d.ts} +1 -1
- package/dist/cron.cjs +3 -1
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +3 -1
- package/dist/cron.js.map +1 -1
- package/dist/define-tool.d.ts +33 -20
- package/dist/{errors-CkCaIqVP.d.cts → errors-DIKBXffg.d.cts} +1 -1
- package/dist/{errors-BuwwkrAk.d.ts → errors-DRS-kqOK.d.ts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +3 -1
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +3 -1
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -26
- package/dist/index.d.ts +37 -26
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/{run-CrIulPF7.d.cts → run-Cr0C6cOM.d.cts} +17 -0
- package/dist/{run-CrIulPF7.d.ts → run-Cr0C6cOM.d.ts} +17 -0
- package/dist/types/run.d.ts +17 -0
- package/dist/workflow.cjs +37 -0
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +47 -1
- package/dist/workflow.d.ts +47 -1
- package/dist/workflow.js +37 -2
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -15788,6 +15788,7 @@ function levenshtein(a, b) {
|
|
|
15788
15788
|
}
|
|
15789
15789
|
|
|
15790
15790
|
// src/internal/runtime/local-agent/real-local-run.ts
|
|
15791
|
+
init_async_local_storage();
|
|
15791
15792
|
function createRealLocalRun(options) {
|
|
15792
15793
|
const { userText, id, startTime } = prepareRunContext(options.message);
|
|
15793
15794
|
const supported = /* @__PURE__ */ new Set(["stream", "wait", "cancel", "conversation"]);
|
|
@@ -15899,6 +15900,7 @@ function buildLoopInputs(options, runId, userText) {
|
|
|
15899
15900
|
...options.onStep !== void 0 ? { onStep: options.onStep } : {},
|
|
15900
15901
|
...options.onDelta !== void 0 ? { onDelta: options.onDelta } : {},
|
|
15901
15902
|
...options.sendOptions.toolChoice !== void 0 ? { toolChoice: options.sendOptions.toolChoice } : {},
|
|
15903
|
+
...options.sendOptions.activeTools !== void 0 ? { activeTools: options.sendOptions.activeTools } : {},
|
|
15902
15904
|
...options.priorMessages !== void 0 ? { priorMessages: options.priorMessages } : {},
|
|
15903
15905
|
...options.memoryTools !== void 0 && options.memoryTools.length > 0 ? { memoryTools: options.memoryTools } : {},
|
|
15904
15906
|
...buildCustomToolsInput(
|
|
@@ -16029,7 +16031,7 @@ var RealLocalRun = class extends FixtureRunBase {
|
|
|
16029
16031
|
}
|
|
16030
16032
|
async executeAgentLoop(inputs) {
|
|
16031
16033
|
try {
|
|
16032
|
-
const output = await runAgentLoop(inputs);
|
|
16034
|
+
const output = inputs.activeTools !== void 0 ? await withToolWhitelist(new Set(inputs.activeTools), () => runAgentLoop(inputs)) : await runAgentLoop(inputs);
|
|
16033
16035
|
this.applyAgentLoopOutput(output);
|
|
16034
16036
|
this.transitionTo(output.finalStatus);
|
|
16035
16037
|
} catch (cause) {
|
|
@@ -19515,6 +19517,11 @@ function defineProvider(profile, opts) {
|
|
|
19515
19517
|
|
|
19516
19518
|
// src/define-tool.ts
|
|
19517
19519
|
init_to_json_schema();
|
|
19520
|
+
function shapeToolResult(spec, out) {
|
|
19521
|
+
const validated = spec.outputSchema === void 0 ? out : spec.outputSchema.parse(out);
|
|
19522
|
+
if (spec.toModelOutput !== void 0) return spec.toModelOutput(validated);
|
|
19523
|
+
return typeof validated === "string" ? validated : JSON.stringify(validated);
|
|
19524
|
+
}
|
|
19518
19525
|
function defineTool(spec) {
|
|
19519
19526
|
const inputSchema = toJsonSchema(spec.inputSchema, {
|
|
19520
19527
|
unrepresentable: "any"
|
|
@@ -19529,7 +19536,8 @@ function defineTool(spec) {
|
|
|
19529
19536
|
schema: spec.inputSchema
|
|
19530
19537
|
}).value : input;
|
|
19531
19538
|
const parsed = spec.inputSchema.parse(raw);
|
|
19532
|
-
|
|
19539
|
+
const out = await spec.handler(parsed, ctx);
|
|
19540
|
+
return shapeToolResult(spec, out);
|
|
19533
19541
|
}
|
|
19534
19542
|
};
|
|
19535
19543
|
}
|