@alisio/plugin-deepseek 0.1.0-alpha.6 → 0.1.0-alpha.8

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.js CHANGED
@@ -2,7 +2,12 @@ import { definePlugin } from "@alisio/sdk";
2
2
  import { DeepSeekProvider } from "./provider.js";
3
3
  import { loadVersion } from "./version.js";
4
4
  const DEFAULT_BASE_URL = "https://api.deepseek.com";
5
- const profileString = (request, key, fallback) => typeof request.profile[key] === "string" ? String(request.profile[key]) : fallback;
5
+ const DEFAULT_API_KEY_ENV = "DEEPSEEK_API_KEY";
6
+ const profileString = (request, key, fallback) => typeof request.profile[key] === "string" && String(request.profile[key]).trim()
7
+ ? String(request.profile[key]).trim()
8
+ : typeof request.legacy?.[key] === "string" && String(request.legacy[key]).trim()
9
+ ? String(request.legacy[key]).trim()
10
+ : fallback;
6
11
  export function createDeepSeekPlugin() {
7
12
  return definePlugin({
8
13
  id: "deepseek",
@@ -24,6 +29,14 @@ export function createDeepSeekPlugin() {
24
29
  required: true,
25
30
  description: "Stored only in the global credentials file",
26
31
  },
32
+ {
33
+ key: "apiKeyEnv",
34
+ label: "API key environment variable",
35
+ kind: "text",
36
+ required: false,
37
+ defaultValue: DEFAULT_API_KEY_ENV,
38
+ description: "Environment variable consulted when no stored API key exists; the connection remembers this name",
39
+ },
27
40
  {
28
41
  key: "apiMode",
29
42
  label: "API mode",
@@ -46,8 +59,9 @@ export function createDeepSeekPlugin() {
46
59
  ],
47
60
  create(request) {
48
61
  const apiKey = request.credentials.apiKey;
49
- if (!apiKey)
50
- throw new Error("DeepSeek API key is required");
62
+ const apiKeyEnv = profileString(request, "apiKeyEnv", DEFAULT_API_KEY_ENV);
63
+ if (!apiKey && !process.env[apiKeyEnv])
64
+ throw new Error(`DeepSeek API key is required (set it in /connect or export ${apiKeyEnv})`);
51
65
  const baseURL = profileString(request, "baseURL", DEFAULT_BASE_URL);
52
66
  const url = new URL(baseURL);
53
67
  if (!["http:", "https:"].includes(url.protocol) || url.username || url.password)
@@ -57,8 +71,8 @@ export function createDeepSeekPlugin() {
57
71
  throw new Error(`Unsupported DeepSeek API mode: ${apiMode}`);
58
72
  const config = {
59
73
  baseURL,
60
- apiKey,
61
- apiKeyEnv: "DEEPSEEK_API_KEY",
74
+ ...(apiKey ? { apiKey } : {}),
75
+ apiKeyEnv,
62
76
  model: profileString(request, "model", ""),
63
77
  apiMode,
64
78
  auth: "bearer",
package/dist/provider.js CHANGED
@@ -176,7 +176,7 @@ export class DeepSeekProvider {
176
176
  if (completed.some((c) => !c.id || !c.name))
177
177
  throw new Error("Incomplete tool call");
178
178
  if (finish === "length" && !text.trim())
179
- throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens");
179
+ throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens (/settings → Agent max output tokens)");
180
180
  yield {
181
181
  type: "completed",
182
182
  message: {
@@ -257,7 +257,7 @@ export class DeepSeekProvider {
257
257
  .map((x) => x.text)
258
258
  .join("");
259
259
  if (!text.trim())
260
- throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens");
260
+ throw new Error("Provider response cut off by max output tokens before any usable content; raise limits.maxOutputTokens (/settings → Agent max output tokens)");
261
261
  if (calls.some((c) => !c.id || !c.name))
262
262
  throw new Error("Incomplete tool call");
263
263
  yield {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alisio/plugin-deepseek",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.8",
4
4
  "description": "Built-in DeepSeek model provider for Alisio.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,10 +24,10 @@
24
24
  "openai": "7.23.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@alisio/sdk": "^0.1.0-alpha.5"
27
+ "@alisio/sdk": "^0.1.0-alpha.6"
28
28
  },
29
29
  "devDependencies": {
30
- "@alisio/sdk": "0.1.0-alpha.5"
30
+ "@alisio/sdk": "0.1.0-alpha.6"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public",