@fungi.computer/tourtois 0.30.3 → 0.30.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppDesktopSettings.js +7 -6
- package/dist/AppWorkbench.js +4 -0
- package/dist/Connections.js +5 -5
- package/dist/DiscordChannels.js +5 -5
- package/dist/Keys.js +4 -4
- package/dist/WebsiteChannels.js +3 -3
- package/dist/app-directory.d.ts +4 -4
- package/dist/app-toast.d.ts +6 -0
- package/dist/app-toast.js +10 -0
- package/dist/member-avatar.js +3 -3
- package/dist/platform-controls.d.ts +7 -1
- package/dist/platform-controls.js +4 -3
- package/dist/window-session.d.ts +26 -0
- package/dist/window-session.js +24 -13
- package/package.json +9 -9
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { DataListHeading } from "@fungi.computer/caps/components/data-list";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { AppError } from "@fungi.computer/agar";
|
|
5
4
|
import { Button } from "@fungi.computer/caps/components/button";
|
|
6
5
|
import { DataList, DataRow } from "@fungi.computer/caps/components/data-list";
|
|
7
6
|
import { toast } from "@fungi.computer/caps/components/toaster";
|
|
8
7
|
import { Select } from "@fungi.computer/caps/components/select";
|
|
9
|
-
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
8
|
+
import { WORKBENCH_NOTICES, failureNotice } from "./app-toast.js";
|
|
10
9
|
const sizeLabels = { S: "Small", M: "Medium", L: "Large" };
|
|
11
10
|
function GillOption({ app, gill, desktop, consentReadyAt, }) {
|
|
12
11
|
const sizes = gill.desktop?.sizes ?? [];
|
|
@@ -43,7 +42,9 @@ function GillOption({ app, gill, desktop, consentReadyAt, }) {
|
|
|
43
42
|
});
|
|
44
43
|
if (!retired) {
|
|
45
44
|
setUnavailable(true);
|
|
46
|
-
toast.error("Your desktop could not be read
|
|
45
|
+
toast.error(failureNotice("Your desktop could not be read", cause), {
|
|
46
|
+
toasterId: WORKBENCH_NOTICES,
|
|
47
|
+
});
|
|
47
48
|
}
|
|
48
49
|
return { kind: "failed", cause };
|
|
49
50
|
});
|
|
@@ -73,9 +74,9 @@ function GillOption({ app, gill, desktop, consentReadyAt, }) {
|
|
|
73
74
|
cause,
|
|
74
75
|
});
|
|
75
76
|
setUnavailable(true);
|
|
76
|
-
toast.error(cause
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
toast.error(failureNotice("The widget could not be changed", cause), {
|
|
78
|
+
toasterId: WORKBENCH_NOTICES,
|
|
79
|
+
});
|
|
79
80
|
// A refusal may mean another tab changed the saved layout. Never keep an optimistic membership flag.
|
|
80
81
|
setSaved(null);
|
|
81
82
|
return { kind: "failed", cause };
|
package/dist/AppWorkbench.js
CHANGED
|
@@ -172,7 +172,10 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
const reconciledDirectoryRef = useRef(null);
|
|
175
|
+
// The stored-window restore yields to the latest request in this page.
|
|
176
|
+
const focusRequest = useRef(null);
|
|
175
177
|
const focusWindow = useCallback((id) => {
|
|
178
|
+
focusRequest.current = { windowId: id };
|
|
176
179
|
focus(id);
|
|
177
180
|
requestAnimationFrame(() => {
|
|
178
181
|
// Focus the person moved into an open App dial since this request must
|
|
@@ -480,6 +483,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
480
483
|
phone,
|
|
481
484
|
onTiledChange: onLayoutChange,
|
|
482
485
|
focusWindow,
|
|
486
|
+
focusRequest: () => focusRequest.current,
|
|
483
487
|
onError: setAppStatus,
|
|
484
488
|
});
|
|
485
489
|
/** An App that is already open comes forward instead of opening twice. */
|
package/dist/Connections.js
CHANGED
|
@@ -12,7 +12,7 @@ import { useState } from "react";
|
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
import { SettingsItem } from "./settings-item.js";
|
|
14
14
|
import { toast } from "@fungi.computer/caps/components/toaster";
|
|
15
|
-
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
15
|
+
import { WORKBENCH_NOTICES, failureNotice } from "./app-toast.js";
|
|
16
16
|
/** What an Agent may do with one connection: everything, only reads, or named tools. */
|
|
17
17
|
const connectionAccessSchema = z.union([
|
|
18
18
|
z.literal("all"),
|
|
@@ -76,8 +76,8 @@ export function Connections({ port, target, onNavigate, }) {
|
|
|
76
76
|
const remove = useMutation({
|
|
77
77
|
mutationFn: (connectionId) => port.remove(connectionId),
|
|
78
78
|
onSuccess: refresh,
|
|
79
|
-
onError: () => {
|
|
80
|
-
toast.error("The connection could not be removed
|
|
79
|
+
onError: (cause) => {
|
|
80
|
+
toast.error(failureNotice("The connection could not be removed", cause), {
|
|
81
81
|
toasterId: WORKBENCH_NOTICES,
|
|
82
82
|
});
|
|
83
83
|
},
|
|
@@ -121,8 +121,8 @@ function AgentAccess({ connection, agents, port, onChanged, }) {
|
|
|
121
121
|
});
|
|
122
122
|
},
|
|
123
123
|
onSuccess: onChanged,
|
|
124
|
-
onError: () => {
|
|
125
|
-
toast.error("The access could not be changed
|
|
124
|
+
onError: (cause) => {
|
|
125
|
+
toast.error(failureNotice("The access could not be changed", cause), {
|
|
126
126
|
toasterId: WORKBENCH_NOTICES,
|
|
127
127
|
});
|
|
128
128
|
},
|
package/dist/DiscordChannels.js
CHANGED
|
@@ -18,7 +18,7 @@ import * as Schema from "effect/Schema";
|
|
|
18
18
|
import * as z from "zod";
|
|
19
19
|
import { websiteConversationSchema, websiteTranscriptSchema, } from "@fungi.computer/nacre/website-channels";
|
|
20
20
|
import { ChannelConversations } from "./ChannelConversations.js";
|
|
21
|
-
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
21
|
+
import { WORKBENCH_NOTICES, failureNotice } from "./app-toast.js";
|
|
22
22
|
import { tourtoisQueryKeys } from "./queries.js";
|
|
23
23
|
import { requestIds } from "./team-directory.js";
|
|
24
24
|
const snowflake = z.string().regex(/^\d{17,20}$/u);
|
|
@@ -346,8 +346,8 @@ function DiscordRow({ port, binding, interactionsOrigin, agentName, open, justCr
|
|
|
346
346
|
throw new Error("Discord unavailable. Reload before changing it.");
|
|
347
347
|
return port.update(binding.bindingId, current.authorityVersion, change);
|
|
348
348
|
},
|
|
349
|
-
onError: () => {
|
|
350
|
-
toast.error("Couldn't update Discord
|
|
349
|
+
onError: (cause) => {
|
|
350
|
+
toast.error(failureNotice("Couldn't update Discord", cause), {
|
|
351
351
|
toasterId: WORKBENCH_NOTICES,
|
|
352
352
|
closeButton: true,
|
|
353
353
|
});
|
|
@@ -356,8 +356,8 @@ function DiscordRow({ port, binding, interactionsOrigin, agentName, open, justCr
|
|
|
356
356
|
});
|
|
357
357
|
const register = useMutation({
|
|
358
358
|
mutationFn: () => port.registerCommands(binding.bindingId),
|
|
359
|
-
onError: () => {
|
|
360
|
-
toast.error("Couldn't register the Discord commands
|
|
359
|
+
onError: (cause) => {
|
|
360
|
+
toast.error(failureNotice("Couldn't register the Discord commands", cause), {
|
|
361
361
|
toasterId: WORKBENCH_NOTICES,
|
|
362
362
|
closeButton: true,
|
|
363
363
|
});
|
package/dist/Keys.js
CHANGED
|
@@ -14,7 +14,7 @@ import * as z from "zod";
|
|
|
14
14
|
import { Sigil } from "@fungi.computer/sigils";
|
|
15
15
|
import { SettingsItem } from "./settings-item.js";
|
|
16
16
|
import { toast } from "@fungi.computer/caps/components/toaster";
|
|
17
|
-
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
17
|
+
import { WORKBENCH_NOTICES, failureNotice } from "./app-toast.js";
|
|
18
18
|
const mutationIds = defineIdFamily({
|
|
19
19
|
family: "tourtois-keys-mutation",
|
|
20
20
|
version: 1,
|
|
@@ -63,9 +63,9 @@ function KeysContent({ port, apps, }) {
|
|
|
63
63
|
}
|
|
64
64
|
catch (cause) {
|
|
65
65
|
console.error("Key change failed", pending.kind, cause);
|
|
66
|
-
toast.error(cause
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
toast.error(failureNotice("The key change failed", cause), {
|
|
67
|
+
toasterId: WORKBENCH_NOTICES,
|
|
68
|
+
});
|
|
69
69
|
}
|
|
70
70
|
finally {
|
|
71
71
|
setBusy(false);
|
package/dist/WebsiteChannels.js
CHANGED
|
@@ -18,7 +18,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
|
18
18
|
import { useId, useMemo, useState } from "react";
|
|
19
19
|
import * as z from "zod";
|
|
20
20
|
import { ChannelConversations } from "./ChannelConversations.js";
|
|
21
|
-
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
21
|
+
import { WORKBENCH_NOTICES, failureNotice } from "./app-toast.js";
|
|
22
22
|
import { tourtoisQueryKeys } from "./queries.js";
|
|
23
23
|
import { requestIds } from "./team-directory.js";
|
|
24
24
|
/** The Toaster id a host mounts so channel failures reach the person. */
|
|
@@ -320,8 +320,8 @@ function WebsiteRow({ port, copy, site, notice, embedOrigin, agentName, open, ju
|
|
|
320
320
|
throw new Error("Website unavailable. Reload before changing it.");
|
|
321
321
|
return port.update(site.bindingId, current.authorityVersion, change);
|
|
322
322
|
},
|
|
323
|
-
onError: () => {
|
|
324
|
-
toast.error("Couldn't save the website
|
|
323
|
+
onError: (cause) => {
|
|
324
|
+
toast.error(failureNotice("Couldn't save the website", cause), {
|
|
325
325
|
toasterId: WORKBENCH_NOTICES,
|
|
326
326
|
closeButton: true,
|
|
327
327
|
});
|
package/dist/app-directory.d.ts
CHANGED
|
@@ -85,7 +85,7 @@ export declare function useAppDirectory(teamId: string, directoryReader: () => P
|
|
|
85
85
|
authorityVersion: number;
|
|
86
86
|
declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
|
|
87
87
|
approvedGrants: readonly Readonly<{
|
|
88
|
-
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
88
|
+
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.stop" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
89
89
|
capabilityApproved: true;
|
|
90
90
|
operations: readonly string[];
|
|
91
91
|
fingerprints: Readonly<Record<string, string>>;
|
|
@@ -113,7 +113,7 @@ export declare function useAppDirectory(teamId: string, directoryReader: () => P
|
|
|
113
113
|
artifactDigest: import("@fungi.computer/puffball").Sha256Digest;
|
|
114
114
|
digest: import("@fungi.computer/puffball").Sha256Digest;
|
|
115
115
|
capabilities: readonly Readonly<{
|
|
116
|
-
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
116
|
+
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.stop" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
117
117
|
operations: readonly string[];
|
|
118
118
|
fingerprints: Readonly<Record<string, string>>;
|
|
119
119
|
}>[];
|
|
@@ -230,7 +230,7 @@ export declare function useAppDirectory(teamId: string, directoryReader: () => P
|
|
|
230
230
|
authorityVersion: number;
|
|
231
231
|
declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
|
|
232
232
|
approvedGrants: readonly Readonly<{
|
|
233
|
-
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
233
|
+
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.stop" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
234
234
|
capabilityApproved: true;
|
|
235
235
|
operations: readonly string[];
|
|
236
236
|
fingerprints: Readonly<Record<string, string>>;
|
|
@@ -258,7 +258,7 @@ export declare function useAppDirectory(teamId: string, directoryReader: () => P
|
|
|
258
258
|
artifactDigest: import("@fungi.computer/puffball").Sha256Digest;
|
|
259
259
|
digest: import("@fungi.computer/puffball").Sha256Digest;
|
|
260
260
|
capabilities: readonly Readonly<{
|
|
261
|
-
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
261
|
+
capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.stop" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
262
262
|
operations: readonly string[];
|
|
263
263
|
fingerprints: Readonly<Record<string, string>>;
|
|
264
264
|
}>[];
|
package/dist/app-toast.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ToastInput } from "@fungi.computer/agar";
|
|
2
2
|
/** The one Toaster mount an App's notice reaches in the Tourtois shell. */
|
|
3
3
|
export declare const WORKBENCH_NOTICES = "workbench-notices";
|
|
4
|
+
/**
|
|
5
|
+
* A failed change as one sentence: what failed, then the host's own reason.
|
|
6
|
+
* Host ports throw an Error whose message is that reason; Hub's client names
|
|
7
|
+
* the HTTP cause when a refusal's body names none.
|
|
8
|
+
*/
|
|
9
|
+
export declare function failureNotice(summary: string, cause: unknown): string;
|
|
4
10
|
export declare function showAppToast(notice: ToastInput): void;
|
package/dist/app-toast.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { showNotice } from "@fungi.computer/caps/components/toaster";
|
|
2
2
|
/** The one Toaster mount an App's notice reaches in the Tourtois shell. */
|
|
3
3
|
export const WORKBENCH_NOTICES = "workbench-notices";
|
|
4
|
+
/**
|
|
5
|
+
* A failed change as one sentence: what failed, then the host's own reason.
|
|
6
|
+
* Host ports throw an Error whose message is that reason; Hub's client names
|
|
7
|
+
* the HTTP cause when a refusal's body names none.
|
|
8
|
+
*/
|
|
9
|
+
export function failureNotice(summary, cause) {
|
|
10
|
+
return cause instanceof Error && cause.message !== ""
|
|
11
|
+
? `${summary}: ${cause.message}`
|
|
12
|
+
: `${summary}.`;
|
|
13
|
+
}
|
|
4
14
|
export function showAppToast(notice) {
|
|
5
15
|
showNotice(notice, WORKBENCH_NOTICES);
|
|
6
16
|
}
|
package/dist/member-avatar.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { SectionHeading } from "@fungi.computer/caps/blocks/section-heading";
|
|
3
3
|
import { memberAvatarSchema, defaultMemberAvatar, } from "@fungi.computer/sprite-zdog/avatar";
|
|
4
4
|
import { toast } from "@fungi.computer/caps/components/toaster";
|
|
5
|
-
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
5
|
+
import { WORKBENCH_NOTICES, failureNotice } from "./app-toast.js";
|
|
6
6
|
import { AvatarPreview } from "./AvatarPreview.js";
|
|
7
7
|
import { AvatarPicker } from "./AvatarPicker.js";
|
|
8
8
|
import { skipToken, useMutation, useQuery, useQueryClient, } from "@tanstack/react-query";
|
|
@@ -61,8 +61,8 @@ function useSaveMemberAvatar(save) {
|
|
|
61
61
|
return { previous, local, optimistic };
|
|
62
62
|
},
|
|
63
63
|
mutationFn: save,
|
|
64
|
-
onError: (
|
|
65
|
-
toast.error("Your avatar could not be saved
|
|
64
|
+
onError: (cause, _next, snapshot) => {
|
|
65
|
+
toast.error(failureNotice("Your avatar could not be saved", cause), {
|
|
66
66
|
toasterId: WORKBENCH_NOTICES,
|
|
67
67
|
});
|
|
68
68
|
if (snapshot &&
|
|
@@ -81,8 +81,14 @@ export type PlatformControlsData = SettingsSectionPorts & Readonly<{
|
|
|
81
81
|
requestAppAccess?(target: Parameters<WorkbenchHostControls["requestAppAccess"]>[0], input: AppPermissionRequest, dialog: AppAccessDialog): Promise<AppPermissionOutcome>;
|
|
82
82
|
}>;
|
|
83
83
|
/** Tourtois owns the same Settings renderer on every embedding host. */
|
|
84
|
-
export declare function PlatformControlsView({ teamId, controls, data, }: {
|
|
84
|
+
export declare function PlatformControlsView({ teamId, controls, data, notices, }: {
|
|
85
85
|
teamId: string;
|
|
86
86
|
controls: PlatformControlsHost;
|
|
87
87
|
data: PlatformControlsData;
|
|
88
|
+
/**
|
|
89
|
+
* Mount the workbench notice toaster that Settings pages report failures
|
|
90
|
+
* to. A host whose page has no Tourtois workbench in this bundle (Hub)
|
|
91
|
+
* sets it; inside the Tourtois shell the workbench already mounts it.
|
|
92
|
+
*/
|
|
93
|
+
notices?: boolean;
|
|
88
94
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { AppError } from "@fungi.computer/agar";
|
|
3
3
|
import { Button } from "@fungi.computer/caps/components/button";
|
|
4
|
-
import { toast } from "@fungi.computer/caps/components/toaster";
|
|
4
|
+
import { Toaster, toast } from "@fungi.computer/caps/components/toaster";
|
|
5
5
|
import { OverlayRoot, } from "@fungi.computer/caps/components/overlay-root";
|
|
6
6
|
import { desktopGillAdditionSchema, desktopGillSelectionSchema, } from "@fungi.computer/nacre/workbench";
|
|
7
7
|
import { tourtoisQueryKeys } from "./queries.js";
|
|
8
|
+
import { WORKBENCH_NOTICES } from "./app-toast.js";
|
|
8
9
|
import { useQuery } from "@tanstack/react-query";
|
|
9
10
|
import { lazy, Suspense, useEffect, useState, useSyncExternalStore, } from "react";
|
|
10
11
|
import { AppAccessConsent } from "./AppAccessConsent.js";
|
|
@@ -231,7 +232,7 @@ function DeferredSystemSettings(props) {
|
|
|
231
232
|
return loaded ? (_jsx(Suspense, { fallback: null, children: _jsx(SystemSettings, { ...props }) })) : null;
|
|
232
233
|
}
|
|
233
234
|
/** Tourtois owns the same Settings renderer on every embedding host. */
|
|
234
|
-
export function PlatformControlsView({ teamId, controls, data, }) {
|
|
235
|
+
export function PlatformControlsView({ teamId, controls, data, notices = false, }) {
|
|
235
236
|
const location = useRouterState({
|
|
236
237
|
router: controls.router,
|
|
237
238
|
select: (state) => settingsLocationSchema
|
|
@@ -272,7 +273,7 @@ export function PlatformControlsView({ teamId, controls, data, }) {
|
|
|
272
273
|
Promise.resolve("declined")));
|
|
273
274
|
return attached;
|
|
274
275
|
}, [controls, data]);
|
|
275
|
-
const settings = (_jsxs(_Fragment, { children: [_jsx(RouterProvider, { router: controls.router }), _jsx(AppAccessConsent, { request: consent }), _jsx(DeferredSystemSettings, { location: location, sections: controls.sections, onNavigate: (next) => {
|
|
276
|
+
const settings = (_jsxs(_Fragment, { children: [_jsx(RouterProvider, { router: controls.router }), notices ? _jsx(Toaster, { id: WORKBENCH_NOTICES, closeButton: true }) : null, _jsx(AppAccessConsent, { request: consent }), _jsx(DeferredSystemSettings, { location: location, sections: controls.sections, onNavigate: (next) => {
|
|
276
277
|
controls.navigate(next);
|
|
277
278
|
// Closing Settings may have changed roles, grants or forks.
|
|
278
279
|
if (next === null)
|
package/dist/window-session.d.ts
CHANGED
|
@@ -50,6 +50,30 @@ export declare function restorableLaunches<App extends Readonly<{
|
|
|
50
50
|
frame: WindowPlacement;
|
|
51
51
|
minimized: boolean;
|
|
52
52
|
}>[];
|
|
53
|
+
/** The workbench's latest focus request in this page, or null for none yet. */
|
|
54
|
+
export type FocusRequest = Readonly<{
|
|
55
|
+
windowId: string;
|
|
56
|
+
}> | null;
|
|
57
|
+
/**
|
|
58
|
+
* Reopen the stored windows one by one and name the window to focus. The
|
|
59
|
+
* restore runs once per page and waits for the stored session, so the person
|
|
60
|
+
* may open or bring forward an App before it starts or while it runs; their
|
|
61
|
+
* latest choice in this page keeps focus over the stored active window.
|
|
62
|
+
*/
|
|
63
|
+
export declare function restoreWindows<Launch extends Readonly<{
|
|
64
|
+
windowId: string;
|
|
65
|
+
}>>(launches: readonly Readonly<{
|
|
66
|
+
launch: Launch;
|
|
67
|
+
minimized: boolean;
|
|
68
|
+
}>[], storedActive: string | null, manager: Readonly<{
|
|
69
|
+
read: () => Readonly<{
|
|
70
|
+
windows: readonly Readonly<{
|
|
71
|
+
windowId: string;
|
|
72
|
+
}>[];
|
|
73
|
+
}>;
|
|
74
|
+
open: (launch: Launch) => Promise<void>;
|
|
75
|
+
minimize: (windowId: string) => Promise<void>;
|
|
76
|
+
}>, focusRequest: () => FocusRequest): Promise<string | null>;
|
|
53
77
|
/** Reads and writes the session through the member's storage layer. */
|
|
54
78
|
export declare function createWindowSessionStore(storage: AppStorage): {
|
|
55
79
|
load(): Promise<WindowSession | null>;
|
|
@@ -66,6 +90,8 @@ export type WindowSessionInput = Readonly<{
|
|
|
66
90
|
phone: boolean;
|
|
67
91
|
onTiledChange: ((tiled: boolean) => void) | undefined;
|
|
68
92
|
focusWindow: (windowId: string) => void;
|
|
93
|
+
/** The workbench's latest focus request, mid-restore ones included. */
|
|
94
|
+
focusRequest: () => FocusRequest;
|
|
69
95
|
/** Shown to the person as a toast; the session is never lost silently. */
|
|
70
96
|
onError: (message: string) => void;
|
|
71
97
|
}>;
|
package/dist/window-session.js
CHANGED
|
@@ -57,6 +57,27 @@ export function restorableLaunches(session, apps, launchFor) {
|
|
|
57
57
|
: [];
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Reopen the stored windows one by one and name the window to focus. The
|
|
62
|
+
* restore runs once per page and waits for the stored session, so the person
|
|
63
|
+
* may open or bring forward an App before it starts or while it runs; their
|
|
64
|
+
* latest choice in this page keeps focus over the stored active window.
|
|
65
|
+
*/
|
|
66
|
+
export async function restoreWindows(launches, storedActive, manager, focusRequest) {
|
|
67
|
+
const isOpen = (windowId) => manager.read().windows.some((item) => item.windowId === windowId);
|
|
68
|
+
for (const { launch, minimized } of launches) {
|
|
69
|
+
if (isOpen(launch.windowId))
|
|
70
|
+
continue;
|
|
71
|
+
await manager.open(launch);
|
|
72
|
+
if (minimized)
|
|
73
|
+
await manager.minimize(launch.windowId);
|
|
74
|
+
}
|
|
75
|
+
const chosen = focusRequest();
|
|
76
|
+
if (chosen !== null && isOpen(chosen.windowId))
|
|
77
|
+
return chosen.windowId;
|
|
78
|
+
const active = storedActive && windowIdFor(storedActive);
|
|
79
|
+
return active && isOpen(active) ? active : null;
|
|
80
|
+
}
|
|
60
81
|
/** Reads and writes the session through the member's storage layer. */
|
|
61
82
|
export function createWindowSessionStore(storage) {
|
|
62
83
|
let revision = null;
|
|
@@ -129,19 +150,9 @@ export function useWindowSession(input) {
|
|
|
129
150
|
const launches = restorableLaunches(session, current.apps, current.launchFor);
|
|
130
151
|
for (const { launch, frame } of launches)
|
|
131
152
|
seeds.current.set(launch.windowId, frame);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
.windows.some((item) => item.windowId === launch.windowId))
|
|
136
|
-
continue;
|
|
137
|
-
await current.manager.open(launch);
|
|
138
|
-
if (minimized)
|
|
139
|
-
await current.manager.minimize(launch.windowId);
|
|
140
|
-
}
|
|
141
|
-
const active = session.active && windowIdFor(session.active);
|
|
142
|
-
if (active &&
|
|
143
|
-
current.manager.read().windows.some((w) => w.windowId === active))
|
|
144
|
-
latest.current.focusWindow(active);
|
|
153
|
+
const focused = await restoreWindows(launches, session.active, current.manager, current.focusRequest);
|
|
154
|
+
if (focused)
|
|
155
|
+
latest.current.focusWindow(focused);
|
|
145
156
|
}
|
|
146
157
|
catch (cause) {
|
|
147
158
|
console.error("Open windows could not be restored", cause);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/tourtois",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.5",
|
|
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",
|
|
@@ -77,15 +77,15 @@
|
|
|
77
77
|
"LICENSE"
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@fungi.computer/agar": "0.
|
|
80
|
+
"@fungi.computer/agar": "0.25.0",
|
|
81
81
|
"@fungi.computer/cairn": "0.1.0",
|
|
82
82
|
"@fungi.computer/caps": "0.12.3",
|
|
83
83
|
"@fungi.computer/ear-tag": "0.1.0",
|
|
84
84
|
"@fungi.computer/gills": "0.4.0",
|
|
85
85
|
"@fungi.computer/maosaico": "0.1.2",
|
|
86
|
-
"@fungi.computer/parakeet": "0.16.
|
|
87
|
-
"@fungi.computer/puffball": "0.
|
|
88
|
-
"@fungi.computer/shiitake": "0.21.
|
|
86
|
+
"@fungi.computer/parakeet": "0.16.6",
|
|
87
|
+
"@fungi.computer/puffball": "0.13.0",
|
|
88
|
+
"@fungi.computer/shiitake": "0.21.14",
|
|
89
89
|
"@fungi.computer/sigils": "0.3.2",
|
|
90
90
|
"@fungi.computer/sprite": "0.2.2",
|
|
91
91
|
"@fungi.computer/sprite-zdog": "0.3.2",
|
|
@@ -100,16 +100,16 @@
|
|
|
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.8.
|
|
103
|
+
"@fungi.computer/nacre": "0.8.7"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"react": "^18.3.1 || ^19.2.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@fungi.computer/oyster": "0.
|
|
109
|
+
"@fungi.computer/oyster": "0.52.0",
|
|
110
110
|
"@cloudflare/workers-types": "5.20260828.1",
|
|
111
|
-
"@fungi.computer/forage": "0.
|
|
112
|
-
"@fungi.computer/mycelium": "0.4.
|
|
111
|
+
"@fungi.computer/forage": "0.4.0",
|
|
112
|
+
"@fungi.computer/mycelium": "0.4.8",
|
|
113
113
|
"@ladle/react": "5.1.1",
|
|
114
114
|
"@types/react": "18.3.3",
|
|
115
115
|
"@vitejs/plugin-react": "6.1.1",
|