@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/index.cjs CHANGED
@@ -12077,12 +12077,9 @@ function buildAssistantTurn(text, toolCalls) {
12077
12077
  function buildUserContent(text, images) {
12078
12078
  const content = [{ type: "text", text }];
12079
12079
  for (const img of images ?? []) {
12080
- if ("data" in img) {
12081
- content.push({
12082
- type: "image",
12083
- source: { type: "base64", media_type: img.mimeType, data: img.data }
12084
- });
12085
- }
12080
+ content.push(
12081
+ "data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
12082
+ );
12086
12083
  }
12087
12084
  return content;
12088
12085
  }
@@ -14755,6 +14752,9 @@ function readOpenAiContent(body) {
14755
14752
  return void 0;
14756
14753
  }
14757
14754
 
14755
+ // src/internal/llm/ollama-native.ts
14756
+ init_errors();
14757
+
14758
14758
  // src/internal/error-mappers/ollama.ts
14759
14759
  init_errors();
14760
14760
  function mapOllamaTransportError(args) {
@@ -15022,6 +15022,12 @@ function toOllamaMessages(message) {
15022
15022
  return [{ role: "system", content: joinTextParts(message) }];
15023
15023
  }
15024
15024
  if (message.role === "user") {
15025
+ if (message.content.some((p) => p.type === "image")) {
15026
+ throw new exports.ConfigurationError(
15027
+ "image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
15028
+ { code: "ollama_image_unsupported" }
15029
+ );
15030
+ }
15025
15031
  const out = [];
15026
15032
  for (const part of message.content) {
15027
15033
  if (part.type === "tool_result") {
@@ -15513,15 +15519,15 @@ function userOrToolMessages(message) {
15513
15519
  }
15514
15520
  }
15515
15521
  const userText = joinTextParts2(message);
15516
- const imageParts = message.content.filter((p) => p.type === "image");
15522
+ const imageParts = message.content.filter(
15523
+ (p) => p.type === "image"
15524
+ );
15517
15525
  if (imageParts.length > 0) {
15518
15526
  const content = [];
15519
15527
  if (userText.length > 0) content.push({ type: "text", text: userText });
15520
15528
  for (const img of imageParts) {
15521
- content.push({
15522
- type: "image_url",
15523
- image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
15524
- });
15529
+ const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
15530
+ content.push({ type: "image_url", image_url: { url } });
15525
15531
  }
15526
15532
  out.push({ role: "user", content });
15527
15533
  } else if (userText.length > 0) {
@@ -19454,6 +19460,11 @@ async function setArchivedFlag(agentId, archived) {
19454
19460
  updateRegisteredAgent(agentId, { archived });
19455
19461
  await flushRegistrySaves();
19456
19462
  }
19463
+ async function setAgentName(agentId, name) {
19464
+ await getRegisteredAgentOrThrow(agentId);
19465
+ updateRegisteredAgent(agentId, { name });
19466
+ await flushRegistrySaves();
19467
+ }
19457
19468
  async function getRegisteredAgentOrThrow(agentId) {
19458
19469
  let agent = getRegisteredAgent(agentId);
19459
19470
  if (agent === void 0) {
@@ -19733,6 +19744,16 @@ var Agent = class _Agent {
19733
19744
  static unarchive(agentId, _options = {}) {
19734
19745
  return setArchivedFlag(agentId, false);
19735
19746
  }
19747
+ /**
19748
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
19749
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
19750
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
19751
+ *
19752
+ * @public
19753
+ */
19754
+ static async rename(agentId, name, _options = {}) {
19755
+ await setAgentName(agentId, name);
19756
+ }
19736
19757
  /**
19737
19758
  * Permanently delete a cloud agent.
19738
19759
  *