@theokit/sdk 4.7.0 → 4.7.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ef7e172: M35 review follow-ups (fail-fast, no silent drop): a `{ url }` `SDKImage` is now forwarded as an `image_url` with the URL directly on OpenAI/OpenRouter (previously silently dropped in `buildUserContent`); and the ollama-native provider throws a typed `ConfigurationError` on an image part instead of silently discarding it (images require an OpenAI/OpenRouter model). `LlmImagePart.source` gains a `{ type: "url" }` variant.
8
+
3
9
  ## 4.7.0
4
10
 
5
11
  ### Minor Changes
package/dist/cron.cjs CHANGED
@@ -9495,12 +9495,9 @@ function buildAssistantTurn(text, toolCalls) {
9495
9495
  function buildUserContent(text, images) {
9496
9496
  const content = [{ type: "text", text }];
9497
9497
  for (const img of images ?? []) {
9498
- if ("data" in img) {
9499
- content.push({
9500
- type: "image",
9501
- source: { type: "base64", media_type: img.mimeType, data: img.data }
9502
- });
9503
- }
9498
+ content.push(
9499
+ "data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
9500
+ );
9504
9501
  }
9505
9502
  return content;
9506
9503
  }
@@ -12158,6 +12155,9 @@ function readOpenAiContent(body) {
12158
12155
  return void 0;
12159
12156
  }
12160
12157
 
12158
+ // src/internal/llm/ollama-native.ts
12159
+ init_errors();
12160
+
12161
12161
  // src/internal/error-mappers/ollama.ts
12162
12162
  init_errors();
12163
12163
  function mapOllamaTransportError(args) {
@@ -12425,6 +12425,12 @@ function toOllamaMessages(message) {
12425
12425
  return [{ role: "system", content: joinTextParts(message) }];
12426
12426
  }
12427
12427
  if (message.role === "user") {
12428
+ if (message.content.some((p) => p.type === "image")) {
12429
+ throw new ConfigurationError(
12430
+ "image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
12431
+ { code: "ollama_image_unsupported" }
12432
+ );
12433
+ }
12428
12434
  const out = [];
12429
12435
  for (const part of message.content) {
12430
12436
  if (part.type === "tool_result") {
@@ -12916,15 +12922,15 @@ function userOrToolMessages(message) {
12916
12922
  }
12917
12923
  }
12918
12924
  const userText = joinTextParts2(message);
12919
- const imageParts = message.content.filter((p) => p.type === "image");
12925
+ const imageParts = message.content.filter(
12926
+ (p) => p.type === "image"
12927
+ );
12920
12928
  if (imageParts.length > 0) {
12921
12929
  const content = [];
12922
12930
  if (userText.length > 0) content.push({ type: "text", text: userText });
12923
12931
  for (const img of imageParts) {
12924
- content.push({
12925
- type: "image_url",
12926
- image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
12927
- });
12932
+ const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
12933
+ content.push({ type: "image_url", image_url: { url } });
12928
12934
  }
12929
12935
  out.push({ role: "user", content });
12930
12936
  } else if (userText.length > 0) {