@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.d.cts CHANGED
@@ -575,6 +575,14 @@ declare class Agent {
575
575
  * @public
576
576
  */
577
577
  static unarchive(agentId: string, _options?: AgentOperationOptions): Promise<void>;
578
+ /**
579
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
580
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
581
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
582
+ *
583
+ * @public
584
+ */
585
+ static rename(agentId: string, name: string, _options?: AgentOperationOptions): Promise<void>;
578
586
  /**
579
587
  * Permanently delete a cloud agent.
580
588
  *
package/dist/index.d.ts CHANGED
@@ -575,6 +575,14 @@ declare class Agent {
575
575
  * @public
576
576
  */
577
577
  static unarchive(agentId: string, _options?: AgentOperationOptions): Promise<void>;
578
+ /**
579
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
580
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
581
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
582
+ *
583
+ * @public
584
+ */
585
+ static rename(agentId: string, name: string, _options?: AgentOperationOptions): Promise<void>;
578
586
  /**
579
587
  * Permanently delete a cloud agent.
580
588
  *
package/dist/index.js CHANGED
@@ -12074,12 +12074,9 @@ function buildAssistantTurn(text, toolCalls) {
12074
12074
  function buildUserContent(text, images) {
12075
12075
  const content = [{ type: "text", text }];
12076
12076
  for (const img of images ?? []) {
12077
- if ("data" in img) {
12078
- content.push({
12079
- type: "image",
12080
- source: { type: "base64", media_type: img.mimeType, data: img.data }
12081
- });
12082
- }
12077
+ content.push(
12078
+ "data" in img ? { type: "image", source: { type: "base64", media_type: img.mimeType, data: img.data } } : { type: "image", source: { type: "url", url: img.url } }
12079
+ );
12083
12080
  }
12084
12081
  return content;
12085
12082
  }
@@ -14752,6 +14749,9 @@ function readOpenAiContent(body) {
14752
14749
  return void 0;
14753
14750
  }
14754
14751
 
14752
+ // src/internal/llm/ollama-native.ts
14753
+ init_errors();
14754
+
14755
14755
  // src/internal/error-mappers/ollama.ts
14756
14756
  init_errors();
14757
14757
  function mapOllamaTransportError(args) {
@@ -15019,6 +15019,12 @@ function toOllamaMessages(message) {
15019
15019
  return [{ role: "system", content: joinTextParts(message) }];
15020
15020
  }
15021
15021
  if (message.role === "user") {
15022
+ if (message.content.some((p) => p.type === "image")) {
15023
+ throw new ConfigurationError(
15024
+ "image input is not supported on the ollama-native provider; use an OpenAI/OpenRouter model for multimodal turns",
15025
+ { code: "ollama_image_unsupported" }
15026
+ );
15027
+ }
15022
15028
  const out = [];
15023
15029
  for (const part of message.content) {
15024
15030
  if (part.type === "tool_result") {
@@ -15510,15 +15516,15 @@ function userOrToolMessages(message) {
15510
15516
  }
15511
15517
  }
15512
15518
  const userText = joinTextParts2(message);
15513
- const imageParts = message.content.filter((p) => p.type === "image");
15519
+ const imageParts = message.content.filter(
15520
+ (p) => p.type === "image"
15521
+ );
15514
15522
  if (imageParts.length > 0) {
15515
15523
  const content = [];
15516
15524
  if (userText.length > 0) content.push({ type: "text", text: userText });
15517
15525
  for (const img of imageParts) {
15518
- content.push({
15519
- type: "image_url",
15520
- image_url: { url: `data:${img.source.media_type};base64,${img.source.data}` }
15521
- });
15526
+ const url = img.source.type === "base64" ? `data:${img.source.media_type};base64,${img.source.data}` : img.source.url;
15527
+ content.push({ type: "image_url", image_url: { url } });
15522
15528
  }
15523
15529
  out.push({ role: "user", content });
15524
15530
  } else if (userText.length > 0) {
@@ -19451,6 +19457,11 @@ async function setArchivedFlag(agentId, archived) {
19451
19457
  updateRegisteredAgent(agentId, { archived });
19452
19458
  await flushRegistrySaves();
19453
19459
  }
19460
+ async function setAgentName(agentId, name) {
19461
+ await getRegisteredAgentOrThrow(agentId);
19462
+ updateRegisteredAgent(agentId, { name });
19463
+ await flushRegistrySaves();
19464
+ }
19454
19465
  async function getRegisteredAgentOrThrow(agentId) {
19455
19466
  let agent = getRegisteredAgent(agentId);
19456
19467
  if (agent === void 0) {
@@ -19730,6 +19741,16 @@ var Agent = class _Agent {
19730
19741
  static unarchive(agentId, _options = {}) {
19731
19742
  return setArchivedFlag(agentId, false);
19732
19743
  }
19744
+ /**
19745
+ * Set the human-facing `name` of a registered agent (the label `Agent.list()` returns). The registry
19746
+ * already carries a `name` field; this is the missing public mutator for it. Runtime-agnostic (mutates
19747
+ * the local per-cwd registry for local agents; the cloud registry for cloud agents).
19748
+ *
19749
+ * @public
19750
+ */
19751
+ static async rename(agentId, name, _options = {}) {
19752
+ await setAgentName(agentId, name);
19753
+ }
19733
19754
  /**
19734
19755
  * Permanently delete a cloud agent.
19735
19756
  *