@trops/dash-core 0.1.99 → 0.1.102
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 +23 -12
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +64 -38
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +64 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -5945,9 +5945,8 @@ var mcpControllerExports = mcpController$3.exports;
|
|
|
5945
5945
|
const path$8 = require$$1$1;
|
|
5946
5946
|
const fs$5 = require$$2;
|
|
5947
5947
|
|
|
5948
|
-
// Default registry
|
|
5949
|
-
const
|
|
5950
|
-
"https://trops.github.io/dash-registry/registry-index.json";
|
|
5948
|
+
// Default registry API base URL
|
|
5949
|
+
const DEFAULT_REGISTRY_API_URL = "https://registry.trops.dev";
|
|
5951
5950
|
|
|
5952
5951
|
// Cache TTL: 5 minutes
|
|
5953
5952
|
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
@@ -5993,7 +5992,7 @@ async function fetchRegistryIndex(forceRefresh = false) {
|
|
|
5993
5992
|
let indexData;
|
|
5994
5993
|
|
|
5995
5994
|
if (isDev()) {
|
|
5996
|
-
// In dev mode,
|
|
5995
|
+
// In dev mode, try local test file first
|
|
5997
5996
|
const testPath = getTestRegistryPath();
|
|
5998
5997
|
if (fs$5.existsSync(testPath)) {
|
|
5999
5998
|
console.log(
|
|
@@ -6003,13 +6002,10 @@ async function fetchRegistryIndex(forceRefresh = false) {
|
|
|
6003
6002
|
const raw = fs$5.readFileSync(testPath, "utf8");
|
|
6004
6003
|
indexData = JSON.parse(raw);
|
|
6005
6004
|
} else {
|
|
6006
|
-
|
|
6007
|
-
"[RegistryController] Test registry not found at:",
|
|
6008
|
-
testPath,
|
|
6009
|
-
"— falling back to remote registry",
|
|
6010
|
-
);
|
|
6005
|
+
// Fall back to API (supports DASH_REGISTRY_URL as full-URL override)
|
|
6011
6006
|
const registryUrl =
|
|
6012
|
-
process.env.DASH_REGISTRY_URL ||
|
|
6007
|
+
process.env.DASH_REGISTRY_URL ||
|
|
6008
|
+
`${process.env.DASH_REGISTRY_API_URL || DEFAULT_REGISTRY_API_URL}/api/packages`;
|
|
6013
6009
|
console.log(
|
|
6014
6010
|
"[RegistryController] Fetching registry from:",
|
|
6015
6011
|
registryUrl,
|
|
@@ -6023,8 +6019,10 @@ async function fetchRegistryIndex(forceRefresh = false) {
|
|
|
6023
6019
|
indexData = await response.json();
|
|
6024
6020
|
}
|
|
6025
6021
|
} else {
|
|
6026
|
-
// In production, fetch from
|
|
6027
|
-
const registryUrl =
|
|
6022
|
+
// In production, fetch from API
|
|
6023
|
+
const registryUrl =
|
|
6024
|
+
process.env.DASH_REGISTRY_URL ||
|
|
6025
|
+
`${process.env.DASH_REGISTRY_API_URL || DEFAULT_REGISTRY_API_URL}/api/packages`;
|
|
6028
6026
|
console.log("[RegistryController] Fetching registry from:", registryUrl);
|
|
6029
6027
|
|
|
6030
6028
|
const response = await fetch(registryUrl);
|
|
@@ -6036,6 +6034,14 @@ async function fetchRegistryIndex(forceRefresh = false) {
|
|
|
6036
6034
|
indexData = await response.json();
|
|
6037
6035
|
}
|
|
6038
6036
|
|
|
6037
|
+
// Normalize: ensure `version` exists on each package (API uses `latestVersion`)
|
|
6038
|
+
if (indexData.packages) {
|
|
6039
|
+
indexData.packages = indexData.packages.map((pkg) => ({
|
|
6040
|
+
...pkg,
|
|
6041
|
+
version: pkg.version || pkg.latestVersion || "0.0.0",
|
|
6042
|
+
}));
|
|
6043
|
+
}
|
|
6044
|
+
|
|
6039
6045
|
// Cache the result
|
|
6040
6046
|
cachedIndex = indexData;
|
|
6041
6047
|
cacheTimestamp = now;
|
|
@@ -10238,6 +10244,11 @@ async function getRegistryProfile$1() {
|
|
|
10238
10244
|
},
|
|
10239
10245
|
});
|
|
10240
10246
|
|
|
10247
|
+
if (response.status === 401) {
|
|
10248
|
+
// Token expired or invalid — clear stored credentials
|
|
10249
|
+
clearToken();
|
|
10250
|
+
return null;
|
|
10251
|
+
}
|
|
10241
10252
|
if (!response.ok) return null;
|
|
10242
10253
|
|
|
10243
10254
|
const data = await response.json();
|