@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/dist/eval.js CHANGED
@@ -9487,12 +9487,9 @@ function buildAssistantTurn(text, toolCalls) {
9487
9487
  function buildUserContent(text, images) {
9488
9488
  const content = [{ type: "text", text }];
9489
9489
  for (const img of images ?? []) {
9490
- if ("data" in img) {
9491
- content.push({
9492
- type: "image",
9493
- source: { type: "base64", media_type: img.mimeType, data: img.data }
9494
- });
9495
- }
9490
+ content.push(
9491
+ "data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
9492
+ );
9496
9493
  }
9497
9494
  return content;
9498
9495
  }
@@ -12150,6 +12147,9 @@ function readOpenAiContent(body) {
12150
12147
  return void 0;
12151
12148
  }
12152
12149
 
12150
+ // src/internal/llm/ollama-native.ts
12151
+ init_errors();
12152
+
12153
12153
  // src/internal/error-mappers/ollama.ts
12154
12154
  init_errors();
12155
12155
  function mapOllamaTransportError(args) {
@@ -12417,6 +12417,12 @@ function toOllamaMessages(message) {
12417
12417
  return [{ role: "system", content: joinTextParts(message) }];
12418
12418
  }
12419
12419
  if (message.role === "user") {
12420
+ if (message.content.some((p) => p.type === "image")) {
12421
+ throw new ConfigurationError(
12422
+ "image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
12423
+ { code: "ollama_image_unsupported" }
12424
+ );
12425
+ }
12420
12426
  const out = [];
12421
12427
  for (const part of message.content) {
12422
12428
  if (part.type === "tool_result") {
@@ -12908,15 +12914,15 @@ function userOrToolMessages(message) {
12908
12914
  }
12909
12915
  }
12910
12916
  const userText = joinTextParts2(message);
12911
- const imageParts = message.content.filter((p) => p.type === "image");
12917
+ const imageParts = message.content.filter(
12918
+ (p) => p.type === "image"
12919
+ );
12912
12920
  if (imageParts.length > 0) {
12913
12921
  const content = [];
12914
12922
  if (userText.length > 0) content.push({ type: "text", text: userText });
12915
12923
  for (const img of imageParts) {
12916
- content.push({
12917
- type: "image_url",
12918
- image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
12919
- });
12924
+ const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
12925
+ content.push({ type: "image_url", image_url: { url } });
12920
12926
  }
12921
12927
  out.push({ role: "user", content });
12922
12928
  } else if (userText.length > 0) {
@@ -17796,6 +17802,11 @@ async function setArchivedFlag(agentId, archived) {
17796
17802
  updateRegisteredAgent(agentId, { archived });
17797
17803
  await flushRegistrySaves();
17798
17804
  }
17805
+ async function setAgentName(agentId, name) {
17806
+ await getRegisteredAgentOrThrow(agentId);
17807
+ updateRegisteredAgent(agentId, { name });
17808
+ await flushRegistrySaves();
17809
+ }
17799
17810
  async function getRegisteredAgentOrThrow(agentId) {
17800
17811
  let agent = getRegisteredAgent(agentId);
17801
17812
  if (agent === void 0) {
@@ -18075,6 +18086,16 @@ var Agent = class _Agent {
18075
18086
  static unarchive(agentId, _options = {}) {
18076
18087
  return setArchivedFlag(agentId, false);
18077
18088
  }
18089
+ /**
18090
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
18091
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
18092
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
18093
+ *
18094
+ * @public
18095
+ */
18096
+ static async rename(agentId, name, _options = {}) {
18097
+ await setAgentName(agentId, name);
18098
+ }
18078
18099
  /**
18079
18100
  * Permanently delete a cloud agent.
18080
18101
  *