@fungi.computer/tourtois 0.12.0 → 0.12.2

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.
@@ -5,6 +5,7 @@ import {} from "@fungi.computer/caps/blocks/app-bar";
5
5
  import { ResizeHandle } from "@fungi.computer/caps/components/resize-handle";
6
6
  import { LoadingState } from "@fungi.computer/caps/blocks/loading-state";
7
7
  import { toast, Toaster } from "@fungi.computer/caps/components/toaster";
8
+ import { WORKBENCH_NOTICES } from "./app-toast.js";
8
9
  import { WindowSnapPreview } from "@fungi.computer/caps/components/window";
9
10
  import { MaosaicoRegion, useLayer, useMaosaicoLayout, } from "@fungi.computer/maosaico";
10
11
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
@@ -42,7 +43,7 @@ function announceFloating(tiled, projection) {
42
43
  if (!tiled && !hasVisibleAppWindows(projection))
43
44
  toast("New windows will float", {
44
45
  id: "workbench-layout",
45
- toasterId: "workbench-notices",
46
+ toasterId: WORKBENCH_NOTICES,
46
47
  });
47
48
  }
48
49
  /** The trial's starter Apps that are still being set up, if the host says so. */
@@ -123,7 +124,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
123
124
  message = "This App lost its connection.";
124
125
  const notice = {
125
126
  id: "workbench-status",
126
- toasterId: "workbench-notices",
127
+ toasterId: WORKBENCH_NOTICES,
127
128
  closeButton: true,
128
129
  dismissible: true,
129
130
  };
@@ -586,7 +587,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
586
587
  }, onOpenPermissions: () => {
587
588
  openAppPermissions(activeWindow.launch.surfaceId);
588
589
  } }, activeWindow.windowId)) : null, systemMenuItems: systemMenuItems }), noticeContainer
589
- ? createPortal(_jsx(Toaster, { id: "workbench-notices", position: "bottom-right", offset: 24, mobileOffset: 24, style: { fontFamily: "var(--font-sans)" }, closeButton: true }), noticeContainer)
590
+ ? createPortal(_jsx(Toaster, { id: WORKBENCH_NOTICES, position: "bottom-right", offset: 24, mobileOffset: 24, style: { fontFamily: "var(--font-sans)" }, closeButton: true }), noticeContainer)
590
591
  : null, _jsxs("div", { className: "relative min-h-0 flex-1", children: [_jsx(MaosaicoRegion, { layer: "desktop", style: { position: "absolute", inset: 0 }, "data-desktop-visibility": visibility, ref: desktopRef, "aria-hidden": covered ? true : undefined, children: _jsx(Desktop, { phone: phone, editing: desktopEditing, onEditingChange: setDesktopEditing, onOwner: receiveDesktopOwner, launcherItems: launchableItems, onAllApps: () => {
591
592
  setAppDialOpen(true);
592
593
  }, installing: installingApps(appsQuery.data), onRetryInstall: platform.retryInstall, paused: covered, apps: windowApps, needsUpdate: needsUpdate, onAppSettings: (app) => {
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { WhistleCommand, WhistleCommandKey, WhistleExecutionInput, WhistleExecutionOutcome, WhistleMenuProjection, WhistleSnapshot } from "@fungi.computer/whistle";
3
- import type { AgentSessionSelection, AppNavigationState, AppStatusItem, FileNavigationInput } from "@fungi.computer/agar";
3
+ import type { AgentSessionSelection, AppNavigationState, AppStatusItem, FileNavigationInput, ToastInput } from "@fungi.computer/agar";
4
4
  import type { AppOpenInput, AppRoleChoice } from "@fungi.computer/agar/apps";
5
5
  import type { AppDeclaredCommand } from "@fungi.computer/puffball/app";
6
6
  import type { AppWindowMount } from "./app-windows.js";
@@ -20,6 +20,8 @@ export type TourtoisAppMountEvents = Pick<WindowEvents, "onDeliveryPending"> & R
20
20
  onNavigationState?: (state: AppNavigationState | null) => void;
21
21
  /** The App's parsed status readouts for its window's status bar. */
22
22
  onStatusItems?: (items: readonly AppStatusItem[]) => void;
23
+ /** A transient notice the App asks the shell to show. */
24
+ onToast?: (toast: ToastInput) => void;
23
25
  /**
24
26
  * The App's own document took focus, as when the person clicks into it.
25
27
  * Its sandboxed frame keeps that pointer from this document, so the App's
@@ -0,0 +1,4 @@
1
+ import type { ToastInput } from "@fungi.computer/agar";
2
+ /** The one Toaster mount an App's notice reaches in the Tourtois shell. */
3
+ export declare const WORKBENCH_NOTICES = "workbench-notices";
4
+ export declare function showAppToast(notice: ToastInput): void;
@@ -0,0 +1,6 @@
1
+ import { showNotice } from "@fungi.computer/caps/components/toaster";
2
+ /** The one Toaster mount an App's notice reaches in the Tourtois shell. */
3
+ export const WORKBENCH_NOTICES = "workbench-notices";
4
+ export function showAppToast(notice) {
5
+ showNotice(notice, WORKBENCH_NOTICES);
6
+ }
@@ -8,6 +8,7 @@ import { LoadingState } from "@fungi.computer/caps/blocks/loading-state";
8
8
  import { Button } from "@fungi.computer/caps/components/button";
9
9
  import { IconButton } from "@fungi.computer/caps/components/icon-button";
10
10
  import { GripVertical, Trash2 } from "lucide-react";
11
+ import { WORKBENCH_NOTICES } from "../app-toast.js";
11
12
  import { toast } from "@fungi.computer/caps/components/toaster";
12
13
  import { Badge } from "@fungi.computer/caps/components/badge";
13
14
  import { Sigil } from "@fungi.computer/sigils";
@@ -248,7 +249,7 @@ function ArrangedDesktop({ owner, ...props }) {
248
249
  if (saved)
249
250
  toast("Desktop saved", {
250
251
  id: "desktop-saved",
251
- toasterId: "workbench-notices",
252
+ toasterId: WORKBENCH_NOTICES,
252
253
  });
253
254
  setSaved(false);
254
255
  onEditingChange(false);
@@ -49,10 +49,9 @@ const starter = (items, appId) => items.find((item) => item.id === `app:${appId}
49
49
  /** Says what this place is and points at the one thing to do next. */
50
50
  export function FirstRunWelcome({ items, onDismiss, }) {
51
51
  const hello = starter(items, "hello");
52
- const first = starter(items, "grove") ?? items.find((item) => item !== hello);
53
- if (!first && !hello)
54
- return null;
55
- const lead = first ?? hello;
52
+ // Grove is the first thing to try; until it is installed, Hello is. Never
53
+ // whichever App sorts first among the rest.
54
+ const lead = starter(items, "grove") ?? hello;
56
55
  if (!lead)
57
56
  return null;
58
57
  return (_jsxs("section", { className: "tourtois-welcome", "aria-labelledby": "tourtois-welcome-title", children: [_jsx("span", { className: "tourtois-welcome-mascot", "aria-hidden": "true", children: _jsx(ShiitakeAvatar, { className: "h-full w-full", state: { activity: "idle", expression: "normal" } }) }), _jsxs("div", { className: "tourtois-welcome-text", children: [_jsx("h3", { id: "tourtois-welcome-title", children: "This is your Oyster" }), _jsx("p", { children: "Apps open here as windows." }), _jsxs("p", { className: "tourtois-welcome-hint", children: [_jsx(Keycap, { size: "hint", children: isMac() ? "⌘" : "Ctrl" }), " ", _jsx(Keycap, { size: "hint", children: "K" }), " then ", _jsx(Keycap, { size: "hint", children: "O" }), " ", "opens any App"] })] }), _jsxs("div", { className: "tourtois-welcome-actions", children: [_jsxs(Button, { size: "sm", variant: "primary", onClick: () => {
@@ -141,7 +141,7 @@ export function createTourtoisShell(workbench) {
141
141
  // One Whistle graph for Tourtois's own shell commands and every mounted
142
142
  // child's Release-validated commands, so the menu bar and Cmd-K follow focus.
143
143
  const commands = createAppSurfaceCommandHost();
144
- const mount = async (container, launch, signal, { onAgentSessionSelection, onDeliveryPending, onComputerChoice, onNavigation, onAppOpen, onAppRole, onSelectionChanged, onNavigationState, onStatusItems, onFocus, }) => {
144
+ const mount = async (container, launch, signal, { onAgentSessionSelection, onDeliveryPending, onComputerChoice, onNavigation, onAppOpen, onAppRole, onSelectionChanged, onNavigationState, onStatusItems, onToast, onFocus, }) => {
145
145
  const commandMount = commands.mount(launch.surfaceId, launch.commands);
146
146
  let resolveHandle = () => undefined;
147
147
  const handleReady = new Promise((resolve) => {
@@ -191,6 +191,12 @@ export function createTourtoisShell(workbench) {
191
191
  onNavigationState(parseNavigationRelay(relayed));
192
192
  }),
193
193
  }),
194
+ ...(onToast && {
195
+ onToast: (toast) => {
196
+ onToast(toast);
197
+ return Promise.resolve();
198
+ },
199
+ }),
194
200
  ...(onStatusItems && {
195
201
  onStatusItems: (items) =>
196
202
  // The host parsed these at the App's edge; parse again at ours.
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useMemo, useRef } from "react";
2
+ import { showAppToast } from "./app-toast.js";
2
3
  import { createAppWindowManager, } from "./app-windows.js";
3
4
  /** One mounted host connection owns its windows, including StrictMode teardown. */
4
5
  export function useAppWindowManager(host, teamId, events) {
@@ -27,6 +28,7 @@ export function useAppWindowManager(host, teamId, events) {
27
28
  },
28
29
  onNavigationState: projectionEvents.onNavigationState,
29
30
  onStatusItems: projectionEvents.onStatusItems,
31
+ onToast: showAppToast,
30
32
  onComputerChoice: projectionEvents.onComputerChoice,
31
33
  });
32
34
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/tourtois",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
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.9.0",
81
81
  "@fungi.computer/cairn": "0.1.0",
82
- "@fungi.computer/caps": "0.10.0",
82
+ "@fungi.computer/caps": "0.10.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.1",
86
- "@fungi.computer/parakeet": "0.11.0",
86
+ "@fungi.computer/parakeet": "0.11.2",
87
87
  "@fungi.computer/puffball": "0.5.5",
88
88
  "@fungi.computer/shiitake": "0.12.3",
89
89
  "@fungi.computer/sigils": "0.3.0",
@@ -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.4.0"
103
+ "@fungi.computer/nacre": "0.4.1"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "react": "^18.3.1 || ^19.2.0"
107
107
  },
108
108
  "devDependencies": {
109
- "@fungi.computer/oyster": "0.17.0",
109
+ "@fungi.computer/oyster": "0.18.2",
110
110
  "@cloudflare/workers-types": "5.20260828.1",
111
111
  "@fungi.computer/forage": "0.3.5",
112
112
  "@fungi.computer/mycelium": "0.3.8",
@@ -118,7 +118,7 @@
118
118
  "typescript": "5.9.3",
119
119
  "vite": "8.2.2",
120
120
  "vitest": "4.1.11",
121
- "wrangler": "4.135.0",
121
+ "wrangler": "4.156.2",
122
122
  "eslint": "10.9.1",
123
123
  "oxlint": "1.78.0",
124
124
  "tsx": "4.23.12",