@shuffleio/shuffle-mcps 0.0.47 → 0.0.49
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 +47 -25
- package/dist/index.mjs +45 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12062,7 +12062,7 @@ var subscribeLastOpenedAgentRun = (cb) => {
|
|
|
12062
12062
|
var import_lucide_react15 = require("lucide-react");
|
|
12063
12063
|
|
|
12064
12064
|
// ../Shuffle-Core/components/WorkflowRunExplorer.tsx
|
|
12065
|
-
var import_react17 = __toESM(require("react")
|
|
12065
|
+
var import_react17 = __toESM(require("react"));
|
|
12066
12066
|
var import_material20 = require("@mui/material");
|
|
12067
12067
|
var import_icons_material = require("@mui/icons-material");
|
|
12068
12068
|
|
|
@@ -12130,14 +12130,43 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
|
|
|
12130
12130
|
const isSameDomain = Boolean(
|
|
12131
12131
|
currentRoot && targetRoot && currentRoot === targetRoot
|
|
12132
12132
|
);
|
|
12133
|
-
|
|
12134
|
-
if (
|
|
12135
|
-
|
|
12133
|
+
function hasActiveSession2() {
|
|
12134
|
+
if (typeof window === "undefined") return false;
|
|
12135
|
+
const token = getSessionToken2();
|
|
12136
|
+
if (token && token.trim().length > 0) return true;
|
|
12137
|
+
try {
|
|
12138
|
+
const cookies = document.cookie || "";
|
|
12139
|
+
if (cookies.includes("session=") || cookies.includes("user_id=") || cookies.includes("token=")) {
|
|
12140
|
+
return true;
|
|
12141
|
+
}
|
|
12142
|
+
const userInfo = localStorage.getItem("shuffle_user_info") || localStorage.getItem("user_id");
|
|
12143
|
+
if (userInfo && userInfo.trim().length > 0 && userInfo !== "null") {
|
|
12144
|
+
return true;
|
|
12145
|
+
}
|
|
12146
|
+
} catch {
|
|
12147
|
+
}
|
|
12148
|
+
return false;
|
|
12149
|
+
}
|
|
12150
|
+
function directNavigate2(targetUrl2, popupWindow2) {
|
|
12151
|
+
if (popupWindow2) {
|
|
12152
|
+
try {
|
|
12153
|
+
popupWindow2.location.href = targetUrl2;
|
|
12154
|
+
} catch {
|
|
12155
|
+
if (typeof window !== "undefined") {
|
|
12156
|
+
window.location.href = targetUrl2;
|
|
12157
|
+
}
|
|
12158
|
+
}
|
|
12136
12159
|
} else if (typeof window !== "undefined") {
|
|
12137
|
-
window.location.href =
|
|
12160
|
+
window.location.href = targetUrl2;
|
|
12138
12161
|
}
|
|
12139
12162
|
return true;
|
|
12140
12163
|
}
|
|
12164
|
+
if (!isCloudDomain3() && !isShuffleBackend || targetHost && currentHost && targetHost === currentHost || isSameDomain) {
|
|
12165
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
12166
|
+
}
|
|
12167
|
+
if (!hasActiveSession2()) {
|
|
12168
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
12169
|
+
}
|
|
12141
12170
|
try {
|
|
12142
12171
|
const isCloud2 = isCloudDomain3() || currentHost.endsWith(".shuffle.security") || currentHost === "shuffle.security";
|
|
12143
12172
|
const handoffEndpoint = isCloud2 || isShuffleBackend ? UK_AUTH_HANDOFF_ENDPOINT : getApiUrl2("/api/v1/auth/handoff");
|
|
@@ -12155,25 +12184,17 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
|
|
|
12155
12184
|
headers
|
|
12156
12185
|
});
|
|
12157
12186
|
if (!response.ok) {
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
reason = errorData.reason;
|
|
12163
|
-
}
|
|
12164
|
-
} catch {
|
|
12165
|
-
}
|
|
12166
|
-
if (popupWindow) popupWindow.close();
|
|
12167
|
-
toast2.error(`Authentication handoff failed: ${reason}`);
|
|
12168
|
-
return false;
|
|
12187
|
+
console.warn(
|
|
12188
|
+
`[authHandoff] Handoff ticket request returned ${response.status}, falling back to direct navigation`
|
|
12189
|
+
);
|
|
12190
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
12169
12191
|
}
|
|
12170
12192
|
const data = await response.json();
|
|
12171
12193
|
if (!data?.success || !data?.ticket) {
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
`Authentication handoff failed: ${data?.reason || "No ticket returned"}`
|
|
12194
|
+
console.warn(
|
|
12195
|
+
`[authHandoff] No ticket returned (${data?.reason || "unknown"}), falling back to direct navigation`
|
|
12175
12196
|
);
|
|
12176
|
-
return
|
|
12197
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
12177
12198
|
}
|
|
12178
12199
|
let targetCoreBase = UK_SHUFFLE_CORE_BASE;
|
|
12179
12200
|
if (!isShuffleBackend && !isCloud2) {
|
|
@@ -12219,15 +12240,16 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
|
|
|
12219
12240
|
}
|
|
12220
12241
|
return true;
|
|
12221
12242
|
} catch (err) {
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12243
|
+
console.warn(
|
|
12244
|
+
"[authHandoff] Error during handoff to Shuffle Core, falling back to direct navigation:",
|
|
12245
|
+
err
|
|
12246
|
+
);
|
|
12247
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
12226
12248
|
}
|
|
12227
12249
|
}
|
|
12228
12250
|
|
|
12229
12251
|
// ../Shuffle-Core/components/WorkflowRunExplorer.tsx
|
|
12230
|
-
var import_react18_json_view3 = __toESM(require("react18-json-view")
|
|
12252
|
+
var import_react18_json_view3 = __toESM(require("react18-json-view"));
|
|
12231
12253
|
var import_style3 = require("react18-json-view/src/style.css");
|
|
12232
12254
|
var import_dark3 = require("react18-json-view/src/dark.css");
|
|
12233
12255
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
package/dist/index.mjs
CHANGED
|
@@ -11035,14 +11035,43 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
|
|
|
11035
11035
|
const isSameDomain = Boolean(
|
|
11036
11036
|
currentRoot && targetRoot && currentRoot === targetRoot
|
|
11037
11037
|
);
|
|
11038
|
-
|
|
11039
|
-
if (
|
|
11040
|
-
|
|
11038
|
+
function hasActiveSession2() {
|
|
11039
|
+
if (typeof window === "undefined") return false;
|
|
11040
|
+
const token = getSessionToken();
|
|
11041
|
+
if (token && token.trim().length > 0) return true;
|
|
11042
|
+
try {
|
|
11043
|
+
const cookies = document.cookie || "";
|
|
11044
|
+
if (cookies.includes("session=") || cookies.includes("user_id=") || cookies.includes("token=")) {
|
|
11045
|
+
return true;
|
|
11046
|
+
}
|
|
11047
|
+
const userInfo = localStorage.getItem("shuffle_user_info") || localStorage.getItem("user_id");
|
|
11048
|
+
if (userInfo && userInfo.trim().length > 0 && userInfo !== "null") {
|
|
11049
|
+
return true;
|
|
11050
|
+
}
|
|
11051
|
+
} catch {
|
|
11052
|
+
}
|
|
11053
|
+
return false;
|
|
11054
|
+
}
|
|
11055
|
+
function directNavigate2(targetUrl2, popupWindow2) {
|
|
11056
|
+
if (popupWindow2) {
|
|
11057
|
+
try {
|
|
11058
|
+
popupWindow2.location.href = targetUrl2;
|
|
11059
|
+
} catch {
|
|
11060
|
+
if (typeof window !== "undefined") {
|
|
11061
|
+
window.location.href = targetUrl2;
|
|
11062
|
+
}
|
|
11063
|
+
}
|
|
11041
11064
|
} else if (typeof window !== "undefined") {
|
|
11042
|
-
window.location.href =
|
|
11065
|
+
window.location.href = targetUrl2;
|
|
11043
11066
|
}
|
|
11044
11067
|
return true;
|
|
11045
11068
|
}
|
|
11069
|
+
if (!isCloudDomain3() && !isShuffleBackend || targetHost && currentHost && targetHost === currentHost || isSameDomain) {
|
|
11070
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
11071
|
+
}
|
|
11072
|
+
if (!hasActiveSession2()) {
|
|
11073
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
11074
|
+
}
|
|
11046
11075
|
try {
|
|
11047
11076
|
const isCloud2 = isCloudDomain3() || currentHost.endsWith(".shuffle.security") || currentHost === "shuffle.security";
|
|
11048
11077
|
const handoffEndpoint = isCloud2 || isShuffleBackend ? UK_AUTH_HANDOFF_ENDPOINT : getApiUrl2("/api/v1/auth/handoff");
|
|
@@ -11060,25 +11089,17 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
|
|
|
11060
11089
|
headers
|
|
11061
11090
|
});
|
|
11062
11091
|
if (!response.ok) {
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
reason = errorData.reason;
|
|
11068
|
-
}
|
|
11069
|
-
} catch {
|
|
11070
|
-
}
|
|
11071
|
-
if (popupWindow) popupWindow.close();
|
|
11072
|
-
toast2.error(`Authentication handoff failed: ${reason}`);
|
|
11073
|
-
return false;
|
|
11092
|
+
console.warn(
|
|
11093
|
+
`[authHandoff] Handoff ticket request returned ${response.status}, falling back to direct navigation`
|
|
11094
|
+
);
|
|
11095
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
11074
11096
|
}
|
|
11075
11097
|
const data = await response.json();
|
|
11076
11098
|
if (!data?.success || !data?.ticket) {
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
`Authentication handoff failed: ${data?.reason || "No ticket returned"}`
|
|
11099
|
+
console.warn(
|
|
11100
|
+
`[authHandoff] No ticket returned (${data?.reason || "unknown"}), falling back to direct navigation`
|
|
11080
11101
|
);
|
|
11081
|
-
return
|
|
11102
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
11082
11103
|
}
|
|
11083
11104
|
let targetCoreBase = UK_SHUFFLE_CORE_BASE;
|
|
11084
11105
|
if (!isShuffleBackend && !isCloud2) {
|
|
@@ -11124,10 +11145,11 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
|
|
|
11124
11145
|
}
|
|
11125
11146
|
return true;
|
|
11126
11147
|
} catch (err) {
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11148
|
+
console.warn(
|
|
11149
|
+
"[authHandoff] Error during handoff to Shuffle Core, falling back to direct navigation:",
|
|
11150
|
+
err
|
|
11151
|
+
);
|
|
11152
|
+
return directNavigate2(targetUrl, popupWindow);
|
|
11131
11153
|
}
|
|
11132
11154
|
}
|
|
11133
11155
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuffleio/shuffle-mcps",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"description": "Turn 3,000+ SaaS tools into MCP servers your agents can use. Headless React component for search, selection, and OAuth handoff.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|