@hanzo/app 0.2.30 → 0.2.32

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/Column.js CHANGED
@@ -127,5 +127,5 @@ export function Column({ host, mode, thread, go, onShut, onSeek, onBack, drawer
127
127
  borderColor: 'var(--border-strong)',
128
128
  bg: 'var(--pane-fill)',
129
129
  }
130
- : HEAD), children: _jsx(Search, { size: drawer ? 18 : 16, "aria-hidden": true }) })] })), mode === 'chat' ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { "data-slot": "app-new", ...ROW, active: !thread, bg: "transparent", hoverStyle: { bg: '$hover' }, icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(SquarePen, { size: 16, "aria-hidden": true }) }), onPress: create, ...keys(create), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('New chat') }) }) }) })) : (_jsx(YStack, { "data-slot": "app-places", shrink: 0, children: groups.map((g, i) => (_jsxs(YStack, { pt: i ? '$2' : 0, children: [i && g.label ? (_jsx(Text, { id: `${uid}-${g.id}`, paddingInlineStart: "$2", pb: 2, fontSize: "$3", color: "$soft", children: g.label })) : null, _jsx(YStack, { role: "list", "aria-labelledby": i && g.label ? `${uid}-${g.id}` : undefined, "aria-label": i && g.label ? undefined : g.label || (at ? t(TITLE[at]) : g.id), gap: 1, children: g.links.map((link) => (_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, ...(link.id === NEW ? { 'data-slot': 'app-new' } : {}), active: link.active, icon: link.id === NEW ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(SquarePen, { size: 16, "aria-hidden": true }) })) : link.icon ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: link.icon })) : null, onPress: link.onPress, ...keys(() => link.onPress?.()), children: _jsx(Text, { fontSize: "$3", color: link.active ? '$ink' : '$quiet', children: link.label }) }) }, link.id))) })] }, g.id))) })), rail, mode === 'studio' || mode === 'tabs' || mode === 'beta' || at ? null : _jsx(Recents, { host: host, mode: mode, thread: thread, onOpen: open, onNew: create }), at ? null : (_jsxs(YStack, { gap: "$2", pt: "$2", shrink: 0, children: [_jsx(Made, {}), _jsx(Setup, {})] })), free ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, pt: "$2", children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, "data-slot": "column-upgrade", icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(Sparkles, { size: 16, "aria-hidden": true, color: "var(--primary)" }) }), onPress: () => window.location.assign(payUrl('/cart', { returnUrl: window.location.href })), ...keys(() => window.location.assign(payUrl('/cart', { returnUrl: window.location.href }))), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Upgrade plan') }) }) }) })) : null, foot] }), drawer ? null : (_jsx(Gutter, { side: dir === 'rtl' ? 'right' : 'left', span: span.span, floor: FLOOR, ceil: CEIL, reset: WIDTH, onSpan: span.move, onKeep: span.keep, onShut: onShut, label: t('Resize sidebar') }))] }));
130
+ : HEAD), children: _jsx(Search, { size: drawer ? 18 : 16, "aria-hidden": true }) })] })), mode === 'chat' ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { "data-slot": "app-new", ...ROW, active: !thread, bg: "transparent", hoverStyle: { bg: '$hover' }, icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(SquarePen, { size: 16, "aria-hidden": true }) }), onPress: create, ...keys(create), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('New chat') }) }) }) })) : (_jsx(YStack, { "data-slot": "app-places", shrink: 0, children: groups.map((g, i) => (_jsxs(YStack, { pt: i ? '$2' : 0, children: [i && g.label ? (_jsx(Text, { id: `${uid}-${g.id}`, paddingInlineStart: "$2", pb: 2, fontSize: "$3", color: "$soft", children: g.label })) : null, _jsx(YStack, { role: "list", "aria-labelledby": i && g.label ? `${uid}-${g.id}` : undefined, "aria-label": i && g.label ? undefined : g.label || (at ? t(TITLE[at]) : g.id), gap: 1, children: g.links.map((link) => (_jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, ...(link.id === NEW ? { 'data-slot': 'app-new' } : {}), active: link.active, icon: link.id === NEW ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(SquarePen, { size: 16, "aria-hidden": true }) })) : link.icon ? (_jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: link.icon })) : null, onPress: link.onPress, ...keys(() => link.onPress?.()), children: _jsx(Text, { fontSize: "$3", color: link.active ? '$ink' : '$quiet', children: link.label }) }) }, link.id))) })] }, g.id))) })), rail, mode === 'studio' || mode === 'tabs' || mode === 'beta' || at ? null : _jsx(Recents, { host: host, mode: mode, thread: thread, onOpen: open, onNew: create }), at ? null : (_jsxs(YStack, { gap: "$2", pt: "$2", shrink: 0, children: [_jsx(Made, {}), _jsx(Setup, { go: go })] })), free ? (_jsx(YStack, { role: "list", gap: 2, shrink: 0, pt: "$2", children: _jsx(YStack, { role: "listitem", children: _jsx(SidebarItem, { ...ROW, "data-slot": "column-upgrade", icon: _jsx(XStack, { width: 20, height: 20, items: "center", justify: "center", shrink: 0, children: _jsx(Sparkles, { size: 16, "aria-hidden": true, color: "var(--primary)" }) }), onPress: () => window.location.assign(payUrl('/cart', { returnUrl: window.location.href })), ...keys(() => window.location.assign(payUrl('/cart', { returnUrl: window.location.href }))), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('Upgrade plan') }) }) }) })) : null, foot] }), drawer ? null : (_jsx(Gutter, { side: dir === 'rtl' ? 'right' : 'left', span: span.span, floor: FLOOR, ceil: CEIL, reset: WIDTH, onSpan: span.move, onKeep: span.keep, onShut: onShut, label: t('Resize sidebar') }))] }));
131
131
  }
package/dist/Setup.d.ts CHANGED
@@ -2,4 +2,7 @@ export declare const LATER_KEY = "hanzo.onboarding.later";
2
2
  export declare const GITHUB_KEY = "hanzo.onboarding.github";
3
3
  export declare const SLACK_KEY = "hanzo.onboarding.slack";
4
4
  export declare const STEP_KEY = "hanzo.onboarding.step";
5
- export declare function Setup(): import("react").JSX.Element;
5
+ export declare const PLUGIN_KEY = "hanzo.onboarding.plugin";
6
+ export declare function Setup({ go }?: {
7
+ go?: (address: string) => void;
8
+ }): import("react").JSX.Element;
package/dist/Setup.js CHANGED
@@ -1,40 +1,57 @@
1
1
  'use client';
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- // The 1-2-3 in-app onboarding: Connect GitHub, Connect Slack, Connect Google Workspace.
3
+ // The 1-2-3 in-app onboarding: Connect GitHub, Connect Slack, Connect a plugin.
4
4
  // Runs INSIDE the app as a compact card in the sidebar column and as an interactive
5
5
  // popup modal dialog. Never a full-screen redirect away from the user's workspace.
6
6
  //
7
7
  // 1. GitHub: Sync repositories, PRs, and team repository context
8
8
  // 2. Slack: Route notifications, agent conversations, and bot alerts
9
- // 3. Google: Connect Google Drive, Docs, Sheets, Gmail & Calendar across one or many Google accounts (personal, work, multiple orgs)
9
+ // 3. Plugin: Give agents tools — a plugin the org builds or an MCP server it adds,
10
+ // both in Dev's Customize, the one home of plugins and connectors.
11
+ // Done once the org has one: GET /v1/tool/plugins/authored or
12
+ // GET /v1/tool/mcp/servers answers a row (the lists Customize reads).
13
+ //
14
+ // Google Workspace is the private beta `workspace` (lib/betas): its connect is
15
+ // drawn only for a reader `opens('workspace')` lets in, staff included, because
16
+ // Google has not verified the app's Drive and Gmail scopes and every other
17
+ // reader would meet Google's unverified-app screen.
10
18
  import { useEffect, useState } from 'react';
11
19
  import { useI18n } from '@hanzo/i18n/react';
12
20
  import { Box, Dialog, DialogContent, DialogTitle, SizableText, Text, XStack, YStack } from '@hanzo/ui';
13
21
  import { useIam } from '@hanzo/iam/react';
14
- import { Check, Maximize2, Plus, Sparkles, X } from 'lucide-react';
22
+ import { Check, Maximize2, Plug, Plus, Sparkles, X } from 'lucide-react';
15
23
  import { ProviderMark } from './ProviderMark.js';
24
+ import { useBetas } from './Betas.js';
25
+ import { useRooms } from './host.js';
16
26
  import { useKept } from './kept.js';
17
27
  import { api } from './lib/api.js';
28
+ import { app } from './lib/host.js';
18
29
  import { scope } from './lib/session.js';
19
30
  import { enter } from './lib/destination.js';
20
- import { brand } from './where.js';
31
+ import { brand, site } from './where.js';
21
32
  import { GOOGLE_ACCOUNTS_KEY, GOOGLE_KEY, accounts, connect, drop, keep } from './lib/gmail.js';
22
33
  import { GOOD } from './lib/mix.js';
23
34
  export const LATER_KEY = 'hanzo.onboarding.later';
24
35
  export const GITHUB_KEY = 'hanzo.onboarding.github';
25
36
  export const SLACK_KEY = 'hanzo.onboarding.slack';
26
37
  export const STEP_KEY = 'hanzo.onboarding.step';
38
+ export const PLUGIN_KEY = 'hanzo.onboarding.plugin';
39
+ /** Where plugins and connectors live: Dev's Customize. */
40
+ const PLUGINS = '-/customize/plugins';
27
41
  /** Inline Slack Mark */
28
42
  function SlackMark({ size = 18 }) {
29
43
  return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 54 54", fill: "none", "aria-hidden": true, children: [_jsx("path", { d: "M11.379 33.9993C11.379 37.1358 8.84512 39.6507 5.7276 39.6507C2.61008 39.6507 0.0572205 37.1168 0.0572205 33.9993C0.0572205 30.8817 2.5911 28.3479 5.70862 28.3479H11.36V33.9993H11.379Z", fill: "#E01E5A" }), _jsx("path", { d: "M14.1962 33.9997C14.1962 30.8632 16.7301 28.3483 19.8476 28.3483C22.9651 28.3483 25.499 30.8822 25.499 33.9997V48.1353C25.499 51.2718 22.9651 53.7867 19.8476 53.7867C16.7301 53.7867 14.1962 51.2718 14.1962 48.1353V33.9997Z", fill: "#E01E5A" }), _jsx("path", { d: "M19.8662 11.2673C16.7296 11.2673 14.2148 8.73347 14.2148 5.61594C14.2148 2.49842 16.7486 -0.0354538 19.8662 -0.0354538C22.9837 -0.0354538 25.5175 2.49842 25.5175 5.61594V11.2673H19.8662Z", fill: "#36C5F0" }), _jsx("path", { d: "M19.8682 14.1334C23.0047 14.1334 25.5196 16.6673 25.5196 19.7848C25.5196 22.9023 22.9857 25.4362 19.8682 25.4362H5.67566C2.53916 25.4362 0.0242615 22.9023 0.0242615 19.7848C0.0242615 16.6673 2.55814 14.1334 5.67566 14.1334H19.8682Z", fill: "#36C5F0" }), _jsx("path", { d: "M42.5323 19.7853C42.5323 16.6488 45.0662 14.1339 48.1837 14.1339C51.3012 14.1339 53.8351 16.6678 53.8351 19.7853C53.8351 22.9028 51.3012 25.4367 48.1837 25.4367H42.5323V19.7853Z", fill: "#2EB67D" }), _jsx("path", { d: "M39.7126 19.7934C39.7126 22.9299 37.1787 25.4448 34.0612 25.4448C30.9436 25.4448 28.4098 22.911 28.4098 19.7934V5.61986C28.4098 2.48336 30.9436 -0.0315399 34.0612 -0.0315399C37.1787 -0.0315399 39.7126 2.48336 39.7126 5.61986V19.7934Z", fill: "#2EB67D" }), _jsx("path", { d: "M34.0376 42.482C37.1741 42.482 39.689 45.0158 39.689 48.1334C39.689 51.2509 37.1552 53.7848 34.0376 53.7848C30.9201 53.7848 28.3862 51.2509 28.3862 48.1334V42.482H34.0376Z", fill: "#ECB22E" }), _jsx("path", { d: "M34.0381 39.6507C30.9016 39.6507 28.3867 37.1168 28.3867 33.9993C28.3867 30.8818 30.9206 28.3479 34.0381 28.3479H48.2306C51.3671 28.3479 53.882 30.8818 53.882 33.9993C53.882 37.1168 51.3482 39.6507 48.2306 39.6507H34.0381Z", fill: "#ECB22E" })] }));
30
44
  }
31
- export function Setup() {
45
+ export function Setup({ go } = {}) {
32
46
  const { t } = useI18n();
33
47
  const { isAuthenticated, accessToken } = useIam();
48
+ const { open: opens } = useBetas();
49
+ const pathed = useRooms().path !== null;
34
50
  const [later, setLater] = useKept(LATER_KEY, false);
35
51
  const [step, setStep] = useKept(STEP_KEY, 1);
36
52
  const [githubDone, setGithubDone] = useKept(GITHUB_KEY, false);
37
53
  const [slackDone, setSlackDone] = useKept(SLACK_KEY, false);
54
+ const [pluginDone, setPluginDone] = useKept(PLUGIN_KEY, false);
38
55
  const [googleDone, setGoogleDone] = useKept(GOOGLE_KEY, false);
39
56
  const [googleAccounts, setGoogleAccounts] = useKept(GOOGLE_ACCOUNTS_KEY, []);
40
57
  const [busy, setBusy] = useState(null);
@@ -44,6 +61,10 @@ export function Setup() {
44
61
  const signed = isAuthenticated && Boolean(accessToken);
45
62
  const accountList = Array.isArray(googleAccounts) ? googleAccounts : [];
46
63
  const hasGoogle = googleDone || accountList.length > 0;
64
+ // Google Workspace is a private beta until Google verifies its scopes.
65
+ const workspace = opens('workspace');
66
+ // Customize's plugins, inside the app where the host reads the path, else Dev on the site.
67
+ const openPlugins = () => (pathed && go ? go(app(PLUGINS)) : window.location.assign(site(app(PLUGINS))));
47
68
  // The token itself is lib/gmail's to keep; Setup lists the addresses.
48
69
  const addGoogleAccount = (rawEmail, tokenData) => {
49
70
  if (tokenData?.accessToken)
@@ -74,9 +95,20 @@ export function Setup() {
74
95
  fetch(`${api()}/v1/integrations/connectors`, { headers: auth })
75
96
  .then((r) => (r.ok ? r.json() : null))
76
97
  .catch(() => null),
77
- ]).then(([integrationsData, connectorsData]) => {
98
+ fetch(`${api()}/v1/tool/plugins/authored`, { headers: auth })
99
+ .then((r) => (r.ok ? r.json() : null))
100
+ .catch(() => null),
101
+ fetch(`${api()}/v1/tool/mcp/servers`, { headers: auth })
102
+ .then((r) => (r.ok ? r.json() : null))
103
+ .catch(() => null),
104
+ ]).then(([integrationsData, connectorsData, pluginsData, serversData]) => {
78
105
  if (!live)
79
106
  return;
107
+ // A plugin the org built, or an MCP server it added: Customize's own lists.
108
+ const built = Array.isArray(pluginsData?.plugins) ? pluginsData.plugins.length : 0;
109
+ const added = Array.isArray(serversData?.servers) ? serversData.servers.length : 0;
110
+ if (built + added > 0)
111
+ setPluginDone(true);
80
112
  const providers = Array.isArray(integrationsData?.providers)
81
113
  ? integrationsData.providers
82
114
  : null;
@@ -162,7 +194,7 @@ export function Setup() {
162
194
  window.removeEventListener('focus', onFocus);
163
195
  };
164
196
  }, [signed, googleAccounts]);
165
- const totalDone = (githubDone ? 1 : 0) + (slackDone ? 1 : 0) + (hasGoogle ? 1 : 0);
197
+ const totalDone = (githubDone ? 1 : 0) + (slackDone ? 1 : 0) + (pluginDone ? 1 : 0);
166
198
  const allDone = totalDone === 3;
167
199
  const activeStep = step === 1 || step === 2 || step === 3 ? step : 1;
168
200
  if (later && !modalOpen)
@@ -248,19 +280,19 @@ export function Setup() {
248
280
  setSlackDone(true);
249
281
  setStep(3);
250
282
  });
251
- // 3. Connect Google Workspace (Drive, Docs, Sheets, Gmail & Calendar; supports multiple accounts)
283
+ // Google Workspace, the private beta (Drive, Docs, Sheets, Gmail & Calendar; one or many accounts)
252
284
  const handleConnectGoogle = () => connectOAuthProvider('google', 'Google', () => {
253
285
  setGoogleDone(true);
254
286
  });
255
- return (_jsxs(_Fragment, { children: [_jsxs(YStack, { "data-slot": "setup", role: "region", "aria-label": t('Onboarding (1-2-3)'), gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$raised", width: "100%", overflow: "hidden", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$1.5", minW: 0, flex: 1, children: [_jsx(Sparkles, { size: 15, color: "var(--primary)", "aria-hidden": true }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: allDone ? t('Onboarding complete') : t('Quick setup ({n}/3)', { n: totalDone }) })] }), _jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Box, { render: "button", "aria-label": t('Expand onboarding popup'), onClick: () => setModalOpen(true), p: "$1", rounded: 999, hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Maximize2, { size: 13, "aria-hidden": true, color: "$soft" }) }), _jsx(Box, { render: "button", "aria-label": t('Dismiss'), onClick: () => setLater(true), p: "$1", rounded: 999, hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(X, { size: 13, "aria-hidden": true, color: "$soft" }) })] })] }), _jsxs(XStack, { gap: "$1", width: "100%", children: [_jsx(Box, { render: "button", "aria-label": t('Step 1: Connect GitHub'), onClick: () => setStep(1), flex: 1, height: 6, rounded: 3, bg: githubDone ? GOOD : activeStep === 1 ? '$ink' : '$edge', cursor: "pointer" }), _jsx(Box, { render: "button", "aria-label": t('Step 2: Connect Slack'), onClick: () => setStep(2), flex: 1, height: 6, rounded: 3, bg: slackDone ? GOOD : activeStep === 2 ? '$ink' : '$edge', cursor: "pointer" }), _jsx(Box, { render: "button", "aria-label": t('Step 3: Connect Google'), onClick: () => setStep(3), flex: 1, height: 6, rounded: 3, bg: hasGoogle ? GOOD : activeStep === 3 ? '$ink' : '$edge', cursor: "pointer" })] }), allDone ? (_jsxs(YStack, { gap: "$2", pt: "$1", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Check, { size: 16, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", color: "$ink", fontWeight: "500", children: t('GitHub, Slack & Google connected') })] }), accountList.length > 0 ? (_jsx(XStack, { gap: "$1", flexWrap: "wrap", children: accountList.map((acct) => (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: "$2", bg: "$edge", children: [_jsx(Text, { fontSize: "$1", color: "$ink", numberOfLines: 1, children: acct }), _jsx(Box, { render: "button", "aria-label": t('Remove {account}', { account: acct }), onClick: () => removeGoogleAccount(acct), cursor: "pointer", children: _jsx(X, { size: 11, color: "$soft", "aria-hidden": true }) })] }, acct))) })) : null, _jsxs(XStack, { gap: "$1.5", items: "center", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: handleConnectGoogle, px: "$2.5", py: "$1", rounded: "$3", bg: "$edge", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(Plus, { size: 12, color: "$ink", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: "$ink", children: t('Add Google account') })] }) }), _jsx(Box, { render: "button", onClick: () => setLater(true), px: "$2.5", py: "$1", rounded: "$3", bg: "$edge", hoverStyle: { bg: '$hover' }, items: "center", justify: "center", cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "500", children: t('Done') }) })] })] })) : activeStep === 1 ? (_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(ProviderMark, { org: "github", size: 18 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('1. Connect GitHub') })] }), githubDone ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Sync repositories, PRs, and team repository context.') }), _jsxs(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: handleConnectGithub, "aria-disabled": busy === 'github', px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", opacity: busy === 'github' ? 0.6 : 1, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'github' ? t('Connecting…') : githubDone ? t('Reconnect') : t('Connect GitHub') }) }), _jsx(Box, { render: "button", onClick: () => setStep(2), px: "$2", py: "$1", rounded: "$3", bg: "transparent", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Skip') }) })] })] })) : activeStep === 2 ? (_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(SlackMark, { size: 18 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('2. Connect Slack') })] }), slackDone ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Route agent notifications and chat in team channels.') }), _jsxs(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: handleConnectSlack, "aria-disabled": busy === 'slack', px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", opacity: busy === 'slack' ? 0.6 : 1, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'slack' ? t('Connecting…') : slackDone ? t('Reconnect') : t('Connect Slack') }) }), _jsx(Box, { render: "button", onClick: () => setStep(3), px: "$2", py: "$1", rounded: "$3", bg: "transparent", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Skip') }) })] })] })) : (_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(ProviderMark, { org: "google", size: 18 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('3. Connect Google') })] }), hasGoogle ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: accountList.length > 1
256
- ? t('{n} connected', { n: accountList.length })
257
- : t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Let Hanzo send the invites and messages you approve from your Gmail. Add personal, work, or several accounts.') }), accountList.length > 0 ? (_jsx(XStack, { gap: "$1", flexWrap: "wrap", children: accountList.map((acct) => (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: "$2", bg: "$edge", children: [_jsx(Text, { fontSize: "$1", color: "$ink", numberOfLines: 1, children: acct }), _jsx(Box, { render: "button", "aria-label": t('Remove {account}', { account: acct }), onClick: () => removeGoogleAccount(acct), cursor: "pointer", children: _jsx(X, { size: 11, color: "$soft", "aria-hidden": true }) })] }, acct))) })) : null, _jsxs(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: handleConnectGoogle, "aria-disabled": busy === 'google', px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", opacity: busy === 'google' ? 0.6 : 1, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'google'
258
- ? t('Connecting…')
259
- : hasGoogle
260
- ? t('+ Add Google account')
261
- : t('Connect Google') }) }), _jsx(Box, { render: "button", onClick: () => setLater(true), px: "$2", py: "$1", rounded: "$3", bg: "transparent", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: hasGoogle ? t('Done') : t('Skip') }) })] })] })), errorMsg ? (_jsx(Text, { fontSize: "$1", color: "$red10", children: errorMsg })) : null] }), _jsx(Dialog, { open: modalOpen, onOpenChange: setModalOpen, children: _jsxs(DialogContent, { maxW: 520, rounded: "$6", gap: "$4", p: "$5", children: [_jsx(DialogTitle, { children: _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Sparkles, { size: 20, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$5", fontWeight: "600", color: "$ink", children: t('Set up {brand} in 3 steps', { brand: brand() }) })] }) }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Connect your code, team chat, and Gmail across personal and business orgs.', { brand: brand() }) }), _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: githubDone ? GOOD : '$borderColor', bg: "$raised", items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(ProviderMark, { org: "github", size: 24 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('1. GitHub') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Sync repositories, PRs, and code context') })] })] }), githubDone ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 14, color: GOOD }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : (_jsx(Box, { render: "button", onClick: handleConnectGithub, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'github' ? t('Connecting…') : t('Connect') }) }))] }), _jsxs(XStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: slackDone ? GOOD : '$borderColor', bg: "$raised", items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(SlackMark, { size: 24 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('2. Slack') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Notifications and agent bot chat in channels') })] })] }), slackDone ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 14, color: GOOD }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : (_jsx(Box, { render: "button", onClick: handleConnectSlack, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'slack' ? t('Connecting…') : t('Connect') }) }))] }), _jsxs(YStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: hasGoogle ? GOOD : '$borderColor', bg: "$raised", gap: "$2.5", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(ProviderMark, { org: "google", size: 24 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('3. Gmail') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Send the invites and messages you approve, from your own address') })] })] }), _jsx(Box, { render: "button", onClick: handleConnectGoogle, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'google'
287
+ return (_jsxs(_Fragment, { children: [_jsxs(YStack, { "data-slot": "setup", role: "region", "aria-label": t('Onboarding (1-2-3)'), gap: "$2.5", p: "$3", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$raised", width: "100%", overflow: "hidden", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$1.5", minW: 0, flex: 1, children: [_jsx(Sparkles, { size: 15, color: "var(--primary)", "aria-hidden": true }), _jsx(SizableText, { size: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: allDone ? t('Onboarding complete') : t('Quick setup ({n}/3)', { n: totalDone }) })] }), _jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Box, { render: "button", "aria-label": t('Expand onboarding popup'), onClick: () => setModalOpen(true), p: "$1", rounded: 999, hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Maximize2, { size: 13, "aria-hidden": true, color: "$soft" }) }), _jsx(Box, { render: "button", "aria-label": t('Dismiss'), onClick: () => setLater(true), p: "$1", rounded: 999, hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(X, { size: 13, "aria-hidden": true, color: "$soft" }) })] })] }), _jsxs(XStack, { gap: "$1", width: "100%", children: [_jsx(Box, { render: "button", "aria-label": t('Step 1: Connect GitHub'), onClick: () => setStep(1), flex: 1, height: 6, rounded: 3, bg: githubDone ? GOOD : activeStep === 1 ? '$ink' : '$edge', cursor: "pointer" }), _jsx(Box, { render: "button", "aria-label": t('Step 2: Connect Slack'), onClick: () => setStep(2), flex: 1, height: 6, rounded: 3, bg: slackDone ? GOOD : activeStep === 2 ? '$ink' : '$edge', cursor: "pointer" }), _jsx(Box, { render: "button", "aria-label": t('Step 3: Connect a plugin'), onClick: () => setStep(3), flex: 1, height: 6, rounded: 3, bg: pluginDone ? GOOD : activeStep === 3 ? '$ink' : '$edge', cursor: "pointer" })] }), allDone ? (_jsxs(YStack, { gap: "$2", pt: "$1", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Check, { size: 16, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$2", color: "$ink", fontWeight: "500", children: t('GitHub, Slack & a plugin connected') })] }), workspace && accountList.length > 0 ? (_jsx(XStack, { gap: "$1", flexWrap: "wrap", children: accountList.map((acct) => (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: "$2", bg: "$edge", children: [_jsx(Text, { fontSize: "$1", color: "$ink", numberOfLines: 1, children: acct }), _jsx(Box, { render: "button", "aria-label": t('Remove {account}', { account: acct }), onClick: () => removeGoogleAccount(acct), cursor: "pointer", children: _jsx(X, { size: 11, color: "$soft", "aria-hidden": true }) })] }, acct))) })) : null, _jsxs(XStack, { gap: "$1.5", items: "center", flexWrap: "wrap", children: [workspace ? (_jsx(Box, { render: "button", onClick: handleConnectGoogle, px: "$2.5", py: "$1", rounded: "$3", bg: "$edge", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsxs(XStack, { items: "center", gap: "$1", children: [_jsx(Plus, { size: 12, color: "$ink", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "500", color: "$ink", children: t('Add Google account') })] }) })) : null, _jsx(Box, { render: "button", onClick: () => setLater(true), px: "$2.5", py: "$1", rounded: "$3", bg: "$edge", hoverStyle: { bg: '$hover' }, items: "center", justify: "center", cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "500", children: t('Done') }) })] })] })) : activeStep === 1 ? (_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(ProviderMark, { org: "github", size: 18 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('1. Connect GitHub') })] }), githubDone ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Sync repositories, PRs, and team repository context.') }), _jsxs(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: handleConnectGithub, "aria-disabled": busy === 'github', px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", opacity: busy === 'github' ? 0.6 : 1, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'github' ? t('Connecting…') : githubDone ? t('Reconnect') : t('Connect GitHub') }) }), _jsx(Box, { render: "button", onClick: () => setStep(2), px: "$2", py: "$1", rounded: "$3", bg: "transparent", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Skip') }) })] })] })) : activeStep === 2 ? (_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(SlackMark, { size: 18 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('2. Connect Slack') })] }), slackDone ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Route agent notifications and chat in team channels.') }), _jsxs(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: handleConnectSlack, "aria-disabled": busy === 'slack', px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", opacity: busy === 'slack' ? 0.6 : 1, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'slack' ? t('Connecting…') : slackDone ? t('Reconnect') : t('Connect Slack') }) }), _jsx(Box, { render: "button", onClick: () => setStep(3), px: "$2", py: "$1", rounded: "$3", bg: "transparent", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Skip') }) })] })] })) : (_jsxs(YStack, { gap: "$2", minW: 0, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(Plug, { size: 18, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('3. Connect a plugin') })] }), pluginDone ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Give your agents tools: build a plugin or add an MCP server in Customize.') }), _jsxs(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: [_jsx(Box, { render: "button", onClick: openPlugins, px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: pluginDone ? t('Open plugins') : t('Connect a plugin') }) }), _jsx(Box, { render: "button", onClick: () => setLater(true), px: "$2", py: "$1", rounded: "$3", bg: "transparent", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$1", color: "$soft", children: pluginDone ? t('Done') : t('Skip') }) })] }), workspace ? (_jsxs(YStack, { gap: "$2", minW: 0, pt: "$2", borderTopWidth: 1, borderColor: "$borderColor", "data-slot": "setup-workspace", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$1.5", flexWrap: "wrap", minW: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", minW: 0, flex: 1, children: [_jsx(ProviderMark, { org: "google", size: 18 }), _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t('Google Workspace') })] }), hasGoogle ? (_jsxs(XStack, { items: "center", gap: "$1", shrink: 0, children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: accountList.length > 1
288
+ ? t('{n} connected', { n: accountList.length })
289
+ : t('Connected') })] })) : null] }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Grant Drive, Docs, Sheets, Gmail & Calendar permissions. Add personal, work, or multiple org accounts.') }), accountList.length > 0 ? (_jsx(XStack, { gap: "$1", flexWrap: "wrap", children: accountList.map((acct) => (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: "$2", bg: "$edge", children: [_jsx(Text, { fontSize: "$1", color: "$ink", numberOfLines: 1, children: acct }), _jsx(Box, { render: "button", "aria-label": t('Remove {account}', { account: acct }), onClick: () => removeGoogleAccount(acct), cursor: "pointer", children: _jsx(X, { size: 11, color: "$soft", "aria-hidden": true }) })] }, acct))) })) : null, _jsx(XStack, { gap: "$1.5", items: "center", pt: "$1", flexWrap: "wrap", children: _jsx(Box, { render: "button", onClick: handleConnectGoogle, "aria-disabled": busy === 'google', px: "$2.5", py: "$1", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", opacity: busy === 'google' ? 0.6 : 1, children: _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'google'
290
+ ? t('Connecting…')
291
+ : hasGoogle
292
+ ? t('+ Add Google account')
293
+ : t('Connect Google') }) }) })] })) : null] })), errorMsg ? (_jsx(Text, { fontSize: "$1", color: "$red10", children: errorMsg })) : null] }), _jsx(Dialog, { open: modalOpen, onOpenChange: setModalOpen, children: _jsxs(DialogContent, { maxW: 520, rounded: "$6", gap: "$4", p: "$5", children: [_jsx(DialogTitle, { children: _jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(Sparkles, { size: 20, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$5", fontWeight: "600", color: "$ink", children: t('Set up {brand} in 3 steps', { brand: brand() }) })] }) }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Connect your code, your team chat, and the tools your agents use.', { brand: brand() }) }), _jsxs(YStack, { gap: "$3", children: [_jsxs(XStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: githubDone ? GOOD : '$borderColor', bg: "$raised", items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(ProviderMark, { org: "github", size: 24 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('1. GitHub') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Sync repositories, PRs, and code context') })] })] }), githubDone ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 14, color: GOOD }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : (_jsx(Box, { render: "button", onClick: handleConnectGithub, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'github' ? t('Connecting…') : t('Connect') }) }))] }), _jsxs(XStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: slackDone ? GOOD : '$borderColor', bg: "$raised", items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(SlackMark, { size: 24 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('2. Slack') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Notifications and agent bot chat in channels') })] })] }), slackDone ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 14, color: GOOD }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : (_jsx(Box, { render: "button", onClick: handleConnectSlack, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'slack' ? t('Connecting…') : t('Connect') }) }))] }), _jsxs(XStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: pluginDone ? GOOD : '$borderColor', bg: "$raised", items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(Plug, { size: 24, color: "var(--foreground)", "aria-hidden": true }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('3. Plugins') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Plugins and MCP servers your agents can call') })] })] }), pluginDone ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 14, color: GOOD }), _jsx(Text, { fontSize: "$1", color: GOOD, fontWeight: "600", children: t('Connected') })] })) : (_jsx(Box, { render: "button", onClick: openPlugins, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: t('Open') }) }))] }), workspace ? (_jsxs(YStack, { p: "$3", rounded: "$4", borderWidth: 1, borderColor: hasGoogle ? GOOD : '$borderColor', bg: "$raised", gap: "$2.5", children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: "$3", children: [_jsxs(XStack, { items: "center", gap: "$3", flex: 1, children: [_jsx(ProviderMark, { org: "google", size: 24 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", children: t('Google Workspace · private beta') }), _jsx(Text, { fontSize: "$1", color: "$soft", children: t('Edit Drive files, Docs, Sheets, Gmail & Calendar across personal and business accounts') })] })] }), _jsx(Box, { render: "button", onClick: handleConnectGoogle, px: "$3", py: "$1.5", rounded: "$3", bg: "var(--accent)", hoverStyle: { bg: 'var(--accent-hover)' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "var(--accent-foreground)", children: busy === 'google'
262
294
  ? t('Connecting…')
263
295
  : hasGoogle
264
296
  ? t('+ Add account')
265
- : t('Connect') }) })] }), accountList.length > 0 ? (_jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: accountList.map((acct) => (_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$ink", fontWeight: "500", children: acct }), _jsx(Box, { render: "button", "aria-label": t('Remove {account}', { account: acct }), onClick: () => removeGoogleAccount(acct), cursor: "pointer", children: _jsx(X, { size: 12, color: "$soft", "aria-hidden": true }) })] }, acct))) })) : null] })] }), _jsx(XStack, { justify: "flex-end", pt: "$2", children: _jsx(Box, { render: "button", onClick: () => setModalOpen(false), px: "$4", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "500", color: "$ink", children: t('Close') }) }) })] }) })] }));
297
+ : t('Connect') }) })] }), accountList.length > 0 ? (_jsx(XStack, { gap: "$1.5", flexWrap: "wrap", children: accountList.map((acct) => (_jsxs(XStack, { items: "center", gap: "$1.5", px: "$2.5", py: "$1", rounded: "$2", bg: "$hover", children: [_jsx(Check, { size: 12, color: GOOD, "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$ink", fontWeight: "500", children: acct }), _jsx(Box, { render: "button", "aria-label": t('Remove {account}', { account: acct }), onClick: () => removeGoogleAccount(acct), cursor: "pointer", children: _jsx(X, { size: 12, color: "$soft", "aria-hidden": true }) })] }, acct))) })) : null] })) : null] }), _jsx(XStack, { justify: "flex-end", pt: "$2", children: _jsx(Box, { render: "button", onClick: () => setModalOpen(false), px: "$4", py: "$2", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$hover' }, cursor: "pointer", children: _jsx(Text, { fontSize: "$2", fontWeight: "500", color: "$ink", children: t('Close') }) }) })] }) })] }));
266
298
  }
package/dist/lib/betas.js CHANGED
@@ -47,6 +47,7 @@ export const BETAS = [
47
47
  { id: 'search', name: 'Search', line: phrase('Keyword and meaning in one query'), group: 'Data', href: `${PLATFORM}/search` },
48
48
  { id: 'world', name: 'World', line: phrase('A live map of every model and AI workload'), group: 'Data', href: 'https://world.hanzo.ai' },
49
49
  { id: 'crawl', name: 'Crawl', line: phrase('Turn a website into clean Markdown'), group: 'Data', href: `${PLATFORM}/crawl` },
50
+ { id: 'workspace', name: 'Google Workspace', line: phrase('Drive, Docs, Sheets, Gmail and Calendar for the assistant, read and write'), group: 'Data' },
50
51
  { id: 'operative', name: 'Operative', line: phrase('A desktop in a container, driven by a model'), group: 'Agents' },
51
52
  { id: 'tasks', name: 'Tasks', line: phrase('Durable execution for long-running work'), group: 'Agents', href: `${PLATFORM}/tasks` },
52
53
  { id: 'functions', name: 'Functions', line: phrase('Serverless functions, no servers to run'), group: 'Build & run', href: `${PLATFORM}/functions` },
@@ -20,11 +20,12 @@ export declare const GOOGLE_ACCOUNTS_KEY = "hanzo.onboarding.google.accounts";
20
20
  export declare const GOOGLE_TOKENS_KEY = "hanzo.onboarding.google.tokens";
21
21
  export declare const DEFAULT_GOOGLE_CLIENT_ID = "113591532635-s8pvqrebprkbndluhftddmdap4htvu1p.apps.googleusercontent.com";
22
22
  /**
23
- * What the Google connect asks for: who the person is, and sending mail they
24
- * wrote or approved (gmail.send). Nothing that reads a mailbox, a drive or a
25
- * calendar: no feature here uses one, and Google verifies an app for the scopes
26
- * it asks, each shown in use. A feature that needs more asks for it when it is
27
- * used (`include_granted_scopes`).
23
+ * What the Google connect asks for: who the person is, and the Workspace the
24
+ * assistant works in for them — Drive, Docs, Sheets, Gmail and Calendar, read
25
+ * and write — so it can study, ingest and create documents across their
26
+ * business and act on the tasks they hand it. Full Drive and gmail.modify are
27
+ * restricted scopes: Google verifies each in use and requires a security
28
+ * assessment for them.
28
29
  */
29
30
  export declare const GOOGLE_WORKSPACE_SCOPES: string;
30
31
  /** The connected addresses, as Setup lists them. */
package/dist/lib/gmail.js CHANGED
@@ -24,13 +24,23 @@ export const GOOGLE_ACCOUNTS_KEY = 'hanzo.onboarding.google.accounts';
24
24
  export const GOOGLE_TOKENS_KEY = 'hanzo.onboarding.google.tokens';
25
25
  export const DEFAULT_GOOGLE_CLIENT_ID = '113591532635-s8pvqrebprkbndluhftddmdap4htvu1p.apps.googleusercontent.com';
26
26
  /**
27
- * What the Google connect asks for: who the person is, and sending mail they
28
- * wrote or approved (gmail.send). Nothing that reads a mailbox, a drive or a
29
- * calendar: no feature here uses one, and Google verifies an app for the scopes
30
- * it asks, each shown in use. A feature that needs more asks for it when it is
31
- * used (`include_granted_scopes`).
27
+ * What the Google connect asks for: who the person is, and the Workspace the
28
+ * assistant works in for them — Drive, Docs, Sheets, Gmail and Calendar, read
29
+ * and write — so it can study, ingest and create documents across their
30
+ * business and act on the tasks they hand it. Full Drive and gmail.modify are
31
+ * restricted scopes: Google verifies each in use and requires a security
32
+ * assessment for them.
32
33
  */
33
- export const GOOGLE_WORKSPACE_SCOPES = ['openid', 'email', 'profile', 'https://www.googleapis.com/auth/gmail.send'].join(' ');
34
+ export const GOOGLE_WORKSPACE_SCOPES = [
35
+ 'openid',
36
+ 'email',
37
+ 'profile',
38
+ 'https://www.googleapis.com/auth/drive',
39
+ 'https://www.googleapis.com/auth/documents',
40
+ 'https://www.googleapis.com/auth/spreadsheets',
41
+ 'https://www.googleapis.com/auth/gmail.modify',
42
+ 'https://www.googleapis.com/auth/calendar',
43
+ ].join(' ');
34
44
  /** Google's own lifetime for a browser token, for one kept before `expiresAt` was. */
35
45
  const LIFE = 3600_000;
36
46
  /** A token this close to its end is treated as ended: a send must not race it. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",