@fungi.computer/tourtois 0.14.0 → 0.15.0

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.
@@ -6,5 +6,5 @@ export function AppCallPermissions({ calls, apps, }) {
6
6
  if (!calls?.length)
7
7
  return null;
8
8
  return (_jsxs("section", { "aria-label": "Calls to other Apps", children: [_jsx(DataListHeading, { level: 3, children: "Other Apps" }), _jsx(DataList, { density: "compact", children: calls.map((call) => (_jsx(DataRow, { children: _jsxs("span", { children: ["Can use", " ", apps.find((app) => app.appId === call.appId)?.displayName ??
9
- call.appId, ": ", call.methods.map(appCallMethodLabel).join(", ")] }) }, call.appId))) }), _jsx("p", { className: "mt-1 text-xs", children: "Calls use your permissions in the other App. Renamed target methods need approval again." })] }));
9
+ call.appId, ": ", call.methods.map(appCallMethodLabel).join(", ")] }) }, call.appId))) }), _jsx("p", { className: "tourtois-call-permissions-note text-xs", children: "Calls use your permissions in the other App. Renamed target methods need approval again." })] }));
10
10
  }
package/dist/AppPane.js CHANGED
@@ -121,9 +121,12 @@ function AppWindowControls({ phone, navigation, onAction, popover, ...actions })
121
121
  onAction({ kind: "action", actionId: command.id });
122
122
  }, children: command.label }, command.id))), actions.onPromote ? (_jsx(DropdownMenuItem, { onSelect: actions.onPromote, children: "Make main window" })) : null, _jsx(DropdownMenuItem, { onSelect: actions.onToggleMaximize, children: actions.maximized ? "Restore window" : "Maximize window" }), _jsx(DropdownMenuItem, { onSelect: actions.onMinimize, children: "Minimize window" }), _jsx(DropdownMenuItem, { variant: "destructive", onSelect: actions.onClose, children: "Close window" })] })] }));
123
123
  }
124
- /** Back and Forward for an App that keeps history; neither for one that does not. */
124
+ /**
125
+ * Back and Forward for an App that publishes navigation, disabled while it
126
+ * cannot move, so the title keeps its place; none for one that never does.
127
+ */
125
128
  function historyProps(navigation, title, onBack, onForward) {
126
- if (navigation === null || !(navigation.canGoBack || navigation.canGoForward))
129
+ if (navigation === null)
127
130
  return {};
128
131
  return {
129
132
  back: {
@@ -14,6 +14,7 @@ import { addressKey } from "@fungi.computer/nacre/app-directory";
14
14
  import { reconcileAppDirectory, reconcileAppWindowFromDirectory, } from "./app-directory-reconciliation.js";
15
15
  import { useAppDirectory } from "./app-directory.js";
16
16
  import { AppIcon } from "./app-icon.js";
17
+ import { tileGap } from "./tile-gap.js";
17
18
  import { appForRole, composeOpenRequests, createAppLaunchDescriptor, attachWindowComputer, launchComputerId, launchForComputer, findOpenFileCommand, launchForRoleIntent, requireHandledNavigation, resolveFileEditorWindow, } from "./app-launch.js";
18
19
  import { useAppSurfaceHost, } from "./app-surface.js";
19
20
  import { hasVisibleAppWindows, } from "./app-windows.js";
@@ -285,6 +286,10 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
285
286
  if (activeId)
286
287
  goBack(activeId);
287
288
  },
289
+ forward: () => {
290
+ if (activeId)
291
+ goForward(activeId);
292
+ },
288
293
  });
289
294
  useEffect(() => {
290
295
  appSurfaceHost?.focus?.(activeSurfaceId);
@@ -620,7 +625,10 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
620
625
  width: layout.snapPreview.frame.width,
621
626
  height: layout.snapPreview.frame.height,
622
627
  ...layout.stackingStyle,
623
- } })), layout.divider ? (_jsx(ResizeHandle, { ...layout.divider.props, className: "pointer-events-auto absolute top-1/2 -translate-x-1/2 -translate-y-1/2", "aria-label": "Main window width", orientation: "vertical", min: layout.divider.min, max: layout.divider.max, value: layout.divider.position, onValueChange: layout.resizeMain, style: { left: layout.divider.position, ...layout.stackingStyle } })) : null] })] }), _jsx(ShellCommandDialogs, { host: appSurfaceHost, state: shellCommands, focusedWindow: activeWindow, directoryApps: directory.map((app) => ({
628
+ } })), layout.divider ? (_jsx(ResizeHandle, { ...layout.divider.props, className: "pointer-events-auto absolute top-1/2 -translate-x-1/2 -translate-y-1/2", "aria-label": "Main window width", orientation: "vertical", min: layout.divider.min, max: layout.divider.max, value: layout.divider.position, onValueChange: layout.resizeMain, style: {
629
+ left: layout.divider.position + tileGap / 2,
630
+ ...layout.stackingStyle,
631
+ } })) : null] })] }), _jsx(ShellCommandDialogs, { host: appSurfaceHost, state: shellCommands, focusedWindow: activeWindow, directoryApps: directory.map((app) => ({
624
632
  commands: app.commands,
625
633
  name: app.displayName ?? "App",
626
634
  roles: app.roles,
@@ -80,7 +80,7 @@ export function Connections({ port, target, onNavigate, }) {
80
80
  // A fresh form after each connection, so the token field empties.
81
81
  const [formKey, setFormKey] = useState(0);
82
82
  const HostSections = port.hostSections;
83
- return (_jsxs("section", { className: "tourtois-settings-content tourtois-connectors", "aria-label": "Connections", children: [_jsx(SectionHeading, { children: "Connections" }), _jsx("p", { className: "tourtois-settings-lede", children: "Connect a remote MCP server, then choose which Agents may use it. A token is sealed by this host, never given to an Agent, and never shown again." }), view.data?.callbackUrl ? (_jsx(DataList, { density: "compact", "aria-label": "Redirect URL", children: _jsx(FactRow, { icon: _jsx(Sigil, { name: "internet" }), label: "Redirect URL", children: _jsx("code", { className: "text-[length:inherit]", children: view.data.callbackUrl }) }) })) : null, view.isPending ? _jsx("p", { children: "Loading connections\u2026" }) : null, view.isError ? (_jsxs("div", { role: "status", className: "tourtois-settings-notice", children: [_jsx("p", { children: "Connections could not be loaded." }), _jsx(Button, { size: "sm", variant: "outline", onClick: () => void view.refetch(), children: "Retry" })] })) : null, view.isSuccess ? (_jsxs(_Fragment, { children: [connections.length === 0 ? (_jsx("p", { children: "No connections yet." })) : (_jsx(DataList, { "aria-label": "Connections", children: connections.map((connection) => (_jsx(DataRow, { children: _jsx(SettingsItem, { icon: _jsx(Sigil, { name: "connected" }), title: connection.label, detail: _jsxs(_Fragment, { children: [_jsxs("p", { children: [connection.url, " \u00B7 ", authText[connection.auth], stateText[connection.state]] }), _jsx(AgentAccess, { connection: connection, agents: agents, port: port, onChanged: refresh }), _jsxs("div", { className: "tourtois-settings-item-keys mt-2", children: [port.editor?.(connection) ? (_jsx(KeycapButton, { density: "compact", label: "Edit", "aria-label": `Edit ${connection.label}`, onClick: () => {
83
+ return (_jsxs("section", { className: "tourtois-settings-content tourtois-connectors", "aria-label": "Connections", children: [_jsx(SectionHeading, { children: "Connections" }), _jsx("p", { className: "tourtois-settings-lede", children: "Connect a remote MCP server, then choose which Agents may use it. A token is sealed by this host, never given to an Agent, and never shown again." }), view.data?.callbackUrl ? (_jsx(DataList, { density: "compact", "aria-label": "Redirect URL", children: _jsx(FactRow, { icon: _jsx(Sigil, { name: "internet" }), label: "Redirect URL", children: _jsx("code", { children: view.data.callbackUrl }) }) })) : null, view.isPending ? _jsx("p", { children: "Loading connections\u2026" }) : null, view.isError ? (_jsxs("div", { role: "status", className: "tourtois-settings-notice", children: [_jsx("p", { children: "Connections could not be loaded." }), _jsx(Button, { size: "sm", variant: "outline", onClick: () => void view.refetch(), children: "Retry" })] })) : null, view.isSuccess ? (_jsxs(_Fragment, { children: [connections.length === 0 ? (_jsx("p", { children: "No connections yet." })) : (_jsx(DataList, { "aria-label": "Connections", children: connections.map((connection) => (_jsx(DataRow, { children: _jsx(SettingsItem, { icon: _jsx(Sigil, { name: "connected" }), title: connection.label, detail: _jsxs(_Fragment, { children: [_jsxs("p", { children: [connection.url, " \u00B7 ", authText[connection.auth], stateText[connection.state]] }), _jsx(AgentAccess, { connection: connection, agents: agents, port: port, onChanged: refresh }), _jsxs("div", { className: "tourtois-settings-item-keys", children: [port.editor?.(connection) ? (_jsx(KeycapButton, { density: "compact", label: "Edit", "aria-label": `Edit ${connection.label}`, onClick: () => {
84
84
  const target = port.editor?.(connection);
85
85
  if (target)
86
86
  onNavigate({
package/dist/Keys.js CHANGED
@@ -104,7 +104,7 @@ function KeysContent({ port, apps, }) {
104
104
  const result = await port.issue(draft);
105
105
  setIssued(result);
106
106
  await refresh();
107
- } }))) : (_jsxs("div", { className: "tourtois-settings-stack", role: "status", children: [_jsx("p", { className: "tourtois-settings-lede", children: "Copy this key now. It is shown once and cannot be retrieved later." }), _jsx("code", { className: "break-all", children: issued.plaintext }), _jsx("div", { className: "tourtois-settings-notice", children: _jsx(Button, { size: "sm", onClick: () => {
107
+ } }))) : (_jsxs("div", { className: "tourtois-settings-stack", role: "status", children: [_jsx("p", { className: "tourtois-settings-lede", children: "Copy this key now. It is shown once and cannot be retrieved later." }), _jsx("code", { className: "tourtois-issued-key", children: issued.plaintext }), _jsx("div", { className: "tourtois-settings-notice", children: _jsx(Button, { size: "sm", onClick: () => {
108
108
  setIssued(null);
109
109
  }, children: "I copied the key" }) })] }))] }));
110
110
  }
@@ -166,7 +166,7 @@ export function SystemSettings({ location: requestedLocation, sections: ceiling,
166
166
  onNavigate({ category: "apps", appKey, section });
167
167
  }, children: [_jsxs("div", { className: "tourtois-settings-app-header", children: [_jsxs(SectionHeading, { className: "tourtois-settings-app-heading", children: [selected ? (_jsx(AppIcon, { roles: selected.roles, icon: selected.icon })) : null, selected
168
168
  ? (selected.displayName ?? selected.appId)
169
- : "Apps"] }), _jsxs(TabsList, { variant: "segmented", className: "ml-auto w-auto", hidden: !selected || (desktopOnly && AppAdvanced === undefined), "aria-label": "App settings sections", children: [!desktopOnly ? (_jsx(TabsTrigger, { value: "permissions", children: "Permissions" })) : null, _jsx(TabsTrigger, { value: "desktop", children: "Desktop" }), AppAdvanced !== undefined ? (_jsx(TabsTrigger, { value: "advanced", children: "Advanced" })) : null] })] }), _jsxs("div", { className: "tourtois-settings-app-content", children: [!selected ? (_jsx("p", { children: "Choose an app to manage its permissions and advanced settings." })) : null, AppPermissions !== undefined ? (_jsx(TabsContent, { value: "permissions", forceMount: true, className: "mt-0 flex min-h-0 flex-1 flex-col", children: _jsx("div", { className: "tourtois-settings-permissions", hidden: !selected, children: _jsx(AppPermissions, { selectedKey: appKey, onAccepted: onAccepted }) }) })) : null, _jsxs(TabsContent, { value: "desktop", forceMount: true, className: "mt-0 flex min-h-0 flex-1 flex-col", children: [selected && desktop && desktopOnly ? (_jsx(AppCallPermissions, { calls: selected.calls, apps: apps })) : null, selected && desktop ? (_jsx(AppDesktopSettings, { app: selected, desktop: desktopSettings, consentReadyAt: desktopConsentReadyAt }, selected.surfaceId)) : null] }), AppAdvanced !== undefined ? (_jsx(TabsContent, { value: "advanced", forceMount: true, className: "mt-0 flex min-h-0 flex-1 flex-col", children: _jsx(AppAdvanced, { selectedKey: appKey, visible: advanced, onNavigate: onNavigate, onAccepted: onAccepted }) })) : null] })] }) })) : null] }) }), leaveError ? (_jsx("div", { className: "tourtois-settings-discard", role: "alert", children: leaveError })) : null, discard ? (_jsxs("div", { className: "tourtois-settings-discard", role: "alert", children: [_jsx("p", { children: "Discard unsaved changes?" }), _jsxs("div", { className: "tourtois-settings-actions", children: [_jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: () => {
169
+ : "Apps"] }), _jsxs(TabsList, { variant: "segmented", className: "tourtois-settings-tabs-end w-auto", hidden: !selected || (desktopOnly && AppAdvanced === undefined), "aria-label": "App settings sections", children: [!desktopOnly ? (_jsx(TabsTrigger, { value: "permissions", children: "Permissions" })) : null, _jsx(TabsTrigger, { value: "desktop", children: "Desktop" }), AppAdvanced !== undefined ? (_jsx(TabsTrigger, { value: "advanced", children: "Advanced" })) : null] })] }), _jsxs("div", { className: "tourtois-settings-app-content", children: [!selected ? (_jsx("p", { children: "Choose an app to manage its permissions and advanced settings." })) : null, AppPermissions !== undefined ? (_jsx(TabsContent, { value: "permissions", forceMount: true, className: "flex min-h-0 flex-1 flex-col", children: _jsx("div", { className: "tourtois-settings-permissions", hidden: !selected, children: _jsx(AppPermissions, { selectedKey: appKey, onAccepted: onAccepted }) }) })) : null, _jsxs(TabsContent, { value: "desktop", forceMount: true, className: "flex min-h-0 flex-1 flex-col", children: [selected && desktop && desktopOnly ? (_jsx(AppCallPermissions, { calls: selected.calls, apps: apps })) : null, selected && desktop ? (_jsx(AppDesktopSettings, { app: selected, desktop: desktopSettings, consentReadyAt: desktopConsentReadyAt }, selected.surfaceId)) : null] }), AppAdvanced !== undefined ? (_jsx(TabsContent, { value: "advanced", forceMount: true, className: "flex min-h-0 flex-1 flex-col", children: _jsx(AppAdvanced, { selectedKey: appKey, visible: advanced, onNavigate: onNavigate, onAccepted: onAccepted }) })) : null] })] }) })) : null] }) }), leaveError ? (_jsx("div", { className: "tourtois-settings-discard", role: "alert", children: leaveError })) : null, discard ? (_jsxs("div", { className: "tourtois-settings-discard", role: "alert", children: [_jsx("p", { children: "Discard unsaved changes?" }), _jsxs("div", { className: "tourtois-settings-actions", children: [_jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: () => {
170
170
  setDiscard(false);
171
171
  }, children: "Keep editing" }), _jsx(Button, { type: "button", size: "sm", onClick: () => {
172
172
  if (!canClose())
@@ -5,6 +5,7 @@ import { useQuery } from "@tanstack/react-query";
5
5
  import { MaosaicoRoot } from "@fungi.computer/maosaico";
6
6
  import { useEffect, useRef, useState } from "react";
7
7
  import { AppWorkbench } from "./AppWorkbench.js";
8
+ import { tileGap } from "./tile-gap.js";
8
9
  import { WelcomeProvider } from "./desktop/welcome.js";
9
10
  function useWorkbenchBounds() {
10
11
  const ref = useRef(null);
@@ -35,6 +36,9 @@ export function TeamTourtois({ children, teamId, teamName, extraLaunchers, setti
35
36
  queryFn: ({ signal }) => computersReader(signal),
36
37
  });
37
38
  return (_jsx("main", { className: "tourtois-shell", "data-tourtois-shell": true, children: _jsxs(TourtoisLayers, { children: [_jsx("div", { className: "tourtois-workbench", children: _jsx(MaosaicoRoot, { bounds: bounds, containerRef: paneLayerRef, tiling: tiled || phone
38
- ? { mainSize: Math.max(0, Math.min(640, bounds.width)), gap: 8 }
39
+ ? {
40
+ mainSize: Math.max(0, Math.min(640, bounds.width)),
41
+ gap: tileGap,
42
+ }
39
43
  : undefined, children: _jsx(WelcomeProvider, { teamId: teamId, storage: desktopStorage, children: _jsx(AppWorkbench, { paneLayerRef: paneLayerRef, phone: phone, teamId: teamId, teamName: teamName ?? teamId, initialComputerId: data?.[0]?.computerId ?? null, computers: data ?? [], computersUnavailable: isLoading || isError, onLayoutChange: phone ? undefined : setTiled, platform: platform, desktopStorage: desktopStorage, desktopMethods: desktopMethods, gills: gills, ...(extraLaunchers ? { extraLaunchers } : {}), ...(settingsLaunchers ? { settingsLaunchers } : {}), settingsSections: settingsSections, ...(systemMenuItems ? { systemMenuItems } : {}), directoryReader: directoryReader, ...(takeAppOpenRequest ? { takeAppOpenRequest } : {}) }) }) }) }), children] }) }));
40
44
  }
@@ -325,7 +325,7 @@ function WebsiteRow({ port, copy, site, notice, embedOrigin, agentName, open, ju
325
325
  onOpenChange(!open);
326
326
  }, children: open ? "Close" : "Set up" })] }), open ? (_jsxs("div", { className: "tourtois-connector-row-details tourtois-website-guide", id: guideId, children: [_jsxs(Prose, { className: "tourtois-website-doc", children: [_jsx("h4", { children: justCreated
327
327
  ? "3. Install and test chat"
328
- : "Add it to your website" }), _jsxs("ol", { children: [_jsxs("li", { children: [_jsx("p", { children: _jsx("strong", { children: "Copy this code." }) }), _jsx(CopyField, { className: "not-prose", layout: "block", title: "HTML", label: "Copy snippet", tokens: snippet, "aria-label": `Embed snippet for ${agentName}` })] }), _jsx("li", { children: _jsxs("p", { children: [_jsxs("strong", { children: ["Paste it into your pages, just before", " ", _jsx(InlineCode, { children: "</body>" }), "."] }), " ", "If your site has a shared layout, template or footer, paste it there once. Site builders call this \u201Ccustom code\u201D or \u201Cfooter code\u201D."] }) }), _jsx("li", { children: _jsxs("p", { children: [_jsx("strong", { children: "Publish, then open your site." }), " A chat button appears in the bottom-right corner. Open it and send a message; ", agentName, " replies."] }) })] }), _jsxs("details", { children: [_jsx("summary", { children: "WordPress installation steps" }), _jsxs("ol", { children: [_jsx("li", { children: "In WordPress, open Pages and edit the page where you want chat. Add a Custom HTML block: type /html and press Enter." }), _jsx("li", { children: "Open Edit HTML and choose the HTML tab. Paste the whole copied code, including the script tags. Choose Update." }), _jsx("li", { children: "Save or publish the page, then open its public address in a private browser window and send a test message." })] }), _jsx("p", { children: "A Custom HTML block adds chat to only this page. For every page, use your host\u2019s shared footer-code setting or the WPCode plugin\u2019s Header & Footer screen." }), _jsx("p", { children: "If WordPress removes the script when you save, ask your site administrator to install it. Some accounts cannot save scripts. You do not need a plugin when your account can save the Custom HTML block." }), _jsx("p", { children: _jsx("a", { href: "https://docs.fungi.computer/guides/wordpress-agent/", children: "Full WordPress guide" }) })] }), _jsxs("p", { className: "tourtois-website-note", children: ["The chat only appears on", " ", origins.map((origin, index) => (_jsxs("span", { children: [index > 0 ? ", " : null, _jsx(InlineCode, { children: origin })] }, origin))), ". To try it somewhere else first, add that address as another website."] }), _jsx("h4", { children: "What visitors see" }), _jsx("p", { children: copy.visitors(agentName) }), _jsx("h4", { children: "What visitors can trigger" }), _jsx("p", { children: copy.reach(agentName) })] }), _jsxs(DataList, { density: "compact", "aria-label": `Website status for ${agentName}`, children: [_jsx(FactRow, { icon: _jsx(Sigil, { name: "agent" }), label: "Agent", children: agentName }), _jsx(FactRow, { icon: _jsx(Sigil, { name: "internet" }), label: "Site key", children: _jsx(InlineCode, { children: siteKey }) }), _jsx(FactRow, { icon: _jsx(Sigil, { name: "chat" }), label: active ? "Chat is live" : "Chat is paused", children: _jsxs("span", { className: "tourtois-website-fact", children: [_jsx("span", { className: "text-sm", children: active
328
+ : "Add it to your website" }), _jsxs("ol", { children: [_jsxs("li", { children: [_jsx("p", { children: _jsx("strong", { children: "Copy this code." }) }), _jsx(CopyField, { layout: "block", title: "HTML", label: "Copy snippet", tokens: snippet, "aria-label": `Embed snippet for ${agentName}` })] }), _jsx("li", { children: _jsxs("p", { children: [_jsxs("strong", { children: ["Paste it into your pages, just before", " ", _jsx(InlineCode, { children: "</body>" }), "."] }), " ", "If your site has a shared layout, template or footer, paste it there once. Site builders call this \u201Ccustom code\u201D or \u201Cfooter code\u201D."] }) }), _jsx("li", { children: _jsxs("p", { children: [_jsx("strong", { children: "Publish, then open your site." }), " A chat button appears in the bottom-right corner. Open it and send a message; ", agentName, " replies."] }) })] }), _jsxs("details", { children: [_jsx("summary", { children: "WordPress installation steps" }), _jsxs("ol", { children: [_jsx("li", { children: "In WordPress, open Pages and edit the page where you want chat. Add a Custom HTML block: type /html and press Enter." }), _jsx("li", { children: "Open Edit HTML and choose the HTML tab. Paste the whole copied code, including the script tags. Choose Update." }), _jsx("li", { children: "Save or publish the page, then open its public address in a private browser window and send a test message." })] }), _jsx("p", { children: "A Custom HTML block adds chat to only this page. For every page, use your host\u2019s shared footer-code setting or the WPCode plugin\u2019s Header & Footer screen." }), _jsx("p", { children: "If WordPress removes the script when you save, ask your site administrator to install it. Some accounts cannot save scripts. You do not need a plugin when your account can save the Custom HTML block." }), _jsx("p", { children: _jsx("a", { href: "https://docs.fungi.computer/guides/wordpress-agent/", children: "Full WordPress guide" }) })] }), _jsxs("p", { className: "tourtois-website-note", children: ["The chat only appears on", " ", origins.map((origin, index) => (_jsxs("span", { children: [index > 0 ? ", " : null, _jsx(InlineCode, { children: origin })] }, origin))), ". To try it somewhere else first, add that address as another website."] }), _jsx("h4", { children: "What visitors see" }), _jsx("p", { children: copy.visitors(agentName) }), _jsx("h4", { children: "What visitors can trigger" }), _jsx("p", { children: copy.reach(agentName) })] }), _jsxs(DataList, { density: "compact", "aria-label": `Website status for ${agentName}`, children: [_jsx(FactRow, { icon: _jsx(Sigil, { name: "agent" }), label: "Agent", children: agentName }), _jsx(FactRow, { icon: _jsx(Sigil, { name: "internet" }), label: "Site key", children: _jsx(InlineCode, { children: siteKey }) }), _jsx(FactRow, { icon: _jsx(Sigil, { name: "chat" }), label: active ? "Chat is live" : "Chat is paused", children: _jsxs("span", { className: "tourtois-website-fact", children: [_jsx("span", { className: "text-sm", children: active
329
329
  ? "Pause to stop new messages without removing the code."
330
330
  : "Visitors can’t send messages until you resume it." }), _jsx(KeycapButton, { density: "compact", label: active ? "Pause website" : "Resume website", disabled: patch.isPending, onClick: () => {
331
331
  patch.mutate({
@@ -8,5 +8,5 @@ import { Check, PanelsTopLeft } from "lucide-react";
8
8
  export function WorkbenchAppBar({ phone, ...props }) {
9
9
  const popover = useLayer("popover");
10
10
  const collapsed = phone && props.windows.length > 0;
11
- return (_jsxs(_Fragment, { children: [collapsed ? (_jsxs(DropdownMenu, { modal: false, children: [_jsxs(DropdownMenuTrigger, { render: _jsx(Button, { size: "menubar", variant: "ghost" }), "aria-label": "Switch open Apps", title: "Switch open Apps", children: [_jsx("span", { "aria-hidden": "true", className: "grid size-5 place-items-center [&_svg]:size-full", children: props.windows.find((item) => item.active)?.icon ?? (_jsx(PanelsTopLeft, {})) }), _jsx("span", { className: "tourtois-windows-label", children: "Windows" })] }), _jsxs(DropdownMenuContent, { container: popover, align: "start", children: [props.windows.map((item) => (_jsxs(DropdownMenuItem, { role: "menuitemradio", "aria-checked": item.active ?? false, "aria-current": item.active ? "page" : undefined, onSelect: item.onSelect, children: [_jsx("span", { "aria-hidden": "true", className: "grid size-7 shrink-0 place-items-center [&_svg]:size-5", children: item.icon }), _jsx("span", { className: "flex-1", children: item.label }), item.active ? _jsx(Check, { "aria-hidden": "true", size: 16 }) : null] }, item.id))), _jsx(DropdownMenuSeparator, {}), props.windows.map((item) => item.onClose ? (_jsxs(DropdownMenuItem, { onSelect: item.onClose, children: ["Close ", item.label] }, item.id)) : null)] })] })) : null, _jsx(AppBar, { appsLabel: "Apps", ...props, windows: collapsed ? [] : props.windows })] }));
11
+ return (_jsxs(_Fragment, { children: [collapsed ? (_jsxs(DropdownMenu, { modal: false, children: [_jsxs(DropdownMenuTrigger, { render: _jsx(Button, { size: "menubar", variant: "ghost" }), "aria-label": "Switch open Apps", title: "Switch open Apps", children: [_jsx("span", { "aria-hidden": "true", className: "tourtois-switcher-icon", children: props.windows.find((item) => item.active)?.icon ?? (_jsx(PanelsTopLeft, {})) }), _jsx("span", { className: "tourtois-windows-label", children: "Windows" })] }), _jsxs(DropdownMenuContent, { container: popover, align: "start", children: [props.windows.map((item) => (_jsxs(DropdownMenuItem, { role: "menuitemradio", "aria-checked": item.active ?? false, "aria-current": item.active ? "page" : undefined, onSelect: item.onSelect, children: [_jsx("span", { "aria-hidden": "true", className: "tourtois-switcher-row-icon", children: item.icon }), _jsx("span", { className: "flex-1", children: item.label }), item.active ? _jsx(Check, { "aria-hidden": "true", size: 16 }) : null] }, item.id))), _jsx(DropdownMenuSeparator, {}), props.windows.map((item) => item.onClose ? (_jsxs(DropdownMenuItem, { onSelect: item.onClose, children: ["Close ", item.label] }, item.id)) : null)] })] })) : null, _jsx(AppBar, { appsLabel: "Apps", ...props, windows: collapsed ? [] : props.windows })] }));
12
12
  }
package/dist/chrome.css CHANGED
@@ -19,6 +19,30 @@
19
19
  color-mix(in oklab, var(--color-base-content) 14%, var(--color-base-200));
20
20
  font-size: 12px;
21
21
  }
22
+ /* The phone switcher's marks size themselves: Tailwind never scans this
23
+ package, so utility classes here would leave the SVG at zero width. */
24
+ .tourtois-switcher-icon,
25
+ .tourtois-switcher-row-icon {
26
+ display: grid;
27
+ flex-shrink: 0;
28
+ place-items: center;
29
+ }
30
+ .tourtois-switcher-icon {
31
+ width: 1.25rem;
32
+ height: 1.25rem;
33
+ }
34
+ .tourtois-switcher-row-icon {
35
+ width: 1.75rem;
36
+ height: 1.75rem;
37
+ }
38
+ .tourtois-switcher-icon svg {
39
+ width: 100%;
40
+ height: 100%;
41
+ }
42
+ .tourtois-switcher-row-icon svg {
43
+ width: 1.25rem;
44
+ height: 1.25rem;
45
+ }
22
46
  .tourtois-focused-app {
23
47
  min-width: 0;
24
48
  overflow: hidden;
@@ -37,5 +37,5 @@ export function GillFrame({ title, appHeader, size, editHandle, children, onCont
37
37
  observer.disconnect();
38
38
  };
39
39
  }, [measuring]);
40
- return (_jsx(SectionCard, { ref: card, className: "tourtois-gill-frame", heading: appHeader ? (_jsxs("span", { className: "flex min-w-0 items-center gap-sm", children: [_jsx("span", { className: "inline-flex size-5 shrink-0 [&_:is(svg,.caps-monogram)]:size-5", children: appHeader.icon }), _jsx("span", { className: "truncate", children: appHeader.name })] })) : (title), description: appHeader ? title : undefined, "data-gill-size": size, actions: editHandle, children: _jsx("div", { className: "tourtois-gill-body", children: _jsx("div", { ref: content, className: "tourtois-gill-content", children: children }) }) }));
40
+ return (_jsx(SectionCard, { ref: card, className: "tourtois-gill-frame", heading: appHeader ? (_jsxs("span", { className: "flex min-w-0 items-center gap-sm", children: [_jsx("span", { className: "tourtois-gill-frame-icon", children: appHeader.icon }), _jsx("span", { className: "truncate", children: appHeader.name })] })) : (title), description: appHeader ? title : undefined, "data-gill-size": size, actions: editHandle, children: _jsx("div", { className: "tourtois-gill-body", children: _jsx("div", { ref: content, className: "tourtois-gill-content", children: children }) }) }));
41
41
  }
@@ -84,7 +84,7 @@ export function LauncherGill({ items, size = "M", onAllApps, loading = false, un
84
84
  },
85
85
  ], size: "lg" })) : null, _jsx("div", { className: "tourtois-install-notes", children: installing.map((entry) => entry.state === "installing" ? null : (_jsx(InstallNote, { entry: entry, onRetry: onRetryInstall, onOpen: starterItem(items, entry.installationId)?.onSelect }, entry.installationId))) }), _jsx("div", { className: "tourtois-launcher-more", children: _jsxs(Button, { size: "sm", variant: "ghost", onClick: () => {
86
86
  window.open(installDocs, "_blank", "noopener,noreferrer");
87
- }, children: ["More Apps", _jsx(ExternalLink, { "aria-hidden": "true", size: 14 })] }) }), editing ? (_jsx(DataList, { "aria-label": "Launcher preferences", children: items.map((item) => (_jsx(DataRow, { children: _jsxs("div", { className: "tourtois-launcher-preference", children: [_jsx("span", { "aria-hidden": "true", className: "grid size-6 place-items-center [&_svg]:size-full", children: item.icon ?? _jsx(Sigil, { name: "installApps" }) }), _jsx("div", { className: "tourtois-launcher-preference-identity", children: _jsx("span", { children: item.label }) }), _jsxs(Select, { "aria-label": `Launcher state for ${item.label}`, value: stateFor(item.id), onChange: (event) => {
87
+ }, children: ["More Apps", _jsx(ExternalLink, { "aria-hidden": "true", size: 14 })] }) }), editing ? (_jsx(DataList, { "aria-label": "Launcher preferences", children: items.map((item) => (_jsx(DataRow, { children: _jsxs("div", { className: "tourtois-launcher-preference", children: [_jsx("span", { "aria-hidden": "true", className: "tourtois-launcher-preference-icon", children: item.icon ?? _jsx(Sigil, { name: "installApps" }) }), _jsx("div", { className: "tourtois-launcher-preference-identity", children: _jsx("span", { children: item.label }) }), _jsxs(Select, { "aria-label": `Launcher state for ${item.label}`, value: stateFor(item.id), onChange: (event) => {
88
88
  const value = event.currentTarget.value;
89
89
  if (value !== "Pinned" &&
90
90
  value !== "Shown" &&
@@ -1,16 +1,17 @@
1
1
  import { CommandDialogs, type ShellCommandState } from "./command-dialogs.js";
2
2
  import { type ShellActions } from "@fungi.computer/nacre/commands";
3
3
  import type { TourtoisAppSurfaceHost } from "./app-surface.js";
4
- /** The Back hint for this platform, e.g. "Back (Ctrl K, then [)". */
4
+ /** The Back hint for this platform. */
5
5
  export declare function backHint(): string;
6
- /** The Forward hint for this platform; the App maps these keys itself. */
6
+ /** The Forward hint for this platform, the matching chord to Back's. */
7
7
  export declare function forwardHint(): string;
8
8
  /**
9
9
  * Register the shell's commands, dispatch their direct chords from the host
10
10
  * document, and own the which-key and `:` line open state.
11
11
  */
12
- export declare function useShellCommands(host: TourtoisAppSurfaceHost | null, actions: Omit<ShellActions, "showKeys" | "showCommandLine" | "back"> & Readonly<{
12
+ export declare function useShellCommands(host: TourtoisAppSurfaceHost | null, actions: Omit<ShellActions, "showKeys" | "showCommandLine" | "back" | "forward"> & Readonly<{
13
13
  back: () => void;
14
+ forward: () => void;
14
15
  showDesktop: () => Promise<void>;
15
16
  }>): ShellCommandState;
16
17
  /** Draw the shared shell dialogs in Tourtois's dialog layer. */
@@ -2,18 +2,22 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CommandDialogs } from "./command-dialogs.js";
3
3
  import { useLayer } from "@fungi.computer/maosaico";
4
4
  import { Sigil, isSigilName } from "@fungi.computer/sigils";
5
- import { backBinding, shellCommands, } from "@fungi.computer/nacre/commands";
5
+ import { backBinding, forwardBinding, shellCommands, } from "@fungi.computer/nacre/commands";
6
6
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
7
7
  import { AppIcon } from "./app-icon.js";
8
8
  import { installShellKeys } from "@fungi.computer/nacre/keys";
9
- /** The Back hint for this platform, e.g. "Back (Ctrl K, then [)". */
9
+ /** A tooltip naming the leader chord for `binding`, e.g. "Back (Ctrl K, then [)". */
10
+ function chordHint(name, binding) {
11
+ const key = binding.slice("<leader>".length);
12
+ return `${name} (${isMac() ? "⌘K" : "Ctrl K"}, then ${key})`;
13
+ }
14
+ /** The Back hint for this platform. */
10
15
  export function backHint() {
11
- const key = backBinding.slice("<leader>".length);
12
- return `Back (${isMac() ? "⌘K" : "Ctrl K"}, then ${key})`;
16
+ return chordHint("Back", backBinding);
13
17
  }
14
- /** The Forward hint for this platform; the App maps these keys itself. */
18
+ /** The Forward hint for this platform, the matching chord to Back's. */
15
19
  export function forwardHint() {
16
- return isMac() ? "Forward (⌘])" : "Forward (Alt+→)";
20
+ return chordHint("Forward", forwardBinding);
17
21
  }
18
22
  const emptySnapshot = Object.freeze({
19
23
  bindings: Object.freeze([]),
@@ -70,6 +74,9 @@ export function useShellCommands(host, actions) {
70
74
  back: () => {
71
75
  latest.current.back();
72
76
  },
77
+ forward: () => {
78
+ latest.current.forward();
79
+ },
73
80
  }),
74
81
  {
75
82
  id: "desktop.show",
@@ -77,9 +84,9 @@ export function useShellCommands(host, actions) {
77
84
  category: "Window",
78
85
  description: "Hide visible Apps, or restore the Apps hidden by Show desktop.",
79
86
  projections: {
80
- bindings: { values: ["<leader>d"], order: 8 },
87
+ bindings: { values: ["<leader>d"], order: 9 },
81
88
  palette: { order: 18 },
82
- help: { order: 8 },
89
+ help: { order: 9 },
83
90
  },
84
91
  handler: async () => {
85
92
  setKeysOpen(false);
@@ -1,6 +1,6 @@
1
1
  import { APP_NAVIGATION_TITLE_MAX, parseAppStatusItems, APP_NAVIGATION_CRUMBS_MAX, APP_NAVIGATION_LABEL_MAX, APP_NAVIGATION_MENU_MAX, APP_NAVIGATION_PRIMARY_MAX, APP_NAVIGATION_SIBLINGS_MAX, APP_NAVIGATION_STATUS_MAX, } from "@fungi.computer/agar";
2
2
  import {} from "@fungi.computer/nacre/workbench";
3
- import { createAppSurfaceCommandHost } from "@fungi.computer/nacre/command-host";
3
+ import { commandPaletteReservedChordForUserAgent, createAppSurfaceCommandHost, } from "@fungi.computer/nacre/command-host";
4
4
  import * as Schema from "effect/Schema";
5
5
  import {} from "./platform-controls.js";
6
6
  import { parseMemberAvatar } from "./member-avatar.js";
@@ -141,6 +141,18 @@ function childLaunch(launch) {
141
141
  openRequest: launch.openRequest,
142
142
  };
143
143
  }
144
+ /** The reserved chord id that opens the leader list. */
145
+ const leaderChordId = commandPaletteReservedChordForUserAgent("").id;
146
+ /**
147
+ * Take keyboard focus back from the App frame that sent the leader chord. The
148
+ * frame keeps focus until the leader list's dialog opens, so a fast next key
149
+ * would otherwise be typed into the App instead of choosing a leader key.
150
+ */
151
+ function releaseFrameFocus() {
152
+ const active = document.activeElement;
153
+ if (active instanceof HTMLIFrameElement)
154
+ active.blur();
155
+ }
144
156
  export function createTourtoisShell(workbench) {
145
157
  // One Whistle graph for Tourtois's own shell commands and every mounted
146
158
  // child's Release-validated commands, so the menu bar and Cmd-K follow focus.
@@ -180,7 +192,11 @@ export function createTourtoisShell(workbench) {
180
192
  }),
181
193
  });
182
194
  },
183
- onReservedChord: (input) => commandMount.handlers.invokeReservedChord(input),
195
+ onReservedChord: (input) => {
196
+ if (input.id === leaderChordId)
197
+ releaseFrameFocus();
198
+ return commandMount.handlers.invokeReservedChord(input);
199
+ },
184
200
  onFocus: (focused) => {
185
201
  if (focused) {
186
202
  commands.focus(launch.surfaceId);
package/dist/shell.css CHANGED
@@ -309,6 +309,19 @@
309
309
  flex-wrap: wrap;
310
310
  align-items: center;
311
311
  gap: var(--spacing-xs) var(--spacing-sm);
312
+ margin-top: 0.5rem;
313
+ }
314
+
315
+ .tourtois-issued-key {
316
+ word-break: break-all;
317
+ }
318
+
319
+ .tourtois-settings-tabs-end {
320
+ margin-left: auto;
321
+ }
322
+
323
+ .tourtois-call-permissions-note {
324
+ margin-top: 0.25rem;
312
325
  }
313
326
 
314
327
  .tourtois-settings-app-content:not([hidden]),
@@ -752,6 +765,16 @@
752
765
  width: 100%;
753
766
  min-width: 0;
754
767
  }
768
+ .tourtois-launcher-preference-icon {
769
+ display: grid;
770
+ place-items: center;
771
+ width: 1.5rem;
772
+ height: 1.5rem;
773
+ }
774
+ .tourtois-launcher-preference-icon svg {
775
+ width: 100%;
776
+ height: 100%;
777
+ }
755
778
  .tourtois-launcher-preference-identity {
756
779
  display: grid;
757
780
  gap: var(--spacing-2xs);
@@ -797,6 +820,16 @@
797
820
  flex-direction: column;
798
821
  overflow: hidden;
799
822
  }
823
+ .tourtois-gill-frame-icon {
824
+ display: inline-flex;
825
+ flex-shrink: 0;
826
+ width: 1.25rem;
827
+ height: 1.25rem;
828
+ }
829
+ .tourtois-gill-frame-icon :is(svg, .caps-monogram) {
830
+ width: 1.25rem;
831
+ height: 1.25rem;
832
+ }
800
833
  .tourtois-gill-frame > :last-child {
801
834
  min-height: 0;
802
835
  flex: 1;
@@ -0,0 +1,2 @@
1
+ /** Pixels between tiled windows; the divider handle is centred in this gap. */
2
+ export declare const tileGap = 8;
@@ -0,0 +1,2 @@
1
+ /** Pixels between tiled windows; the divider handle is centred in this gap. */
2
+ export const tileGap = 8;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/tourtois",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Tourtois: the trusted desktop shell for Oyster and Fungi, with host-supplied Settings sections",
6
6
  "type": "module",
@@ -79,11 +79,11 @@
79
79
  "dependencies": {
80
80
  "@fungi.computer/agar": "0.10.0",
81
81
  "@fungi.computer/cairn": "0.1.0",
82
- "@fungi.computer/caps": "0.11.0",
82
+ "@fungi.computer/caps": "0.11.1",
83
83
  "@fungi.computer/ear-tag": "0.1.0",
84
84
  "@fungi.computer/gills": "0.3.0",
85
85
  "@fungi.computer/maosaico": "0.1.2",
86
- "@fungi.computer/parakeet": "0.11.18",
86
+ "@fungi.computer/parakeet": "0.11.19",
87
87
  "@fungi.computer/puffball": "0.5.5",
88
88
  "@fungi.computer/shiitake": "0.13.1",
89
89
  "@fungi.computer/sigils": "0.3.1",
@@ -100,13 +100,13 @@
100
100
  "lucide-react": "0.460.0",
101
101
  "react-dom": "18.3.1",
102
102
  "zod": "4.4.3",
103
- "@fungi.computer/nacre": "0.5.0"
103
+ "@fungi.computer/nacre": "0.5.2"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "react": "^18.3.1 || ^19.2.0"
107
107
  },
108
108
  "devDependencies": {
109
- "@fungi.computer/oyster": "0.21.0",
109
+ "@fungi.computer/oyster": "0.21.4",
110
110
  "@cloudflare/workers-types": "5.20260828.1",
111
111
  "@fungi.computer/forage": "0.3.5",
112
112
  "@fungi.computer/mycelium": "0.3.8",