@jacobbd/relay-ai 0.10.1 → 0.11.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/README.md CHANGED
@@ -106,7 +106,7 @@ Pick your backend:
106
106
 
107
107
  ## Prerequisites
108
108
 
109
- - Node.js 18+
109
+ - Node.js 22+
110
110
  - A supported AI coding tool installed (e.g. [Claude Code](https://www.npmjs.com/package/@anthropic-ai/claude-code), [OpenAI Codex](https://www.npmjs.com/package/@openai/codex), or [Google Gemini CLI](https://www.npmjs.com/package/@google/gemini-cli))
111
111
  - At least one provider configured via `relay-ai providers add` or `import` — **or** an [OpenCode API key](https://opencode.ai/auth) for Zen/Go cloud backends
112
112
  - [OpenCode CLI](https://opencode.ai) only if you want **one-time import** from an existing OpenCode setup (optional)
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getTemplateById,
4
4
  init_provider_templates
5
- } from "./chunk-TFMHIGRX.js";
5
+ } from "./chunk-SFN33VAE.js";
6
6
 
7
7
  // src/constants.ts
8
8
  import { homedir } from "os";
@@ -11,7 +11,7 @@ import { join } from "path";
11
11
  // package.json
12
12
  var package_default = {
13
13
  name: "@jacobbd/relay-ai",
14
- version: "0.10.1",
14
+ version: "0.11.0",
15
15
  publishConfig: {
16
16
  access: "public"
17
17
  },
@@ -43,7 +43,7 @@ var package_default = {
43
43
  "README.md"
44
44
  ],
45
45
  engines: {
46
- node: ">=18"
46
+ node: ">=22"
47
47
  },
48
48
  scripts: {
49
49
  build: "tsup && tsup --config tsup.core.config.ts && node scripts/copy-ui-assets.mjs",
@@ -57,35 +57,34 @@ var package_default = {
57
57
  prepublishOnly: "npm run release:check && npm run build"
58
58
  },
59
59
  dependencies: {
60
- "@ai-sdk/alibaba": "^1.0.26",
61
- "@ai-sdk/amazon-bedrock": "^4.0.113",
62
- "@ai-sdk/azure": "^3.0.70",
63
- "@ai-sdk/cerebras": "^2.0.54",
64
- "@ai-sdk/cohere": "^3.0.36",
65
- "@ai-sdk/deepinfra": "^2.0.52",
66
- "@ai-sdk/gateway": "^3.0.125",
67
- "@ai-sdk/google": "^3.0.80",
68
- "@ai-sdk/google-vertex": "^4.0.142",
69
- "@ai-sdk/groq": "^3.0.39",
70
- "@ai-sdk/mistral": "^3.0.37",
71
- "@ai-sdk/openai": "^3.0.68",
72
- "@ai-sdk/openai-compatible": "^2.0.48",
73
- "@ai-sdk/perplexity": "^3.0.33",
74
- "@ai-sdk/togetherai": "^2.0.53",
75
- "@ai-sdk/vercel": "^2.0.50",
76
- "@ai-sdk/xai": "^3.0.93",
60
+ "@ai-sdk/alibaba": "^2.0.41",
61
+ "@ai-sdk/amazon-bedrock": "^5.0.76",
62
+ "@ai-sdk/azure": "^4.0.63",
63
+ "@ai-sdk/cerebras": "^3.0.44",
64
+ "@ai-sdk/cohere": "^4.0.37",
65
+ "@ai-sdk/deepinfra": "^3.0.44",
66
+ "@ai-sdk/gateway": "^4.0.75",
67
+ "@ai-sdk/google": "^4.0.64",
68
+ "@ai-sdk/google-vertex": "^5.0.76",
69
+ "@ai-sdk/groq": "^4.0.37",
70
+ "@ai-sdk/mistral": "^4.0.39",
71
+ "@ai-sdk/openai": "^4.0.60",
72
+ "@ai-sdk/openai-compatible": "^3.0.44",
73
+ "@ai-sdk/perplexity": "^4.0.39",
74
+ "@ai-sdk/togetherai": "^3.0.45",
75
+ "@ai-sdk/vercel": "^3.0.30",
76
+ "@ai-sdk/xai": "^4.0.54",
77
77
  "@clack/prompts": "^0.9.1",
78
- "@openrouter/ai-sdk-provider": "^2.9.0",
79
- ai: "^6.0.197",
78
+ "@openrouter/ai-sdk-provider": "^3.0.0",
79
+ ai: "^7.0.93",
80
80
  "cross-spawn": "^7.0.6",
81
- "gitlab-ai-provider": "^6.8.0",
81
+ "gitlab-ai-provider": "^6.15.0",
82
82
  graphql: "^16.14.2",
83
83
  "ipaddr.js": "^2.4.0",
84
84
  "node-forge": "^1.4.0",
85
85
  open: "^11.0.0",
86
86
  picocolors: "^1.1.1",
87
87
  "smol-toml": "^1.6.1",
88
- "venice-ai-sdk-provider": "^2.0.2",
89
88
  ws: "^8.21.0",
90
89
  zod: "^3.25.76"
91
90
  },
@@ -1003,6 +1002,9 @@ function isSdkMigratedNpm(npm) {
1003
1002
  function maxToolsForNpm(npm) {
1004
1003
  return npm === "@ai-sdk/groq" ? 128 : void 0;
1005
1004
  }
1005
+ function resolveProviderNpm(npm) {
1006
+ return npm === "venice-ai-sdk-provider" ? "@ai-sdk/openai-compatible" : npm;
1007
+ }
1006
1008
  function findCreateFactory(mod) {
1007
1009
  for (const value of Object.values(mod)) {
1008
1010
  if (typeof value === "function" && value.name.startsWith("create")) {
@@ -1032,7 +1034,8 @@ async function loadSdkProviderFactory(npm) {
1032
1034
  return cached;
1033
1035
  }
1034
1036
  async function createLanguageModel(spec) {
1035
- const { npm, modelId, apiKey, baseURL } = spec;
1037
+ const npm = resolveProviderNpm(spec.npm);
1038
+ const { modelId, apiKey, baseURL } = spec;
1036
1039
  if (npm === VERTEX_ANTHROPIC_NPM) {
1037
1040
  if (!spec.vertex?.project) {
1038
1041
  throw new Error("Vertex project is required for @ai-sdk/google-vertex/anthropic");
@@ -6526,10 +6529,10 @@ function imagePart(block) {
6526
6529
  const src = block.source;
6527
6530
  if (!src) return null;
6528
6531
  if (src.type === "base64" && src.data) {
6529
- return { type: "image", image: Buffer.from(src.data, "base64"), mediaType: src.media_type };
6532
+ return { type: "file", mediaType: src.media_type ?? "image", data: Buffer.from(src.data, "base64") };
6530
6533
  }
6531
6534
  if (src.type === "url" && src.url) {
6532
- return { type: "image", image: new URL(src.url) };
6535
+ return { type: "file", mediaType: src.media_type ?? "image", data: { type: "url", url: new URL(src.url) } };
6533
6536
  }
6534
6537
  return null;
6535
6538
  }
@@ -6681,7 +6684,7 @@ function translateRequest(body, npm, options) {
6681
6684
  });
6682
6685
  }
6683
6686
  return {
6684
- system: options?.openAiOAuth ? void 0 : systemText,
6687
+ instructions: options?.openAiOAuth ? void 0 : systemText,
6685
6688
  messages: translateMessages(messages, npm, options?.onDebug),
6686
6689
  tools: translateTools2(upstreamTools.length ? upstreamTools : void 0),
6687
6690
  toolChoice: translateToolChoice(body.tool_choice),
@@ -6906,7 +6909,7 @@ async function streamAnthropicResponse(model, params, modelId, write, log7, esti
6906
6909
  Promise.resolve(result.usage).catch(() => {
6907
6910
  });
6908
6911
  await writeAnthropicStream(
6909
- result.fullStream,
6912
+ result.stream,
6910
6913
  modelId,
6911
6914
  write,
6912
6915
  log7,
@@ -11251,7 +11254,7 @@ function translateOpenAiRequest(body, requestHeaders) {
11251
11254
  }
11252
11255
  }
11253
11256
  return {
11254
- system,
11257
+ instructions: system,
11255
11258
  messages,
11256
11259
  tools,
11257
11260
  toolChoice: sdkToolChoice,
@@ -11301,7 +11304,7 @@ async function generateOpenAiResponse(model, params, responseModelId) {
11301
11304
  };
11302
11305
  }
11303
11306
  async function streamOpenAiResponse(model, params, responseModelId, onChunk, log7) {
11304
- const { fullStream } = streamText2({ model, ...params });
11307
+ const { stream } = streamText2({ model, ...params });
11305
11308
  const baseData = {
11306
11309
  id: `chatcmpl-${Date.now()}`,
11307
11310
  object: "chat.completion.chunk",
@@ -11315,7 +11318,7 @@ async function streamOpenAiResponse(model, params, responseModelId, onChunk, log
11315
11318
  let nextToolIndex = 0;
11316
11319
  const seenPartTypes = /* @__PURE__ */ new Set();
11317
11320
  let toolCallChunksEmitted = 0;
11318
- for await (const part of fullStream) {
11321
+ for await (const part of stream) {
11319
11322
  const p8 = part;
11320
11323
  seenPartTypes.add(p8.type);
11321
11324
  switch (p8.type) {
@@ -14064,4 +14067,4 @@ export {
14064
14067
  supportsClaudeTransparentMode,
14065
14068
  buildHttpProxyRoutes
14066
14069
  };
14067
- //# sourceMappingURL=chunk-YYI6EJ2X.js.map
14070
+ //# sourceMappingURL=chunk-G6QWYYAY.js.map