sim-setup 1.0.10-preview.96.1 → 1.0.10-preview.98.1
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 +238 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -727,7 +727,8 @@ function getProviderFields(provider) {
|
|
|
727
727
|
return unique(providerKeys(provider));
|
|
728
728
|
}
|
|
729
729
|
function providerIsActive(provider, values) {
|
|
730
|
-
|
|
730
|
+
const activated = provider.activation.mode === "enabled" ? isTruthyValue(values, provider.activation.key) : provider.activation.keys.some((key) => hasValue(values, key));
|
|
731
|
+
return activated && (provider.activeWhen?.(values) ?? true);
|
|
731
732
|
}
|
|
732
733
|
function capabilityKeys(definition) {
|
|
733
734
|
return [
|
|
@@ -1071,10 +1072,11 @@ function findFieldRequirement(requirement, key) {
|
|
|
1071
1072
|
}
|
|
1072
1073
|
return null;
|
|
1073
1074
|
}
|
|
1074
|
-
function validateCapabilityFieldInput(definition, key, value) {
|
|
1075
|
+
function validateCapabilityFieldInput(definition, key, value, providerId) {
|
|
1075
1076
|
if (!value)
|
|
1076
1077
|
return "required";
|
|
1077
|
-
|
|
1078
|
+
const providers = providerId ? definition.providers.filter((provider) => provider.id === providerId) : definition.providers;
|
|
1079
|
+
for (const provider of providers) {
|
|
1078
1080
|
const field = findFieldRequirement(provider.requires, key) ?? provider.optionalFields?.find((candidate) => candidate.key === key);
|
|
1079
1081
|
if (!field)
|
|
1080
1082
|
continue;
|
|
@@ -1083,6 +1085,8 @@ function validateCapabilityFieldInput(definition, key, value) {
|
|
|
1083
1085
|
}
|
|
1084
1086
|
return field.validation.message;
|
|
1085
1087
|
}
|
|
1088
|
+
if (providerId)
|
|
1089
|
+
return;
|
|
1086
1090
|
throw new Error(`${definition.label} has no validation definition for ${key}`);
|
|
1087
1091
|
}
|
|
1088
1092
|
function validateRedisProvider(values) {
|
|
@@ -1105,6 +1109,42 @@ function validateRedisProvider(values) {
|
|
|
1105
1109
|
}
|
|
1106
1110
|
return [];
|
|
1107
1111
|
}
|
|
1112
|
+
function validateEmbeddingModelWidth(values) {
|
|
1113
|
+
const model = String(readValue(values, "KB_EMBEDDING_MODEL") ?? "");
|
|
1114
|
+
const rawWidth = readValue(values, "EMBEDDING_OUTPUT_DIMS");
|
|
1115
|
+
if (!hasValue(values, "EMBEDDING_OUTPUT_DIMS"))
|
|
1116
|
+
return [];
|
|
1117
|
+
const widths = KB_EMBEDDING_MODEL_WIDTHS[model];
|
|
1118
|
+
if (!widths)
|
|
1119
|
+
return [];
|
|
1120
|
+
if (widths.includes(Number(String(rawWidth).trim())))
|
|
1121
|
+
return [];
|
|
1122
|
+
return [
|
|
1123
|
+
{
|
|
1124
|
+
kind: "invalid",
|
|
1125
|
+
fields: ["EMBEDDING_OUTPUT_DIMS"],
|
|
1126
|
+
message: `EMBEDDING_OUTPUT_DIMS must be one of ${widths.join(", ")} for ${model}`
|
|
1127
|
+
}
|
|
1128
|
+
];
|
|
1129
|
+
}
|
|
1130
|
+
function knowledgeEmbeddingFamily(values) {
|
|
1131
|
+
const model = String(readValue(values, "KB_EMBEDDING_MODEL") ?? "");
|
|
1132
|
+
if (model.startsWith(OLLAMA_EMBEDDING_MODEL_PREFIX)) {
|
|
1133
|
+
return model.length > OLLAMA_EMBEDDING_MODEL_PREFIX.length ? "ollama" : "openai";
|
|
1134
|
+
}
|
|
1135
|
+
if (GEMINI_KB_EMBEDDING_MODELS.includes(model))
|
|
1136
|
+
return "gemini";
|
|
1137
|
+
return "openai";
|
|
1138
|
+
}
|
|
1139
|
+
function embeddingOutputDimsField(widths) {
|
|
1140
|
+
return envField("EMBEDDING_OUTPUT_DIMS", {
|
|
1141
|
+
validation: {
|
|
1142
|
+
kind: "pattern",
|
|
1143
|
+
pattern: new RegExp(`^(${widths.join("|")})$`),
|
|
1144
|
+
message: `must be one of ${widths.join(", ")}`
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1108
1148
|
function resolveOAuthClientCapabilityId(serviceId) {
|
|
1109
1149
|
const normalized = serviceId.toLowerCase().replace(/_/g, "-");
|
|
1110
1150
|
if (GOOGLE_OAUTH_SERVICES.has(normalized))
|
|
@@ -1142,7 +1182,7 @@ function inspectOAuthClientCapability(providerId, values) {
|
|
|
1142
1182
|
setupCommand: `npx sim-setup add integration ${providerId}`
|
|
1143
1183
|
};
|
|
1144
1184
|
}
|
|
1145
|
-
var CORE_CONFIGURATION_KEYS, EnvCapabilityConfigurationError, EMAIL_CAPABILITY, STORAGE_CAPABILITY, SANDBOX_CAPABILITY, ASYNC_JOBS_CAPABILITY, CACHE_CAPABILITY, OCR_CAPABILITY, KNOWLEDGE_EMBEDDINGS_CAPABILITY, OAUTH_CLIENT_CAPABILITIES, ENV_CAPABILITIES, LLM_KEY_POOLS, DEPLOYMENT_CONFIGURATION_KEYS, GOOGLE_OAUTH_SERVICES, MICROSOFT_OAUTH_SERVICES;
|
|
1185
|
+
var CORE_CONFIGURATION_KEYS, EnvCapabilityConfigurationError, EMAIL_CAPABILITY, STORAGE_CAPABILITY, SANDBOX_CAPABILITY, ASYNC_JOBS_CAPABILITY, CACHE_CAPABILITY, OCR_CAPABILITY, OLLAMA_EMBEDDING_MODEL_PREFIX = "ollama/", KB_EMBEDDING_MODEL_WIDTHS, GEMINI_KB_EMBEDDING_MODELS, embeddingFamilyIs = (family) => (values) => knowledgeEmbeddingFamily(values) === family, OPENAI_EMBEDDING_WIDTHS, GEMINI_EMBEDDING_WIDTHS, OLLAMA_EMBEDDING_WIDTHS, KNOWLEDGE_EMBEDDINGS_CAPABILITY, OAUTH_CLIENT_CAPABILITIES, ENV_CAPABILITIES, LLM_KEY_POOLS, DEPLOYMENT_CONFIGURATION_KEYS, GOOGLE_OAUTH_SERVICES, MICROSOFT_OAUTH_SERVICES;
|
|
1146
1186
|
var init_env_capabilities = __esm(() => {
|
|
1147
1187
|
init_sandbox_references();
|
|
1148
1188
|
CORE_CONFIGURATION_KEYS = [
|
|
@@ -1412,6 +1452,15 @@ var init_env_capabilities = __esm(() => {
|
|
|
1412
1452
|
}
|
|
1413
1453
|
]
|
|
1414
1454
|
});
|
|
1455
|
+
KB_EMBEDDING_MODEL_WIDTHS = {
|
|
1456
|
+
"text-embedding-3-small": [1536, 1024, 768],
|
|
1457
|
+
"text-embedding-3-large": [3072, 1536, 1024, 768],
|
|
1458
|
+
"gemini-embedding-001": [3072, 1536, 768]
|
|
1459
|
+
};
|
|
1460
|
+
GEMINI_KB_EMBEDDING_MODELS = ["gemini-embedding-001"];
|
|
1461
|
+
OPENAI_EMBEDDING_WIDTHS = [768, 1024, 1536, 3072];
|
|
1462
|
+
GEMINI_EMBEDDING_WIDTHS = [768, 1536, 3072];
|
|
1463
|
+
OLLAMA_EMBEDDING_WIDTHS = [384, 768, 1024, 1536, 3072];
|
|
1415
1464
|
KNOWLEDGE_EMBEDDINGS_CAPABILITY = defineCapability({
|
|
1416
1465
|
strategy: "fallback",
|
|
1417
1466
|
id: "knowledge-embeddings",
|
|
@@ -1424,6 +1473,7 @@ var init_env_capabilities = __esm(() => {
|
|
|
1424
1473
|
mode: "any-present",
|
|
1425
1474
|
keys: ["AZURE_OPENAI_API_KEY", "AZURE_OPENAI_ENDPOINT", "AZURE_OPENAI_API_VERSION"]
|
|
1426
1475
|
},
|
|
1476
|
+
activeWhen: embeddingFamilyIs("openai"),
|
|
1427
1477
|
requires: allOf(envField("AZURE_OPENAI_API_KEY"), envField("AZURE_OPENAI_ENDPOINT", {
|
|
1428
1478
|
validation: {
|
|
1429
1479
|
kind: "url",
|
|
@@ -1431,7 +1481,12 @@ var init_env_capabilities = __esm(() => {
|
|
|
1431
1481
|
message: "must be a valid HTTP(S) URL"
|
|
1432
1482
|
}
|
|
1433
1483
|
}), envField("AZURE_OPENAI_API_VERSION")),
|
|
1434
|
-
optionalFields: [
|
|
1484
|
+
optionalFields: [
|
|
1485
|
+
envField("KB_OPENAI_MODEL_NAME"),
|
|
1486
|
+
envField("KB_EMBEDDING_MODEL"),
|
|
1487
|
+
embeddingOutputDimsField(OPENAI_EMBEDDING_WIDTHS)
|
|
1488
|
+
],
|
|
1489
|
+
validate: validateEmbeddingModelWidth
|
|
1435
1490
|
},
|
|
1436
1491
|
{
|
|
1437
1492
|
id: "openai",
|
|
@@ -1440,13 +1495,57 @@ var init_env_capabilities = __esm(() => {
|
|
|
1440
1495
|
mode: "any-present",
|
|
1441
1496
|
keys: ["OPENAI_API_KEY", "OPENAI_API_KEY_1", "OPENAI_API_KEY_2", "OPENAI_API_KEY_3"]
|
|
1442
1497
|
},
|
|
1443
|
-
|
|
1498
|
+
activeWhen: embeddingFamilyIs("openai"),
|
|
1499
|
+
requires: anyOf(envField("OPENAI_API_KEY"), envField("OPENAI_API_KEY_1"), envField("OPENAI_API_KEY_2"), envField("OPENAI_API_KEY_3")),
|
|
1500
|
+
optionalFields: [
|
|
1501
|
+
envField("KB_EMBEDDING_MODEL"),
|
|
1502
|
+
embeddingOutputDimsField(OPENAI_EMBEDDING_WIDTHS)
|
|
1503
|
+
],
|
|
1504
|
+
validate: validateEmbeddingModelWidth
|
|
1444
1505
|
},
|
|
1445
1506
|
{
|
|
1446
1507
|
id: "openrouter",
|
|
1447
1508
|
label: "OpenRouter",
|
|
1448
1509
|
activation: { mode: "any-present", keys: ["OPENROUTER_API_KEY"] },
|
|
1449
|
-
|
|
1510
|
+
activeWhen: embeddingFamilyIs("openai"),
|
|
1511
|
+
requires: envField("OPENROUTER_API_KEY"),
|
|
1512
|
+
optionalFields: [
|
|
1513
|
+
envField("KB_EMBEDDING_MODEL"),
|
|
1514
|
+
embeddingOutputDimsField(OPENAI_EMBEDDING_WIDTHS)
|
|
1515
|
+
],
|
|
1516
|
+
validate: validateEmbeddingModelWidth
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
id: "gemini",
|
|
1520
|
+
label: "Google Gemini",
|
|
1521
|
+
activation: {
|
|
1522
|
+
mode: "any-present",
|
|
1523
|
+
keys: ["GEMINI_API_KEY", "GEMINI_API_KEY_1", "GEMINI_API_KEY_2", "GEMINI_API_KEY_3"]
|
|
1524
|
+
},
|
|
1525
|
+
activeWhen: embeddingFamilyIs("gemini"),
|
|
1526
|
+
requires: allOf(anyOf(envField("GEMINI_API_KEY"), envField("GEMINI_API_KEY_1"), envField("GEMINI_API_KEY_2"), envField("GEMINI_API_KEY_3")), envField("KB_EMBEDDING_MODEL")),
|
|
1527
|
+
optionalFields: [embeddingOutputDimsField(GEMINI_EMBEDDING_WIDTHS)],
|
|
1528
|
+
validate: validateEmbeddingModelWidth
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
id: "ollama",
|
|
1532
|
+
label: "Ollama",
|
|
1533
|
+
activation: { mode: "any-present", keys: ["OLLAMA_URL", "KB_EMBEDDING_MODEL"] },
|
|
1534
|
+
activeWhen: embeddingFamilyIs("ollama"),
|
|
1535
|
+
requires: allOf(envField("OLLAMA_URL", {
|
|
1536
|
+
validation: {
|
|
1537
|
+
kind: "url",
|
|
1538
|
+
protocols: ["http:", "https:"],
|
|
1539
|
+
message: "must be a valid HTTP(S) URL"
|
|
1540
|
+
}
|
|
1541
|
+
}), envField("KB_EMBEDDING_MODEL", {
|
|
1542
|
+
validation: {
|
|
1543
|
+
kind: "pattern",
|
|
1544
|
+
pattern: /^ollama\/.+/,
|
|
1545
|
+
message: "must name a model on your Ollama server, as ollama/<model>"
|
|
1546
|
+
}
|
|
1547
|
+
})),
|
|
1548
|
+
optionalFields: [embeddingOutputDimsField(OLLAMA_EMBEDDING_WIDTHS)]
|
|
1450
1549
|
}
|
|
1451
1550
|
]
|
|
1452
1551
|
});
|
|
@@ -1571,7 +1670,7 @@ var init_env_capabilities = __esm(() => {
|
|
|
1571
1670
|
var integrations_default;
|
|
1572
1671
|
var init_integrations = __esm(() => {
|
|
1573
1672
|
integrations_default = {
|
|
1574
|
-
updatedAt: "2026-09-
|
|
1673
|
+
updatedAt: "2026-09-04",
|
|
1575
1674
|
integrations: [
|
|
1576
1675
|
{
|
|
1577
1676
|
type: "onepassword",
|
|
@@ -9032,7 +9131,7 @@ var init_integrations = __esm(() => {
|
|
|
9032
9131
|
slug: "embeddings",
|
|
9033
9132
|
name: "Embeddings",
|
|
9034
9133
|
description: "Generate embeddings",
|
|
9035
|
-
longDescription: "Turn text into embedding vectors for semantic search, clustering, and similarity. Supports OpenAI, OpenRouter, Google Gemini, Cohere, and Mistral embedding models.",
|
|
9134
|
+
longDescription: "Turn text into embedding vectors for semantic search, clustering, and similarity. Supports OpenAI, OpenRouter, Google Gemini, Cohere, and Mistral embedding models, plus embedding models on a self-hosted Ollama.",
|
|
9036
9135
|
bgColor: "#7B4DFF",
|
|
9037
9136
|
iconName: "EmbeddingsIcon",
|
|
9038
9137
|
docsUrl: "https://docs.sim.ai/integrations/embeddings",
|
|
@@ -25939,9 +26038,13 @@ var init_integrations = __esm(() => {
|
|
|
25939
26038
|
{
|
|
25940
26039
|
name: "List Vault Items",
|
|
25941
26040
|
description: "List the credentials available from password managers connected to TinyFish, with the URIs an agent run can be scoped to"
|
|
26041
|
+
},
|
|
26042
|
+
{
|
|
26043
|
+
name: "List Browser Profiles",
|
|
26044
|
+
description: "List the Browser Context Profiles saved on the TinyFish account, with the ids an agent run can start from to reuse a logged-in session"
|
|
25942
26045
|
}
|
|
25943
26046
|
],
|
|
25944
|
-
operationCount:
|
|
26047
|
+
operationCount: 9,
|
|
25945
26048
|
triggers: [],
|
|
25946
26049
|
triggerCount: 0,
|
|
25947
26050
|
authType: "api-key",
|
|
@@ -28444,7 +28547,7 @@ function matchesSetupCondition(condition, values) {
|
|
|
28444
28547
|
}
|
|
28445
28548
|
return !matchesSetupCondition(condition.condition, values);
|
|
28446
28549
|
}
|
|
28447
|
-
var EMAIL_SETUP, STORAGE_SETUP, SANDBOX_SETUP, JOBS_SETUP, CACHE_SETUP, KNOWLEDGE_SETUP, KNOWLEDGE_EMBEDDINGS_SETUP, CAPABILITY_SETUPS, configuredCapabilityIds, missingCapabilitySetups, SETUP_FEATURES, OAUTH_CLIENT_SETUP_FIELDS;
|
|
28550
|
+
var EMAIL_SETUP, STORAGE_SETUP, SANDBOX_SETUP, JOBS_SETUP, CACHE_SETUP, KNOWLEDGE_SETUP, OPENAI_EMBEDDING_MODEL_PROMPTS, KNOWLEDGE_EMBEDDINGS_SETUP, CAPABILITY_SETUPS, configuredCapabilityIds, missingCapabilitySetups, SETUP_FEATURES, OAUTH_CLIENT_SETUP_FIELDS;
|
|
28448
28551
|
var init_capability_config = __esm(() => {
|
|
28449
28552
|
init_env_capabilities();
|
|
28450
28553
|
EMAIL_SETUP = defineCapabilitySetup(EMAIL_CAPABILITY, {
|
|
@@ -28914,6 +29017,40 @@ var init_capability_config = __esm(() => {
|
|
|
28914
29017
|
},
|
|
28915
29018
|
optionOrder: ["local", "mistral", "azure-mistral"]
|
|
28916
29019
|
});
|
|
29020
|
+
OPENAI_EMBEDDING_MODEL_PROMPTS = [
|
|
29021
|
+
{
|
|
29022
|
+
type: "choice",
|
|
29023
|
+
id: "openai-embedding-model",
|
|
29024
|
+
message: "Embedding model?",
|
|
29025
|
+
options: [
|
|
29026
|
+
{
|
|
29027
|
+
id: "small",
|
|
29028
|
+
label: "text-embedding-3-small (default)",
|
|
29029
|
+
currentWhen: {
|
|
29030
|
+
kind: "any",
|
|
29031
|
+
conditions: [
|
|
29032
|
+
{ kind: "equals", key: "KB_EMBEDDING_MODEL", value: "text-embedding-3-small" },
|
|
29033
|
+
{ kind: "not", condition: { kind: "present", key: "KB_EMBEDDING_MODEL" } }
|
|
29034
|
+
]
|
|
29035
|
+
},
|
|
29036
|
+
env: { KB_EMBEDDING_MODEL: "text-embedding-3-small" }
|
|
29037
|
+
},
|
|
29038
|
+
{
|
|
29039
|
+
id: "large",
|
|
29040
|
+
label: "text-embedding-3-large",
|
|
29041
|
+
currentWhen: { kind: "equals", key: "KB_EMBEDDING_MODEL", value: "text-embedding-3-large" },
|
|
29042
|
+
env: { KB_EMBEDDING_MODEL: "text-embedding-3-large" }
|
|
29043
|
+
}
|
|
29044
|
+
]
|
|
29045
|
+
},
|
|
29046
|
+
{
|
|
29047
|
+
type: "field",
|
|
29048
|
+
key: "EMBEDDING_OUTPUT_DIMS",
|
|
29049
|
+
input: "text",
|
|
29050
|
+
hint: "optional vector width for new knowledge bases: 768, 1024, 1536 (default), or 3072",
|
|
29051
|
+
validate: true
|
|
29052
|
+
}
|
|
29053
|
+
];
|
|
28917
29054
|
KNOWLEDGE_EMBEDDINGS_SETUP = defineCapabilitySetup(KNOWLEDGE_EMBEDDINGS_CAPABILITY, {
|
|
28918
29055
|
label: "Knowledge embeddings",
|
|
28919
29056
|
message: "Knowledge embedding provider?",
|
|
@@ -28946,7 +29083,8 @@ var init_capability_config = __esm(() => {
|
|
|
28946
29083
|
key: "KB_OPENAI_MODEL_NAME",
|
|
28947
29084
|
input: "text",
|
|
28948
29085
|
hint: "optional Azure deployment name; defaults to the embedding model id"
|
|
28949
|
-
}
|
|
29086
|
+
},
|
|
29087
|
+
...OPENAI_EMBEDDING_MODEL_PROMPTS
|
|
28950
29088
|
]
|
|
28951
29089
|
},
|
|
28952
29090
|
openai: {
|
|
@@ -28991,7 +29129,8 @@ var init_capability_config = __esm(() => {
|
|
|
28991
29129
|
]
|
|
28992
29130
|
}
|
|
28993
29131
|
]
|
|
28994
|
-
}
|
|
29132
|
+
},
|
|
29133
|
+
...OPENAI_EMBEDDING_MODEL_PROMPTS
|
|
28995
29134
|
]
|
|
28996
29135
|
},
|
|
28997
29136
|
openrouter: {
|
|
@@ -29002,11 +29141,93 @@ var init_capability_config = __esm(() => {
|
|
|
29002
29141
|
key: "OPENROUTER_API_KEY",
|
|
29003
29142
|
input: "secret",
|
|
29004
29143
|
required: true
|
|
29144
|
+
},
|
|
29145
|
+
...OPENAI_EMBEDDING_MODEL_PROMPTS
|
|
29146
|
+
]
|
|
29147
|
+
},
|
|
29148
|
+
gemini: {
|
|
29149
|
+
hint: "gemini-embedding-001, at 768, 1536, or 3072 dimensions",
|
|
29150
|
+
env: { KB_EMBEDDING_MODEL: "gemini-embedding-001" },
|
|
29151
|
+
prompts: [
|
|
29152
|
+
{
|
|
29153
|
+
type: "choice",
|
|
29154
|
+
id: "gemini-credentials",
|
|
29155
|
+
message: "Gemini credentials?",
|
|
29156
|
+
options: [
|
|
29157
|
+
{
|
|
29158
|
+
id: "single",
|
|
29159
|
+
label: "Single API key",
|
|
29160
|
+
currentWhen: { kind: "present", key: "GEMINI_API_KEY" },
|
|
29161
|
+
prompts: [{ type: "field", key: "GEMINI_API_KEY", input: "secret", required: true }]
|
|
29162
|
+
},
|
|
29163
|
+
{
|
|
29164
|
+
id: "rotating",
|
|
29165
|
+
label: "Rotating key pool",
|
|
29166
|
+
currentWhen: {
|
|
29167
|
+
kind: "any",
|
|
29168
|
+
conditions: [
|
|
29169
|
+
{ kind: "present", key: "GEMINI_API_KEY_1" },
|
|
29170
|
+
{ kind: "present", key: "GEMINI_API_KEY_2" },
|
|
29171
|
+
{ kind: "present", key: "GEMINI_API_KEY_3" }
|
|
29172
|
+
]
|
|
29173
|
+
},
|
|
29174
|
+
prompts: [
|
|
29175
|
+
{ type: "field", key: "GEMINI_API_KEY_1", input: "secret", required: true },
|
|
29176
|
+
{
|
|
29177
|
+
type: "field",
|
|
29178
|
+
key: "GEMINI_API_KEY_2",
|
|
29179
|
+
input: "secret",
|
|
29180
|
+
hint: "optional rotating key"
|
|
29181
|
+
},
|
|
29182
|
+
{
|
|
29183
|
+
type: "field",
|
|
29184
|
+
key: "GEMINI_API_KEY_3",
|
|
29185
|
+
input: "secret",
|
|
29186
|
+
hint: "optional rotating key"
|
|
29187
|
+
}
|
|
29188
|
+
]
|
|
29189
|
+
}
|
|
29190
|
+
]
|
|
29191
|
+
},
|
|
29192
|
+
{
|
|
29193
|
+
type: "field",
|
|
29194
|
+
key: "EMBEDDING_OUTPUT_DIMS",
|
|
29195
|
+
input: "text",
|
|
29196
|
+
hint: "vector width for new knowledge bases: 768, 1536 (default), or 3072",
|
|
29197
|
+
validate: true
|
|
29198
|
+
}
|
|
29199
|
+
]
|
|
29200
|
+
},
|
|
29201
|
+
ollama: {
|
|
29202
|
+
hint: "embeddings on your own Ollama; no API key, nothing billed",
|
|
29203
|
+
prompts: [
|
|
29204
|
+
{
|
|
29205
|
+
type: "field",
|
|
29206
|
+
key: "OLLAMA_URL",
|
|
29207
|
+
input: "text",
|
|
29208
|
+
required: true,
|
|
29209
|
+
hint: "e.g. http://localhost:11434, or http://host.docker.internal:11434 in Docker",
|
|
29210
|
+
validate: true
|
|
29211
|
+
},
|
|
29212
|
+
{
|
|
29213
|
+
type: "field",
|
|
29214
|
+
key: "KB_EMBEDDING_MODEL",
|
|
29215
|
+
input: "text",
|
|
29216
|
+
required: true,
|
|
29217
|
+
defaultValue: "ollama/nomic-embed-text",
|
|
29218
|
+
hint: "ollama/<model>, pulled on that server (nomic-embed-text is 768)"
|
|
29219
|
+
},
|
|
29220
|
+
{
|
|
29221
|
+
type: "field",
|
|
29222
|
+
key: "EMBEDDING_OUTPUT_DIMS",
|
|
29223
|
+
input: "text",
|
|
29224
|
+
hint: "optional — leave blank and Sim reads the width from your Ollama server",
|
|
29225
|
+
validate: true
|
|
29005
29226
|
}
|
|
29006
29227
|
]
|
|
29007
29228
|
}
|
|
29008
29229
|
},
|
|
29009
|
-
optionOrder: ["openai", "azure-openai", "openrouter"]
|
|
29230
|
+
optionOrder: ["openai", "azure-openai", "gemini", "ollama", "openrouter"]
|
|
29010
29231
|
});
|
|
29011
29232
|
CAPABILITY_SETUPS = [
|
|
29012
29233
|
EMAIL_SETUP,
|
|
@@ -35786,11 +36007,12 @@ async function promptField(prompt, state) {
|
|
|
35786
36007
|
const existing = state.currentValues.get(prompt.key);
|
|
35787
36008
|
const current = hasEnvCapabilityValue(state.currentValues, prompt.key);
|
|
35788
36009
|
const draft = getCapabilitySetupDraftValues(state.setup, state.optionId, state.values);
|
|
35789
|
-
const
|
|
36010
|
+
const reusableExisting = existing !== undefined && validateCapabilityFieldInput(state.setup.definition, prompt.key, existing, state.optionId) === undefined ? existing : undefined;
|
|
36011
|
+
const initialValue = reusableExisting ?? draft[prompt.key] ?? prompt.defaultValue;
|
|
35790
36012
|
const validate = (value) => {
|
|
35791
36013
|
if (!value)
|
|
35792
36014
|
return prompt.required && !existing ? "required" : undefined;
|
|
35793
|
-
return prompt.validate ? validateCapabilityFieldInput(state.setup.definition, prompt.key, value) : undefined;
|
|
36015
|
+
return prompt.validate ? validateCapabilityFieldInput(state.setup.definition, prompt.key, value, state.optionId) : undefined;
|
|
35794
36016
|
};
|
|
35795
36017
|
let value;
|
|
35796
36018
|
if (prompt.input === "secret") {
|