@fungi.computer/tourtois 0.14.1 → 0.15.1

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.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { type AppStatusAction } from "@fungi.computer/agar";
1
+ import { WindowHeader } from "@fungi.computer/caps/components/window";
2
+ import { type AppNavigationState, type AppStatusAction } from "@fungi.computer/agar";
3
+ import { type ComponentProps } from "react";
2
4
  import { createAppWindowManager, type AppWindowProjection, type AppLaunchDescriptor } from "./app-windows.js";
3
5
  import { type AppDirectoryApp } from "./app-launch.js";
4
6
  /** The focused window's App-level settings; its Computer lives in its status bar. */
@@ -8,6 +10,11 @@ export declare function FocusedWindowControls({ app, onOpenSettings, onOpenPermi
8
10
  onOpenPermissions: () => void;
9
11
  projection: AppWindowProjection;
10
12
  }): import("react/jsx-runtime").JSX.Element | null;
13
+ /**
14
+ * Back and Forward on every window, disabled while the App cannot move (or
15
+ * has published no history), so every title keeps its place.
16
+ */
17
+ export declare function historyProps(navigation: AppNavigationState | null, title: string, onBack: () => void, onForward: () => void): Pick<ComponentProps<typeof WindowHeader>, "back" | "forward">;
11
18
  export declare function AppPane({ projection, nextLaunch, icon, manager, onError, index, focusWindow, afterHide, onBack, onForward, onSelectComputer, onChooseComputer, }: {
12
19
  projection: AppWindowProjection;
13
20
  nextLaunch?: AppLaunchDescriptor | null;
package/dist/AppPane.js CHANGED
@@ -122,23 +122,21 @@ function AppWindowControls({ phone, navigation, onAction, popover, ...actions })
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
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.
125
+ * Back and Forward on every window, disabled while the App cannot move (or
126
+ * has published no history), so every title keeps its place.
127
127
  */
128
- function historyProps(navigation, title, onBack, onForward) {
129
- if (navigation === null)
130
- return {};
128
+ export function historyProps(navigation, title, onBack, onForward) {
131
129
  return {
132
130
  back: {
133
131
  label: `Back in ${title}`,
134
132
  hint: backHint(),
135
- disabled: !navigation.canGoBack,
133
+ disabled: navigation?.canGoBack !== true,
136
134
  onBack,
137
135
  },
138
136
  forward: {
139
137
  label: `Forward in ${title}`,
140
138
  hint: forwardHint(),
141
- disabled: !navigation.canGoForward,
139
+ disabled: navigation?.canGoForward !== true,
142
140
  onForward,
143
141
  },
144
142
  };
@@ -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";
@@ -613,7 +614,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
613
614
  return app ? (launchFor(app)?.computers ?? []) : [];
614
615
  }, storage: desktopStorage, methods: desktopMethods, transport: gills, onRetryApps: () => {
615
616
  void appsQuery.refetch();
616
- } }) }), _jsxs(MaosaicoRegion, { layer: "windows", style: { height: "100%", pointerEvents: "none" }, ref: paneLayerRef, className: "tourtois-pane-layer", "data-layout-mode": mode, children: [appProjection.windows.map((projection, index) => {
617
+ } }) }), _jsxs(MaosaicoRegion, { layer: "windows", style: { height: "100%", pointerEvents: "none" }, ref: paneLayerRef, className: "tourtois-pane-layer", "data-layout-mode": mode, "data-desktop": visibility, children: [appProjection.windows.map((projection, index) => {
617
618
  const app = directory.find((item) => item.surfaceId === projection.launch.surfaceId);
618
619
  return (_jsx(AppPane, { index: index, focusWindow: focusWindow, afterHide: afterHide, onBack: goBack, onForward: goForward, manager: appWindows, projection: projection, nextLaunch: app ? launchFor(app, projection.launch) : null, icon: app?.icon, onError: setAppStatus, onSelectComputer: (windowId, computerId) => {
619
620
  void selectWindowComputer(windowId, computerId);
@@ -624,7 +625,10 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
624
625
  width: layout.snapPreview.frame.width,
625
626
  height: layout.snapPreview.frame.height,
626
627
  ...layout.stackingStyle,
627
- } })), 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) => ({
628
632
  commands: app.commands,
629
633
  name: app.displayName ?? "App",
630
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,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]),
@@ -562,6 +575,13 @@
562
575
  width: 100%;
563
576
  }
564
577
 
578
+ /* Tiled windows cover the desktop: the gaps between them paint a plain face,
579
+ never the widgets underneath. The layer ignores the pointer, so the divider
580
+ handle above the backdrop keeps working. */
581
+ .tourtois-pane-layer[data-desktop="covered"] {
582
+ background: var(--color-base-200);
583
+ }
584
+
565
585
  .tourtois-pane {
566
586
  pointer-events: auto;
567
587
  position: absolute;
@@ -752,6 +772,16 @@
752
772
  width: 100%;
753
773
  min-width: 0;
754
774
  }
775
+ .tourtois-launcher-preference-icon {
776
+ display: grid;
777
+ place-items: center;
778
+ width: 1.5rem;
779
+ height: 1.5rem;
780
+ }
781
+ .tourtois-launcher-preference-icon svg {
782
+ width: 100%;
783
+ height: 100%;
784
+ }
755
785
  .tourtois-launcher-preference-identity {
756
786
  display: grid;
757
787
  gap: var(--spacing-2xs);
@@ -797,6 +827,16 @@
797
827
  flex-direction: column;
798
828
  overflow: hidden;
799
829
  }
830
+ .tourtois-gill-frame-icon {
831
+ display: inline-flex;
832
+ flex-shrink: 0;
833
+ width: 1.25rem;
834
+ height: 1.25rem;
835
+ }
836
+ .tourtois-gill-frame-icon :is(svg, .caps-monogram) {
837
+ width: 1.25rem;
838
+ height: 1.25rem;
839
+ }
800
840
  .tourtois-gill-frame > :last-child {
801
841
  min-height: 0;
802
842
  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.1",
3
+ "version": "0.15.1",
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",
@@ -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.1"
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.1",
109
+ "@fungi.computer/oyster": "0.21.5",
110
110
  "@cloudflare/workers-types": "5.20260828.1",
111
111
  "@fungi.computer/forage": "0.3.5",
112
112
  "@fungi.computer/mycelium": "0.3.8",
@@ -247,7 +247,7 @@
247
247
  "workbench:build": "ladle build --outDir ../../.botanical/tourtois-ladle",
248
248
  "test:overlay-layering": "node test/overlay-layering.browser.mjs",
249
249
  "test:window-new-version": "node test/window-new-version.browser.mjs",
250
- "test:workbench": "node test/workbench.browser.mjs && node test/desktop-gills.browser.mjs && node test/app-directory-isolation.browser.mjs && node test/workflows-launcher-icon.browser.mjs && node test/landing-bugs.browser.mjs && node test/show-desktop.browser.mjs && node test/window-stack.browser.mjs && node test/window-chrome-back.browser.mjs && node test/app-bar-menu.browser.mjs && node test/launcher-gill.browser.mjs && node test/desktop-storage.browser.mjs && node test/desktop-method-editing.browser.mjs && node test/arrange-layout-shift.browser.mjs && node test/phone-layout.browser.mjs && node test/phone-app-switcher.browser.mjs && node test/computer-choice.browser.mjs && node test/window-resize.browser.mjs",
250
+ "test:workbench": "node test/workbench.browser.mjs && node test/desktop-gills.browser.mjs && node test/app-directory-isolation.browser.mjs && node test/workflows-launcher-icon.browser.mjs && node test/landing-bugs.browser.mjs && node test/show-desktop.browser.mjs && node test/window-stack.browser.mjs && node test/window-chrome-back.browser.mjs && node test/tile-backdrop.browser.mjs && node test/app-bar-menu.browser.mjs && node test/launcher-gill.browser.mjs && node test/desktop-storage.browser.mjs && node test/desktop-method-editing.browser.mjs && node test/arrange-layout-shift.browser.mjs && node test/phone-layout.browser.mjs && node test/phone-app-switcher.browser.mjs && node test/computer-choice.browser.mjs && node test/window-resize.browser.mjs",
251
251
  "test": "pnpm run test:unit && pnpm run test:merge",
252
252
  "test:settings-icons": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/tourtois-ladle --origin-env TOURTOIS_WORKBENCH_URL test/settings-icons.browser.mjs",
253
253
  "format:check": "node ../../tooling/repository/scripts/format-package-check.mjs",