@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 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/agent.d.ts CHANGED
@@ -166,6 +166,14 @@ export declare class Agent {
166
166
  * @public
167
167
  */
168
168
  static unarchive(agentId: string, _options?: AgentOperationOptions): Promise<void>;
169
+ /**
170
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
171
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
172
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
173
+ *
174
+ * @public
175
+ */
176
+ static rename(agentId: string, name: string, _options?: AgentOperationOptions): Promise<void>;
169
177
  /**
170
178
  * Permanently delete a cloud agent.
171
179
  *
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) {
@@ -17804,6 +17810,11 @@ async function setArchivedFlag(agentId, archived) {
17804
17810
  updateRegisteredAgent(agentId, { archived });
17805
17811
  await flushRegistrySaves();
17806
17812
  }
17813
+ async function setAgentName(agentId, name) {
17814
+ await getRegisteredAgentOrThrow(agentId);
17815
+ updateRegisteredAgent(agentId, { name });
17816
+ await flushRegistrySaves();
17817
+ }
17807
17818
  async function getRegisteredAgentOrThrow(agentId) {
17808
17819
  let agent = getRegisteredAgent(agentId);
17809
17820
  if (agent === void 0) {
@@ -18083,6 +18094,16 @@ var Agent = class _Agent {
18083
18094
  static unarchive(agentId, _options = {}) {
18084
18095
  return setArchivedFlag(agentId, false);
18085
18096
  }
18097
+ /**
18098
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
18099
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
18100
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
18101
+ *
18102
+ * @public
18103
+ */
18104
+ static async rename(agentId, name, _options = {}) {
18105
+ await setAgentName(agentId, name);
18106
+ }
18086
18107
  /**
18087
18108
  * Permanently delete a cloud agent.
18088
18109
  *