@objectstack/service-settings 6.9.0 → 7.1.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.cjs +186 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +186 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -849,8 +849,8 @@ var manifest = {
|
|
|
849
849
|
icon: "Mail",
|
|
850
850
|
description: "SMTP and transactional email provider configuration.",
|
|
851
851
|
scope: "global",
|
|
852
|
-
readPermission: "
|
|
853
|
-
writePermission: "
|
|
852
|
+
readPermission: "manage_platform_settings",
|
|
853
|
+
writePermission: "manage_platform_settings",
|
|
854
854
|
category: "Communication",
|
|
855
855
|
order: 10,
|
|
856
856
|
specifiers: [
|
|
@@ -1063,8 +1063,8 @@ var manifest2 = {
|
|
|
1063
1063
|
icon: "HardDrive",
|
|
1064
1064
|
description: "Backend used for attachments, exports, and user uploads. \u26A0 Switching adapter does not migrate existing files \u2014 files uploaded under the previous adapter become unreachable through the new one.",
|
|
1065
1065
|
scope: "global",
|
|
1066
|
-
readPermission: "
|
|
1067
|
-
writePermission: "
|
|
1066
|
+
readPermission: "manage_platform_settings",
|
|
1067
|
+
writePermission: "manage_platform_settings",
|
|
1068
1068
|
category: "Infrastructure",
|
|
1069
1069
|
order: 20,
|
|
1070
1070
|
specifiers: [
|
|
@@ -1236,8 +1236,8 @@ var manifest3 = {
|
|
|
1236
1236
|
icon: "Sparkles",
|
|
1237
1237
|
description: "LLM provider, model, credentials, and embedder configuration used by the platform AI and knowledge services. Provider SDK packages (e.g. @ai-sdk/openai for chat, @objectstack/embedder-openai for embeddings) must be installed on the host for the chosen provider to be loadable at runtime.",
|
|
1238
1238
|
scope: "global",
|
|
1239
|
-
readPermission: "
|
|
1240
|
-
writePermission: "
|
|
1239
|
+
readPermission: "manage_platform_settings",
|
|
1240
|
+
writePermission: "manage_platform_settings",
|
|
1241
1241
|
category: "Infrastructure",
|
|
1242
1242
|
order: 30,
|
|
1243
1243
|
specifiers: [
|
|
@@ -1260,7 +1260,16 @@ var manifest3 = {
|
|
|
1260
1260
|
{ value: "gateway", label: "Vercel AI Gateway" },
|
|
1261
1261
|
{ value: "openai", label: "OpenAI" },
|
|
1262
1262
|
{ value: "anthropic", label: "Anthropic" },
|
|
1263
|
-
{ value: "google", label: "Google Generative AI" }
|
|
1263
|
+
{ value: "google", label: "Google Generative AI" },
|
|
1264
|
+
// Below: providers expose an OpenAI-compatible Chat Completions API,
|
|
1265
|
+
// so they reuse the @ai-sdk/openai SDK with a preset base_url. The
|
|
1266
|
+
// plugin's buildAdapterFromValues maps these onto provider="openai"
|
|
1267
|
+
// + an auto-filled openai_base_url at runtime.
|
|
1268
|
+
{ value: "deepseek", label: "DeepSeek (OpenAI-compatible)" },
|
|
1269
|
+
{ value: "dashscope", label: "\u963F\u91CC\u901A\u4E49 DashScope (OpenAI-compatible)" },
|
|
1270
|
+
{ value: "cloudflare", label: "Cloudflare AI Gateway (OpenAI-compatible)" },
|
|
1271
|
+
{ value: "siliconflow", label: "\u7845\u57FA\u6D41\u52A8 SiliconFlow (OpenAI-compatible)" },
|
|
1272
|
+
{ value: "openrouter", label: "OpenRouter (OpenAI-compatible)" }
|
|
1264
1273
|
]
|
|
1265
1274
|
},
|
|
1266
1275
|
// ── Vercel AI Gateway ─────────────────────────────────────────
|
|
@@ -1373,6 +1382,160 @@ var manifest3 = {
|
|
|
1373
1382
|
default: "gemini-2.0-flash",
|
|
1374
1383
|
visible: "${data.provider === 'google'}"
|
|
1375
1384
|
},
|
|
1385
|
+
// ── OpenAI-compatible presets (DeepSeek / DashScope / Cloudflare / …) ──
|
|
1386
|
+
//
|
|
1387
|
+
// These providers all expose `/v1/chat/completions` in OpenAI shape, so
|
|
1388
|
+
// we reuse the `@ai-sdk/openai` SDK with a preset base URL. The plugin
|
|
1389
|
+
// normalises `provider=deepseek` (etc.) to `provider=openai` at adapter
|
|
1390
|
+
// construction time, injecting the right base URL and a sensible default
|
|
1391
|
+
// model id. Users only fill in API key + (optionally) model — the URL
|
|
1392
|
+
// is preset, eliminating the #1 onboarding mistake.
|
|
1393
|
+
{
|
|
1394
|
+
type: "group",
|
|
1395
|
+
id: "deepseek",
|
|
1396
|
+
label: "DeepSeek",
|
|
1397
|
+
required: false,
|
|
1398
|
+
visible: "${data.provider === 'deepseek'}",
|
|
1399
|
+
description: "OpenAI-compatible API at https://api.deepseek.com. Base URL is auto-filled."
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
type: "password",
|
|
1403
|
+
key: "deepseek_api_key",
|
|
1404
|
+
label: "DeepSeek API key",
|
|
1405
|
+
required: true,
|
|
1406
|
+
encrypted: true,
|
|
1407
|
+
description: "sk-... \u2014 issued at platform.deepseek.com.",
|
|
1408
|
+
visible: "${data.provider === 'deepseek'}"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
type: "text",
|
|
1412
|
+
key: "deepseek_model",
|
|
1413
|
+
label: "Model",
|
|
1414
|
+
required: false,
|
|
1415
|
+
default: "deepseek-chat",
|
|
1416
|
+
description: "Examples: deepseek-chat (V3), deepseek-reasoner (R1 thinking).",
|
|
1417
|
+
visible: "${data.provider === 'deepseek'}"
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
type: "group",
|
|
1421
|
+
id: "dashscope",
|
|
1422
|
+
label: "\u963F\u91CC\u901A\u4E49 DashScope",
|
|
1423
|
+
required: false,
|
|
1424
|
+
visible: "${data.provider === 'dashscope'}",
|
|
1425
|
+
description: "OpenAI-compatible endpoint at dashscope.aliyuncs.com/compatible-mode/v1. Base URL is auto-filled."
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
type: "password",
|
|
1429
|
+
key: "dashscope_api_key",
|
|
1430
|
+
label: "DashScope API key",
|
|
1431
|
+
required: true,
|
|
1432
|
+
encrypted: true,
|
|
1433
|
+
description: "sk-... \u2014 issued at dashscope.console.aliyun.com.",
|
|
1434
|
+
visible: "${data.provider === 'dashscope'}"
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
type: "text",
|
|
1438
|
+
key: "dashscope_model",
|
|
1439
|
+
label: "Model",
|
|
1440
|
+
required: false,
|
|
1441
|
+
default: "qwen-plus",
|
|
1442
|
+
description: "Examples: qwen-plus, qwen-max, qwen3-max, qwen-turbo.",
|
|
1443
|
+
visible: "${data.provider === 'dashscope'}"
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
type: "group",
|
|
1447
|
+
id: "cloudflare",
|
|
1448
|
+
label: "Cloudflare AI Gateway",
|
|
1449
|
+
required: false,
|
|
1450
|
+
visible: "${data.provider === 'cloudflare'}",
|
|
1451
|
+
description: "Uses the /compat endpoint so the model id is `provider/model` (e.g. `openai/gpt-4o-mini`, `anthropic/claude-3-5-sonnet`, `deepseek/deepseek-chat`). Note: alibaba/qwen* is NOT supported by Cloudflare /compat \u2014 use the DashScope provider for Qwen."
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
type: "text",
|
|
1455
|
+
key: "cloudflare_account_id",
|
|
1456
|
+
label: "Cloudflare account id",
|
|
1457
|
+
required: true,
|
|
1458
|
+
description: "The 32-char hex id from your Cloudflare dashboard URL.",
|
|
1459
|
+
visible: "${data.provider === 'cloudflare'}"
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
type: "text",
|
|
1463
|
+
key: "cloudflare_gateway_id",
|
|
1464
|
+
label: "Gateway id",
|
|
1465
|
+
required: false,
|
|
1466
|
+
default: "default",
|
|
1467
|
+
description: "Gateway name configured in Cloudflare \u2192 AI Gateway. Defaults to `default`.",
|
|
1468
|
+
visible: "${data.provider === 'cloudflare'}"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
type: "password",
|
|
1472
|
+
key: "cloudflare_api_key",
|
|
1473
|
+
label: "Cloudflare AI Gateway token",
|
|
1474
|
+
required: true,
|
|
1475
|
+
encrypted: true,
|
|
1476
|
+
description: 'Issued in AI Gateway \u2192 "API tokens" tab (cfut_\u2026 or sk_\u2026).',
|
|
1477
|
+
visible: "${data.provider === 'cloudflare'}"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
type: "text",
|
|
1481
|
+
key: "cloudflare_model",
|
|
1482
|
+
label: "Model",
|
|
1483
|
+
required: false,
|
|
1484
|
+
default: "openai/gpt-4o-mini",
|
|
1485
|
+
description: "Format: provider/model. Allowed providers (per Cloudflare /compat): anthropic, openai, groq, mistral, cohere, perplexity, workers-ai, google-ai-studio, vertex, grok, deepseek, cerebras, baseten, parallel.",
|
|
1486
|
+
visible: "${data.provider === 'cloudflare'}"
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
type: "group",
|
|
1490
|
+
id: "siliconflow",
|
|
1491
|
+
label: "\u7845\u57FA\u6D41\u52A8 SiliconFlow",
|
|
1492
|
+
required: false,
|
|
1493
|
+
visible: "${data.provider === 'siliconflow'}",
|
|
1494
|
+
description: "OpenAI-compatible endpoint at api.siliconflow.cn/v1. Base URL is auto-filled."
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
type: "password",
|
|
1498
|
+
key: "siliconflow_api_key",
|
|
1499
|
+
label: "SiliconFlow API key",
|
|
1500
|
+
required: true,
|
|
1501
|
+
encrypted: true,
|
|
1502
|
+
visible: "${data.provider === 'siliconflow'}"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
type: "text",
|
|
1506
|
+
key: "siliconflow_model",
|
|
1507
|
+
label: "Model",
|
|
1508
|
+
required: false,
|
|
1509
|
+
default: "Qwen/Qwen2.5-7B-Instruct",
|
|
1510
|
+
description: "Examples: Qwen/Qwen2.5-72B-Instruct, deepseek-ai/DeepSeek-V3, meta-llama/Meta-Llama-3.1-8B-Instruct.",
|
|
1511
|
+
visible: "${data.provider === 'siliconflow'}"
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
type: "group",
|
|
1515
|
+
id: "openrouter",
|
|
1516
|
+
label: "OpenRouter",
|
|
1517
|
+
required: false,
|
|
1518
|
+
visible: "${data.provider === 'openrouter'}",
|
|
1519
|
+
description: "Multi-provider router at openrouter.ai/api/v1. Base URL is auto-filled."
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
type: "password",
|
|
1523
|
+
key: "openrouter_api_key",
|
|
1524
|
+
label: "OpenRouter API key",
|
|
1525
|
+
required: true,
|
|
1526
|
+
encrypted: true,
|
|
1527
|
+
description: "sk-or-...",
|
|
1528
|
+
visible: "${data.provider === 'openrouter'}"
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
type: "text",
|
|
1532
|
+
key: "openrouter_model",
|
|
1533
|
+
label: "Model",
|
|
1534
|
+
required: false,
|
|
1535
|
+
default: "openai/gpt-4o-mini",
|
|
1536
|
+
description: "Format: provider/model (e.g. anthropic/claude-3.5-sonnet, deepseek/deepseek-chat).",
|
|
1537
|
+
visible: "${data.provider === 'openrouter'}"
|
|
1538
|
+
},
|
|
1376
1539
|
// ── Generation defaults ──────────────────────────────────────
|
|
1377
1540
|
{
|
|
1378
1541
|
type: "group",
|
|
@@ -1590,6 +1753,20 @@ var aiTestActionHandler = async ({ values, payload }) => {
|
|
|
1590
1753
|
message: `Vercel AI Gateway configured (model=${values.gateway_model}). Mount @objectstack/service-ai to exercise live calls.`
|
|
1591
1754
|
};
|
|
1592
1755
|
}
|
|
1756
|
+
if (provider === "cloudflare") {
|
|
1757
|
+
if (!values.cloudflare_account_id) {
|
|
1758
|
+
return { ok: false, severity: "error", message: "Cloudflare account id is required." };
|
|
1759
|
+
}
|
|
1760
|
+
if (!values.cloudflare_api_key) {
|
|
1761
|
+
return { ok: false, severity: "error", message: "Cloudflare AI Gateway token is required." };
|
|
1762
|
+
}
|
|
1763
|
+
const model2 = values.cloudflare_model ?? "(default openai/gpt-4o-mini)";
|
|
1764
|
+
return {
|
|
1765
|
+
ok: true,
|
|
1766
|
+
severity: "info",
|
|
1767
|
+
message: `Cloudflare AI Gateway configured (model=${model2}). Mount @objectstack/service-ai to exercise live calls.`
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1593
1770
|
const keyField = `${provider}_api_key`;
|
|
1594
1771
|
if (!values[keyField]) {
|
|
1595
1772
|
return { ok: false, severity: "error", message: `${provider} API key is required.` };
|
|
@@ -1619,8 +1796,8 @@ var manifest4 = {
|
|
|
1619
1796
|
icon: "BookOpen",
|
|
1620
1797
|
description: "Vector-store backend for RAG / knowledge sources. \u26A0 Switching adapter does NOT migrate existing indices \u2014 documents indexed under the previous adapter become unreachable until re-indexed. The embedder is configured separately under AI.",
|
|
1621
1798
|
scope: "global",
|
|
1622
|
-
readPermission: "
|
|
1623
|
-
writePermission: "
|
|
1799
|
+
readPermission: "manage_platform_settings",
|
|
1800
|
+
writePermission: "manage_platform_settings",
|
|
1624
1801
|
category: "Infrastructure",
|
|
1625
1802
|
order: 35,
|
|
1626
1803
|
specifiers: [
|