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