@hanzo/app 0.3.94 → 0.3.96

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.
Files changed (110) hide show
  1. package/dist/Account.d.ts +9 -3
  2. package/dist/Account.js +142 -141
  3. package/dist/App.js +71 -37
  4. package/dist/Bar.js +1 -1
  5. package/dist/Betas.d.ts +1 -1
  6. package/dist/Betas.js +16 -22
  7. package/dist/Board.js +114 -48
  8. package/dist/CalScheduler.d.ts +1 -0
  9. package/dist/CalScheduler.js +223 -57
  10. package/dist/Chat.js +432 -153
  11. package/dist/Contacts.js +35 -31
  12. package/dist/ContextMenu.js +126 -42
  13. package/dist/Directory.js +1 -1
  14. package/dist/Drawer.js +1 -1
  15. package/dist/Drive.js +351 -119
  16. package/dist/Gate.js +156 -13
  17. package/dist/Home.js +31 -53
  18. package/dist/Inbox.js +29 -15
  19. package/dist/InlineRename.d.ts +6 -0
  20. package/dist/InlineRename.js +41 -0
  21. package/dist/Learning.js +132 -13
  22. package/dist/Market.js +13 -9
  23. package/dist/Meet.d.ts +5 -0
  24. package/dist/Meet.js +75 -51
  25. package/dist/MoreMenu.d.ts +19 -0
  26. package/dist/MoreMenu.js +33 -0
  27. package/dist/NeedMoreUsage.js +2 -2
  28. package/dist/OrgSwitcher.js +6 -2
  29. package/dist/PreferencesDialog.js +5 -2
  30. package/dist/Rail.d.ts +73 -7
  31. package/dist/Rail.js +372 -111
  32. package/dist/Recents.js +77 -24
  33. package/dist/RightPane.js +2 -2
  34. package/dist/Search.d.ts +13 -1
  35. package/dist/Search.js +366 -50
  36. package/dist/Setup.js +34 -5
  37. package/dist/Shared.js +12 -12
  38. package/dist/Shell.d.ts +10 -0
  39. package/dist/Shell.js +258 -158
  40. package/dist/Sidebar.d.ts +14 -3
  41. package/dist/Sidebar.js +411 -129
  42. package/dist/SkipLink.d.ts +8 -0
  43. package/dist/SkipLink.js +11 -0
  44. package/dist/Start.js +51 -52
  45. package/dist/Terminals.js +159 -11
  46. package/dist/ToBottom.js +1 -1
  47. package/dist/Upgrade.d.ts +8 -3
  48. package/dist/Upgrade.js +194 -103
  49. package/dist/Usage.d.ts +1 -1
  50. package/dist/Usage.js +186 -82
  51. package/dist/WalletPill.js +8 -2
  52. package/dist/Work.js +162 -53
  53. package/dist/archive.d.ts +8 -0
  54. package/dist/archive.js +16 -0
  55. package/dist/bots/Bots.js +16 -1
  56. package/dist/bots/ComputerDialog.js +53 -26
  57. package/dist/bots/ConnectorsDialog.js +34 -15
  58. package/dist/bots/Make.js +5 -1
  59. package/dist/bots/Panel.js +37 -31
  60. package/dist/bots/Roster.d.ts +4 -1
  61. package/dist/bots/Roster.js +71 -25
  62. package/dist/bots/Thread.js +54 -27
  63. package/dist/bots/face.js +9 -3
  64. package/dist/bots/grid.d.ts +36 -0
  65. package/dist/bots/grid.js +91 -0
  66. package/dist/bots/ink.d.ts +1 -1
  67. package/dist/bots/ink.js +1 -1
  68. package/dist/bots/kit.d.ts +9 -4
  69. package/dist/bots/kit.js +3 -2
  70. package/dist/chord.d.ts +13 -0
  71. package/dist/chord.js +30 -1
  72. package/dist/crew.js +47 -4
  73. package/dist/ground.d.ts +2 -2
  74. package/dist/ground.js +3 -3
  75. package/dist/help.d.ts +7 -3
  76. package/dist/help.js +19 -14
  77. package/dist/keys.d.ts +28 -0
  78. package/dist/keys.js +58 -0
  79. package/dist/lib/arrival.d.ts +5 -0
  80. package/dist/lib/arrival.js +10 -0
  81. package/dist/lib/betas.d.ts +2 -0
  82. package/dist/lib/betas.js +10 -0
  83. package/dist/lib/branch.d.ts +11 -0
  84. package/dist/lib/branch.js +11 -0
  85. package/dist/lib/chatPreferences.d.ts +1 -1
  86. package/dist/lib/chatPreferences.js +1 -1
  87. package/dist/lib/dev-mode.d.ts +18 -0
  88. package/dist/lib/dev-mode.js +102 -0
  89. package/dist/lib/durable.d.ts +1 -1
  90. package/dist/lib/durable.js +1 -1
  91. package/dist/lib/info-hint.d.ts +7 -0
  92. package/dist/lib/info-hint.js +8 -0
  93. package/dist/lib/model-picker.d.ts +2 -0
  94. package/dist/lib/model-picker.js +12 -0
  95. package/dist/lib/owners.d.ts +5 -0
  96. package/dist/lib/owners.js +15 -0
  97. package/dist/lib/pay.d.ts +2 -0
  98. package/dist/lib/pay.js +4 -0
  99. package/dist/lib/todo.d.ts +7 -1
  100. package/dist/lib/todo.js +41 -29
  101. package/dist/look.js +39 -8
  102. package/dist/rail-open.d.ts +9 -0
  103. package/dist/rail-open.js +34 -0
  104. package/dist/renaming.d.ts +10 -0
  105. package/dist/renaming.js +25 -0
  106. package/dist/seek.d.ts +6 -1
  107. package/dist/seek.js +13 -0
  108. package/dist/thread.d.ts +2 -1
  109. package/dist/thread.js +85 -44
  110. package/package.json +11 -11
@@ -10,21 +10,15 @@ import { useCallback, useEffect, useRef, useState } from 'react';
10
10
  import { useI18n } from '@hanzo/i18n/react';
11
11
  import { Input, Text, XStack, YStack } from '@hanzo/gui';
12
12
  import { Dialog, DialogContent, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@hanzo/ui';
13
- import { Camera, ClipboardPaste, ExternalLink, Eye, KeyRound, Maximize2, Minimize2, Monitor, MousePointerClick, Pause, Play, RefreshCw, Send, Sparkles, Terminal, } from 'lucide-react';
13
+ import { Camera, ClipboardPaste, ExternalLink, Eye, KeyRound, Maximize2, Minimize2, Monitor, MousePointerClick, Pause, Play, RefreshCw, Send, Sparkles, Terminal, X, } from 'lucide-react';
14
14
  import { useAi } from '../lib/ai.js';
15
15
  import { say } from '../failure.js';
16
16
  import { called } from '../team.js';
17
17
  import { VaultDialog, readVault } from '../vault.js';
18
18
  import { actComputer, bootOrResumeComputer, disk, findBotComputer, grant, opened, parkComputer, runDesktopAgent, updateBotMeta, } from './api.js';
19
- import { CLIP, PILL, WORD } from './kit.js';
20
- import { DIM } from './ink.js';
21
- // Always-dark translucent surfaces inside the pure-black desktop window chrome,
22
- // invariant across light and dark page themes.
23
- const FLOOR = 'var(--white-05)';
24
- const RAISED = 'var(--white-08)';
25
- const PICKED = 'var(--white-16)';
26
- const LINE = 'var(--white-15)';
27
- const INK = 'var(--pure-white)';
19
+ import { CLIP, PILL, ROUND, WORD } from './kit.js';
20
+ import { DIM, EDGE, FLOOR, GROUND, INK, LINE, PICKED, RAISED } from './ink.js';
21
+ import { useDevMode } from '../lib/dev-mode.js';
28
22
  function PulsingCluster({ label }) {
29
23
  const [step, setStep] = useState(0);
30
24
  useEffect(() => {
@@ -34,11 +28,12 @@ function PulsingCluster({ label }) {
34
28
  return (_jsxs(YStack, { items: "center", justify: "center", gap: 18, "aria-live": "polite", children: [_jsx(XStack, { items: "center", justify: "center", gap: 6, height: 20, children: [0, 1, 2].map((i) => {
35
29
  const active = step === i;
36
30
  const mid = i === 1;
37
- return (_jsx(YStack, { width: mid ? 7 : 4, height: mid ? 7 : 4, rounded: 999, bg: "var(--pure-white)", opacity: active ? 1 : 0.35 }, i));
38
- }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "var(--pure-white)", opacity: 0.58, children: label })] }));
31
+ return (_jsx(YStack, { width: mid ? 7 : 4, height: mid ? 7 : 4, rounded: 999, bg: INK, opacity: active ? 1 : 0.3 }, i));
32
+ }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: DIM, children: label })] }));
39
33
  }
40
34
  export function ComputerDialog({ open, onOpenChange, bot, box, onUpdated, }) {
41
35
  const { t } = useI18n();
36
+ const [devMode] = useDevMode();
42
37
  const { client } = useAi();
43
38
  const displayName = called(bot.name);
44
39
  const iframeRef = useRef(null);
@@ -260,8 +255,12 @@ export function ComputerDialog({ open, onOpenChange, bot, box, onUpdated, }) {
260
255
  }
261
256
  setStatusToast(out.text ||
262
257
  (field === 'totp'
263
- ? t('Typed 6-digit 2FA code for {name} via KMS.', { name: item.name })
264
- : t('Autofilled {name} via zero-knowledge KMS.', { name: item.name })));
258
+ ? devMode
259
+ ? t('Typed 6-digit 2FA code for {name} via KMS.', { name: item.name })
260
+ : t('Entered 6-digit verification code for {name}.', { name: item.name })
261
+ : devMode
262
+ ? t('Autofilled {name} via zero-knowledge KMS.', { name: item.name })
263
+ : t('Filled login for {name}.', { name: item.name })));
265
264
  }
266
265
  catch (e) {
267
266
  setError(say(e, t('credential autofill'), 'save', t));
@@ -282,11 +281,17 @@ export function ComputerDialog({ open, onOpenChange, bot, box, onUpdated, }) {
282
281
  action: 'save_credential',
283
282
  });
284
283
  if (out.ok === false) {
285
- setError(out.text || t('No staged credential found at /dev/shm/.hanzo-credential.json.'));
284
+ setError(out.text ||
285
+ (devMode
286
+ ? t('No staged credential found at /dev/shm/.hanzo-credential.json.')
287
+ : t('No staged app login found to save.')));
286
288
  return;
287
289
  }
288
290
  await refreshVault();
289
- setStatusToast(out.text || t('Sealed sandbox app credential into Hanzo KMS and shredded RAM file.'));
291
+ setStatusToast(out.text ||
292
+ (devMode
293
+ ? t('Sealed sandbox app credential into Hanzo KMS and shredded RAM file.')
294
+ : t('Saved login to your vault.')));
290
295
  }
291
296
  catch (e) {
292
297
  setError(say(e, t('sandbox credential save'), 'save', t));
@@ -361,17 +366,31 @@ export function ComputerDialog({ open, onOpenChange, bot, box, onUpdated, }) {
361
366
  setRunningTask(false);
362
367
  }
363
368
  };
369
+ useEffect(() => {
370
+ if (!open || vaultOpen)
371
+ return;
372
+ const onKey = (e) => {
373
+ if (e.key === 'Escape') {
374
+ e.preventDefault();
375
+ onOpenChange(false);
376
+ }
377
+ };
378
+ window.addEventListener('keydown', onKey);
379
+ return () => window.removeEventListener('keydown', onKey);
380
+ }, [open, vaultOpen, onOpenChange]);
364
381
  const logins = vaultItems.filter((i) => i.kind === 'login');
365
382
  const otherSecrets = vaultItems.filter((i) => i.kind !== 'login');
366
383
  const showBottomBar = phase === 'connecting' || phase === 'live' || awake;
367
- return (_jsxs(_Fragment, { children: [_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { "data-parity-key": "bots.computer.dialog", width: expanded ? '98vw' : '95vw', maxW: expanded ? 1480 : 1140, p: 0, showCloseButton: false, bg: "var(--pure-black)", borderWidth: 1, borderColor: LINE, rounded: 18, overflow: "hidden", children: _jsxs(YStack, { height: expanded ? '94vh' : '86vh', maxH: "95vh", bg: "var(--pure-black)", children: [_jsxs(XStack, { height: 44, px: 16, items: "center", justify: "space-between", gap: 12, shrink: 0, children: [_jsxs(XStack, { items: "center", gap: 12, minW: 0, children: [_jsxs(XStack, { items: "center", gap: 8, shrink: 0, children: [_jsx(YStack, { render: "button", type: 'button', "aria-label": t('Close computer window'), onClick: () => onOpenChange(false), width: 12, height: 12, rounded: 999, bg: "var(--chrome-dot-red)", borderWidth: 0, p: 0, cursor: "pointer" }), _jsx(YStack, { render: "button", type: 'button', "aria-label": t('Park desktop computer'), onClick: () => (awake ? void handlePark() : onOpenChange(false)), width: 12, height: 12, rounded: 999, bg: "var(--chrome-dot-yellow)", borderWidth: 0, p: 0, cursor: "pointer" }), _jsx(YStack, { render: "button", type: 'button', "aria-label": expanded ? t('Exit fullscreen size') : t('Expand computer window'), onClick: () => setExpanded((v) => !v), width: 12, height: 12, rounded: 999, bg: "var(--chrome-dot-green)", borderWidth: 0, p: 0, cursor: "pointer" })] }), _jsx(DialogTitle, { children: _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 16, fontWeight: "500", color: "var(--pure-white)", opacity: 0.55, children: awake
368
- ? `${displayName} · ${activeBox?.id ?? disk(bot.name)}`
384
+ return (_jsxs(_Fragment, { children: [_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { "data-parity-key": "bots.computer.dialog", width: "calc(100vw - 24px)", maxW: expanded ? 1480 : 1140, "$max-sm": { width: 'calc(100vw - 24px)', maxW: 'calc(100vw - 24px)', rounded: 14 }, p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: EDGE, rounded: 18, overflow: "hidden", children: _jsxs(YStack, { height: expanded ? '92vh' : '86vh', maxH: "94vh", bg: GROUND, minW: 0, children: [_jsxs(XStack, { minH: 46, px: 14, py: 6, "$max-sm": { px: 10, py: 8, gap: 8 }, items: "center", justify: "space-between", flexWrap: "wrap", gap: 10, borderBottomWidth: 1, borderColor: LINE, bg: FLOOR, shrink: 0, children: [_jsxs(XStack, { items: "center", gap: 10, minW: 0, flex: 1, children: [_jsx(YStack, { width: 8, height: 8, rounded: 999, shrink: 0, bg: awake ? 'var(--state-online)' : DIM, opacity: awake ? 1 : 0.45, "aria-hidden": true }), _jsx(DialogTitle, { children: _jsx(Text, { ...CLIP, fontSize: "$2", lineHeight: 18, fontWeight: "500", color: INK, children: awake
385
+ ? devMode
386
+ ? `${displayName} · ${activeBox?.id ?? disk(bot.name)}`
387
+ : `${displayName} · ${t('Cloud desktop')}`
369
388
  : phase === 'parked'
370
- ? `${displayName} · ${t('Parked (resumable)')}`
371
- : `${displayName} · ${t('Desktop')}` }) })] }), _jsxs(XStack, { items: "center", gap: 6, children: [awake && activeBox?.id ? (_jsxs(_Fragment, { children: [_jsxs(XStack, { render: "button", type: 'button', "aria-label": mode === 'screen' ? t('Switch to Terminal') : t('Switch to Desktop GUI'), onClick: () => {
389
+ ? `${displayName} · ${t('Paused')}`
390
+ : `${displayName} · ${t('Cloud desktop')}` }) })] }), _jsxs(XStack, { items: "center", gap: 6, flexWrap: "wrap", shrink: 0, children: [awake && activeBox?.id ? (_jsxs(_Fragment, { children: [devMode || mode === 'terminal' ? (_jsxs(XStack, { render: "button", type: 'button', "aria-label": mode === 'screen' ? t('Switch to terminal') : t('Switch to desktop'), onClick: () => {
372
391
  setSnapDataUrl(null);
373
392
  setMode((m) => (m === 'screen' ? 'terminal' : 'screen'));
374
- }, height: 26, px: 9, gap: 5, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [mode === 'screen' ? (_jsx(Terminal, { size: 12, color: "var(--pure-white)", "aria-hidden": true })) : (_jsx(Monitor, { size: 12, color: "var(--pure-white)", "aria-hidden": true })), _jsx(Text, { fontSize: 11, lineHeight: 15, color: "var(--pure-white)", opacity: 0.85, children: mode === 'screen' ? t('Terminal') : t('Desktop') })] }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Autofill login or secret'), height: 26, px: 9, gap: 5, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [_jsx(KeyRound, { size: 12, color: "var(--pure-white)", "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: "var(--pure-white)", opacity: 0.85, children: t('Autofill') })] }) }), _jsxs(DropdownMenuContent, { minW: 260, children: [logins.map((item) => (_jsx(DropdownMenuItem, { onSelect: () => void runAutofill(item, item.totpSecretKey ? 'login_totp' : 'login'), children: _jsxs(YStack, { gap: 1, children: [_jsx(Text, { fontSize: "$3", fontWeight: "500", color: "$ink", children: `${item.name}${item.domain ? ` (${item.domain})` : ''}` }), _jsx(Text, { fontSize: "$1", color: DIM, children: item.username
393
+ }, height: 28, "$max-sm": { minH: 44 }, px: 10, gap: 5, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: EDGE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [mode === 'screen' ? (_jsx(Terminal, { size: 12, color: INK, "aria-hidden": true })) : (_jsx(Monitor, { size: 12, color: INK, "aria-hidden": true })), _jsx(Text, { fontSize: "$1", lineHeight: 15, color: INK, children: mode === 'screen' ? t('Terminal') : t('Desktop') })] })) : null, _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Autofill login or secret'), height: 28, "$max-sm": { minH: 44 }, px: 10, gap: 5, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: EDGE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(KeyRound, { size: 12, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: INK, children: t('Autofill') })] }) }), _jsxs(DropdownMenuContent, { minW: 260, children: [logins.map((item) => (_jsx(DropdownMenuItem, { onSelect: () => void runAutofill(item, item.totpSecretKey ? 'login_totp' : 'login'), children: _jsxs(YStack, { gap: 1, children: [_jsx(Text, { fontSize: "$3", fontWeight: "500", color: "$ink", children: `${item.name}${item.domain ? ` (${item.domain})` : ''}` }), _jsx(Text, { fontSize: "$1", color: DIM, children: item.username
375
394
  ? item.totpSecretKey
376
395
  ? t('Fill {user} + password + 2FA via {src}', {
377
396
  user: item.username,
@@ -380,14 +399,22 @@ export function ComputerDialog({ open, onOpenChange, bot, box, onUpdated, }) {
380
399
  : t('Fill {user} + password via {src}', { user: item.username, src: item.source })
381
400
  : t('Fill password via {src}', { src: item.source }) })] }) }, item.id))), logins
382
401
  .filter((i) => Boolean(i.totpSecretKey))
383
- .map((item) => (_jsx(DropdownMenuItem, { onSelect: () => void runAutofill(item, 'totp'), children: _jsx(Text, { fontSize: "$2", color: "$ink", children: t('2FA TOTP code only · {name}', { name: item.name }) }) }, `${item.id}-totp`))), otherSecrets.slice(0, 5).map((item) => (_jsx(DropdownMenuItem, { onSelect: () => void runAutofill(item, 'secret'), children: _jsx(Text, { fontSize: "$2", color: "$ink", children: t('Type secret · {name}', { name: item.name }) }) }, item.id))), _jsx(DropdownMenuItem, { onSelect: () => void sealStagedAppCredential(), children: _jsxs(YStack, { gap: 1, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Seal staged sandbox app login → KMS') }), _jsx(Text, { fontSize: "$1", color: DIM, children: t('Imports /dev/shm/.hanzo-credential.json & shreds RAM file') })] }) }), _jsx(DropdownMenuItem, { onSelect: () => setVaultOpen(true), children: _jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: vaultItems.length === 0
384
- ? t('+ Add 1Password, LastPass, or KMS logins…')
385
- : t('Manage Vault & Password Managers…') }) })] })] }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Paste clipboard to desktop'), onClick: () => void pasteClipboardToDesktop(), width: 26, height: 26, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: RAISED }, children: _jsx(ClipboardPaste, { size: 13, color: "var(--pure-white)", opacity: 0.7, "aria-hidden": true }) }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Capture screenshot'), onClick: () => void captureScreenshot(), width: 26, height: 26, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: RAISED }, children: _jsx(Camera, { size: 13, color: "var(--pure-white)", opacity: 0.7, "aria-hidden": true }) }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Reconnect stream'), onClick: () => {
402
+ .map((item) => (_jsx(DropdownMenuItem, { onSelect: () => void runAutofill(item, 'totp'), children: _jsx(Text, { fontSize: "$2", color: "$ink", children: t('2FA TOTP code only · {name}', { name: item.name }) }) }, `${item.id}-totp`))), otherSecrets.slice(0, 5).map((item) => (_jsx(DropdownMenuItem, { onSelect: () => void runAutofill(item, 'secret'), children: _jsx(Text, { fontSize: "$2", color: "$ink", children: t('Type secret · {name}', { name: item.name }) }) }, item.id))), devMode ? (_jsx(DropdownMenuItem, { onSelect: () => void sealStagedAppCredential(), children: _jsxs(YStack, { gap: 1, children: [_jsx(Text, { fontFamily: "$body", fontSize: "$2", fontWeight: "600", color: "$ink", children: t('Seal staged sandbox app login → KMS') }), _jsx(Text, { fontFamily: "$body", fontSize: "$1", color: DIM, children: t('Imports /dev/shm/.hanzo-credential.json & shreds RAM file') })] }) })) : null, _jsx(DropdownMenuItem, { onSelect: () => setVaultOpen(true), children: _jsx(Text, { fontFamily: "$body", fontSize: "$2", fontWeight: "600", color: "$ink", children: vaultItems.length === 0
403
+ ? devMode
404
+ ? t('+ Add 1Password, LastPass, or KMS logins…')
405
+ : t('Add saved logins…')
406
+ : devMode
407
+ ? t('Manage vault & password managers…')
408
+ : t('Manage saved logins…') }) })] })] }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Paste clipboard to desktop'), onClick: () => void pasteClipboardToDesktop(), width: 28, height: 28, "$max-sm": { width: 44, height: 44 }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(ClipboardPaste, { size: 13, color: DIM, "aria-hidden": true }) }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Capture screenshot'), onClick: () => void captureScreenshot(), width: 28, height: 28, "$max-sm": { width: 44, height: 44 }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Camera, { size: 13, color: DIM, "aria-hidden": true }) }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Reconnect stream'), onClick: () => {
386
409
  setSnapDataUrl(null);
387
410
  void openStream(activeBox.id, mode, control === 'watching');
388
- }, width: 26, height: 26, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: RAISED }, children: _jsx(RefreshCw, { size: 13, color: "var(--pure-white)", opacity: 0.7, "aria-hidden": true }) }), frameUrl ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Open stream in new tab'), onClick: () => window.open(frameUrl, '_blank', 'noopener,noreferrer'), width: 26, height: 26, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: RAISED }, children: _jsx(ExternalLink, { size: 13, color: "var(--pure-white)", opacity: 0.7, "aria-hidden": true }) })) : null, _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Park desktop'), disabled: busy, onClick: () => void handlePark(), height: 26, px: 9, gap: 4, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [_jsx(Pause, { size: 11, color: "var(--pure-white)", "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: "var(--pure-white)", opacity: 0.85, children: t('Park') })] })] })) : null, _jsx(XStack, { render: "button", type: 'button', "aria-label": expanded ? t('Collapse window') : t('Expand window'), onClick: () => setExpanded((v) => !v), width: 28, height: 28, rounded: 8, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", hoverStyle: { bg: RAISED }, children: expanded ? (_jsx(Minimize2, { size: 14, color: "var(--pure-white)", opacity: 0.65, "aria-hidden": true })) : (_jsx(Maximize2, { size: 14, color: "var(--pure-white)", opacity: 0.65, "aria-hidden": true })) })] })] }), _jsx(YStack, { flex: 1, minH: 0, px: 10, pt: 4, pb: showBottomBar ? 0 : 12, items: "center", justify: "center", children: phase === 'starting' && !frameUrl ? (_jsx(YStack, { flex: 1, width: "100%", items: "center", justify: "center", children: _jsx(PulsingCluster, { label: t('Starting desktop') }) })) : phase === 'parked' || (!awake && !busy && !frameUrl) ? (_jsxs(YStack, { flex: 1, width: "100%", rounded: 12, borderWidth: 1, borderColor: LINE, bg: FLOOR, items: "center", justify: "center", gap: 14, px: 24, children: [_jsx(Text, { fontSize: 16, lineHeight: 22, fontWeight: "600", color: "var(--pure-white)", text: "center", children: phase === 'parked' ? t('Desktop is parked') : t('{name}’s resumable desktop', { name: displayName }) }), _jsx(Text, { fontSize: 13, lineHeight: 19, maxW: 440, color: "var(--pure-white)", opacity: 0.62, text: "center", children: t('Persistent home volume preserves open files, browser sessions, and tools across sleep/wake cycles.') }), error ? (_jsx(Text, { role: "alert", fontSize: 12, lineHeight: 17, color: "var(--pure-white)", opacity: 0.75, text: "center", children: error })) : null, _jsxs(XStack, { ...PILL, bg: "var(--pure-white)", borderColor: "var(--pure-white)", disabled: busy, onClick: () => void startOrResume(true), children: [_jsx(Play, { size: 13, color: "var(--pure-black)", "aria-hidden": true }), _jsx(Text, { ...WORD, color: "var(--pure-black)", children: phase === 'parked' ? t('Resume desktop') : t('Start desktop') })] })] })) : (_jsx(YStack, { flex: 1, width: "100%", rounded: 10, borderWidth: 1, borderColor: LINE, bg: FLOOR, overflow: "hidden", position: "relative", items: "center", justify: "center", children: snapDataUrl ? (_jsxs(YStack, { width: "100%", height: "100%", items: "center", justify: "center", position: "relative", children: [_jsx(YStack, { render: "img", src: snapDataUrl, alt: `${displayName} desktop screenshot`, maxW: "100%", maxH: "100%", objectFit: "contain" }), _jsx(XStack, { position: "absolute", t: 12, r: 12, children: _jsx(XStack, { ...PILL, height: 30, px: 12, bg: RAISED, borderColor: LINE, onClick: () => setSnapDataUrl(null), children: _jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: t('Back to live desktop') }) }) })] })) : frameUrl ? (_jsx(YStack, { ref: iframeRef, render: "iframe", src: frameUrl,
411
+ }, width: 28, height: 28, "$max-sm": { width: 44, height: 44 }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(RefreshCw, { size: 13, color: DIM, "aria-hidden": true }) }), frameUrl ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Open stream in new tab'), onClick: () => window.open(frameUrl, '_blank', 'noopener,noreferrer'), width: 28, height: 28, "$max-sm": { width: 44, height: 44 }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(ExternalLink, { size: 13, color: DIM, "aria-hidden": true }) })) : null, _jsxs(XStack, { render: "button", type: 'button', "aria-label": t('Park desktop'), disabled: busy, onClick: () => void handlePark(), height: 28, "$max-sm": { minH: 44 }, px: 10, gap: 4, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: EDGE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Pause, { size: 11, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 15, color: INK, children: t('Park') })] })] })) : null, _jsx(XStack, { render: "button", type: 'button', "aria-label": expanded ? t('Collapse window') : t('Expand window'), onClick: () => setExpanded((v) => !v), width: 28, height: 28, "$max-sm": { display: 'none' }, rounded: 999, items: "center", justify: "center", bg: "transparent", borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: expanded ? (_jsx(Minimize2, { size: 14, color: DIM, "aria-hidden": true })) : (_jsx(Maximize2, { size: 14, color: DIM, "aria-hidden": true })) }), _jsx(XStack, { ...ROUND, width: 30, height: 30, borderColor: EDGE, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Close computer window'), onClick: () => onOpenChange(false), children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })] })] }), _jsx(YStack, { flex: 1, minH: 0, px: 10, pt: 10, pb: showBottomBar ? 0 : 12, items: "center", justify: "center", children: phase === 'starting' && !frameUrl ? (_jsx(YStack, { flex: 1, width: "100%", items: "center", justify: "center", children: _jsx(PulsingCluster, { label: t('Starting desktop') }) })) : phase === 'parked' || (!awake && !busy && !frameUrl) ? (_jsxs(YStack, { flex: 1, width: "100%", rounded: 12, borderWidth: 1, borderColor: LINE, bg: FLOOR, items: "center", justify: "center", gap: 14, px: 24, children: [_jsx(Text, { fontSize: "$3", lineHeight: 22, fontWeight: "600", color: INK, text: "center", children: phase === 'parked' ? t('Desktop is paused') : t('{name}’s cloud desktop', { name: displayName }) }), _jsx(Text, { fontSize: "$2", lineHeight: 19, maxW: 440, color: DIM, text: "center", children: devMode
412
+ ? t('Persistent home volume preserves open files, browser sessions, and tools across sleep/wake cycles.')
413
+ : t('Keeps open files, browser tabs, and logins ready whenever you resume.') }), error ? (_jsx(Text, { role: "alert", fontSize: 12, lineHeight: 17, color: "var(--state-error)", text: "center", children: error })) : null, _jsxs(XStack, { ...PILL, bg: INK, borderColor: INK, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, disabled: busy, onClick: () => void startOrResume(true), children: [_jsx(Play, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, color: "var(--background)", children: phase === 'parked' ? t('Resume desktop') : t('Start desktop') })] })] })) : (_jsx(YStack, { flex: 1, width: "100%", rounded: 10, borderWidth: 1, borderColor: LINE, bg: FLOOR, overflow: "hidden", position: "relative", items: "center", justify: "center", children: snapDataUrl ? (_jsxs(YStack, { width: "100%", height: "100%", items: "center", justify: "center", position: "relative", children: [_jsx(YStack, { render: "img", src: snapDataUrl, alt: `${displayName} desktop screenshot`, maxW: "100%", maxH: "100%", objectFit: "contain" }), _jsx(XStack, { position: "absolute", t: 12, r: 12, children: _jsx(XStack, { ...PILL, height: 30, "$max-sm": { minH: 44 }, px: 12, bg: RAISED, borderColor: EDGE, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: () => setSnapDataUrl(null), children: _jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: t('Back to live desktop') }) }) })] })) : frameUrl ? (_jsx(YStack, { ref: iframeRef, render: "iframe", src: frameUrl,
389
414
  title: `${displayName} desktop ${mode}`,
390
- allow: 'clipboard-read; clipboard-write; fullscreen', width: "100%", height: "100%", borderWidth: 0 })) : (_jsx(PulsingCluster, { label: t('Connecting') })) })) }), promptOpen && awake ? (_jsx(YStack, { px: 16, pt: 10, gap: 8, children: _jsxs(XStack, { render: "form", onSubmit: (e) => void submitComputerTask(e), gap: 8, items: "center", children: [_jsx(Input, { unstyled: true, autoFocus: true, value: task, onChange: (e) => setTask(e.target.value), placeholder: t('Tell {name} what to do on this desktop (e.g., "Log in with my GitHub vault credentials and review open PRs")…', { name: displayName }), "aria-label": t('Co-work with {name} on desktop', { name: displayName }), flex: 1, height: 36, px: 14, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsxs(XStack, { ...PILL, type: 'submit', height: 36, px: 14, bg: "var(--pure-white)", borderColor: "var(--pure-white)", disabled: !task.trim() || runningTask, opacity: !task.trim() || runningTask ? 0.5 : 1, children: [_jsx(Send, { size: 12, color: "var(--pure-black)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 12, color: "var(--pure-black)", children: runningTask ? t('Working…') : t('Run on desktop') })] })] }) })) : null, showBottomBar ? (_jsxs(XStack, { height: 58, px: 16, items: "center", justify: "space-between", gap: 12, shrink: 0, children: [_jsx(XStack, { flex: 1, items: "center", gap: 8, minW: 0, children: error ? (_jsx(Text, { ...CLIP, role: "alert", fontSize: 12, lineHeight: 16, color: "var(--pure-white)", opacity: 0.75, children: error })) : statusToast ? (_jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 16, color: "var(--pure-white)", opacity: 0.68, children: statusToast })) : null }), _jsxs(XStack, { "data-parity-key": "bots.computer.control-pill", height: 38, pl: 14, pr: 5, gap: 12, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", gap: 7, children: [control === 'watching' ? (_jsx(Eye, { size: 14, color: "var(--pure-white)", opacity: 0.75, "aria-hidden": true })) : (_jsx(MousePointerClick, { size: 14, color: "var(--state-online)", "aria-hidden": true })), _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: "var(--pure-white)", opacity: 0.88, children: control === 'watching' ? t('Watching') : t('In control') })] }), control === 'watching' ? (_jsx(XStack, { render: "button", type: 'button', onClick: () => toggleControl('controlling'), height: 28, px: 13, rounded: 999, items: "center", justify: "center", bg: "var(--pure-white)", borderWidth: 0, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: "var(--pure-black)", children: t('Take control') }) })) : (_jsx(XStack, { render: "button", type: 'button', onClick: () => toggleControl('watching'), height: 28, px: 13, rounded: 999, items: "center", justify: "center", bg: PICKED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: "var(--pure-white)", children: t('Watch only') }) }))] }), _jsx(XStack, { flex: 1, items: "center", justify: "flex-end", gap: 8, children: awake ? (_jsxs(XStack, { render: "button", type: 'button', onClick: () => setPromptOpen((v) => !v), height: 30, px: 11, gap: 6, rounded: 999, items: "center", bg: promptOpen ? PICKED : 'transparent', borderWidth: 1, borderColor: promptOpen ? LINE : 'transparent', cursor: "pointer", hoverStyle: { bg: RAISED }, children: [_jsx(Sparkles, { size: 12, color: "var(--pure-white)", opacity: 0.78, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: "var(--pure-white)", opacity: 0.78, children: runningTask ? t('{name} working…', { name: displayName }) : t('Work with {name}', { name: displayName }) })] })) : null })] })) : null] }) }) }), _jsx(VaultDialog, { open: vaultOpen, onOpenChange: (next) => {
415
+ allow: 'clipboard-read; clipboard-write; fullscreen', width: "100%", height: "100%", borderWidth: 0 })) : (_jsx(PulsingCluster, { label: t('Connecting') })) })) }), promptOpen && awake ? (_jsx(YStack, { px: 14, "$max-sm": { px: 10 }, pt: 10, gap: 8, children: _jsxs(XStack, { render: "form", onSubmit: (e) => void submitComputerTask(e), gap: 8, items: "center", flexWrap: "wrap", children: [_jsx(Input, { unstyled: true, autoFocus: true, value: task, onChange: (e) => setTask(e.target.value), placeholder: devMode
416
+ ? t('Tell {name} what to do on this desktop (e.g., "Log in with my GitHub vault credentials and review open PRs")…', { name: displayName })
417
+ : t('Tell {name} what to do on this desktop…', { name: displayName }), "aria-label": t('Co-work with {name} on desktop', { name: displayName }), flex: 1, minW: 180, height: 36, "$max-sm": { minH: 44 }, px: 14, rounded: 999, bg: RAISED, borderWidth: 1, borderColor: EDGE, focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsxs(XStack, { ...PILL, type: 'submit', height: 36, "$max-sm": { minH: 44 }, px: 14, bg: INK, borderColor: INK, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, disabled: !task.trim() || runningTask, opacity: !task.trim() || runningTask ? 0.5 : 1, children: [_jsx(Send, { size: 12, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 12, color: "var(--background)", children: runningTask ? t('Working…') : t('Run on desktop') })] })] }) })) : null, showBottomBar ? (_jsxs(XStack, { minH: 58, px: 14, py: 8, "$max-sm": { px: 10, gap: 8, justify: 'center' }, items: "center", justify: "space-between", flexWrap: "wrap", gap: 10, shrink: 0, children: [_jsx(XStack, { flex: 1, items: "center", gap: 8, minW: 0, "$max-sm": { display: error || statusToast ? 'flex' : 'none', width: '100%', justify: 'center' }, children: error ? (_jsx(Text, { ...CLIP, role: "alert", fontSize: 12, lineHeight: 16, color: "var(--state-error)", children: error })) : statusToast ? (_jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 16, color: DIM, children: statusToast })) : null }), _jsxs(XStack, { "data-parity-key": "bots.computer.control-pill", height: 38, "$max-sm": { minH: 44 }, pl: 14, pr: 5, gap: 12, rounded: 999, items: "center", bg: RAISED, borderWidth: 1, borderColor: EDGE, children: [_jsxs(XStack, { items: "center", gap: 7, children: [control === 'watching' ? (_jsx(Eye, { size: 14, color: DIM, "aria-hidden": true })) : (_jsx(MousePointerClick, { size: 14, color: "var(--state-online)", "aria-hidden": true })), _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: "500", color: INK, children: control === 'watching' ? t('Watching') : t('In control') })] }), control === 'watching' ? (_jsx(XStack, { render: "button", type: 'button', onClick: () => toggleControl('controlling'), height: 28, "$max-sm": { minH: 36 }, px: 13, rounded: 999, items: "center", justify: "center", bg: INK, borderWidth: 0, cursor: "pointer", transition: "quickest", hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "600", color: "var(--background)", children: t('Take control') }) })) : (_jsx(XStack, { render: "button", type: 'button', onClick: () => toggleControl('watching'), height: 28, "$max-sm": { minH: 36 }, px: 13, rounded: 999, items: "center", justify: "center", bg: PICKED, borderWidth: 1, borderColor: EDGE, cursor: "pointer", transition: "quickest", hoverStyle: { bg: GROUND }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Watch only') }) }))] }), _jsx(XStack, { flex: 1, items: "center", justify: "flex-end", gap: 8, "$max-sm": { flex: 0, justify: 'center' }, children: awake ? (_jsxs(XStack, { render: "button", type: 'button', onClick: () => setPromptOpen((v) => !v), height: 30, "$max-sm": { minH: 44 }, px: 11, gap: 6, rounded: 999, items: "center", bg: promptOpen ? PICKED : 'transparent', borderWidth: 1, borderColor: promptOpen ? EDGE : 'transparent', cursor: "pointer", transition: "quickest", hoverStyle: { bg: RAISED, borderColor: EDGE }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Sparkles, { size: 12, color: DIM, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, color: INK, children: runningTask ? t('{name} working…', { name: displayName }) : t('Work with {name}', { name: displayName }) })] })) : null })] })) : null] }) }) }), _jsx(VaultDialog, { open: vaultOpen, onOpenChange: (next) => {
391
418
  setVaultOpen(next);
392
419
  if (!next)
393
420
  void refreshVault();
@@ -45,15 +45,15 @@ export const CONNECTOR_CATALOG = [
45
45
  ];
46
46
  const SECTIONS = [
47
47
  { id: 'popular', title: 'Popular' },
48
- { id: 'channels', title: 'Messaging & Social' },
49
- { id: 'business', title: 'Small Business' },
50
- { id: 'productivity', title: 'Productivity & Developer' },
48
+ { id: 'channels', title: 'Messaging & social' },
49
+ { id: 'business', title: 'Small business' },
50
+ { id: 'productivity', title: 'Productivity & developer' },
51
51
  ];
52
52
  const FILTERS = [
53
53
  { id: 'all', label: 'All' },
54
54
  { id: 'personal', label: 'Connected' },
55
- { id: 'channels', label: 'Messaging & Social' },
56
- { id: 'business', label: 'Small Business' },
55
+ { id: 'channels', label: 'Messaging & social' },
56
+ { id: 'business', label: 'Small business' },
57
57
  { id: 'productivity', label: 'Productivity' },
58
58
  ];
59
59
  function backendId(item) {
@@ -304,6 +304,22 @@ export function ConnectorsCatalog({ defaultFilter = 'all', embedded = false, onC
304
304
  setSyncingSlack(false);
305
305
  }
306
306
  };
307
+ useEffect(() => {
308
+ if (embedded)
309
+ return;
310
+ const onKey = (e) => {
311
+ if (e.key !== 'Escape')
312
+ return;
313
+ if (configuring) {
314
+ e.preventDefault();
315
+ setConfiguring(null);
316
+ return;
317
+ }
318
+ onClose?.();
319
+ };
320
+ window.addEventListener('keydown', onKey);
321
+ return () => window.removeEventListener('keydown', onKey);
322
+ }, [embedded, configuring, onClose]);
307
323
  const filtered = useMemo(() => {
308
324
  const q = query.trim().toLowerCase();
309
325
  return CONNECTOR_CATALOG.filter((item) => {
@@ -317,18 +333,21 @@ export function ConnectorsCatalog({ defaultFilter = 'all', embedded = false, onC
317
333
  return item.name.toLowerCase().includes(q) || item.description.toLowerCase().includes(q) || item.id.includes(q);
318
334
  });
319
335
  }, [filter, query, stateOf]);
320
- return (_jsxs(YStack, { flex: 1, minH: 0, bg: embedded ? 'transparent' : GROUND, children: [_jsxs(YStack, { px: embedded ? 0 : 28, pt: embedded ? 0 : 22, pb: 14, gap: 14, borderBottomWidth: 1, borderColor: LINE, bg: embedded ? 'transparent' : FLOOR, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 12, flexWrap: "wrap", children: [_jsx(YStack, { gap: 3, children: embedded ? (_jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('Sync Slack (@hanzo), GitHub, Linear, and MCP servers so your Primary Bot and groups act across your stack.') })) : (_jsxs(_Fragment, { children: [_jsx(DialogTitle, { children: _jsx(Text, { fontSize: 21, lineHeight: 27, fontWeight: "600", color: INK, children: t('Connectors & Channels') }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Add @hanzo to Slack, link repos, and connect tools across every bot and group.') })] })) }), _jsxs(XStack, { items: "center", gap: 8, children: [_jsxs(XStack, { height: 34, width: 220, px: 11, gap: 7, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: LINE, children: [_jsx(Search, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Input, { unstyled: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search connectors'), "aria-label": t('Search connectors'), flex: 1, minW: 0, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), query ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Clear search'), onClick: () => setQuery(''), bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })) : null] }), _jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Refresh connectors'), onClick: () => setTurn((n) => n + 1), children: _jsx(RefreshCw, { size: 14, color: DIM, "aria-hidden": true }) }), _jsxs(XStack, { ...PILL, render: "button", type: 'button', height: 34, px: 14, bg: INK, borderColor: INK, onClick: () => setConfiguring({
336
+ return (_jsxs(YStack, { flex: 1, minH: 0, minW: 0, bg: embedded ? 'transparent' : GROUND, children: [_jsxs(YStack, { px: embedded ? 0 : 28, pt: embedded ? 0 : 22, "$max-sm": { px: embedded ? 0 : 14, pt: embedded ? 0 : 14 }, pb: 14, gap: 14, borderBottomWidth: 1, borderColor: LINE, bg: embedded ? 'transparent' : FLOOR, children: [_jsxs(XStack, { items: "flex-start", justify: "space-between", gap: 12, flexWrap: "wrap", minW: 0, children: [_jsx(YStack, { gap: 3, flex: 1, minW: 200, children: embedded ? (_jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: t('Sync Slack (@hanzo), GitHub, Linear, and MCP servers so your primary bot and groups act across your stack.') })) : (_jsxs(_Fragment, { children: [_jsx(DialogTitle, { children: _jsx(Text, { fontSize: 21, lineHeight: 27, fontWeight: "600", color: INK, children: t('Connectors & channels') }) }), _jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, children: t('Add @hanzo to Slack, link repos, and connect tools across every bot and group.') })] })) }), _jsxs(XStack, { items: "center", gap: 8, flexWrap: "wrap", "$max-sm": { width: '100%' }, children: [_jsxs(XStack, { height: 34, width: 220, "$max-sm": { flex: 1, width: 'auto', minW: 140, minH: 44 }, px: 11, gap: 7, items: "center", rounded: 999, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", focusWithinStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(Search, { size: 14, color: DIM, "aria-hidden": true }), _jsx(Input, { unstyled: true, value: query, onChange: (e) => setQuery(e.target.value), placeholder: t('Search connectors'), "aria-label": t('Search connectors'), flex: 1, minW: 0, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), query ? (_jsx(XStack, { render: "button", type: 'button', "aria-label": t('Clear search'), onClick: () => setQuery(''), bg: "transparent", borderWidth: 0, p: 4, rounded: 999, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })) : null] }), _jsx(XStack, { ...ROUND, width: 34, height: 34, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Refresh connectors'), onClick: () => setTurn((n) => n + 1), children: _jsx(RefreshCw, { size: 14, color: DIM, "aria-hidden": true }) }), _jsxs(XStack, { ...PILL, render: "button", type: 'button', height: 34, "$max-sm": { minH: 44 }, px: 14, bg: INK, borderColor: INK, hoverStyle: { opacity: 0.9 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: () => setConfiguring({
321
337
  id: 'openai',
322
- name: t('API Key Credential'),
338
+ name: t('API key credential'),
323
339
  description: t('Store a verified provider API token in KMS'),
324
340
  section: 'productivity',
325
341
  filter: 'productivity',
326
- }), children: [_jsx(Plus, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Add token') })] }), onClose ? (_jsx(XStack, { ...ROUND, width: 34, height: 34, "aria-label": t('Close connectors'), onClick: onClose, children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })) : null] })] }), _jsx(XStack, { items: "center", gap: 6, flexWrap: "wrap", children: FILTERS.map((f) => {
342
+ }), children: [_jsx(Plus, { size: 13, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Add token') })] }), onClose ? (_jsx(XStack, { ...ROUND, width: 34, height: 34, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Close connectors'), onClick: onClose, children: _jsx(X, { size: 15, color: INK, "aria-hidden": true }) })) : null] })] }), _jsx(XStack, { items: "center", gap: 6, flexWrap: "wrap", children: FILTERS.map((f) => {
327
343
  const active = filter === f.id;
328
- return (_jsx(XStack, { render: "button", type: 'button', 'aria-pressed': active, onClick: () => setFilter(f.id), height: 30, px: 13, rounded: 999, items: "center", bg: active ? PICKED : 'transparent', borderWidth: 1, borderColor: active ? LINE : 'transparent', cursor: "pointer", hoverStyle: { bg: PICKED }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: active ? '500' : '400', color: active ? INK : DIM, children: t(f.label) }) }, f.id));
329
- }) })] }), configuring ? (_jsxs(YStack, { px: embedded ? 0 : 28, py: 14, gap: 10, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 10, children: [_jsxs(XStack, { items: "center", gap: 10, children: [_jsx(Mark, { item: configuring }), _jsxs(YStack, { children: [_jsx(Text, { fontSize: 14, lineHeight: 19, fontWeight: "600", color: INK, children: t('Connect {name}', { name: configuring.name }) }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Paste an API key or bot token for {name}. Verified live before sealing in KMS.', {
344
+ return (_jsx(XStack, { render: "button", type: 'button', 'aria-pressed': active, onClick: () => setFilter(f.id), height: 30, "$max-sm": { minH: 40 }, px: 13, rounded: 999, items: "center", bg: active ? PICKED : 'transparent', borderWidth: 1, borderColor: active ? 'var(--border-strong)' : 'transparent', cursor: "pointer", transition: "quickest", hoverStyle: { bg: PICKED, borderColor: 'var(--border-strong)' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 13, lineHeight: 18, fontWeight: active ? '500' : '400', color: active ? INK : DIM, children: t(f.label) }) }, f.id));
345
+ }) })] }), configuring ? (_jsxs(YStack, { px: embedded ? 0 : 28, "$max-sm": { px: embedded ? 0 : 14 }, py: 14, gap: 10, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, children: [_jsxs(XStack, { items: "center", justify: "space-between", gap: 10, children: [_jsxs(XStack, { items: "center", gap: 10, flex: 1, minW: 0, children: [_jsx(Mark, { item: configuring }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "600", color: INK, children: t('Connect {name}', { name: configuring.name }) }), _jsx(Text, { fontSize: 12, lineHeight: 17, color: DIM, children: t('Paste an API key or bot token for {name}. Verified live before sealing in KMS.', {
330
346
  name: configuring.name,
331
- }) })] })] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, "aria-label": t('Cancel'), onClick: () => setConfiguring(null), children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), _jsxs(XStack, { gap: 8, items: "center", children: [_jsx(Input, { unstyled: true, autoFocus: true, type: "password", value: secret, onChange: (e) => setSecret(e.target.value), placeholder: `${configuring.name} token`, "aria-label": t('{name} credential', { name: configuring.name }), flex: 1, height: 36, px: 12, rounded: 9, bg: GROUND, borderWidth: 1, borderColor: LINE, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsx(XStack, { ...PILL, render: "button", type: 'button', height: 36, px: 16, bg: INK, borderColor: INK, opacity: secret.trim() ? 1 : 0.45, onClick: () => void saveCredential(), children: _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Verify & Save') }) })] })] })) : null, statusNote ? (_jsxs(XStack, { px: embedded ? 0 : 28, py: 9, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: INK, children: statusNote }), _jsx(XStack, { render: "button", type: 'button', onClick: () => setStatusNote(null), bg: "transparent", borderWidth: 0, cursor: "pointer", children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })] })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: embedded ? undefined : 'auto', px: embedded ? 0 : 28, py: 20, gap: 24, children: [SECTIONS.map((sec) => {
347
+ }) })] })] }), _jsx(XStack, { ...ROUND, width: 28, height: 28, borderColor: "var(--border-strong)", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { width: 44, height: 44 }, "aria-label": t('Cancel'), onClick: () => setConfiguring(null), children: _jsx(X, { size: 14, color: DIM, "aria-hidden": true }) })] }), _jsxs(XStack, { gap: 8, items: "center", flexWrap: "wrap", children: [_jsx(Input, { unstyled: true, autoFocus: true, type: "password", value: secret, onChange: (e) => setSecret(e.target.value), onKeyDown: (e) => {
348
+ if (e.key === 'Enter' && secret.trim())
349
+ void saveCredential();
350
+ }, placeholder: `${configuring.name} token`, "aria-label": t('{name} credential', { name: configuring.name }), flex: 1, minW: 180, height: 36, "$max-sm": { minH: 44 }, px: 12, rounded: 9, bg: GROUND, borderWidth: 1, borderColor: "var(--border-strong)", focusStyle: { borderColor: 'var(--ring)' }, color: INK, fontSize: 13, placeholderTextColor: "$placeholderColor" }), _jsx(XStack, { ...PILL, render: "button", type: 'button', height: 36, "$max-sm": { minH: 44 }, px: 16, bg: INK, borderColor: INK, opacity: secret.trim() ? 1 : 0.45, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, onClick: () => void saveCredential(), children: _jsx(Text, { ...WORD, fontSize: 13, color: "var(--background)", children: t('Verify & save') }) })] })] })) : null, statusNote ? (_jsxs(XStack, { px: embedded ? 0 : 28, "$max-sm": { px: embedded ? 0 : 14 }, py: 9, bg: RAISED, borderBottomWidth: 1, borderColor: LINE, items: "center", justify: "space-between", gap: 8, children: [_jsx(Text, { fontSize: 12, lineHeight: 17, color: INK, flex: 1, minW: 0, children: statusNote }), _jsx(XStack, { render: "button", type: 'button', "aria-label": t('Dismiss'), onClick: () => setStatusNote(null), bg: "transparent", borderWidth: 0, p: 4, rounded: 999, cursor: "pointer", focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(X, { size: 13, color: DIM, "aria-hidden": true }) })] })) : null, _jsxs(YStack, { flex: 1, minH: 0, overflowY: embedded ? undefined : 'auto', overflowX: "hidden", px: embedded ? 0 : 28, "$max-sm": { px: embedded ? 0 : 14, py: 14 }, py: 20, gap: 24, children: [SECTIONS.map((sec) => {
332
351
  const items = filtered.filter((i) => i.section === sec.id);
333
352
  if (!items.length)
334
353
  return null;
@@ -338,16 +357,16 @@ export function ConnectorsCatalog({ defaultFilter = 'all', embedded = false, onC
338
357
  const waiting = pendingOAuth === backendId(item);
339
358
  const busy = busyId === item.id;
340
359
  const isSlack = item.id === 'slack';
341
- return (_jsxs(XStack, { "data-connector": item.id, width: "calc(50% - 12px)", "$max-md": { width: '100%' }, minH: 60, px: 10, py: 8, rounded: 12, items: "center", gap: 12, hoverStyle: { bg: RAISED }, children: [_jsx(Mark, { item: item }), _jsxs(YStack, { flex: 1, minW: 0, gap: 1, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: item.name }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: connected && state?.account
360
+ return (_jsxs(XStack, { "data-connector": item.id, width: "calc(50% - 12px)", "$max-md": { width: '100%' }, minW: 0, minH: 60, px: 10, py: 8, rounded: 12, items: "center", flexWrap: "wrap", gap: 12, transition: "quickest", hoverStyle: { bg: RAISED }, children: [_jsx(Mark, { item: item }), _jsxs(YStack, { flex: 1, minW: 120, gap: 1, children: [_jsx(Text, { ...CLIP, fontSize: 14, lineHeight: 19, fontWeight: "500", color: INK, children: item.name }), _jsx(Text, { ...CLIP, fontSize: 12, lineHeight: 17, color: DIM, children: connected && state?.account
342
361
  ? `${t('Connected')} · ${state.account}`
343
362
  : waiting
344
363
  ? t('Waiting for authorization…')
345
- : item.description })] }), isSlack && connected ? (_jsxs(XStack, { render: "button", type: 'button', disabled: syncingSlack, onClick: () => void handleSlackSync(), height: 30, px: 10, rounded: 999, items: "center", gap: 5, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", opacity: syncingSlack ? 0.5 : 1, hoverStyle: { bg: PICKED }, children: [_jsx(RefreshCw, { size: 12, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: syncingSlack ? t('Syncing…') : t('Sync channels') })] })) : null, _jsx(XStack, { render: "button", type: 'button', "aria-label": connected ? t('Disconnect {name}', { name: item.name }) : t('Connect {name}', { name: item.name }), disabled: busy, onClick: () => void connectItem(item), height: 30, minW: 30, px: connected || isSlack ? 11 : 8, rounded: 999, items: "center", justify: "center", gap: 5, bg: connected ? PICKED : isSlack ? INK : RAISED, borderWidth: 1, borderColor: connected ? LINE : isSlack ? INK : LINE, cursor: "pointer", opacity: busy ? 0.5 : 1, hoverStyle: { bg: connected ? PICKED : isSlack ? INK : PICKED, opacity: isSlack && !connected ? 0.9 : 1 }, children: connected ? (_jsxs(_Fragment, { children: [_jsx(Check, { size: 13, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connected') })] })) : isSlack ? (_jsxs(_Fragment, { children: [_jsx(ExternalLink, { size: 12, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: "var(--background)", children: t('Add to Slack') })] })) : (_jsxs(_Fragment, { children: [_jsx(Plus, { size: 14, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connect') })] })) })] }, item.id));
364
+ : item.description })] }), _jsxs(XStack, { items: "center", gap: 6, flexWrap: "wrap", shrink: 0, children: [isSlack && connected ? (_jsxs(XStack, { render: "button", type: 'button', disabled: syncingSlack, onClick: () => void handleSlackSync(), height: 30, "$max-sm": { minH: 44 }, px: 10, rounded: 999, items: "center", gap: 5, bg: RAISED, borderWidth: 1, borderColor: "var(--border-strong)", cursor: "pointer", opacity: syncingSlack ? 0.5 : 1, transition: "quickest", hoverStyle: { bg: PICKED }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: [_jsx(RefreshCw, { size: 12, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: syncingSlack ? t('Syncing…') : t('Sync channels') })] })) : null, _jsx(XStack, { render: "button", type: 'button', "aria-label": connected ? t('Disconnect {name}', { name: item.name }) : t('Connect {name}', { name: item.name }), disabled: busy, onClick: () => void connectItem(item), height: 30, "$max-sm": { minH: 44 }, minW: 30, px: connected || isSlack ? 11 : 10, rounded: 999, items: "center", justify: "center", gap: 5, bg: connected ? PICKED : isSlack ? INK : RAISED, borderWidth: 1, borderColor: connected ? 'var(--border-strong)' : isSlack ? INK : 'var(--border-strong)', cursor: "pointer", opacity: busy ? 0.5 : 1, transition: "quickest", hoverStyle: { bg: connected ? PICKED : isSlack ? INK : PICKED, opacity: isSlack && !connected ? 0.9 : 1 }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: connected ? (_jsxs(_Fragment, { children: [_jsx(Check, { size: 13, color: "var(--state-success)", "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connected') })] })) : isSlack ? (_jsxs(_Fragment, { children: [_jsx(ExternalLink, { size: 12, color: "var(--background)", "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: "var(--background)", children: t('Add to Slack') })] })) : (_jsxs(_Fragment, { children: [_jsx(Plus, { size: 14, color: INK, "aria-hidden": true }), _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: "500", color: INK, children: t('Connect') })] })) })] })] }, item.id));
346
365
  }) })] }, sec.id));
347
- }), filtered.length === 0 ? (_jsx(YStack, { py: 36, items: "center", gap: 8, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, children: filter === 'personal' && !query
366
+ }), filtered.length === 0 ? (_jsx(YStack, { py: 36, items: "center", gap: 8, children: _jsx(Text, { fontSize: 14, lineHeight: 20, color: DIM, text: "center", children: filter === 'personal' && !query
348
367
  ? t('No connectors active yet. Switch to All to add @hanzo to Slack, connect GitHub, Linear, and more.')
349
368
  : t('No connectors match “{query}”.', { query }) }) })) : null] })] }));
350
369
  }
351
370
  export function ConnectorsDialog({ open, onOpenChange, defaultFilter = 'all', onConnected, }) {
352
- return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { width: "94vw", maxW: 880, p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: LINE, rounded: 16, overflow: "hidden", children: _jsx(YStack, { height: "82vh", maxH: "86vh", bg: GROUND, children: _jsx(ConnectorsCatalog, { defaultFilter: defaultFilter, onClose: () => onOpenChange(false), onConnected: onConnected }) }) }) }));
371
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { width: "calc(100vw - 24px)", maxW: 880, "$max-sm": { width: 'calc(100vw - 24px)', maxW: 'calc(100vw - 24px)', rounded: 14 }, p: 0, showCloseButton: false, bg: GROUND, borderWidth: 1, borderColor: "var(--border-strong)", rounded: 16, overflow: "hidden", children: _jsx(YStack, { height: "82vh", maxH: "86vh", bg: GROUND, children: _jsx(ConnectorsCatalog, { defaultFilter: defaultFilter, onClose: () => onOpenChange(false), onConnected: onConnected }) }) }) }));
353
372
  }
package/dist/bots/Make.js CHANGED
@@ -69,7 +69,11 @@ export function Make({ groups = [], onDone, onCancel, }) {
69
69
  }
70
70
  };
71
71
  return (_jsx(Dialog, { open: true, onOpenChange: (v) => (v ? undefined : onCancel()), children: _jsxs(DialogContent, { "data-parity-key": "bots.make", width: "calc(100vw - 32px)", maxW: 460, bg: "var(--popover)", rounded: 20, p: 20, gap: 14, borderWidth: 1, borderColor: LINE, children: [_jsx(DialogTitle, { fontSize: 18, lineHeight: 24, fontWeight: "500", color: "$ink", children: t('New bot') }), _jsxs(YStack, { render: "form", onSubmit: submit, gap: 12, children: [_jsx(Input, { ...FIELD, autoFocus: true, value: name, onChange: (e) => setName(e.target.value), placeholder: t('Name'), "aria-label": t('Bot name') }), name.trim() && !named ? (_jsx(Text, { fontSize: 13, lineHeight: 18, color: DIM, px: 4, children: t('Letters, digits, dot, dash and underscore; it starts with a letter or a digit.') })) : null, _jsx(Input, { ...FIELD, render: "textarea", rows: 4, value: does, onChange: (e) => setDoes(e.target.value), placeholder: t('What it does (directed by Primary Bot hanzo, with full Desktop Computer Use)'), "aria-label": t('What it does') }), _jsxs(XStack, { items: "center", justify: "space-between", gap: 10, px: 4, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: DIM, children: t('Coordination Layer') }), _jsx(XStack, { gap: 6, children: [1, 2, 3].map((lv) => {
72
+ const locked = Boolean(selectedGroup);
72
73
  const active = (selectedGroup?.layer ?? layer) === lv;
73
- return (_jsx(XStack, { render: "button", type: 'button', onClick: () => setLayer(lv), height: 28, px: 10, rounded: 999, items: "center", bg: active ? PICKED : RAISED, borderWidth: 1, borderColor: active ? INK : LINE, cursor: "pointer", children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: INK, children: `L${lv}` }) }, lv));
74
+ return (_jsx(XStack, { render: "button", type: 'button', disabled: locked, "aria-pressed": active, "aria-disabled": locked, onClick: () => {
75
+ if (!locked)
76
+ setLayer(lv);
77
+ }, height: 28, px: 10, rounded: 999, items: "center", bg: active ? PICKED : RAISED, borderWidth: 1, borderColor: active ? INK : LINE, opacity: locked ? 0.5 : 1, cursor: locked ? 'not-allowed' : 'pointer', focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, children: _jsx(Text, { fontSize: 12, lineHeight: 16, fontWeight: active ? '600' : '400', color: INK, children: `L${lv}` }) }, lv));
74
78
  }) })] }), groups.length > 0 ? (_jsxs(XStack, { items: "center", justify: "space-between", px: 4, children: [_jsx(Text, { fontSize: 14, lineHeight: 19, color: DIM, children: t('Assign to Group') }), _jsxs(DropdownMenu, { placement: "bottom-end", offset: 6, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(XStack, { render: "button", type: 'button', height: 30, px: 11, rounded: 999, items: "center", gap: 5, bg: RAISED, borderWidth: 1, borderColor: LINE, cursor: "pointer", children: [_jsx(Text, { fontSize: 13, lineHeight: 18, color: INK, children: selectedGroup ? `${selectedGroup.name} (L${selectedGroup.layer || 1})` : t('None') }), _jsx(ChevronDown, { size: 13, color: DIM, "aria-hidden": true })] }) }), _jsxs(DropdownMenuContent, { minW: 180, children: [_jsx(DropdownMenuItem, { onSelect: () => setGroupId(''), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: t('None') }) }), groups.map((g) => (_jsx(DropdownMenuItem, { onSelect: () => setGroupId(g.id), children: _jsx(Text, { fontSize: "$3", color: "$ink", children: `${g.name} (Layer ${g.layer || 1})` }) }, g.id)))] })] })] })) : null, _jsxs(XStack, { items: "center", gap: 10, px: 4, children: [_jsx(Text, { fontSize: 15, lineHeight: 20, color: DIM, children: t('Spend up to $') }), _jsx(Input, { ...FIELD, width: 88, py: 8, inputMode: "numeric", value: weekly, onChange: (e) => setWeekly(e.target.value.replace(/[^\d]/g, '')), "aria-label": t('Weekly budget in US dollars') }), _jsx(Text, { fontSize: 15, lineHeight: 20, color: DIM, children: t('a week') })] }), wrong ? (_jsx(Text, { role: "alert", fontSize: 13, lineHeight: 18, color: DIM, px: 4, children: wrong })) : null, _jsxs(XStack, { justify: "flex-end", gap: 8, pt: 4, children: [_jsx(XStack, { ...PILL, onClick: onCancel, children: _jsx(Text, { ...WORD, children: t('Cancel') }) }), _jsx(XStack, { ...PILL, type: 'submit', disabled: !ok, opacity: ok ? 1 : 0.5, bg: INK, borderColor: INK, hoverStyle: { bg: INK, opacity: 0.9 }, children: _jsx(Text, { ...WORD, color: "var(--background)", children: t(busy ? 'Making…' : 'Make bot') }) })] })] })] }) }));
75
79
  }