@fungi.computer/parakeet 0.15.0 → 0.16.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.
@@ -2,3 +2,5 @@ export { AgentHead } from "./components/AgentHead.js";
2
2
  export type { AgentHeadActivity } from "./components/AgentHead.js";
3
3
  export { ShiitakeAvatar } from "./components/ShiitakeAvatar.js";
4
4
  export type { AvatarState } from "./components/ShiitakeAvatar.js";
5
+ export { BootCurtain } from "./components/BootCurtain.js";
6
+ export { BootFailure } from "./components/BootFailure.js";
@@ -1,2 +1,4 @@
1
1
  export { AgentHead } from "./components/AgentHead.js";
2
2
  export { ShiitakeAvatar } from "./components/ShiitakeAvatar.js";
3
+ export { BootCurtain } from "./components/BootCurtain.js";
4
+ export { BootFailure } from "./components/BootFailure.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The one full-viewport wait a person sees between signing in and a ready
3
+ * desktop. Every pre-ready state of that journey renders this component at
4
+ * this fixed position, so the Hub's separate documents read as one loader.
5
+ * It shows the Shiitake mascot thinking and one line of copy, never a
6
+ * spinner; Sprite holds the face still under reduced motion, so the copy
7
+ * alone carries the state. Until the live face is drawn, the same SVG face
8
+ * the Hub's static first-frame markup carries stands in for it. Only a
9
+ * state that cannot fail, or one that lifts the curtain on its own error,
10
+ * may render it: the curtain sits above toasts.
11
+ */
12
+ export declare function BootCurtain({ message }: {
13
+ message: string;
14
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { bootCurtainFaceSvg } from "./boot-curtain-face.js";
4
+ import { ShiitakeAvatar } from "./ShiitakeAvatar.js";
5
+ /**
6
+ * The one full-viewport wait a person sees between signing in and a ready
7
+ * desktop. Every pre-ready state of that journey renders this component at
8
+ * this fixed position, so the Hub's separate documents read as one loader.
9
+ * It shows the Shiitake mascot thinking and one line of copy, never a
10
+ * spinner; Sprite holds the face still under reduced motion, so the copy
11
+ * alone carries the state. Until the live face is drawn, the same SVG face
12
+ * the Hub's static first-frame markup carries stands in for it. Only a
13
+ * state that cannot fail, or one that lifts the curtain on its own error,
14
+ * may render it: the curtain sits above toasts.
15
+ */
16
+ export function BootCurtain({ message }) {
17
+ const [ready, setReady] = useState(false);
18
+ return (_jsxs("div", { className: "boot-curtain", "data-boot-curtain": "", role: "status", "aria-live": "polite", children: [_jsxs("span", { className: "boot-curtain-stage", children: [ready ? null : (_jsx("span", { className: "boot-curtain-standin", dangerouslySetInnerHTML: { __html: bootCurtainFaceSvg } })), _jsx(ShiitakeAvatar, { className: "boot-curtain-face", onState: (state) => {
19
+ setReady(state.status === "ready");
20
+ }, state: { activity: "thinking", expression: "normal" } })] }), _jsx("p", { className: "boot-curtain-copy", children: message })] }));
21
+ }
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * A boot wait that failed, in the curtain's own centered layout: the mascot
4
+ * looking concerned, one plain line naming the real cause, a short reference
5
+ * when the failure carries one, and the host's actions (a compact Reload).
6
+ * It replaces the curtain, so a failure is never left underneath it.
7
+ */
8
+ export declare function BootFailure({ children, message, note, reference, }: {
9
+ /** The recovery actions, such as a Caps Button that reloads. */
10
+ children?: ReactNode;
11
+ /** One plain sentence naming the real cause. */
12
+ message: string;
13
+ /** A second plain line, such as why a recovery attempt also failed. */
14
+ note?: string | undefined;
15
+ /** A short request id or code the person can quote. */
16
+ reference?: string | undefined;
17
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ShiitakeAvatar } from "./ShiitakeAvatar.js";
3
+ /**
4
+ * A boot wait that failed, in the curtain's own centered layout: the mascot
5
+ * looking concerned, one plain line naming the real cause, a short reference
6
+ * when the failure carries one, and the host's actions (a compact Reload).
7
+ * It replaces the curtain, so a failure is never left underneath it.
8
+ */
9
+ export function BootFailure({ children, message, note, reference, }) {
10
+ return (_jsxs("div", { className: "boot-curtain", "data-boot-failure": "", role: "alert", children: [_jsx("span", { className: "boot-curtain-stage", children: _jsx(ShiitakeAvatar, { className: "boot-curtain-face", state: { activity: "idle", expression: "sad" } }) }), _jsx("p", { className: "boot-curtain-copy", children: message }), note ? _jsx("p", { className: "boot-curtain-copy", children: note }) : null, reference ? (_jsxs("p", { className: "boot-curtain-copy text-sm opacity-70", children: ["Ref ", reference] })) : null, children ? (_jsx("div", { className: "flex flex-wrap justify-center gap-sm", children: children })) : null] }));
11
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Avatar } from "@fungi.computer/sprite/avatar";
2
- import { type AvatarPresentation, type SpriteService } from "@fungi.computer/sprite";
2
+ import { type AvatarPresentation, type PlayerState, type SpriteService } from "@fungi.computer/sprite";
3
3
  /** The current activity and expression supplied to a live avatar. */
4
4
  export type AvatarState = Readonly<Pick<AvatarPresentation, "activity" | "expression">>;
5
5
  /**
@@ -14,6 +14,8 @@ export declare const ShiitakeAvatar: import("react").NamedExoticComponent<{
14
14
  avatar?: Avatar | null;
15
15
  /** Replaces the default 3rem size, for a host that sizes the head itself. */
16
16
  className?: string;
17
+ /** Called as the player loads, draws and fails; a host can show a stand-in until it is ready. */
18
+ onState?: (state: PlayerState) => void;
17
19
  /** Replaces the shared Shiitake service; a faithful fake for tests. */
18
20
  service?: SpriteService;
19
21
  /** Activity and expression presented by the avatar. */
@@ -11,9 +11,9 @@ import { shiitakeSprite } from "./sprite-service.js";
11
11
  * Conversations have no avatar: an Agent's head is `AgentHead`, drawn from
12
12
  * the Agent record.
13
13
  */
14
- export const ShiitakeAvatar = memo(function ShiitakeAvatar({ avatar, className = "h-12 w-12 shrink-0", service = shiitakeSprite, state, }) {
14
+ export const ShiitakeAvatar = memo(function ShiitakeAvatar({ avatar, className = "h-12 w-12 shrink-0", onState, service = shiitakeSprite, state, }) {
15
15
  const presentation = useMemo(() => (avatar ? avatarPresentation(avatar) : undefined), [avatar]);
16
- return (_jsx(Sprite, { "aria-hidden": "true", className: className, service: service, src: presentation?.src ?? { local: "mushroom" }, ...(presentation
16
+ return (_jsx(Sprite, { "aria-hidden": "true", className: className, service: service, ...(onState ? { onState } : {}), src: presentation?.src ?? { local: "mushroom" }, ...(presentation
17
17
  ? {
18
18
  appearance: presentation.appearance,
19
19
  renderStyle: presentation.renderStyle,
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The mascot as plain SVG: the stand-in the boot curtain draws before the live
3
+ * Sprite is ready. The Hub's static first-frame documents carry this same
4
+ * markup, so the face never leaves the screen between documents.
5
+ */
6
+ export declare const bootCurtainFaceSvg: string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The mascot as plain SVG: the stand-in the boot curtain draws before the live
3
+ * Sprite is ready. The Hub's static first-frame documents carry this same
4
+ * markup, so the face never leaves the screen between documents.
5
+ */
6
+ export const bootCurtainFaceSvg = '<svg class="boot-curtain-face" viewBox="0 0 96 96" aria-hidden="true" focusable="false">' +
7
+ '<path d="M17 52h62c0 18-14 32-31 32S17 70 17 52z" fill="#fff3e0"/>' +
8
+ '<path d="M6 50C6 26 24 8 48 8s42 18 42 42c0 3-3 5-6 5H12c-3 0-6-2-6-5z" fill="#ff8383"/>' +
9
+ '<path d="M10 52h76" stroke="#ffd9b8" stroke-width="5" stroke-linecap="round"/>' +
10
+ '<circle cx="25" cy="27" r="12" fill="#ffd9b8"/>' +
11
+ '<ellipse cx="38" cy="65" rx="4.5" ry="6" fill="#2a2024"/>' +
12
+ '<ellipse cx="58" cy="65" rx="4.5" ry="6" fill="#2a2024"/>' +
13
+ '<circle cx="39.5" cy="62.5" r="1.6" fill="#ffffff"/>' +
14
+ '<circle cx="59.5" cy="62.5" r="1.6" fill="#ffffff"/>' +
15
+ '<rect x="43" y="75" width="10" height="2.4" rx="1.2" fill="#2a2024"/>' +
16
+ "</svg>";
package/dist/styles.css CHANGED
@@ -19624,6 +19624,50 @@
19624
19624
  max-width: none;
19625
19625
  }
19626
19626
  }
19627
+ .boot-curtain {
19628
+ position: fixed;
19629
+ inset: 0;
19630
+ z-index: 2147483000;
19631
+ display: flex;
19632
+ flex-direction: column;
19633
+ align-items: center;
19634
+ justify-content: center;
19635
+ gap: 1rem;
19636
+ background: var(--color-base-100, #eff1f5);
19637
+ color: var(--color-base-content, #4c4f69);
19638
+ font-family: system-ui, sans-serif;
19639
+ }
19640
+ @media (prefers-color-scheme: dark) {
19641
+ .boot-curtain {
19642
+ background: var(--color-base-100, #1e1e2e);
19643
+ color: var(--color-base-content, #cdd6f4);
19644
+ }
19645
+ }
19646
+ .boot-curtain-stage {
19647
+ position: relative;
19648
+ display: block;
19649
+ width: 6rem;
19650
+ height: 6rem;
19651
+ }
19652
+ .boot-curtain-stage > * {
19653
+ position: absolute;
19654
+ inset: 0;
19655
+ }
19656
+ .boot-curtain-standin svg {
19657
+ display: block;
19658
+ }
19659
+ .boot-curtain-face {
19660
+ width: 6rem;
19661
+ height: 6rem;
19662
+ }
19663
+ .boot-curtain-copy {
19664
+ margin: 0;
19665
+ min-height: 1.5rem;
19666
+ max-width: 32rem;
19667
+ padding-inline: 1rem;
19668
+ font-size: 0.9375rem;
19669
+ text-align: center;
19670
+ }
19627
19671
  :root {
19628
19672
  --prose-max-width: 80ch;
19629
19673
  --tool-error-rail: #fff7a0;
package/docs/api/index.md CHANGED
@@ -1076,6 +1076,7 @@ const ShiitakeAvatar: NamedExoticComponent<{
1076
1076
  | "watercolor";
1077
1077
  } | null;
1078
1078
  className?: string;
1079
+ onState?: (state) => void;
1079
1080
  service?: SpriteService;
1080
1081
  state: AvatarState;
1081
1082
  }>;
@@ -1098,6 +1099,61 @@ Defaults only, with no reader choices.
1098
1099
 
1099
1100
  ## Functions
1100
1101
 
1102
+ ### BootCurtain()
1103
+
1104
+ ```ts
1105
+ function BootCurtain(__namedParameters): Element;
1106
+ ```
1107
+
1108
+ The one full-viewport wait a person sees between signing in and a ready desktop.
1109
+ Every pre-ready state of that journey renders this component at this fixed
1110
+ position, so the Hub's separate documents read as one loader. It shows the
1111
+ Shiitake mascot thinking and one line of copy, never a spinner; Sprite holds the
1112
+ face still under reduced motion, so the copy alone carries the state. Until the
1113
+ live face is drawn, the same SVG face the Hub's static first-frame markup
1114
+ carries stands in for it. Only a state that cannot fail, or one that lifts the
1115
+ curtain on its own error, may render it: the curtain sits above toasts.
1116
+
1117
+ #### Parameters
1118
+
1119
+ | Parameter | Type |
1120
+ | --------------------------- | -------------------------- |
1121
+ | `__namedParameters` | \{ `message`: `string`; \} |
1122
+ | `__namedParameters.message` | `string` |
1123
+
1124
+ #### Returns
1125
+
1126
+ `Element`
1127
+
1128
+ ---
1129
+
1130
+ ### BootFailure()
1131
+
1132
+ ```ts
1133
+ function BootFailure(__namedParameters): Element;
1134
+ ```
1135
+
1136
+ A boot wait that failed, in the curtain's own centered layout: the mascot
1137
+ looking concerned, one plain line naming the real cause, a short reference when
1138
+ the failure carries one, and the host's actions (a compact Reload). It replaces
1139
+ the curtain, so a failure is never left underneath it.
1140
+
1141
+ #### Parameters
1142
+
1143
+ | Parameter | Type | Description |
1144
+ | ------------------------------ | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
1145
+ | `__namedParameters` | \{ `children?`: `ReactNode`; `message`: `string`; `note?`: `string`; `reference?`: `string`; \} | - |
1146
+ | `__namedParameters.children?` | `ReactNode` | The recovery actions, such as a Caps Button that reloads. |
1147
+ | `__namedParameters.message` | `string` | One plain sentence naming the real cause. |
1148
+ | `__namedParameters.note?` | `string` | A second plain line, such as why a recovery attempt also failed. |
1149
+ | `__namedParameters.reference?` | `string` | A short request id or code the person can quote. |
1150
+
1151
+ #### Returns
1152
+
1153
+ `Element`
1154
+
1155
+ ---
1156
+
1101
1157
  ### composerSendState()
1102
1158
 
1103
1159
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/parakeet",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "private": false,
6
6
  "description": "Standalone React composer for a typed Shiitake Session",
@@ -31,6 +31,10 @@
31
31
  "types": "./dist/agent-head.d.ts",
32
32
  "import": "./dist/agent-head.js"
33
33
  },
34
+ "./boot-curtain-face": {
35
+ "types": "./dist/components/boot-curtain-face.d.ts",
36
+ "import": "./dist/components/boot-curtain-face.js"
37
+ },
34
38
  "./website-visitor-client": {
35
39
  "types": "./dist/website-visitor-client.d.ts",
36
40
  "import": "./dist/website-visitor-client.js"
@@ -64,14 +68,14 @@
64
68
  },
65
69
  "dependencies": {
66
70
  "@earendil-works/pi-ai": "1.5.2",
67
- "@fungi.computer/agar": "0.23.0",
71
+ "@fungi.computer/agar": "0.23.1",
68
72
  "@fungi.computer/bird-dog": "0.3.7",
69
73
  "@fungi.computer/cairn": "0.1.0",
70
74
  "@fungi.computer/caps": "0.12.2",
71
75
  "@fungi.computer/gills": "0.4.0",
72
- "@fungi.computer/knapsack": "0.4.20",
76
+ "@fungi.computer/knapsack": "0.4.21",
73
77
  "@fungi.computer/mule": "0.3.0",
74
- "@fungi.computer/shiitake": "0.21.8",
78
+ "@fungi.computer/shiitake": "0.21.9",
75
79
  "@fungi.computer/sigils": "0.3.2",
76
80
  "@fungi.computer/sprite": "0.2.2",
77
81
  "@fungi.computer/sprite-zdog": "0.3.2",
package/src/styles.css CHANGED
@@ -15,6 +15,54 @@
15
15
 
16
16
  @plugin "@tailwindcss/typography";
17
17
 
18
+ /* The boot curtain: one fixed, full-viewport wait for the whole sign-in to
19
+ * desktop journey. The Hub document carries the same classes as static markup
20
+ * so a page that has not run its script yet already shows it. */
21
+ .boot-curtain {
22
+ position: fixed;
23
+ inset: 0;
24
+ z-index: 2147483000;
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ justify-content: center;
29
+ gap: 1rem;
30
+ background: var(--color-base-100, #eff1f5);
31
+ color: var(--color-base-content, #4c4f69);
32
+ font-family: system-ui, sans-serif;
33
+ }
34
+ @media (prefers-color-scheme: dark) {
35
+ .boot-curtain {
36
+ background: var(--color-base-100, #1e1e2e);
37
+ color: var(--color-base-content, #cdd6f4);
38
+ }
39
+ }
40
+ .boot-curtain-stage {
41
+ position: relative;
42
+ display: block;
43
+ width: 6rem;
44
+ height: 6rem;
45
+ }
46
+ .boot-curtain-stage > * {
47
+ position: absolute;
48
+ inset: 0;
49
+ }
50
+ .boot-curtain-standin svg {
51
+ display: block;
52
+ }
53
+ .boot-curtain-face {
54
+ width: 6rem;
55
+ height: 6rem;
56
+ }
57
+ .boot-curtain-copy {
58
+ margin: 0;
59
+ min-height: 1.5rem;
60
+ max-width: 32rem;
61
+ padding-inline: 1rem;
62
+ font-size: 0.9375rem;
63
+ text-align: center;
64
+ }
65
+
18
66
  :root {
19
67
  --prose-max-width: 80ch;
20
68
  --tool-error-rail: #fff7a0;