groove-dev 0.17.7 → 0.17.8
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/node_modules/@groove-dev/daemon/integrations-registry.json +10 -8
- package/node_modules/@groove-dev/daemon/src/integrations.js +39 -0
- package/node_modules/@groove-dev/gui/dist/assets/{index-CsymvgNh.js → index-D5dtDQf0.js} +22 -22
- package/node_modules/@groove-dev/gui/dist/index.html +1 -1
- package/node_modules/@groove-dev/gui/src/views/IntegrationsStore.jsx +45 -7
- package/package.json +1 -1
- package/packages/daemon/integrations-registry.json +10 -8
- package/packages/daemon/src/integrations.js +39 -0
- package/packages/gui/dist/assets/{index-CsymvgNh.js → index-D5dtDQf0.js} +22 -22
- package/packages/gui/dist/index.html +1 -1
- package/packages/gui/src/views/IntegrationsStore.jsx +45 -7
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>GROOVE</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-D5dtDQf0.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-BhjOFLBc.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -86,8 +86,9 @@ function CredentialModal({ integration, onClose }) {
|
|
|
86
86
|
const [showGoogleSetup, setShowGoogleSetup] = useState(false);
|
|
87
87
|
|
|
88
88
|
useEffect(() => {
|
|
89
|
-
if (integration?.authType === 'oauth-google') {
|
|
89
|
+
if (integration?.authType === 'oauth-google' || integration?.authType === 'google-autoauth' || integration?._googleSetupNeeded) {
|
|
90
90
|
setOauthStatus('checking');
|
|
91
|
+
setShowGoogleSetup(integration?._googleSetupNeeded || false);
|
|
91
92
|
fetch('/api/integrations/google-oauth/status')
|
|
92
93
|
.then((r) => r.json())
|
|
93
94
|
.then((data) => setOauthStatus(data.configured ? 'ready' : 'not-configured'))
|
|
@@ -98,6 +99,7 @@ function CredentialModal({ integration, onClose }) {
|
|
|
98
99
|
if (!integration) return null;
|
|
99
100
|
|
|
100
101
|
const isOAuth = integration.authType === 'oauth-google';
|
|
102
|
+
const isGoogleAutoAuth = integration.authType === 'google-autoauth' || integration._googleSetupNeeded;
|
|
101
103
|
const envKeys = (integration.envKeys || []).filter((ek) => !ek.hidden);
|
|
102
104
|
const setupSteps = integration.setupSteps || [];
|
|
103
105
|
|
|
@@ -133,6 +135,22 @@ function CredentialModal({ integration, onClose }) {
|
|
|
133
135
|
setSaving(false);
|
|
134
136
|
}
|
|
135
137
|
|
|
138
|
+
async function handleAutoAuthConnect() {
|
|
139
|
+
setOauthStatus('connecting');
|
|
140
|
+
try {
|
|
141
|
+
const res = await fetch(`/api/integrations/${integration.id}/authenticate`, { method: 'POST' });
|
|
142
|
+
const data = await res.json();
|
|
143
|
+
if (!data.ok) {
|
|
144
|
+
setOauthStatus('ready');
|
|
145
|
+
}
|
|
146
|
+
// The MCP server will open a browser — poll isn't needed since
|
|
147
|
+
// the server handles auth internally. Just close after a moment.
|
|
148
|
+
setTimeout(() => onClose(), 2000);
|
|
149
|
+
} catch {
|
|
150
|
+
setOauthStatus('ready');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
136
154
|
async function handleOAuthConnect() {
|
|
137
155
|
setOauthStatus('connecting');
|
|
138
156
|
try {
|
|
@@ -218,12 +236,14 @@ function CredentialModal({ integration, onClose }) {
|
|
|
218
236
|
</a>
|
|
219
237
|
)}
|
|
220
238
|
|
|
221
|
-
{/* OAuth flow for Google integrations */}
|
|
222
|
-
{isOAuth && (
|
|
239
|
+
{/* OAuth flow for Google integrations (both oauth-google and google-autoauth) */}
|
|
240
|
+
{(isOAuth || isGoogleAutoAuth) && (
|
|
223
241
|
<div style={{ marginBottom: 16 }}>
|
|
224
242
|
{/* Always show the primary Connect button */}
|
|
225
243
|
<button
|
|
226
|
-
onClick={oauthStatus === 'ready'
|
|
244
|
+
onClick={oauthStatus === 'ready'
|
|
245
|
+
? (isGoogleAutoAuth ? handleAutoAuthConnect : handleOAuthConnect)
|
|
246
|
+
: () => setShowGoogleSetup(true)}
|
|
227
247
|
disabled={oauthStatus === 'checking' || oauthStatus === 'connecting'}
|
|
228
248
|
style={{
|
|
229
249
|
display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
|
|
@@ -292,9 +312,12 @@ function CredentialModal({ integration, onClose }) {
|
|
|
292
312
|
<button
|
|
293
313
|
onClick={async () => {
|
|
294
314
|
await handleGoogleSetup();
|
|
295
|
-
// After saving, immediately trigger the
|
|
315
|
+
// After saving, immediately trigger the appropriate connect flow
|
|
296
316
|
if (googleClientId && googleClientSecret) {
|
|
297
|
-
setTimeout(() =>
|
|
317
|
+
setTimeout(() => {
|
|
318
|
+
if (isGoogleAutoAuth) handleAutoAuthConnect();
|
|
319
|
+
else handleOAuthConnect();
|
|
320
|
+
}, 500);
|
|
298
321
|
}
|
|
299
322
|
}}
|
|
300
323
|
disabled={saving || !googleClientId || !googleClientSecret}
|
|
@@ -369,7 +392,8 @@ function CredentialModal({ integration, onClose }) {
|
|
|
369
392
|
function IntegrationDetailModal({ integration, installing, onInstall, onUninstall, onConfigure, onAuthenticate, onClose }) {
|
|
370
393
|
if (!integration) return null;
|
|
371
394
|
|
|
372
|
-
const isAutoAuth = integration.authType === 'none'
|
|
395
|
+
const isAutoAuth = (integration.authType === 'none' || integration.authType === 'google-autoauth')
|
|
396
|
+
&& (integration.envKeys || []).length === 0;
|
|
373
397
|
const hasCredentials = (integration.envKeys || []).filter((ek) => !ek.hidden).length > 0
|
|
374
398
|
|| integration.authType === 'oauth-google';
|
|
375
399
|
|
|
@@ -716,6 +740,20 @@ export default function IntegrationsStore() {
|
|
|
716
740
|
}
|
|
717
741
|
|
|
718
742
|
async function handleAuthenticate(item) {
|
|
743
|
+
// For google-autoauth, check if Google OAuth is configured first
|
|
744
|
+
if (item.authType === 'google-autoauth') {
|
|
745
|
+
try {
|
|
746
|
+
const statusRes = await fetch('/api/integrations/google-oauth/status');
|
|
747
|
+
const statusData = await statusRes.json();
|
|
748
|
+
if (!statusData.configured) {
|
|
749
|
+
// Need Google OAuth setup first — open the credential modal
|
|
750
|
+
setSelectedItem(null);
|
|
751
|
+
setConfiguring({ ...item, _googleSetupNeeded: true });
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
} catch { /* proceed anyway */ }
|
|
755
|
+
}
|
|
756
|
+
|
|
719
757
|
setSelectedItem(null);
|
|
720
758
|
try {
|
|
721
759
|
const res = await fetch(`/api/integrations/${item.id}/authenticate`, { method: 'POST' });
|