@trops/dash-core 0.1.634 → 0.1.635
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/electron/index.js +15 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +44 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +44 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -47320,21 +47320,45 @@ var PROVIDER_LABELS = {
|
|
|
47320
47320
|
xai: "xAI"
|
|
47321
47321
|
};
|
|
47322
47322
|
var AI_PROVIDER_TYPES = Object.keys(PROVIDER_LABELS);
|
|
47323
|
-
function
|
|
47324
|
-
var present =
|
|
47323
|
+
function presentProviderTypes(providers) {
|
|
47324
|
+
var present = [];
|
|
47325
47325
|
for (var _i = 0, _Object$values = Object.values(providers || {}); _i < _Object$values.length; _i++) {
|
|
47326
47326
|
var p = _Object$values[_i];
|
|
47327
|
-
if (p && AI_PROVIDER_TYPES.includes(p.type)
|
|
47327
|
+
if (p && AI_PROVIDER_TYPES.includes(p.type) && !present.includes(p.type)) {
|
|
47328
|
+
present.push(p.type);
|
|
47329
|
+
}
|
|
47328
47330
|
}
|
|
47329
|
-
return
|
|
47330
|
-
|
|
47331
|
-
|
|
47332
|
-
|
|
47331
|
+
return present;
|
|
47332
|
+
}
|
|
47333
|
+
function providerOptionsFrom(providers) {
|
|
47334
|
+
return [].concat(_toConsumableArray(presentProviderTypes(providers).map(function (t) {
|
|
47333
47335
|
return {
|
|
47334
47336
|
value: t,
|
|
47335
47337
|
label: PROVIDER_LABELS[t] || t
|
|
47336
47338
|
};
|
|
47337
|
-
}))
|
|
47339
|
+
})), [
|
|
47340
|
+
// Auth via the logged-in Claude Code CLI — no API key needed. Runs on the
|
|
47341
|
+
// Claude Agent engine (native tools).
|
|
47342
|
+
{
|
|
47343
|
+
value: "claude-code",
|
|
47344
|
+
label: "Claude Code (CLI) — no API key"
|
|
47345
|
+
}]);
|
|
47346
|
+
}
|
|
47347
|
+
|
|
47348
|
+
/**
|
|
47349
|
+
* The provider to pre-select for a new bot: the user's configured default AI
|
|
47350
|
+
* (its `isDefaultForType`, else the first configured). If none is configured,
|
|
47351
|
+
* fall back to the always-available Claude Code (CLI) — it's the only option in
|
|
47352
|
+
* that case and needs no API key.
|
|
47353
|
+
*/
|
|
47354
|
+
function defaultProviderId(providers) {
|
|
47355
|
+
var list = Object.values(providers || {}).filter(function (p) {
|
|
47356
|
+
return p && AI_PROVIDER_TYPES.includes(p.type);
|
|
47357
|
+
});
|
|
47358
|
+
var def = list.find(function (p) {
|
|
47359
|
+
return p.isDefaultForType;
|
|
47360
|
+
}) || list[0];
|
|
47361
|
+
return def ? def.type : "claude-code";
|
|
47338
47362
|
}
|
|
47339
47363
|
var APPROVAL_OPTIONS = [{
|
|
47340
47364
|
value: "ask",
|
|
@@ -47393,7 +47417,7 @@ var BotDetail = function BotDetail(_ref) {
|
|
|
47393
47417
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
47394
47418
|
instructions = _useState4[0],
|
|
47395
47419
|
setInstructions = _useState4[1];
|
|
47396
|
-
var _useState5 = useState((bot === null || bot === void 0 ? void 0 : bot.provider) ||
|
|
47420
|
+
var _useState5 = useState((bot === null || bot === void 0 ? void 0 : bot.provider) || defaultProviderId(providers)),
|
|
47397
47421
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
47398
47422
|
provider = _useState6[0],
|
|
47399
47423
|
setProvider = _useState6[1];
|
|
@@ -47662,12 +47686,17 @@ var BotDetail = function BotDetail(_ref) {
|
|
|
47662
47686
|
placeholder: "What should this bot do?",
|
|
47663
47687
|
rows: 5
|
|
47664
47688
|
})]
|
|
47665
|
-
}), /*#__PURE__*/
|
|
47666
|
-
|
|
47667
|
-
|
|
47668
|
-
|
|
47669
|
-
|
|
47670
|
-
|
|
47689
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
47690
|
+
className: "flex flex-col gap-1",
|
|
47691
|
+
children: [/*#__PURE__*/jsx(SelectInput, {
|
|
47692
|
+
label: "Provider",
|
|
47693
|
+
value: provider,
|
|
47694
|
+
onChange: setProvider,
|
|
47695
|
+
options: providerOptionsFrom(providers)
|
|
47696
|
+
}), /*#__PURE__*/jsx("span", {
|
|
47697
|
+
className: "text-xs opacity-50",
|
|
47698
|
+
children: "The AI that runs this bot. \"Claude Code (CLI)\" uses your Claude login \u2014 no API key needed."
|
|
47699
|
+
})]
|
|
47671
47700
|
}), /*#__PURE__*/jsx(SelectInput, {
|
|
47672
47701
|
label: "Model",
|
|
47673
47702
|
value: model,
|