@trops/dash-core 0.1.395 → 0.1.396
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 +39 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +1330 -508
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1362 -549
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -4863,6 +4863,10 @@ function requireProviderController () {
|
|
|
4863
4863
|
* @param {object} mcpConfig MCP server config (transport, command, args, envMapping) - only for providerClass "mcp"
|
|
4864
4864
|
* @param {string[]|null} allowedTools optional list of allowed tool names - only for providerClass "mcp"
|
|
4865
4865
|
* @param {object} wsConfig WebSocket config (url, headers, subprotocols) - only for providerClass "websocket"
|
|
4866
|
+
* @param {boolean} [isDefaultForType=false] mark this provider as the app-wide default for its type.
|
|
4867
|
+
* Single-winner invariant: if true, every other provider with the same
|
|
4868
|
+
* `providerType` has its `isDefaultForType` cleared in the same save.
|
|
4869
|
+
* Consumed by the 3-layer resolution in `useMcpProvider`.
|
|
4866
4870
|
*/
|
|
4867
4871
|
saveProvider: (
|
|
4868
4872
|
win,
|
|
@@ -4874,6 +4878,9 @@ function requireProviderController () {
|
|
|
4874
4878
|
mcpConfig = null,
|
|
4875
4879
|
allowedTools = null,
|
|
4876
4880
|
wsConfig = null,
|
|
4881
|
+
// `undefined` means "preserve whatever the saved provider has";
|
|
4882
|
+
// explicit `true`/`false` flips the flag.
|
|
4883
|
+
isDefaultForType = undefined,
|
|
4877
4884
|
) => {
|
|
4878
4885
|
try {
|
|
4879
4886
|
// Build file path
|
|
@@ -4919,6 +4926,31 @@ function requireProviderController () {
|
|
|
4919
4926
|
providerEntry.wsConfig = wsConfig;
|
|
4920
4927
|
}
|
|
4921
4928
|
|
|
4929
|
+
// Preserve existing flag if caller didn't pass one; otherwise honor
|
|
4930
|
+
// the caller's value. Explicit false from the caller MUST clear an
|
|
4931
|
+
// existing true flag — this is how the "unset default" path works.
|
|
4932
|
+
const prev = providers[providerName] || {};
|
|
4933
|
+
if (typeof isDefaultForType === "boolean") {
|
|
4934
|
+
providerEntry.isDefaultForType = isDefaultForType;
|
|
4935
|
+
} else if (prev.isDefaultForType) {
|
|
4936
|
+
providerEntry.isDefaultForType = true;
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
// Single-winner invariant: when flipping this provider's flag to
|
|
4940
|
+
// true, clear it on every other provider with the same type. Run
|
|
4941
|
+
// this BEFORE we set `providers[providerName] = providerEntry` so
|
|
4942
|
+
// self is excluded naturally. Stable per-type: clearing siblings
|
|
4943
|
+
// only touches `isDefaultForType` + `dateUpdated`, nothing else.
|
|
4944
|
+
if (providerEntry.isDefaultForType) {
|
|
4945
|
+
for (const [name, data] of Object.entries(providers)) {
|
|
4946
|
+
if (name === providerName) continue;
|
|
4947
|
+
if (data?.type === providerType && data?.isDefaultForType) {
|
|
4948
|
+
data.isDefaultForType = false;
|
|
4949
|
+
data.dateUpdated = new Date().toISOString();
|
|
4950
|
+
}
|
|
4951
|
+
}
|
|
4952
|
+
}
|
|
4953
|
+
|
|
4922
4954
|
providers[providerName] = providerEntry;
|
|
4923
4955
|
|
|
4924
4956
|
// Save to file with restrictive permissions (owner read/write only)
|
|
@@ -5001,6 +5033,7 @@ function requireProviderController () {
|
|
|
5001
5033
|
credentials,
|
|
5002
5034
|
dateCreated: data.dateCreated,
|
|
5003
5035
|
dateUpdated: data.dateUpdated,
|
|
5036
|
+
isDefaultForType: data.isDefaultForType === true,
|
|
5004
5037
|
};
|
|
5005
5038
|
|
|
5006
5039
|
// Include mcpConfig for MCP providers
|
|
@@ -5096,6 +5129,7 @@ function requireProviderController () {
|
|
|
5096
5129
|
credentials,
|
|
5097
5130
|
dateCreated: providerData.dateCreated,
|
|
5098
5131
|
dateUpdated: providerData.dateUpdated,
|
|
5132
|
+
isDefaultForType: providerData.isDefaultForType === true,
|
|
5099
5133
|
};
|
|
5100
5134
|
|
|
5101
5135
|
// Include mcpConfig for MCP providers
|
|
@@ -74035,6 +74069,10 @@ const providerApi$2 = {
|
|
|
74035
74069
|
mcpConfig = null,
|
|
74036
74070
|
allowedTools = null,
|
|
74037
74071
|
wsConfig = null,
|
|
74072
|
+
// `undefined` (not `false`) means "don't touch the existing flag".
|
|
74073
|
+
// The controller uses this to distinguish "caller didn't pass a
|
|
74074
|
+
// value, preserve what's on disk" from "caller explicitly unset it".
|
|
74075
|
+
isDefaultForType = undefined,
|
|
74038
74076
|
) =>
|
|
74039
74077
|
ipcRenderer$j.invoke(PROVIDER_SAVE, {
|
|
74040
74078
|
appId,
|
|
@@ -74045,6 +74083,7 @@ const providerApi$2 = {
|
|
|
74045
74083
|
mcpConfig,
|
|
74046
74084
|
allowedTools,
|
|
74047
74085
|
wsConfig,
|
|
74086
|
+
isDefaultForType,
|
|
74048
74087
|
}),
|
|
74049
74088
|
|
|
74050
74089
|
/**
|