@theokit/sdk 4.7.0 → 4.8.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 +6 -0
- package/dist/agent.d.ts +8 -0
- package/dist/cron.cjs +32 -11
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +32 -11
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +32 -11
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +32 -11
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +32 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/llm/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/eval.cjs
CHANGED
|
@@ -9490,12 +9490,9 @@ function buildAssistantTurn(text, toolCalls) {
|
|
|
9490
9490
|
function buildUserContent(text, images) {
|
|
9491
9491
|
const content = [{ type: "text", text }];
|
|
9492
9492
|
for (const img of images ?? []) {
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
source: { type: "base64", media_type: img.mimeType, data: img.data }
|
|
9497
|
-
});
|
|
9498
|
-
}
|
|
9493
|
+
content.push(
|
|
9494
|
+
"data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
|
|
9495
|
+
);
|
|
9499
9496
|
}
|
|
9500
9497
|
return content;
|
|
9501
9498
|
}
|
|
@@ -12153,6 +12150,9 @@ function readOpenAiContent(body) {
|
|
|
12153
12150
|
return void 0;
|
|
12154
12151
|
}
|
|
12155
12152
|
|
|
12153
|
+
// src/internal/llm/ollama-native.ts
|
|
12154
|
+
init_errors();
|
|
12155
|
+
|
|
12156
12156
|
// src/internal/error-mappers/ollama.ts
|
|
12157
12157
|
init_errors();
|
|
12158
12158
|
function mapOllamaTransportError(args) {
|
|
@@ -12420,6 +12420,12 @@ function toOllamaMessages(message) {
|
|
|
12420
12420
|
return [{ role: "system", content: joinTextParts(message) }];
|
|
12421
12421
|
}
|
|
12422
12422
|
if (message.role === "user") {
|
|
12423
|
+
if (message.content.some((p) => p.type === "image")) {
|
|
12424
|
+
throw new ConfigurationError(
|
|
12425
|
+
"image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
|
|
12426
|
+
{ code: "ollama_image_unsupported" }
|
|
12427
|
+
);
|
|
12428
|
+
}
|
|
12423
12429
|
const out = [];
|
|
12424
12430
|
for (const part of message.content) {
|
|
12425
12431
|
if (part.type === "tool_result") {
|
|
@@ -12911,15 +12917,15 @@ function userOrToolMessages(message) {
|
|
|
12911
12917
|
}
|
|
12912
12918
|
}
|
|
12913
12919
|
const userText = joinTextParts2(message);
|
|
12914
|
-
const imageParts = message.content.filter(
|
|
12920
|
+
const imageParts = message.content.filter(
|
|
12921
|
+
(p) => p.type === "image"
|
|
12922
|
+
);
|
|
12915
12923
|
if (imageParts.length > 0) {
|
|
12916
12924
|
const content = [];
|
|
12917
12925
|
if (userText.length > 0) content.push({ type: "text", text: userText });
|
|
12918
12926
|
for (const img of imageParts) {
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
|
|
12922
|
-
});
|
|
12927
|
+
const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
|
|
12928
|
+
content.push({ type: "image_url", image_url: { url } });
|
|
12923
12929
|
}
|
|
12924
12930
|
out.push({ role: "user", content });
|
|
12925
12931
|
} else if (userText.length > 0) {
|
|
@@ -17799,6 +17805,11 @@ async function setArchivedFlag(agentId, archived) {
|
|
|
17799
17805
|
updateRegisteredAgent(agentId, { archived });
|
|
17800
17806
|
await flushRegistrySaves();
|
|
17801
17807
|
}
|
|
17808
|
+
async function setAgentName(agentId, name) {
|
|
17809
|
+
await getRegisteredAgentOrThrow(agentId);
|
|
17810
|
+
updateRegisteredAgent(agentId, { name });
|
|
17811
|
+
await flushRegistrySaves();
|
|
17812
|
+
}
|
|
17802
17813
|
async function getRegisteredAgentOrThrow(agentId) {
|
|
17803
17814
|
let agent = getRegisteredAgent(agentId);
|
|
17804
17815
|
if (agent === void 0) {
|
|
@@ -18078,6 +18089,16 @@ var Agent = class _Agent {
|
|
|
18078
18089
|
static unarchive(agentId, _options = {}) {
|
|
18079
18090
|
return setArchivedFlag(agentId, false);
|
|
18080
18091
|
}
|
|
18092
|
+
/**
|
|
18093
|
+
* Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
|
|
18094
|
+
* already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
|
|
18095
|
+
* the local per-cwd registry for local agents; the cloud registry for cloud agents).
|
|
18096
|
+
*
|
|
18097
|
+
* @public
|
|
18098
|
+
*/
|
|
18099
|
+
static async rename(agentId, name, _options = {}) {
|
|
18100
|
+
await setAgentName(agentId, name);
|
|
18101
|
+
}
|
|
18081
18102
|
/**
|
|
18082
18103
|
* Permanently delete a cloud agent.
|
|
18083
18104
|
*
|