@hanzo/app 0.2.31 → 0.2.33

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/Chat.js CHANGED
@@ -75,7 +75,7 @@ import { first } from './lib/first.js';
75
75
  import { BAD } from "./lib/mix.js";
76
76
  import { brand } from './where.js';
77
77
  import { ThinkingEffort } from './ThinkingEffort.js';
78
- import { useChatPreferences } from './lib/chatPreferences.js';
78
+ import { shared, useChatPreferences } from './lib/chatPreferences.js';
79
79
  // NO REASONING PANEL HERE. Every assistant turn opened a "Thinking" disclosure
80
80
  // listing seven steps — "Planning CSS extraction for chat styles", "Designing
81
81
  // responsive top bar grid layout" — typed into this file as a literal array.
@@ -511,17 +511,10 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
511
511
  const { limits, notice, reload: reread } = useLimits(!anonymous, org(), (id) => nameOf(id, catalog.current));
512
512
  const mind = useMind(target, anonymous ? "free" : limits?.plan);
513
513
  catalog.current = mind.models;
514
+ // Chat's effort is its own (ThinkingEffort, sent as `reasoning_effort`); a
515
+ // pick of one Dev offers too moves Dev's, where it is made, and opening Chat
516
+ // never resets Dev's.
514
517
  const [chatPrefs, setChatPrefs] = useChatPreferences();
515
- useEffect(() => {
516
- const eff = chatPrefs.effort || "high";
517
- if (eff === "low" || eff === "medium" || eff === "high") {
518
- mind.pace(eff);
519
- }
520
- else if (eff === "xhigh" || eff === "max") {
521
- mind.pace("high");
522
- }
523
- // eslint-disable-next-line react-hooks/exhaustive-deps
524
- }, [chatPrefs.effort]);
525
518
  const ai = useAi();
526
519
  // In the app's frame the composer floats on the pane as a pane of its own.
527
520
  const framed = useContext(Framed);
@@ -1460,8 +1453,9 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
1460
1453
  at: anonymous ? undefined : carry.plugins,
1461
1454
  // Auto vs Manual approval lives in Settings rather than floating under the composer.
1462
1455
  mode: null,
1463
- // The model, the effort and the mode under the frame (@hanzo/build).
1464
- mind,
1456
+ // The model under the frame (@hanzo/build) only where Settings' model
1457
+ // selector is on; the effort is ThinkingEffort, beside send.
1458
+ model: chatPrefs.showModelSelector ? mind : null,
1465
1459
  limits,
1466
1460
  onUpgrade: (id) => setAsk({ model: nameOf(id, listed) }),
1467
1461
  voice,
@@ -1591,19 +1585,15 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
1591
1585
  column: { maxW: MEASURE }, composer: (() => {
1592
1586
  const basePrompt = prompt({
1593
1587
  ...composing,
1594
- mind: chatPrefs.showModelSelector ? mind : null,
1595
1588
  field: mention.field,
1596
1589
  }, mention.state);
1597
1590
  return {
1598
1591
  ...basePrompt,
1599
1592
  send: (_jsxs(XStack, { items: "center", gap: "$1.5", shrink: 0, children: [chatPrefs.showTurboApproval ? (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", py: "$1", rounded: 999, borderWidth: 1, borderColor: "$borderColor", bg: "$background", "aria-label": t("Turbo Approval: {mode}", { mode: chatPrefs.approvalMode }), children: [_jsx(Zap, { size: 12, color: "var(--primary)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: chatPrefs.approvalMode === "manual" ? t("Manual") : t("Turbo") })] })) : null, _jsx(ThinkingEffort, { effort: chatPrefs.effort || 'high', onChange: (eff) => {
1600
1593
  setChatPrefs({ effort: eff });
1601
- if (eff === 'low' || eff === 'medium' || eff === 'high') {
1602
- mind.pace(eff);
1603
- }
1604
- else if (eff === 'xhigh' || eff === 'max') {
1605
- mind.pace('high');
1606
- }
1594
+ const next = shared(eff);
1595
+ if (next)
1596
+ mind.pace(next);
1607
1597
  }, disabled: chat.streaming || talk.open }), basePrompt.send] })),
1608
1598
  };
1609
1599
  })() }), _jsx(AgentMaker, {}), carry.dialog, _jsx(Upgrade, { ask: ask, onClose: () => setAsk(null) })] }));
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
  }
@@ -6,7 +6,7 @@ import { useMemo, useState } from 'react';
6
6
  import { phrase } from '@hanzo/i18n';
7
7
  import { useI18n } from '@hanzo/i18n/react';
8
8
  import { ArrowUpRight, Check, ExternalLink, Lock, Sparkles } from 'lucide-react';
9
- import { useChatPreferences } from './lib/chatPreferences.js';
9
+ import { shared, useChatPreferences } from './lib/chatPreferences.js';
10
10
  import { EFFORT_STEPS } from './ThinkingEffort.js';
11
11
  import { Box, Button, Input, Separator, Text, XStack, YStack, } from '@hanzo/ui';
12
12
  import { tap } from './lib/tap.js';
@@ -90,9 +90,9 @@ function Model() {
90
90
  const active = (chatPrefs.effort || 'high') === step.id;
91
91
  return (_jsx(Box, { render: _jsx("button", { type: "button" }), ...tap, onClick: () => {
92
92
  setChatPrefs({ effort: step.id });
93
- if (step.id === 'low' || step.id === 'medium' || step.id === 'high') {
94
- choose({ effort: step.id });
95
- }
93
+ const next = shared(step.id);
94
+ if (next)
95
+ choose({ effort: next });
96
96
  }, ...CHOICE, bg: active ? 'var(--edge, var(--white-14))' : 'transparent', borderColor: active ? 'var(--borderColor, var(--white-22))' : 'var(--white-08)', py: 6, px: 12, children: _jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(Text, { fontSize: "$2", fontWeight: active ? '600' : '400', color: active ? '$ink' : '$soft', children: step.label }), active ? _jsx(Check, { size: 12, color: "var(--primary)", "aria-hidden": true }) : null] }) }, step.id));
97
97
  }) })] }), _jsx(Separator, {}), _jsxs(YStack, { gap: "$2", "data-slot": "settings-approval-mode", children: [_jsx(Text, { fontSize: "$4", fontWeight: "600", color: "$ink", children: t('Tool & action approval') }), _jsx(Text, { fontSize: "$2", color: "$soft", children: t('Choose whether agents run tools and connectors automatically or ask for manual approval before each action.') }), _jsx(XStack, { gap: "$2", pt: "$1", children: [
98
98
  { id: 'auto', label: t('Auto'), desc: t('Runs tools on its own; pauses only for anything risky.') },
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('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, _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 Google Workspace (Drive, Docs, Sheets, Gmail & Calendar) 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. Google Workspace (Drive, Docs, Sheets, Gmail & Calendar)') }), _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'
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/dev.js CHANGED
@@ -41,6 +41,7 @@ import { CAST } from './agents.js';
41
41
  import { app, place, settings, visit } from './lib/host.js';
42
42
  import { link } from './lib/tags.js';
43
43
  import { payUrl } from './lib/pay.js';
44
+ import { useChatPreferences } from './lib/chatPreferences.js';
44
45
  /** Where the builder links out: every one of them an address of this site. */
45
46
  const LINKS = {
46
47
  github: app('-/sync'),
@@ -80,6 +81,7 @@ export function useDevHost() {
80
81
  const { router, path: pathname } = useRooms();
81
82
  const here = path(route(at(pathname)));
82
83
  const look = useLook();
84
+ const [prefs] = useChatPreferences();
83
85
  // The token's claims change only when the token does: a sign-in, a refresh.
84
86
  const memberships = useMemo(() => orgs(), [accessToken]); // eslint-disable-line react-hooks/exhaustive-deps
85
87
  const scoped = useMemo(() => org(), [accessToken]); // eslint-disable-line react-hooks/exhaustive-deps
@@ -111,6 +113,8 @@ export function useDevHost() {
111
113
  links: LINKS,
112
114
  // The sidebar lists Settings' sections and Customize's tabs (Column.tsx), and Customize › Agents offers the cast.
113
115
  sections: true,
116
+ // The model is named, and its picker offered, only where Settings' model selector is on (as in Chat).
117
+ models: prefs.showModelSelector,
114
118
  cast: CAST,
115
119
  // An address of the app moves the app, another of this site moves in the
116
120
  // router, and another origin is left in this tab. platform.hanzo.ai is
@@ -134,5 +138,5 @@ export function useDevHost() {
134
138
  },
135
139
  signIn: () => enter(),
136
140
  signOut: () => void logout(),
137
- }), [scoped, memberships, look.pref.theme, look.set, name, email, avatar, here, router, logout]);
141
+ }), [scoped, memberships, look.pref.theme, look.set, prefs.showModelSelector, name, email, avatar, here, router, logout]);
138
142
  }
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` },
@@ -1,3 +1,4 @@
1
+ import { type Effort } from '@hanzo/build/mind';
1
2
  import { type EffortLevel } from '../ThinkingEffort.js';
2
3
  export type ApprovalMode = 'auto' | 'manual';
3
4
  export interface ChatPreferences {
@@ -9,6 +10,8 @@ export interface ChatPreferences {
9
10
  showTurboApproval?: boolean;
10
11
  effortVersion?: number;
11
12
  }
13
+ /** The effort Dev takes for one chosen here (@hanzo/build `EFFORTS`: Auto, High, XHigh, Max), or null for Low and Medium, which only Chat offers. */
14
+ export declare function shared(effort: EffortLevel): Effort | null;
12
15
  export declare function getChatPreferences(): ChatPreferences;
13
16
  export declare function setChatPreferences(patch: Partial<ChatPreferences>): ChatPreferences;
14
17
  export declare function useChatPreferences(): [ChatPreferences, (patch: Partial<ChatPreferences>) => void];
@@ -5,6 +5,7 @@
5
5
  * - approvalMode: whether tools/actions run automatically ('auto') or ask for confirmation first ('manual') (default: 'auto')
6
6
  */
7
7
  import { useEffect, useState } from 'react';
8
+ import { EFFORTS } from '@hanzo/build/mind';
8
9
  import { DEFAULT_EFFORT, EFFORT_STEPS } from '../ThinkingEffort.js';
9
10
  const STORAGE_KEY = 'hanzo.chat.preferences';
10
11
  const AUTONOMY_KEY = 'hanzo.agent.autonomy';
@@ -19,6 +20,10 @@ const DEFAULT_PREFERENCES = {
19
20
  showTurboApproval: false,
20
21
  effortVersion: EFFORT_SCHEMA_VERSION,
21
22
  };
23
+ /** The effort Dev takes for one chosen here (@hanzo/build `EFFORTS`: Auto, High, XHigh, Max), or null for Low and Medium, which only Chat offers. */
24
+ export function shared(effort) {
25
+ return EFFORTS.some((e) => e.id === effort) ? effort : null;
26
+ }
22
27
  function validEffort(v) {
23
28
  return EFFORT_STEPS.some((s) => s.id === v) ? v : DEFAULT_EFFORT;
24
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.2.31",
3
+ "version": "0.2.33",
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",
@@ -51,7 +51,7 @@
51
51
  "peerDependencies": {
52
52
  "@hanzo/ai": ">=0.6.23",
53
53
  "@hanzo/appearance": ">=0.2.6",
54
- "@hanzo/build": ">=0.2.81",
54
+ "@hanzo/build": ">=0.2.83",
55
55
  "@hanzo/composer": ">=0.2.0",
56
56
  "@hanzo/event": ">=0.3.56",
57
57
  "@hanzo/gui": "^8.3.5",
@@ -71,7 +71,7 @@
71
71
  "devDependencies": {
72
72
  "@hanzo/ai": "0.6.23",
73
73
  "@hanzo/appearance": "0.2.8",
74
- "@hanzo/build": "0.2.81",
74
+ "@hanzo/build": "0.2.83",
75
75
  "@hanzo/composer": "0.2.0",
76
76
  "@hanzo/design": "0.5.34",
77
77
  "@hanzo/event": "0.3.56",