@theokit/sdk 2.21.0 → 2.22.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 +33 -0
- package/dist/a2a/index.cjs +73 -19
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.d.cts +2 -1
- package/dist/a2a/index.d.ts +2 -1
- package/dist/a2a/index.js +73 -19
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/subagent.d.cts +70 -1
- package/dist/a2a/subagent.d.ts +70 -1
- package/dist/{cron-dpvtRoro.d.ts → cron-7CruUd_0.d.ts} +1 -1
- package/dist/{cron-YrmsszEN.d.cts → cron-Bpt_1khA.d.cts} +1 -1
- package/dist/cron.cjs +16 -6
- 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 +16 -6
- package/dist/cron.js.map +1 -1
- package/dist/{errors-C4vZPqXf.d.ts → errors-BuwwkrAk.d.ts} +1 -1
- package/dist/{errors-DrcpYVfZ.d.cts → errors-CkCaIqVP.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +16 -6
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +16 -6
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +16 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/{run-BMo8yRwK.d.cts → run-CrIulPF7.d.cts} +22 -2
- package/dist/{run-BMo8yRwK.d.ts → run-CrIulPF7.d.ts} +22 -2
- package/dist/types/agent-prims.d.ts +21 -1
- package/dist/types/agent.d.ts +1 -1
- package/package.json +3 -3
package/dist/cron.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import './run-
|
|
2
|
-
export { Q as Cron } from './cron-
|
|
1
|
+
import './run-CrIulPF7.cjs';
|
|
2
|
+
export { Q as Cron } from './cron-Bpt_1khA.cjs';
|
|
3
3
|
import 'zod';
|
package/dist/cron.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import './run-
|
|
2
|
-
export { Q as Cron } from './cron-
|
|
1
|
+
import './run-CrIulPF7.js';
|
|
2
|
+
export { Q as Cron } from './cron-7CruUd_0.js';
|
|
3
3
|
import 'zod';
|
package/dist/cron.js
CHANGED
|
@@ -9451,21 +9451,21 @@ async function executeTool(inputs, resolved, call) {
|
|
|
9451
9451
|
if (resolved.origin === "shell") return runShellTool(inputs, call);
|
|
9452
9452
|
if (resolved.origin === "memory") return runMemoryTool(resolved, call, inputs.context);
|
|
9453
9453
|
if (resolved.origin === "custom")
|
|
9454
|
-
return runCustomTool(resolved, call, inputs.signal, inputs.context);
|
|
9454
|
+
return runCustomTool(resolved, call, inputs.signal, inputs.context, inputs.messages);
|
|
9455
9455
|
return runMcpTool(inputs, resolved, call);
|
|
9456
9456
|
}
|
|
9457
9457
|
async function runMemoryTool(resolved, call, context) {
|
|
9458
9458
|
return runHandlerTool("memory", resolved.memoryHandler, call, void 0, context);
|
|
9459
9459
|
}
|
|
9460
|
-
async function runCustomTool(resolved, call, signal, context) {
|
|
9461
|
-
return runHandlerTool("custom", resolved.customHandler, call, signal, context);
|
|
9460
|
+
async function runCustomTool(resolved, call, signal, context, messages) {
|
|
9461
|
+
return runHandlerTool("custom", resolved.customHandler, call, signal, context, messages);
|
|
9462
9462
|
}
|
|
9463
|
-
async function runHandlerTool(kind, handler, call, signal, context) {
|
|
9463
|
+
async function runHandlerTool(kind, handler, call, signal, context, messages) {
|
|
9464
9464
|
if (handler === void 0) {
|
|
9465
9465
|
return { stdout: "", stderr: `${kind} tool ${call.name} has no handler`, exitCode: 127 };
|
|
9466
9466
|
}
|
|
9467
9467
|
try {
|
|
9468
|
-
const out = await handler(call.input, { signal, context });
|
|
9468
|
+
const out = await handler(call.input, { signal, context, messages });
|
|
9469
9469
|
if (typeof out !== "string") return { stdout: "", stderr: "", exitCode: 0, content: out };
|
|
9470
9470
|
return { stdout: out, stderr: "", exitCode: 0 };
|
|
9471
9471
|
} catch (cause) {
|
|
@@ -10225,6 +10225,14 @@ function computeUsageCost(inputs, usage) {
|
|
|
10225
10225
|
}
|
|
10226
10226
|
|
|
10227
10227
|
// src/internal/agent-loop/loop.ts
|
|
10228
|
+
function projectToolContextMessages(messages) {
|
|
10229
|
+
const projected = [];
|
|
10230
|
+
for (const m of messages) {
|
|
10231
|
+
const content = m.content.flatMap((p) => p.type === "text" ? [p.text] : []).join("");
|
|
10232
|
+
if (content !== "") projected.push({ role: m.role, content });
|
|
10233
|
+
}
|
|
10234
|
+
return projected;
|
|
10235
|
+
}
|
|
10228
10236
|
var MAX_NUDGE_ATTEMPTS = 2;
|
|
10229
10237
|
var MAX_STOP_FEEDBACK_ATTEMPTS = 2;
|
|
10230
10238
|
async function runAgentLoop(inputs) {
|
|
@@ -10467,7 +10475,9 @@ async function continueOrTerminate(inputs, ctx, llmOutput) {
|
|
|
10467
10475
|
const outText = await transformLlmOutputText(inputs, llmOutput.text, tCtx);
|
|
10468
10476
|
ctx.messages.push(buildAssistantTurn(outText, llmOutput.toolCalls));
|
|
10469
10477
|
const rawResults = await dispatchTools(
|
|
10470
|
-
|
|
10478
|
+
// SE12 — forward a read-only text projection of the transcript-so-far to tool
|
|
10479
|
+
// handlers via `ctx.messages` (consumed by defineSubAgent's messageFilter).
|
|
10480
|
+
{ ...inputs, messages: projectToolContextMessages(ctx.messages) },
|
|
10471
10481
|
ctx.tools,
|
|
10472
10482
|
llmOutput.toolCalls,
|
|
10473
10483
|
ctx.events,
|